From 318d43d932c476e21eea421267a52913d94b66e3 Mon Sep 17 00:00:00 2001 From: Teo Miscia Date: Thu, 9 Apr 2026 23:38:59 -0700 Subject: [PATCH 1/7] fix: retrieve CSRF token from environment and add Node.js fallback --- bun.lock | 1 + src/plugin.ts | 111 ++++++++++++++++++++++++++++-------- src/plugin/auth.ts | 44 +++++++++++--- tests/live/verify-plugin.ts | 34 +++++++++-- 4 files changed, 154 insertions(+), 36 deletions(-) diff --git a/bun.lock b/bun.lock index 7f726e9..dbb3526 100644 --- a/bun.lock +++ b/bun.lock @@ -1,5 +1,6 @@ { "lockfileVersion": 1, + "configVersion": 0, "workspaces": { "": { "name": "opencode-windsurf-auth", diff --git a/src/plugin.ts b/src/plugin.ts index 8af1d3b..0c3a449 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -15,6 +15,7 @@ */ import * as crypto from 'crypto'; +import * as http from 'http'; import type { PluginInput, Hooks } from '@opencode-ai/plugin'; import { getCredentials, isWindsurfRunning, WindsurfCredentials } from './plugin/auth.js'; import { streamChatGenerator, ChatMessage } from './plugin/grpc-client.js'; @@ -732,7 +733,7 @@ async function ensureWindsurfProxyServer(): Promise { const bunAny = globalThis as any; if (typeof bunAny.Bun !== 'undefined' && typeof bunAny.Bun.serve === 'function') { - // Check if server already running on default port + // Bun runtime logic (original) try { const res = await fetch(`http://${WINDSURF_PROXY_HOST}:${WINDSURF_PROXY_DEFAULT_PORT}/health`).catch(() => null); if (res && res.ok) { @@ -740,17 +741,14 @@ async function ensureWindsurfProxyServer(): Promise { g[key].baseURL = baseURL; return baseURL; } - } catch { - // ignore - } + } catch { /* ignore */ } const startServer = (port: number) => { return bunAny.Bun.serve({ hostname: WINDSURF_PROXY_HOST, port, fetch: handler, - // Keep connections alive longer to allow slow/long chat streams - idleTimeout: 100, // seconds + idleTimeout: 100, }); }; @@ -760,24 +758,13 @@ async function ensureWindsurfProxyServer(): Promise { g[key].baseURL = baseURL; return baseURL; } catch (error) { - const code = (error as any)?.code; - if (code !== 'EADDRINUSE') { - throw error; - } - - // Port in use - check if it's our server - try { - const res = await fetch(`http://${WINDSURF_PROXY_HOST}:${WINDSURF_PROXY_DEFAULT_PORT}/health`).catch(() => null); - if (res && res.ok) { - const baseURL = `http://${WINDSURF_PROXY_HOST}:${WINDSURF_PROXY_DEFAULT_PORT}/v1`; - g[key].baseURL = baseURL; - return baseURL; - } - } catch { - // ignore + if ((error as any)?.code !== 'EADDRINUSE') throw error; + const res = await fetch(`http://${WINDSURF_PROXY_HOST}:${WINDSURF_PROXY_DEFAULT_PORT}/health`).catch(() => null); + if (res && res.ok) { + const baseURL = `http://${WINDSURF_PROXY_HOST}:${WINDSURF_PROXY_DEFAULT_PORT}/v1`; + g[key].baseURL = baseURL; + return baseURL; } - - // Fallback to random port const server = startServer(0); const baseURL = `http://${WINDSURF_PROXY_HOST}:${server.port}/v1`; g[key].baseURL = baseURL; @@ -785,7 +772,83 @@ async function ensureWindsurfProxyServer(): Promise { } } - throw new Error('Windsurf proxy server requires Bun runtime'); + // Node.js fallback + const startNodeServer = (port: number): Promise<{ port: number }> => { + return new Promise((resolve, reject) => { + const server = http.createServer(async (nodeReq, nodeRes) => { + try { + // Construct Fetch-like Request from Node request + const protocol = (nodeReq.socket as any).encrypted ? 'https' : 'http'; + const host = nodeReq.headers.host || `${WINDSURF_PROXY_HOST}:${port}`; + const url = new URL(nodeReq.url || '/', `${protocol}://${host}`); + + const chunks: Buffer[] = []; + for await (const chunk of nodeReq) { + chunks.push(chunk); + } + const body = chunks.length > 0 ? Buffer.concat(chunks) : undefined; + + const request = new Request(url.toString(), { + method: nodeReq.method, + headers: nodeReq.headers as any, + body: body, + }); + + const response = await handler(request); + + // Stream Response back to Node response + nodeRes.statusCode = response.status; + response.headers.forEach((value, key) => { + nodeRes.setHeader(key, value); + }); + + if (response.body) { + const reader = response.body.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) break; + nodeRes.write(value); + } + } + nodeRes.end(); + } catch (err) { + console.error('[Windsurf Proxy] Request handler error:', err); + nodeRes.statusCode = 500; + nodeRes.end(JSON.stringify({ error: 'Internal Server Error', message: String(err) })); + } + }); + + server.on('error', (err: any) => { + if (port !== 0 && err.code === 'EADDRINUSE') { + reject(err); + } else { + console.error('[Windsurf Proxy] Server error:', err); + reject(err); + } + }); + + server.listen(port, WINDSURF_PROXY_HOST, () => { + const address = server.address(); + const actualPort = typeof address === 'string' ? port : (address?.port ?? port); + resolve({ port: actualPort }); + }); + }); + }; + + try { + const { port } = await startNodeServer(WINDSURF_PROXY_DEFAULT_PORT); + const baseURL = `http://${WINDSURF_PROXY_HOST}:${port}/v1`; + g[key].baseURL = baseURL; + return baseURL; + } catch (error) { + if ((error as any)?.code === 'EADDRINUSE') { + const { port } = await startNodeServer(0); + const baseURL = `http://${WINDSURF_PROXY_HOST}:${port}/v1`; + g[key].baseURL = baseURL; + return baseURL; + } + throw error; + } } // ============================================================================ diff --git a/src/plugin/auth.ts b/src/plugin/auth.ts index 04efc8c..8e15c9c 100644 --- a/src/plugin/auth.ts +++ b/src/plugin/auth.ts @@ -97,11 +97,11 @@ function getLanguageServerProcess(): string | null { ); return output; } else { - // Unix-like: use ps - const output = execSync( - `ps aux | grep ${pattern}`, - { encoding: 'utf8', timeout: 5000 } - ); + // Unix-like: use ps with eww to see environment on macOS + const cmd = process.platform === 'darwin' + ? `ps auxeww | grep ${pattern} | grep -v grep` + : `ps aux | grep ${pattern} | grep -v grep`; + const output = execSync(cmd, { encoding: 'utf8', timeout: 5000 }); return output; } } catch { @@ -122,9 +122,37 @@ export function getCSRFToken(): string { ); } - const match = processInfo.match(/--csrf_token\s+([a-f0-9-]+)/); - if (match?.[1]) { - return match[1]; + // 1. Try process arguments + const argMatch = processInfo.match(/--csrf_token\s+([a-f0-9-]+)/); + if (argMatch?.[1]) { + return argMatch[1]; + } + + // 2. Try environment variables (macOS/Linux) + if (process.platform !== 'win32') { + const envMatch = processInfo.match(/WINDSURF_CSRF_TOKEN=([a-f0-9-]+)/); + if (envMatch?.[1]) { + return envMatch[1]; + } + + // 3. Linux fallback: check /proc if ps aux didn't show it + if (process.platform === 'linux') { + try { + const pidMatch = processInfo.match(/^\s*\S+\s+(\d+)/); + if (pidMatch) { + const pid = pidMatch[1]; + const environ = fs.readFileSync(`/proc/${pid}/environ`, 'utf8'); + const lines = environ.split('\0'); + for (const line of lines) { + if (line.startsWith('WINDSURF_CSRF_TOKEN=')) { + return line.split('=')[1]; + } + } + } + } catch { + // Fall through + } + } } throw new WindsurfError( diff --git a/tests/live/verify-plugin.ts b/tests/live/verify-plugin.ts index 356abeb..28f001a 100644 --- a/tests/live/verify-plugin.ts +++ b/tests/live/verify-plugin.ts @@ -77,10 +77,10 @@ async function main() { process.exit(1); } - // Test 5: Test another model (Claude) + // Test 5: Test Claude 3.5 console.log('5. Testing with Claude 3.5 Sonnet...'); const messages2: ChatMessage[] = [ - { role: 'user', content: 'Reply with just: "Claude OK"' } + { role: 'user', content: 'Reply with just: "Claude 3.5 OK"' } ]; try { @@ -95,9 +95,35 @@ async function main() { chunks.push(chunk); process.stdout.write(chunk); } - console.log('\n OK: Claude streaming completed\n'); + console.log('\n OK: Claude 3.5 streaming completed\n'); } catch (error) { - console.error(`\n FAIL: ${error instanceof Error ? error.message : error}`); + console.log(`\n INFO: Claude 3.5 failed (might be deprecated): ${error instanceof Error ? error.message : error}`); + } + + // Add delay + await new Promise(r => setTimeout(r, 1000)); + + // Test 6: Test Claude 3.7 + console.log('6. Testing with Claude 3.7 Sonnet...'); + const messages3: ChatMessage[] = [ + { role: 'user', content: 'Reply with just: "Claude 3.7 OK"' } + ]; + + try { + const chunks: string[] = []; + const generator = streamChatGenerator(credentials, { + model: 'claude-3.7-sonnet', + messages: messages3, + }); + + process.stdout.write(' Response: '); + for await (const chunk of generator) { + chunks.push(chunk); + process.stdout.write(chunk); + } + console.log('\n OK: Claude 3.7 streaming completed\n'); + } catch (error) { + console.error(`\n FAIL: Claude 3.7 failed: ${error instanceof Error ? error.message : error}`); process.exit(1); } From 22adf31b262beff30247f42d77af7a0fadf59818 Mon Sep 17 00:00:00 2001 From: Teo Miscia Date: Fri, 10 Apr 2026 00:30:00 -0700 Subject: [PATCH 2/7] feat: implement data-driven model discovery and Enterprise support --- README.md | 99 +++++++-------- bun.lock | 258 ++++++++++++++++++++++++++++++++++++++ package.json | 3 + scripts/sync-models.ts | 126 +++++++++++++++++++ src/plugin.ts | 28 ++++- src/plugin/grpc-client.ts | 126 +++++++++++++++++-- src/plugin/models.ts | 34 ++++- src/plugin/types.ts | 40 ++++++ 8 files changed, 644 insertions(+), 70 deletions(-) create mode 100644 scripts/sync-models.ts diff --git a/README.md b/README.md index 0365d04..a9351e0 100644 --- a/README.md +++ b/README.md @@ -9,22 +9,18 @@ Opencode plugin for Windsurf/Codeium authentication - use Windsurf models in Ope ## Features -- OpenAI-compatible `/v1/chat/completions` interface with streaming SSE -- Automatic credential discovery (CSRF token, port, API key) -- Transparent REST↔gRPC translation over HTTP/2 -- Zero extra auth prompts when Windsurf is running -- Opencode tool-calling compatible: tools are planned via Windsurf inference but executed by Opencode (MCP/tool registry remains authoritative) - -## Overview - -This plugin enables Opencode users to access Windsurf/Codeium models by leveraging their existing Windsurf installation. It communicates directly with the **local Windsurf language server** via gRPC—no network traffic capture or OAuth flows required. +- **OpenAI-compatible** `/v1/chat/completions` interface with streaming SSE. +- **Automatic Discovery**: CSRF tokens, dynamic ports, and API keys are fetched directly from your running Windsurf process. +- **Node.js & Bun Support**: Runs in standard Node.js environments (like default OpenCode) or Bun. +- **Enterprise Ready**: Supports exclusive Enterprise models, regional deployments, and private model slots (Kimi, Minimax, etc.). +- **Dynamic Model Sync**: Automatically update your `opencode.json` with the models actually enabled for your account. +- **Transparent gRPC Translation**: Translates REST requests to Windsurf's internal gRPC protocol over HTTP/2. ## Prerequisites 1. **Windsurf IDE installed** - Download from [windsurf.com](https://windsurf.com) -2. **Windsurf running** - The plugin communicates with the local language server -3. **Logged into Windsurf** - Provides API key in `~/.codeium/config.json` -4. **Active Windsurf subscription** - Model access depends on your plan +2. **Windsurf running** - The plugin communicates with the local language server process. +3. **Logged into Windsurf** - Ensure you are signed in within the IDE. ## Installation @@ -32,13 +28,29 @@ This plugin enables Opencode users to access Windsurf/Codeium models by leveragi bun add opencode-windsurf-auth@beta ``` +## Model Synchronization + +Windsurf account permissions vary by tier (Free, Pro, Enterprise). To ensure you only see and use models enabled for your account, use the built-in sync tool: + +### Method 1: Via OpenCode (Recommended) +Run the login command and select **"Sync Models"**: +```bash +opencode login windsurf +``` + +### Method 2: Via CLI +Run the sync script directly from the plugin directory: +```bash +bun run sync-models +``` +This will scan your Windsurf configuration and update `~/.config/opencode/opencode.json` with the correct model IDs and human-readable labels. + ## Opencode Configuration -Add the following to your Opencode config (typically `~/.config/opencode/config.json`). The plugin starts a local proxy server on port 42100 (falls back to a random free port and updates `chat.params` automatically). The full model list with variants is in `opencode_config_example.json`; thinking vs non-thinking are separate models, while variants are only for performance tiers (low/high/xhigh/etc.). +Your `opencode.json` should point to the local proxy started by the plugin. Use the sync tool above to populate the `models` list automatically. ```json { - "$schema": "https://opencode.ai/config.json", "plugin": ["opencode-windsurf-auth@beta"], "provider": { "windsurf": { @@ -119,45 +131,22 @@ Keep Windsurf running and signed in—credentials are fetched live from the IDE ``` src/ -├── plugin.ts # Fetch interceptor that routes to Windsurf -├── constants.ts # gRPC service metadata -└── plugin/ - ├── auth.ts # Credential discovery - ├── grpc-client.ts # Streaming chat bridge - ├── models.ts # Model lookup tables - └── types.ts # Shared enums/types +├── plugin.ts # Proxy server & OpenCode hooks +├── plugin/ + ├── auth.ts # Process-based credential discovery (CSRF/Port) + ├── grpc-client.ts # Protobuf/gRPC communication logic + ├── models.ts # Internal ID to Enum mapping + └── types.ts # Protobuf Enums including PRIVATE slots +scripts/ +└── sync-models.ts # Data-driven model discovery script ``` -### How It Works - -1. **Credential Discovery**: Extracts CSRF token and port from the running `language_server_macos` process -2. **API Key**: Reads from `~/.codeium/config.json` -3. **gRPC Communication**: Sends requests to `localhost:{port}` using HTTP/2 gRPC protocol -4. **Response Transformation**: Converts gRPC responses to OpenAI-compatible SSE format (assistant/tool turns are not replayed back to Windsurf) -5. **Model Naming**: Sends both model enum and `chat_model_name` for fidelity with Windsurf’s expectations -6. **Tool Planning**: When `tools` are provided, we build a tool-calling prompt (with system messages) and ask Windsurf to produce `tool_calls`/final text. Tool execution and MCP tool registry stay on OpenCode’s side. - -### Supported Models (canonical names) - -**Claude**: `claude-3-opus`, `claude-3-sonnet`, `claude-3-haiku`, `claude-3.5-sonnet`, `claude-3.5-haiku`, `claude-3.7-sonnet`, `claude-3.7-sonnet-thinking`, `claude-4-opus`, `claude-4-opus-thinking`, `claude-4-sonnet`, `claude-4-sonnet-thinking`, `claude-4.1-opus`, `claude-4.1-opus-thinking`, `claude-4.5-sonnet`, `claude-4.5-sonnet-thinking`, `claude-4.5-opus`, `claude-4.5-opus-thinking`, `claude-code`. - -**OpenAI GPT**: `gpt-4`, `gpt-4-turbo`, `gpt-4o`, `gpt-4o-mini`, `gpt-4.1`, `gpt-4.1-mini`, `gpt-4.1-nano`, `gpt-5`, `gpt-5-nano`, `gpt-5-codex`, `gpt-5.1-codex-mini`, `gpt-5.1-codex`, `gpt-5.1-codex-max`, `gpt-5.2` (variants low/medium/high/xhigh + priority tiers). Non-thinking vs thinking are separate model IDs, not variants. - -**OpenAI O-series**: `o3`, `o3-mini`, `o3-low`, `o3-high`, `o3-pro`, `o3-pro-low`, `o3-pro-high`, `o4-mini`, `o4-mini-low`, `o4-mini-high`. - -**Gemini**: `gemini-2.0-flash`, `gemini-2.5-pro`, `gemini-2.5-flash`, `gemini-2.5-flash-thinking`, `gemini-2.5-flash-lite`, `gemini-3.0-pro` (variants: `minimal`, `low`, `medium`, `high`), `gemini-3.0-flash` (variants: `minimal`, `low`, `medium`, `high`). Thinking versions of Gemini 2.5 are separate models. - -**DeepSeek**: `deepseek-v3`, `deepseek-v3-2`, `deepseek-r1`, `deepseek-r1-fast`, `deepseek-r1-slow`. - -**Llama**: `llama-3.1-8b`, `llama-3.1-70b`, `llama-3.1-405b`, `llama-3.3-70b`, `llama-3.3-70b-r1`. - -**Qwen**: `qwen-2.5-7b`, `qwen-2.5-32b`, `qwen-2.5-72b`, `qwen-2.5-32b-r1`, `qwen-3-235b`, `qwen-3-coder-480b`, `qwen-3-coder-480b-fast`. - -**Grok (xAI)**: `grok-2`, `grok-3`, `grok-3-mini`, `grok-code-fast`. - -**Specialty & Proprietary**: `mistral-7b`, `kimi-k2`, `kimi-k2-thinking`, `glm-4.5`, `glm-4.5-fast`, `glm-4.6`, `glm-4.6-fast`, `glm-4.7`, `glm-4.7-fast`, `minimax-m2`, `minimax-m2.1`, `swe-1.5`, `swe-1.5-thinking`, `swe-1.5-slow`. +## How It Works -Aliases (e.g., `gpt-5.2-low-priority`) are also accepted. Variants live under `provider.windsurf.models[model].variants`; thinking/non-thinking are distinct models. +1. **Discovery**: The plugin finds the Windsurf process and extracts the CSRF token from its environment variables (`WINDSURF_CSRF_TOKEN`) and the dynamic port from its listener list. +2. **Proxy**: A local server (Node or Bun) starts to handle incoming OpenCode requests. +3. **Translation**: REST requests are converted to the internal gRPC format, including metadata like your API key and IDE version. +4. **Streaming**: Responses are streamed back in real-time using standard SSE. ## Development @@ -165,14 +154,14 @@ Aliases (e.g., `gpt-5.2-low-priority`) are also accepted. Variants live under `p # Install dependencies bun install -# Build +# Build (TypeScript to JS) bun run build -# Type check -bun run typecheck +# Synchronize models for testing +bun run sync-models -# Run tests -bun test +# Run live verification +bun run tests/live/verify-plugin.ts ``` ## Known Limitations diff --git a/bun.lock b/bun.lock index dbb3526..c87a0fe 100644 --- a/bun.lock +++ b/bun.lock @@ -9,6 +9,7 @@ "@connectrpc/connect": "^2.0.0", "@connectrpc/connect-web": "^2.0.0", "proper-lockfile": "^4.1.2", + "sqlite3": "^5.1.7", "xdg-basedir": "^5.1.0", "zod": "^4.3.5", }, @@ -17,6 +18,7 @@ "@types/bun": "^1.3.6", "@types/node": "^25.0.0", "@types/proper-lockfile": "^4.1.4", + "@types/sqlite3": "^5.0.0", "typescript": "^5.7.0", }, "peerDependencies": { @@ -31,10 +33,18 @@ "@connectrpc/connect-web": ["@connectrpc/connect-web@2.1.1", "", { "peerDependencies": { "@bufbuild/protobuf": "^2.7.0", "@connectrpc/connect": "2.1.1" } }, "sha512-J8317Q2MaFRCT1jzVR1o06bZhDIBmU0UAzWx6xOIXzOq8+k71/+k7MUF7AwcBUX+34WIvbm5syRgC5HXQA8fOg=="], + "@gar/promisify": ["@gar/promisify@1.1.3", "", {}, "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw=="], + + "@npmcli/fs": ["@npmcli/fs@1.1.1", "", { "dependencies": { "@gar/promisify": "^1.0.1", "semver": "^7.3.5" } }, "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ=="], + + "@npmcli/move-file": ["@npmcli/move-file@1.1.2", "", { "dependencies": { "mkdirp": "^1.0.4", "rimraf": "^3.0.2" } }, "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg=="], + "@opencode-ai/plugin": ["@opencode-ai/plugin@1.1.21", "", { "dependencies": { "@opencode-ai/sdk": "1.1.21", "zod": "4.1.8" } }, "sha512-oAWVlKG7LACGFYawfdHGMN6e+6lyN6F+zPVncFUB99BrTl/TjELE5gTZwU7MalGpjwfU77yslBOZm4BXVAYGvw=="], "@opencode-ai/sdk": ["@opencode-ai/sdk@1.1.21", "", {}, "sha512-4M6lBjRPlPz99Rb5rS5ZqKrb0UDDxOT9VTG06JpNxvA7ynTd8C50ckc2NGzWtvjarmxfaAk1VeuBYN/cq2pIKQ=="], + "@tootallnate/once": ["@tootallnate/once@1.1.2", "", {}, "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw=="], + "@types/bun": ["@types/bun@1.3.6", "", { "dependencies": { "bun-types": "1.3.6" } }, "sha512-uWCv6FO/8LcpREhenN1d1b6fcspAB+cefwD7uti8C8VffIv0Um08TKMn98FynpTiU38+y2dUO55T11NgDt8VAA=="], "@types/node": ["@types/node@25.0.8", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-powIePYMmC3ibL0UJ2i2s0WIbq6cg6UyVFQxSCpaPxxzAaziRfimGivjdF943sSGV6RADVbk0Nvlm5P/FB44Zg=="], @@ -43,28 +53,276 @@ "@types/retry": ["@types/retry@0.12.5", "", {}, "sha512-3xSjTp3v03X/lSQLkczaN9UIEwJMoMCA1+Nb5HfbJEQWogdeQIyVtTvxPXDQjZ5zws8rFQfVfRdz03ARihPJgw=="], + "@types/sqlite3": ["@types/sqlite3@5.1.0", "", { "dependencies": { "sqlite3": "*" } }, "sha512-w25Gd6OzcN0Sb6g/BO7cyee0ugkiLgonhgGYfG+H0W9Ub6PUsC2/4R+KXy2tc80faPIWO3Qytbvr8gP1fU4siA=="], + + "abbrev": ["abbrev@1.1.1", "", {}, "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q=="], + + "agent-base": ["agent-base@6.0.2", "", { "dependencies": { "debug": "4" } }, "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ=="], + + "agentkeepalive": ["agentkeepalive@4.6.0", "", { "dependencies": { "humanize-ms": "^1.2.1" } }, "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ=="], + + "aggregate-error": ["aggregate-error@3.1.0", "", { "dependencies": { "clean-stack": "^2.0.0", "indent-string": "^4.0.0" } }, "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA=="], + + "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], + + "aproba": ["aproba@2.1.0", "", {}, "sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew=="], + + "are-we-there-yet": ["are-we-there-yet@3.0.1", "", { "dependencies": { "delegates": "^1.0.0", "readable-stream": "^3.6.0" } }, "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg=="], + + "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + + "base64-js": ["base64-js@1.5.1", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="], + + "bindings": ["bindings@1.5.0", "", { "dependencies": { "file-uri-to-path": "1.0.0" } }, "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ=="], + + "bl": ["bl@4.1.0", "", { "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", "readable-stream": "^3.4.0" } }, "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w=="], + + "brace-expansion": ["brace-expansion@1.1.13", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-9ZLprWS6EENmhEOpjCYW2c8VkmOvckIJZfkr7rBW6dObmfgJ/L1GpSYW5Hpo9lDz4D1+n0Ckz8rU7FwHDQiG/w=="], + + "buffer": ["buffer@5.7.1", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" } }, "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ=="], + "bun-types": ["bun-types@1.3.6", "", { "dependencies": { "@types/node": "*" } }, "sha512-OlFwHcnNV99r//9v5IIOgQ9Uk37gZqrNMCcqEaExdkVq3Avwqok1bJFmvGMCkCE0FqzdY8VMOZpfpR3lwI+CsQ=="], + "cacache": ["cacache@15.3.0", "", { "dependencies": { "@npmcli/fs": "^1.0.0", "@npmcli/move-file": "^1.0.1", "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "glob": "^7.1.4", "infer-owner": "^1.0.4", "lru-cache": "^6.0.0", "minipass": "^3.1.1", "minipass-collect": "^1.0.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.2", "mkdirp": "^1.0.3", "p-map": "^4.0.0", "promise-inflight": "^1.0.1", "rimraf": "^3.0.2", "ssri": "^8.0.1", "tar": "^6.0.2", "unique-filename": "^1.1.1" } }, "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ=="], + + "chownr": ["chownr@2.0.0", "", {}, "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ=="], + + "clean-stack": ["clean-stack@2.2.0", "", {}, "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A=="], + + "color-support": ["color-support@1.1.3", "", { "bin": { "color-support": "bin.js" } }, "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg=="], + + "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="], + + "console-control-strings": ["console-control-strings@1.1.0", "", {}, "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ=="], + + "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], + + "decompress-response": ["decompress-response@6.0.0", "", { "dependencies": { "mimic-response": "^3.1.0" } }, "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ=="], + + "deep-extend": ["deep-extend@0.6.0", "", {}, "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA=="], + + "delegates": ["delegates@1.0.0", "", {}, "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ=="], + + "detect-libc": ["detect-libc@2.1.2", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="], + + "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="], + + "encoding": ["encoding@0.1.13", "", { "dependencies": { "iconv-lite": "^0.6.2" } }, "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A=="], + + "end-of-stream": ["end-of-stream@1.4.5", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="], + + "env-paths": ["env-paths@2.2.1", "", {}, "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A=="], + + "err-code": ["err-code@2.0.3", "", {}, "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA=="], + + "expand-template": ["expand-template@2.0.3", "", {}, "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg=="], + + "file-uri-to-path": ["file-uri-to-path@1.0.0", "", {}, "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw=="], + + "fs-constants": ["fs-constants@1.0.0", "", {}, "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="], + + "fs-minipass": ["fs-minipass@2.1.0", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg=="], + + "fs.realpath": ["fs.realpath@1.0.0", "", {}, "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="], + + "gauge": ["gauge@4.0.4", "", { "dependencies": { "aproba": "^1.0.3 || ^2.0.0", "color-support": "^1.1.3", "console-control-strings": "^1.1.0", "has-unicode": "^2.0.1", "signal-exit": "^3.0.7", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "wide-align": "^1.1.5" } }, "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg=="], + + "github-from-package": ["github-from-package@0.0.0", "", {}, "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="], + + "glob": ["glob@7.2.3", "", { "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", "minimatch": "^3.1.1", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q=="], + "graceful-fs": ["graceful-fs@4.2.11", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="], + "has-unicode": ["has-unicode@2.0.1", "", {}, "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ=="], + + "http-cache-semantics": ["http-cache-semantics@4.2.0", "", {}, "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ=="], + + "http-proxy-agent": ["http-proxy-agent@4.0.1", "", { "dependencies": { "@tootallnate/once": "1", "agent-base": "6", "debug": "4" } }, "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg=="], + + "https-proxy-agent": ["https-proxy-agent@5.0.1", "", { "dependencies": { "agent-base": "6", "debug": "4" } }, "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA=="], + + "humanize-ms": ["humanize-ms@1.2.1", "", { "dependencies": { "ms": "^2.0.0" } }, "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ=="], + + "iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="], + + "ieee754": ["ieee754@1.2.1", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="], + + "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="], + + "indent-string": ["indent-string@4.0.0", "", {}, "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg=="], + + "infer-owner": ["infer-owner@1.0.4", "", {}, "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A=="], + + "inflight": ["inflight@1.0.6", "", { "dependencies": { "once": "^1.3.0", "wrappy": "1" } }, "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA=="], + + "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], + + "ini": ["ini@1.3.8", "", {}, "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="], + + "ip-address": ["ip-address@10.1.0", "", {}, "sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q=="], + + "is-fullwidth-code-point": ["is-fullwidth-code-point@3.0.0", "", {}, "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="], + + "is-lambda": ["is-lambda@1.0.1", "", {}, "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ=="], + + "isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], + + "lru-cache": ["lru-cache@6.0.0", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA=="], + + "make-fetch-happen": ["make-fetch-happen@9.1.0", "", { "dependencies": { "agentkeepalive": "^4.1.3", "cacache": "^15.2.0", "http-cache-semantics": "^4.1.0", "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", "is-lambda": "^1.0.1", "lru-cache": "^6.0.0", "minipass": "^3.1.3", "minipass-collect": "^1.0.2", "minipass-fetch": "^1.3.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", "negotiator": "^0.6.2", "promise-retry": "^2.0.1", "socks-proxy-agent": "^6.0.0", "ssri": "^8.0.0" } }, "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg=="], + + "mimic-response": ["mimic-response@3.1.0", "", {}, "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ=="], + + "minimatch": ["minimatch@3.1.5", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w=="], + + "minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="], + + "minipass": ["minipass@5.0.0", "", {}, "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ=="], + + "minipass-collect": ["minipass-collect@1.0.2", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA=="], + + "minipass-fetch": ["minipass-fetch@1.4.1", "", { "dependencies": { "minipass": "^3.1.0", "minipass-sized": "^1.0.3", "minizlib": "^2.0.0" }, "optionalDependencies": { "encoding": "^0.1.12" } }, "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw=="], + + "minipass-flush": ["minipass-flush@1.0.7", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-TbqTz9cUwWyHS2Dy89P3ocAGUGxKjjLuR9z8w4WUTGAVgEj17/4nhgo2Du56i0Fm3Pm30g4iA8Lcqctc76jCzA=="], + + "minipass-pipeline": ["minipass-pipeline@1.2.4", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A=="], + + "minipass-sized": ["minipass-sized@1.0.3", "", { "dependencies": { "minipass": "^3.0.0" } }, "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g=="], + + "minizlib": ["minizlib@2.1.2", "", { "dependencies": { "minipass": "^3.0.0", "yallist": "^4.0.0" } }, "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg=="], + + "mkdirp": ["mkdirp@1.0.4", "", { "bin": { "mkdirp": "bin/cmd.js" } }, "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw=="], + + "mkdirp-classic": ["mkdirp-classic@0.5.3", "", {}, "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="], + + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "napi-build-utils": ["napi-build-utils@2.0.0", "", {}, "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA=="], + + "negotiator": ["negotiator@0.6.4", "", {}, "sha512-myRT3DiWPHqho5PrJaIRyaMv2kgYf0mUVgBNOYMuCH5Ki1yEiQaf/ZJuQ62nvpc44wL5WDbTX7yGJi1Neevw8w=="], + + "node-abi": ["node-abi@3.89.0", "", { "dependencies": { "semver": "^7.3.5" } }, "sha512-6u9UwL0HlAl21+agMN3YAMXcKByMqwGx+pq+P76vii5f7hTPtKDp08/H9py6DY+cfDw7kQNTGEj/rly3IgbNQA=="], + + "node-addon-api": ["node-addon-api@7.1.1", "", {}, "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ=="], + + "node-gyp": ["node-gyp@8.4.1", "", { "dependencies": { "env-paths": "^2.2.0", "glob": "^7.1.4", "graceful-fs": "^4.2.6", "make-fetch-happen": "^9.1.0", "nopt": "^5.0.0", "npmlog": "^6.0.0", "rimraf": "^3.0.2", "semver": "^7.3.5", "tar": "^6.1.2", "which": "^2.0.2" }, "bin": { "node-gyp": "bin/node-gyp.js" } }, "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w=="], + + "nopt": ["nopt@5.0.0", "", { "dependencies": { "abbrev": "1" }, "bin": { "nopt": "bin/nopt.js" } }, "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ=="], + + "npmlog": ["npmlog@6.0.2", "", { "dependencies": { "are-we-there-yet": "^3.0.0", "console-control-strings": "^1.1.0", "gauge": "^4.0.3", "set-blocking": "^2.0.0" } }, "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg=="], + + "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], + + "p-map": ["p-map@4.0.0", "", { "dependencies": { "aggregate-error": "^3.0.0" } }, "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ=="], + + "path-is-absolute": ["path-is-absolute@1.0.1", "", {}, "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg=="], + + "prebuild-install": ["prebuild-install@7.1.3", "", { "dependencies": { "detect-libc": "^2.0.0", "expand-template": "^2.0.3", "github-from-package": "0.0.0", "minimist": "^1.2.3", "mkdirp-classic": "^0.5.3", "napi-build-utils": "^2.0.0", "node-abi": "^3.3.0", "pump": "^3.0.0", "rc": "^1.2.7", "simple-get": "^4.0.0", "tar-fs": "^2.0.0", "tunnel-agent": "^0.6.0" }, "bin": { "prebuild-install": "bin.js" } }, "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug=="], + + "promise-inflight": ["promise-inflight@1.0.1", "", {}, "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g=="], + + "promise-retry": ["promise-retry@2.0.1", "", { "dependencies": { "err-code": "^2.0.2", "retry": "^0.12.0" } }, "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g=="], + "proper-lockfile": ["proper-lockfile@4.1.2", "", { "dependencies": { "graceful-fs": "^4.2.4", "retry": "^0.12.0", "signal-exit": "^3.0.2" } }, "sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA=="], + "pump": ["pump@3.0.4", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA=="], + + "rc": ["rc@1.2.8", "", { "dependencies": { "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" }, "bin": { "rc": "./cli.js" } }, "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw=="], + + "readable-stream": ["readable-stream@3.6.2", "", { "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", "util-deprecate": "^1.0.1" } }, "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA=="], + "retry": ["retry@0.12.0", "", {}, "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow=="], + "rimraf": ["rimraf@3.0.2", "", { "dependencies": { "glob": "^7.1.3" }, "bin": { "rimraf": "bin.js" } }, "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA=="], + + "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], + + "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="], + + "semver": ["semver@7.7.4", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="], + + "set-blocking": ["set-blocking@2.0.0", "", {}, "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="], + "signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], + "simple-concat": ["simple-concat@1.0.1", "", {}, "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q=="], + + "simple-get": ["simple-get@4.0.1", "", { "dependencies": { "decompress-response": "^6.0.0", "once": "^1.3.1", "simple-concat": "^1.0.0" } }, "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA=="], + + "smart-buffer": ["smart-buffer@4.2.0", "", {}, "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg=="], + + "socks": ["socks@2.8.7", "", { "dependencies": { "ip-address": "^10.0.1", "smart-buffer": "^4.2.0" } }, "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A=="], + + "socks-proxy-agent": ["socks-proxy-agent@6.2.1", "", { "dependencies": { "agent-base": "^6.0.2", "debug": "^4.3.3", "socks": "^2.6.2" } }, "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ=="], + + "sqlite3": ["sqlite3@5.1.7", "", { "dependencies": { "bindings": "^1.5.0", "node-addon-api": "^7.0.0", "prebuild-install": "^7.1.1", "tar": "^6.1.11" }, "optionalDependencies": { "node-gyp": "8.x" } }, "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog=="], + + "ssri": ["ssri@8.0.1", "", { "dependencies": { "minipass": "^3.1.1" } }, "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ=="], + + "string-width": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="], + + "string_decoder": ["string_decoder@1.3.0", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="], + + "strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="], + + "strip-json-comments": ["strip-json-comments@2.0.1", "", {}, "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ=="], + + "tar": ["tar@6.2.1", "", { "dependencies": { "chownr": "^2.0.0", "fs-minipass": "^2.0.0", "minipass": "^5.0.0", "minizlib": "^2.1.1", "mkdirp": "^1.0.3", "yallist": "^4.0.0" } }, "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A=="], + + "tar-fs": ["tar-fs@2.1.4", "", { "dependencies": { "chownr": "^1.1.1", "mkdirp-classic": "^0.5.2", "pump": "^3.0.0", "tar-stream": "^2.1.4" } }, "sha512-mDAjwmZdh7LTT6pNleZ05Yt65HC3E+NiQzl672vQG38jIrehtJk/J3mNwIg+vShQPcLF/LV7CMnDW6vjj6sfYQ=="], + + "tar-stream": ["tar-stream@2.2.0", "", { "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", "fs-constants": "^1.0.0", "inherits": "^2.0.3", "readable-stream": "^3.1.1" } }, "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ=="], + + "tunnel-agent": ["tunnel-agent@0.6.0", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w=="], + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], "undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], + "unique-filename": ["unique-filename@1.1.1", "", { "dependencies": { "unique-slug": "^2.0.0" } }, "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ=="], + + "unique-slug": ["unique-slug@2.0.2", "", { "dependencies": { "imurmurhash": "^0.1.4" } }, "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w=="], + + "util-deprecate": ["util-deprecate@1.0.2", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="], + + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], + + "wide-align": ["wide-align@1.1.5", "", { "dependencies": { "string-width": "^1.0.2 || 2 || 3 || 4" } }, "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg=="], + + "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], + "xdg-basedir": ["xdg-basedir@5.1.0", "", {}, "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ=="], + "yallist": ["yallist@4.0.0", "", {}, "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="], + "zod": ["zod@4.3.5", "", {}, "sha512-k7Nwx6vuWx1IJ9Bjuf4Zt1PEllcwe7cls3VNzm4CQ1/hgtFUK2bRNG3rvnpPUhFjmqJKAKtjV576KnUkHocg/g=="], "@opencode-ai/plugin/zod": ["zod@4.1.8", "", {}, "sha512-5R1P+WwQqmmMIEACyzSvo4JXHY5WiAFHRMg+zBZKgKS+Q1viRa0C1hmUKtHltoIFKtIdki3pRxkmpP74jnNYHQ=="], "bun-types/@types/node": ["@types/node@22.19.6", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-qm+G8HuG6hOHQigsi7VGuLjUVu6TtBo/F05zvX04Mw2uCg9Dv0Qxy3Qw7j41SidlTcl5D/5yg0SEZqOB+EqZnQ=="], + "cacache/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "fs-minipass/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "make-fetch-happen/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "minipass-collect/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "minipass-fetch/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "minipass-flush/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "minipass-pipeline/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "minipass-sized/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "minizlib/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "ssri/minipass": ["minipass@3.3.6", "", { "dependencies": { "yallist": "^4.0.0" } }, "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw=="], + + "tar-fs/chownr": ["chownr@1.1.4", "", {}, "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="], + "bun-types/@types/node/undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], } } diff --git a/package.json b/package.json index e3533df..2a3e8b6 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "test:unit": "bun test tests/unit", "test:request": "bun run tests/live/request.ts", "test:analyze": "bun run tests/live/analyze.ts", + "sync-models": "bun run scripts/sync-models.ts", "clean": "rm -rf dist" }, "keywords": [ @@ -40,6 +41,7 @@ "@connectrpc/connect-web": "^2.0.0", "@bufbuild/protobuf": "^2.0.0", "proper-lockfile": "^4.1.2", + "sqlite3": "^5.1.7", "xdg-basedir": "^5.1.0", "zod": "^4.3.5" }, @@ -48,6 +50,7 @@ "@types/bun": "^1.3.6", "@types/node": "^25.0.0", "@types/proper-lockfile": "^4.1.4", + "@types/sqlite3": "^5.0.0", "typescript": "^5.7.0" }, "peerDependencies": { diff --git a/scripts/sync-models.ts b/scripts/sync-models.ts new file mode 100644 index 0000000..98822c5 --- /dev/null +++ b/scripts/sync-models.ts @@ -0,0 +1,126 @@ + +import sqlite3 from 'sqlite3'; +import { promisify } from 'util'; +import fs from 'fs'; +import path from 'path'; +import os from 'path'; +import { execSync } from 'child_process'; + +const DB_PATH = `${process.env.HOME}/Library/Application Support/Windsurf/User/globalStorage/state.vscdb`; +const CONFIG_PATH = `${process.env.HOME}/.config/opencode/opencode.json`; +const EXTENSION_PATH = "/Applications/Windsurf.app/Contents/Resources/app/extensions/windsurf/dist/extension.js"; + +async function getWindsurfConfigs() { + return new Promise((resolve, reject) => { + const db = new sqlite3.Database(DB_PATH, sqlite3.OPEN_READONLY, (err) => { + if (err) reject(err); + }); + + db.get("SELECT value FROM ItemTable WHERE key = 'windsurfConfigurations'", (err, row: any) => { + db.close(); + if (err) reject(err); + if (!row) reject(new Error("windsurfConfigurations not found in database")); + resolve(row.value); + }); + }); +} + +function extractModels(data: Buffer) { + // Extract clean model IDs (they look like 'kimi-k2-5' or 'gpt-5-4') + const dataStr = data.toString('binary'); + + // Enterprise Mappings discovered from binary decode + const enterpriseMap: Record = { + "kimi-k2-5": "Kimi K2.5", + "minimax-m2-5": "Minimax M2.5", + "claude-haiku-4-5": "Claude Haiku 4.5", + "claude-sonnet-4-5": "Claude Sonnet 4.5", + "claude-sonnet-4-5-thinking": "Claude Sonnet 4.5 Thinking", + "gpt-5-1": "GPT-5.1", + "gpt-5-2": "GPT-5.2", + "gpt-5-3": "GPT-5.3", + "gpt-5-4": "GPT-5.4", + "gpt-oss-120b": "GPT-OSS 120B Medium Thinking", + "claude-4-sonnet": "Claude Sonnet 4", + "claude-4-5-opus": "Claude 4.5 Opus", + "gpt-4-1": "GPT-4.1", + "swe-1-5": "SWE-1.5", + "windsurf-fast": "Windsurf Fast", + "gpt-4o": "GPT-4o", + "claude-3-5-sonnet": "Claude 3.5 Sonnet", + "claude-3-7-sonnet": "Claude 3.7 Sonnet", + "claude-3-7-sonnet-thinking": "Claude 3.7 Sonnet (Thinking)", + "gemini-3-1-pro-high": "Gemini 3.1 Pro High Thinking", + "gemini-3-1-pro-low": "Gemini 3.1 Pro Low Thinking" + }; + + const foundModels: Record = {}; + + // Find which ones are actually present in the binary config + for (const [id, label] of Object.entries(enterpriseMap)) { + if (dataStr.includes(id) || dataStr.includes(id.replace(/-/g, '_').toUpperCase())) { + foundModels[id] = { + name: `${label} (Windsurf)`, + limit: { context: 200000, output: 8192 } + }; + } + } + + // Always include standard ones as fallback + const defaults = ["gpt-4o", "claude-3-5-sonnet", "claude-3-7-sonnet"]; + for (const id of defaults) { + if (!foundModels[id]) { + foundModels[id] = { + name: `${enterpriseMap[id]} (Windsurf)`, + limit: { context: 200000, output: 8192 } + }; + } + } + + return foundModels; +} + +async function main() { + console.log("Starting Windsurf model synchronization..."); + + try { + const rawB64 = await getWindsurfConfigs(); + const data = Buffer.from(rawB64, 'base64'); + const enabledModels = extractModels(data); + + if (Object.keys(enabledModels).length === 0) { + console.error("No enabled models found in Windsurf configuration."); + return; + } + + if (!fs.existsSync(CONFIG_PATH)) { + console.error(`OpenCode config not found at ${CONFIG_PATH}`); + return; + } + + const config = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8')); + + if (!config.provider) config.provider = {}; + if (!config.provider.windsurf) { + config.provider.windsurf = { + npm: "@ai-sdk/openai-compatible", + options: { baseURL: "http://127.0.0.1:42100/v1" }, + models: {} + }; + } + + config.provider.windsurf.models = enabledModels; + + fs.writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2)); + + console.log(`Successfully updated ${Object.keys(enabledModels).length} models in OpenCode configuration.`); + for (const id of Object.keys(enabledModels)) { + console.log(` - ${id}`); + } + + } catch (error) { + console.error("Synchronization failed:", error); + } +} + +main(); diff --git a/src/plugin.ts b/src/plugin.ts index 0c3a449..4e5db17 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -874,7 +874,33 @@ export const createWindsurfPlugin = }, // No auth methods needed - we use Windsurf's existing auth - methods: [], + methods: [ + { + type: 'api', + label: 'Sync Models', + async authorize() { + console.log('Synchronizing Windsurf models...'); + try { + const { execSync } = await import('child_process'); + const path = await import('path'); + const { fileURLToPath } = await import('url'); + + // Find the root of the plugin package + const currentFile = fileURLToPath(import.meta.url); + const pluginRoot = path.join(path.dirname(currentFile), '..', '..'); + const scriptPath = path.join(pluginRoot, 'scripts', 'sync-models.ts'); + + console.log(`Executing sync script: ${scriptPath}`); + // Run bun install first to ensure sqlite3 exists in the cache folder, then run script + execSync(`cd ${pluginRoot} && bun install --silent && bun ${scriptPath}`, { stdio: 'inherit' }); + return { type: 'success', key: 'synced' }; + } catch (err) { + console.error('Failed to sync models:', err); + return { type: 'failed' }; + } + }, + }, + ], }, // Dynamic baseURL injection (key pattern from cursor-auth) diff --git a/src/plugin/grpc-client.ts b/src/plugin/grpc-client.ts index 6a1b8be..050a8c9 100644 --- a/src/plugin/grpc-client.ts +++ b/src/plugin/grpc-client.ts @@ -655,17 +655,123 @@ export async function* streamChatGenerator( // Yield chunks as they arrive while (!done || chunkQueue.length > 0) { - if (chunkQueue.length > 0) { - yield chunkQueue.shift()!; - } else if (!done) { - await new Promise((resolve) => { - resolveWait = resolve; - }); - resolveWait = null; - } + if (chunkQueue.length > 0) { + yield chunkQueue.shift()!; + } else if (!done) { + await new Promise((resolve) => { + resolveWait = resolve; + }); + resolveWait = null; + } } if (error) { - throw error; + throw error; } -} + } + + /** + * Discovered model configuration from Windsurf + */ + export interface DiscoveredModel { + id: string; + name: string; + enumValue: number; + } + + /** + * Fetch available model configurations from Windsurf language server + */ + export async function getModels(credentials: WindsurfCredentials): Promise { + const { csrfToken, port, apiKey, version } = credentials; + + // GetModelStatusesRequest has Metadata in Field 1 + const metadata = encodeMetadata(apiKey, version); + const requestPayload = encodeMessage(1, metadata); + + // gRPC framing: 1 byte compression (0) + 4 bytes length + payload + const body = Buffer.alloc(5 + requestPayload.length); + body[0] = 0; + body.writeUInt32BE(requestPayload.length, 1); + Buffer.from(requestPayload).copy(body, 5); + + return new Promise((resolve, reject) => { + const client = http2.connect(`http://localhost:${port}`); + const chunks: Buffer[] = []; + + client.on('error', reject); + + const req = client.request({ + ':method': 'POST', + ':path': '/exa.language_server_pb.LanguageServerService/GetModelStatuses', + 'content-type': 'application/grpc', + 'te': 'trailers', + 'x-codeium-csrf-token': csrfToken, + }); + + req.on('data', (chunk: Buffer) => { + chunks.push(chunk); + }); + + req.on('end', () => { + client.close(); + const fullBuffer = Buffer.concat(chunks); + if (fullBuffer.length < 5) { + resolve([]); + return; + } + + const messageLength = fullBuffer.readUInt32BE(1); + const payload = fullBuffer.subarray(5, 5 + messageLength); + + try { + const models: DiscoveredModel[] = []; + let offset = 0; + + // Parse GetModelStatusesResponse + // Field 1: model_status_infos (repeated ModelStatusInfo) + while (offset < payload.length) { + const field = parseProtobufField(payload, offset); + if (!field) break; + offset += field.bytesConsumed; + + if (field.fieldNum === 1 && field.wireType === 2 && Buffer.isBuffer(field.value)) { + // Parse ModelStatusInfo + // Field 1: model (enum) + // Field 4: model_uid (string) + let infoOffset = 0; + let modelEnum = 0; + let modelUid = ''; + + const infoBuf = field.value; + while (infoOffset < infoBuf.length) { + const infoField = parseProtobufField(infoBuf, infoOffset); + if (!infoField) break; + infoOffset += infoField.bytesConsumed; + + if (infoField.fieldNum === 1 && infoField.wireType === 0) { + modelEnum = Number(infoField.value); + } else if (infoField.fieldNum === 4 && infoField.wireType === 2 && Buffer.isBuffer(infoField.value)) { + modelUid = infoField.value.toString('utf8'); + } + } + + if (modelEnum > 0) { + models.push({ + id: modelUid || `model-${modelEnum}`, + name: modelUid || `Model ${modelEnum}`, + enumValue: modelEnum + }); + } + } + } + resolve(models); + } catch (err) { + reject(err); + } + }); + + req.end(body); + }); + } + diff --git a/src/plugin/models.ts b/src/plugin/models.ts index 4b53fc3..3e446cc 100644 --- a/src/plugin/models.ts +++ b/src/plugin/models.ts @@ -353,13 +353,9 @@ const MODEL_NAME_TO_ENUM: Record = { // GPT 5.2 variants 'gpt-5.2': ModelEnum.GPT_5_2_MEDIUM, - 'gpt-5-2': ModelEnum.GPT_5_2_MEDIUM, 'gpt-5.2-low': ModelEnum.GPT_5_2_LOW, - 'gpt-5-2-low': ModelEnum.GPT_5_2_LOW, 'gpt-5.2-high': ModelEnum.GPT_5_2_HIGH, - 'gpt-5-2-high': ModelEnum.GPT_5_2_HIGH, 'gpt-5.2-xhigh': ModelEnum.GPT_5_2_XHIGH, - 'gpt-5-2-xhigh': ModelEnum.GPT_5_2_XHIGH, 'gpt-5.2-priority': ModelEnum.GPT_5_2_MEDIUM_PRIORITY, 'gpt-5.2-low-priority': ModelEnum.GPT_5_2_LOW_PRIORITY, 'gpt-5.2-high-priority': ModelEnum.GPT_5_2_HIGH_PRIORITY, @@ -493,6 +489,22 @@ const MODEL_NAME_TO_ENUM: Record = { 'swe-1-5-thinking': ModelEnum.SWE_1_5_THINKING, 'swe-1.5-slow': ModelEnum.SWE_1_5_SLOW, 'swe-1-5-slow': ModelEnum.SWE_1_5_SLOW, + + // ============================================================================ + // Enterprise / Private Model Mappings + // ============================================================================ + 'kimi-k2-5': ModelEnum.MODEL_PRIVATE_9, + 'minimax-m2-5': ModelEnum.MODEL_PRIVATE_19, + 'claude-haiku-4-5': ModelEnum.MODEL_PRIVATE_11, + 'claude-sonnet-4-5': ModelEnum.MODEL_PRIVATE_2, + 'claude-sonnet-4-5-thinking': ModelEnum.MODEL_PRIVATE_3, + 'gpt-5-1': ModelEnum.MODEL_PRIVATE_12, + 'gpt-5-2': ModelEnum.MODEL_PRIVATE_13, + 'gpt-5-3': ModelEnum.MODEL_PRIVATE_14, + 'gpt-5-4': ModelEnum.MODEL_PRIVATE_15, + 'gemini-3-1-pro-high': ModelEnum.MODEL_PRIVATE_20, + 'gemini-3-1-pro-low': ModelEnum.MODEL_PRIVATE_21, + 'gpt-oss-120b': ModelEnum.GPT_OSS_120B, }; /** @@ -611,6 +623,20 @@ const ENUM_TO_MODEL_NAME: Partial> = { [ModelEnum.SWE_1_5]: 'swe-1.5', [ModelEnum.SWE_1_5_THINKING]: 'swe-1.5-thinking', [ModelEnum.SWE_1_5_SLOW]: 'swe-1.5-slow', + + // Enterprise Reverse Mappings + [ModelEnum.MODEL_PRIVATE_9]: 'kimi-k2-5', + [ModelEnum.MODEL_PRIVATE_19]: 'minimax-m2-5', + [ModelEnum.MODEL_PRIVATE_11]: 'claude-haiku-4-5', + [ModelEnum.MODEL_PRIVATE_2]: 'claude-sonnet-4-5', + [ModelEnum.MODEL_PRIVATE_3]: 'claude-sonnet-4-5-thinking', + [ModelEnum.MODEL_PRIVATE_12]: 'gpt-5-1', + [ModelEnum.MODEL_PRIVATE_13]: 'gpt-5-2', + [ModelEnum.MODEL_PRIVATE_14]: 'gpt-5-3', + [ModelEnum.MODEL_PRIVATE_15]: 'gpt-5-4', + [ModelEnum.MODEL_PRIVATE_20]: 'gemini-3-1-pro-high', + [ModelEnum.MODEL_PRIVATE_21]: 'gemini-3-1-pro-low', + [ModelEnum.GPT_OSS_120B]: 'gpt-oss-120b', }; // ============================================================================ diff --git a/src/plugin/types.ts b/src/plugin/types.ts index 446a129..3321bf4 100644 --- a/src/plugin/types.ts +++ b/src/plugin/types.ts @@ -176,6 +176,46 @@ export const ModelEnum = { SWE_1_5_THINKING: 369, SWE_1_5_SLOW: 377, CLAUDE_4_5_SONNET_THINKING_1M: 371, + + // ============================================================================ + // Enterprise / Private Model Slots + // These are often used for exclusive or regional model deployments + // ============================================================================ + MODEL_PRIVATE_1: 219, + MODEL_PRIVATE_2: 220, + MODEL_PRIVATE_3: 221, + MODEL_PRIVATE_4: 222, + MODEL_PRIVATE_5: 223, + MODEL_PRIVATE_6: 314, + MODEL_PRIVATE_7: 315, + MODEL_PRIVATE_8: 316, + MODEL_PRIVATE_9: 317, + MODEL_PRIVATE_10: 318, + MODEL_PRIVATE_11: 347, + MODEL_PRIVATE_12: 348, + MODEL_PRIVATE_13: 349, + MODEL_PRIVATE_14: 350, + MODEL_PRIVATE_15: 351, + MODEL_PRIVATE_16: 363, + MODEL_PRIVATE_17: 364, + MODEL_PRIVATE_18: 365, + MODEL_PRIVATE_19: 366, + MODEL_PRIVATE_20: 367, + MODEL_PRIVATE_21: 372, + MODEL_PRIVATE_22: 373, + MODEL_PRIVATE_23: 374, + MODEL_PRIVATE_24: 375, + MODEL_PRIVATE_25: 376, + MODEL_PRIVATE_26: 380, + MODEL_PRIVATE_27: 381, + MODEL_PRIVATE_28: 382, + MODEL_PRIVATE_29: 383, + MODEL_PRIVATE_30: 384, + + // ============================================================================ + // Additional Models + // ============================================================================ + GPT_OSS_120B: 326, } as const; export type ModelEnumValue = (typeof ModelEnum)[keyof typeof ModelEnum]; From 86e72a1c99e1283d4142f42bb62343cbb1e646c2 Mon Sep 17 00:00:00 2001 From: Teo Miscia Date: Fri, 10 Apr 2026 00:39:03 -0700 Subject: [PATCH 3/7] feat: implement fully dynamic model discovery for Enterprise support --- scripts/sync-models.ts | 202 ++++++++++++++++++++++++++--------------- src/plugin/models.ts | 90 ++++++++++++------ src/plugin/types.ts | 4 +- 3 files changed, 192 insertions(+), 104 deletions(-) diff --git a/scripts/sync-models.ts b/scripts/sync-models.ts index 98822c5..46afa8b 100644 --- a/scripts/sync-models.ts +++ b/scripts/sync-models.ts @@ -1,95 +1,149 @@ import sqlite3 from 'sqlite3'; -import { promisify } from 'util'; import fs from 'fs'; import path from 'path'; -import os from 'path'; -import { execSync } from 'child_process'; +import base64 from 'base64-js'; -const DB_PATH = `${process.env.HOME}/Library/Application Support/Windsurf/User/globalStorage/state.vscdb`; -const CONFIG_PATH = `${process.env.HOME}/.config/opencode/opencode.json`; -const EXTENSION_PATH = "/Applications/Windsurf.app/Contents/Resources/app/extensions/windsurf/dist/extension.js"; +const DB_PATH = path.join(process.env.HOME || '', 'Library/Application Support/Windsurf/User/globalStorage/state.vscdb'); +const CONFIG_PATH = path.join(process.env.HOME || '', '.config/opencode/opencode.json'); -async function getWindsurfConfigs() { - return new Promise((resolve, reject) => { +async function getWindsurfValue(key: string): Promise { + return new Promise((resolve, reject) => { + if (!fs.existsSync(DB_PATH)) { + resolve(null); + return; + } const db = new sqlite3.Database(DB_PATH, sqlite3.OPEN_READONLY, (err) => { if (err) reject(err); }); - db.get("SELECT value FROM ItemTable WHERE key = 'windsurfConfigurations'", (err, row: any) => { + db.get("SELECT value FROM ItemTable WHERE key = ?", [key], (err, row: any) => { db.close(); - if (err) reject(err); - if (!row) reject(new Error("windsurfConfigurations not found in database")); - resolve(row.value); + if (err) { + reject(err); + } else { + resolve(row ? row.value : null); + } }); }); } -function extractModels(data: Buffer) { - // Extract clean model IDs (they look like 'kimi-k2-5' or 'gpt-5-4') - const dataStr = data.toString('binary'); +/** + * Extracts model definitions from the binary windsurfConfigurations blob. + * Returns a map of internal ID (e.g. model-private-9) to { name: "Human Label" } + */ +function discoverModels(configData: Buffer, allowedData?: Buffer): Record { + const models: Record = {}; - // Enterprise Mappings discovered from binary decode - const enterpriseMap: Record = { - "kimi-k2-5": "Kimi K2.5", - "minimax-m2-5": "Minimax M2.5", - "claude-haiku-4-5": "Claude Haiku 4.5", - "claude-sonnet-4-5": "Claude Sonnet 4.5", - "claude-sonnet-4-5-thinking": "Claude Sonnet 4.5 Thinking", - "gpt-5-1": "GPT-5.1", - "gpt-5-2": "GPT-5.2", - "gpt-5-3": "GPT-5.3", - "gpt-5-4": "GPT-5.4", - "gpt-oss-120b": "GPT-OSS 120B Medium Thinking", - "claude-4-sonnet": "Claude Sonnet 4", - "claude-4-5-opus": "Claude 4.5 Opus", - "gpt-4-1": "GPT-4.1", - "swe-1-5": "SWE-1.5", - "windsurf-fast": "Windsurf Fast", - "gpt-4o": "GPT-4o", - "claude-3-5-sonnet": "Claude 3.5 Sonnet", - "claude-3-7-sonnet": "Claude 3.7 Sonnet", - "claude-3-7-sonnet-thinking": "Claude 3.7 Sonnet (Thinking)", - "gemini-3-1-pro-high": "Gemini 3.1 Pro High Thinking", - "gemini-3-1-pro-low": "Gemini 3.1 Pro Low Thinking" - }; - - const foundModels: Record = {}; + // Convert buffer to a string where we can search for identifiers + // We use latin1 to preserve byte values for regex matching + const content = configData.toString('latin1'); - // Find which ones are actually present in the binary config - for (const [id, label] of Object.entries(enterpriseMap)) { - if (dataStr.includes(id) || dataStr.includes(id.replace(/-/g, '_').toUpperCase())) { - foundModels[id] = { - name: `${label} (Windsurf)`, - limit: { context: 200000, output: 8192 } - }; + // Find all MODEL_ strings (e.g. MODEL_PRIVATE_9, MODEL_CHAT_GPT_4O) + // Also look for numeric identifiers like 11121 + const modelMatches = [...content.matchAll(/MODEL_[A-Z0-9_]+/g)]; + + // Add some known numeric IDs if they appear in certain blocks + const numericIds = ["11121"]; + for (const numId of numericIds) { + if (content.includes(numId)) { + // Just a stub match to trigger the heuristic + modelMatches.push({ 0: `MODEL_CHAT_${numId}`, index: content.indexOf(numId) } as any); + } + } + + const allowedContent = allowedData ? allowedData.toString('latin1') : null; + + for (const match of modelMatches) { + const internalName = match[0]; + const pos = match.index || 0; + + // Check if this model is allowed (if we have the allowed list) + if (allowedContent && !allowedContent.includes(internalName)) { + continue; + } + + // Heuristic: Look backward from the model ID to find the display label + // Labels are usually UTF-8 strings ending with a few metadata bytes before the ID + const lookback = content.slice(Math.max(0, pos - 150), pos); + + // Improved Regex: Find strings that look like model names. + // Must start with Uppercase, usually contains numbers/dots, ends before metadata. + // We avoid common metadata words. + const labels = [...lookback.matchAll(/[A-Z][a-zA-Z0-9.]+ (?:[a-zA-Z0-9.]+ )*[a-zA-Z0-9.]+/g)]; + + if (labels.length > 0) { + let label = labels[labels.length - 1][0].trim(); + const cleanId = internalName.toLowerCase().replace(/^model_/, '').replace(/_/g, '-'); + + // If the label is just metadata, try the one before it + const metadataWords = ['No Thinking', 'Thinking', 'Fast Mode', 'Prompt Cache Retention', 'Reasoning Effort']; + if (metadataWords.includes(label) && labels.length > 1) { + label = labels[labels.length - 2][0].trim(); + } + + // Final validation - allow special cases like SWE-1.5 and GPT 5.1 + const isSpecialCase = label.includes('SWE-') || label.includes('GPT 5'); + if (label.length > 2 && (!['Windsurf', 'Enterprise', 'Codeium', 'Cascade', ...metadataWords].includes(label) || isSpecialCase)) { + models[cleanId] = { + name: `${label} (Windsurf)`, + limit: { + context: 200000, + output: 8192 + } + }; + } } } - // Always include standard ones as fallback - const defaults = ["gpt-4o", "claude-3-5-sonnet", "claude-3-7-sonnet"]; - for (const id of defaults) { - if (!foundModels[id]) { - foundModels[id] = { - name: `${enterpriseMap[id]} (Windsurf)`, + // Ensure standard defaults are present if not found + const defaults: Record = { + "gpt-4o": "GPT-4o", + "claude-3-5-sonnet": "Claude 3.5 Sonnet", + "claude-3-7-sonnet": "Claude 3.7 Sonnet" + }; + + for (const [id, name] of Object.entries(defaults)) { + if (!models[id]) { + models[id] = { + name: `${name} (Windsurf)`, limit: { context: 200000, output: 8192 } }; } } - return foundModels; + return models; } async function main() { - console.log("Starting Windsurf model synchronization..."); + console.log("Starting Dynamic Windsurf Model Discovery..."); try { - const rawB64 = await getWindsurfConfigs(); - const data = Buffer.from(rawB64, 'base64'); - const enabledModels = extractModels(data); + const configRaw = await getWindsurfValue('windsurfConfigurations'); + const authStatusRaw = await getWindsurfValue('windsurfAuthStatus'); + + if (!configRaw) { + console.error("Could not find Windsurf configurations in database."); + return; + } + + const configBuf = Buffer.from(configRaw, 'base64'); - if (Object.keys(enabledModels).length === 0) { - console.error("No enabled models found in Windsurf configuration."); + // Optional: Get the allowed list from auth status if present + let allowedBuf: Buffer | undefined; + if (authStatusRaw) { + // The auth status is a JSON containing the allowed protos + const authData = JSON.parse(authStatusRaw); + const allowedProtos = authData.allowedCommandModelConfigsProtoBinaryBase64 || []; + // Combine all allowed protos into one search buffer + allowedBuf = Buffer.concat(allowedProtos.map((p: string) => Buffer.from(p, 'base64'))); + } + + const discovered = discoverModels(configBuf, allowedBuf); + const count = Object.keys(discovered).length; + + if (count === 0) { + console.error("No models could be discovered."); return; } @@ -98,28 +152,28 @@ async function main() { return; } - const config = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8')); - - if (!config.provider) config.provider = {}; - if (!config.provider.windsurf) { - config.provider.windsurf = { + const opencodeConfig = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8')); + if (!opencodeConfig.provider) opencodeConfig.provider = {}; + if (!opencodeConfig.provider.windsurf) { + opencodeConfig.provider.windsurf = { npm: "@ai-sdk/openai-compatible", options: { baseURL: "http://127.0.0.1:42100/v1" }, models: {} }; } - config.provider.windsurf.models = enabledModels; + opencodeConfig.provider.windsurf.models = discovered; - fs.writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2)); - - console.log(`Successfully updated ${Object.keys(enabledModels).length} models in OpenCode configuration.`); - for (const id of Object.keys(enabledModels)) { - console.log(` - ${id}`); - } + fs.writeFileSync(CONFIG_PATH, JSON.stringify(opencodeConfig, null, 2)); + console.log(`\nSuccess! Updated ${count} models in opencode.json.`); + console.log("Discovered models:"); + Object.entries(discovered).forEach(([id, meta]: [string, any]) => { + console.log(` - ${id.padEnd(30)} -> ${meta.name}`); + }); + } catch (error) { - console.error("Synchronization failed:", error); + console.error("Discovery failed:", error); } } diff --git a/src/plugin/models.ts b/src/plugin/models.ts index 3e446cc..43ea248 100644 --- a/src/plugin/models.ts +++ b/src/plugin/models.ts @@ -490,21 +490,37 @@ const MODEL_NAME_TO_ENUM: Record = { 'swe-1.5-slow': ModelEnum.SWE_1_5_SLOW, 'swe-1-5-slow': ModelEnum.SWE_1_5_SLOW, - // ============================================================================ - // Enterprise / Private Model Mappings - // ============================================================================ - 'kimi-k2-5': ModelEnum.MODEL_PRIVATE_9, - 'minimax-m2-5': ModelEnum.MODEL_PRIVATE_19, - 'claude-haiku-4-5': ModelEnum.MODEL_PRIVATE_11, - 'claude-sonnet-4-5': ModelEnum.MODEL_PRIVATE_2, - 'claude-sonnet-4-5-thinking': ModelEnum.MODEL_PRIVATE_3, - 'gpt-5-1': ModelEnum.MODEL_PRIVATE_12, - 'gpt-5-2': ModelEnum.MODEL_PRIVATE_13, - 'gpt-5-3': ModelEnum.MODEL_PRIVATE_14, - 'gpt-5-4': ModelEnum.MODEL_PRIVATE_15, - 'gemini-3-1-pro-high': ModelEnum.MODEL_PRIVATE_20, - 'gemini-3-1-pro-low': ModelEnum.MODEL_PRIVATE_21, - 'gpt-oss-120b': ModelEnum.GPT_OSS_120B, + // Generic Private slots for dynamic discovery + 'private-1': ModelEnum.MODEL_PRIVATE_1, + 'private-2': ModelEnum.MODEL_PRIVATE_2, + 'private-3': ModelEnum.MODEL_PRIVATE_3, + 'private-4': ModelEnum.MODEL_PRIVATE_4, + 'private-5': ModelEnum.MODEL_PRIVATE_5, + 'private-6': ModelEnum.MODEL_PRIVATE_6, + 'private-7': ModelEnum.MODEL_PRIVATE_7, + 'private-8': ModelEnum.MODEL_PRIVATE_8, + 'private-9': ModelEnum.MODEL_PRIVATE_9, + 'private-10': ModelEnum.MODEL_PRIVATE_10, + 'private-11': ModelEnum.MODEL_PRIVATE_11, + 'private-12': ModelEnum.MODEL_PRIVATE_12, + 'private-13': ModelEnum.MODEL_PRIVATE_13, + 'private-14': ModelEnum.MODEL_PRIVATE_14, + 'private-15': ModelEnum.MODEL_PRIVATE_15, + 'private-16': ModelEnum.MODEL_PRIVATE_16, + 'private-17': ModelEnum.MODEL_PRIVATE_17, + 'private-18': ModelEnum.MODEL_PRIVATE_18, + 'private-19': ModelEnum.MODEL_PRIVATE_19, + 'private-20': ModelEnum.MODEL_PRIVATE_20, + 'private-21': ModelEnum.MODEL_PRIVATE_21, + 'private-22': ModelEnum.MODEL_PRIVATE_22, + 'private-23': ModelEnum.MODEL_PRIVATE_23, + 'private-24': ModelEnum.MODEL_PRIVATE_24, + 'private-25': ModelEnum.MODEL_PRIVATE_25, + 'private-26': ModelEnum.MODEL_PRIVATE_26, + 'private-27': ModelEnum.MODEL_PRIVATE_27, + 'private-28': ModelEnum.MODEL_PRIVATE_28, + 'private-29': ModelEnum.MODEL_PRIVATE_29, + 'private-30': ModelEnum.MODEL_PRIVATE_30, }; /** @@ -624,19 +640,37 @@ const ENUM_TO_MODEL_NAME: Partial> = { [ModelEnum.SWE_1_5_THINKING]: 'swe-1.5-thinking', [ModelEnum.SWE_1_5_SLOW]: 'swe-1.5-slow', - // Enterprise Reverse Mappings - [ModelEnum.MODEL_PRIVATE_9]: 'kimi-k2-5', - [ModelEnum.MODEL_PRIVATE_19]: 'minimax-m2-5', - [ModelEnum.MODEL_PRIVATE_11]: 'claude-haiku-4-5', - [ModelEnum.MODEL_PRIVATE_2]: 'claude-sonnet-4-5', - [ModelEnum.MODEL_PRIVATE_3]: 'claude-sonnet-4-5-thinking', - [ModelEnum.MODEL_PRIVATE_12]: 'gpt-5-1', - [ModelEnum.MODEL_PRIVATE_13]: 'gpt-5-2', - [ModelEnum.MODEL_PRIVATE_14]: 'gpt-5-3', - [ModelEnum.MODEL_PRIVATE_15]: 'gpt-5-4', - [ModelEnum.MODEL_PRIVATE_20]: 'gemini-3-1-pro-high', - [ModelEnum.MODEL_PRIVATE_21]: 'gemini-3-1-pro-low', - [ModelEnum.GPT_OSS_120B]: 'gpt-oss-120b', + // Generic Private slots + [ModelEnum.MODEL_PRIVATE_1]: 'private-1', + [ModelEnum.MODEL_PRIVATE_2]: 'private-2', + [ModelEnum.MODEL_PRIVATE_3]: 'private-3', + [ModelEnum.MODEL_PRIVATE_4]: 'private-4', + [ModelEnum.MODEL_PRIVATE_5]: 'private-5', + [ModelEnum.MODEL_PRIVATE_6]: 'private-6', + [ModelEnum.MODEL_PRIVATE_7]: 'private-7', + [ModelEnum.MODEL_PRIVATE_8]: 'private-8', + [ModelEnum.MODEL_PRIVATE_9]: 'private-9', + [ModelEnum.MODEL_PRIVATE_10]: 'private-10', + [ModelEnum.MODEL_PRIVATE_11]: 'private-11', + [ModelEnum.MODEL_PRIVATE_12]: 'private-12', + [ModelEnum.MODEL_PRIVATE_13]: 'private-13', + [ModelEnum.MODEL_PRIVATE_14]: 'private-14', + [ModelEnum.MODEL_PRIVATE_15]: 'private-15', + [ModelEnum.MODEL_PRIVATE_16]: 'private-16', + [ModelEnum.MODEL_PRIVATE_17]: 'private-17', + [ModelEnum.MODEL_PRIVATE_18]: 'private-18', + [ModelEnum.MODEL_PRIVATE_19]: 'private-19', + [ModelEnum.MODEL_PRIVATE_20]: 'private-20', + [ModelEnum.MODEL_PRIVATE_21]: 'private-21', + [ModelEnum.MODEL_PRIVATE_22]: 'private-22', + [ModelEnum.MODEL_PRIVATE_23]: 'private-23', + [ModelEnum.MODEL_PRIVATE_24]: 'private-24', + [ModelEnum.MODEL_PRIVATE_25]: 'private-25', + [ModelEnum.MODEL_PRIVATE_26]: 'private-26', + [ModelEnum.MODEL_PRIVATE_27]: 'private-27', + [ModelEnum.MODEL_PRIVATE_28]: 'private-28', + [ModelEnum.MODEL_PRIVATE_29]: 'private-29', + [ModelEnum.MODEL_PRIVATE_30]: 'private-30', }; // ============================================================================ diff --git a/src/plugin/types.ts b/src/plugin/types.ts index 3321bf4..d554700 100644 --- a/src/plugin/types.ts +++ b/src/plugin/types.ts @@ -178,8 +178,8 @@ export const ModelEnum = { CLAUDE_4_5_SONNET_THINKING_1M: 371, // ============================================================================ - // Enterprise / Private Model Slots - // These are often used for exclusive or regional model deployments + // Enterprise / Private Model Slots (Generic) + // These are used for dynamic discovery of account-specific models. // ============================================================================ MODEL_PRIVATE_1: 219, MODEL_PRIVATE_2: 220, From 3fa2431f7ac401db38eb5991fcc46c3b8d9caac1 Mon Sep 17 00:00:00 2001 From: Teo Miscia Date: Fri, 10 Apr 2026 00:43:24 -0700 Subject: [PATCH 4/7] feat: improve dynamic model discovery with Enterprise anchor mappings --- scripts/sync-models.ts | 156 ++++++++++++++++++----------------------- 1 file changed, 67 insertions(+), 89 deletions(-) diff --git a/scripts/sync-models.ts b/scripts/sync-models.ts index 46afa8b..56620ec 100644 --- a/scripts/sync-models.ts +++ b/scripts/sync-models.ts @@ -2,7 +2,6 @@ import sqlite3 from 'sqlite3'; import fs from 'fs'; import path from 'path'; -import base64 from 'base64-js'; const DB_PATH = path.join(process.env.HOME || '', 'Library/Application Support/Windsurf/User/globalStorage/state.vscdb'); const CONFIG_PATH = path.join(process.env.HOME || '', '.config/opencode/opencode.json'); @@ -28,79 +27,80 @@ async function getWindsurfValue(key: string): Promise { }); } -/** - * Extracts model definitions from the binary windsurfConfigurations blob. - * Returns a map of internal ID (e.g. model-private-9) to { name: "Human Label" } - */ -function discoverModels(configData: Buffer, allowedData?: Buffer): Record { +function discoverModels(configData: Buffer, authStatus?: string): Record { const models: Record = {}; - - // Convert buffer to a string where we can search for identifiers - // We use latin1 to preserve byte values for regex matching const content = configData.toString('latin1'); - // Find all MODEL_ strings (e.g. MODEL_PRIVATE_9, MODEL_CHAT_GPT_4O) - // Also look for numeric identifiers like 11121 - const modelMatches = [...content.matchAll(/MODEL_[A-Z0-9_]+/g)]; - - // Add some known numeric IDs if they appear in certain blocks - const numericIds = ["11121"]; - for (const numId of numericIds) { - if (content.includes(numId)) { - // Just a stub match to trigger the heuristic - modelMatches.push({ 0: `MODEL_CHAT_${numId}`, index: content.indexOf(numId) } as any); - } - } - - const allowedContent = allowedData ? allowedData.toString('latin1') : null; + // 1. Precise Enterprise Mappings discovered from previous decodes + // We keep these mapping rules here so the plugin knows which generic slot to use + const enterpriseIdMap: Record = { + "kimi-k2-5": "private-9", + "minimax-m2-5": "private-19", + "claude-haiku-4-5": "private-11", + "claude-sonnet-4-5": "private-2", + "claude-sonnet-4-5-thinking": "private-3", + "gpt-5-1": "private-12", + "gpt-5-2": "private-13", + "gpt-5-3": "private-14", + "gpt-5-4": "private-15", + "gemini-3-1-pro-high": "private-20", + "gemini-3-1-pro-low": "private-21", + }; - for (const match of modelMatches) { - const internalName = match[0]; - const pos = match.index || 0; - - // Check if this model is allowed (if we have the allowed list) - if (allowedContent && !allowedContent.includes(internalName)) { - continue; - } + // 2. Enterprise Anchors: Force correct names for specific internal IDs that are hard to parse + const anchorLabels: Record = { + "private-15": "GPT-5.4 Low Thinking", + "private-14": "GPT-5.3-Codex Medium", + "private-13": "GPT-5.2 High Thinking", + "private-12": "GPT-5.1-Codex Medium", + }; - // Heuristic: Look backward from the model ID to find the display label - // Labels are usually UTF-8 strings ending with a few metadata bytes before the ID - const lookback = content.slice(Math.max(0, pos - 150), pos); - - // Improved Regex: Find strings that look like model names. - // Must start with Uppercase, usually contains numbers/dots, ends before metadata. - // We avoid common metadata words. - const labels = [...lookback.matchAll(/[A-Z][a-zA-Z0-9.]+ (?:[a-zA-Z0-9.]+ )*[a-zA-Z0-9.]+/g)]; - - if (labels.length > 0) { - let label = labels[labels.length - 1][0].trim(); - const cleanId = internalName.toLowerCase().replace(/^model_/, '').replace(/_/g, '-'); + // 3. Scan for labels and IDs in the binary config + // Pattern: [Label String]...[ID String] + // We look for IDs like kimi-k2-5, gpt-5-4, etc. + const idPatterns = [ + "kimi-k2-5", "minimax-m2-5", "gpt-5-4", "gpt-5-3", "gpt-5-2", "gpt-5-1", + "gpt-oss-120b", "claude-4-sonnet", "claude-4-5-sonnet", "claude-4-5-opus", + "gpt-4-1", "swe-1-5", "gemini-3-1-pro-high", "gemini-3-1-pro-low" + ]; + + for (const id of idPatterns) { + const pos = content.indexOf(id); + if (pos !== -1) { + // Look back for the human label + const lookback = content.slice(Math.max(0, pos - 100), pos); + const labels = [...lookback.matchAll(/[A-Z][a-zA-Z0-9.]+ (?:[a-zA-Z0-9.]+ )*[a-zA-Z0-9.]+/g)]; - // If the label is just metadata, try the one before it - const metadataWords = ['No Thinking', 'Thinking', 'Fast Mode', 'Prompt Cache Retention', 'Reasoning Effort']; - if (metadataWords.includes(label) && labels.length > 1) { - label = labels[labels.length - 2][0].trim(); - } + if (labels.length > 0) { + let label = labels[labels.length - 1][0].trim(); + + // If the label is just a detail (Low Thinking, Codex Medium), grab the one before it + const detailWords = ['Low Thinking', 'Medium Thinking', 'High Thinking', 'No Thinking', 'Codex Medium', 'Fast Mode']; + if (detailWords.some(d => label.endsWith(d)) && labels.length > 1) { + const prevLabel = labels[labels.length - 2][0].trim(); + // If the previous label looks like a series name (GPT-5.4, Gemini 3.1) + if (prevLabel.includes('GPT') || prevLabel.includes('Gemini') || prevLabel.includes('Claude')) { + label = prevLabel + " " + label; + } + } - // Final validation - allow special cases like SWE-1.5 and GPT 5.1 - const isSpecialCase = label.includes('SWE-') || label.includes('GPT 5'); - if (label.length > 2 && (!['Windsurf', 'Enterprise', 'Codeium', 'Cascade', ...metadataWords].includes(label) || isSpecialCase)) { + const cleanId = enterpriseIdMap[id] || id; + const finalLabel = anchorLabels[cleanId] || label; + models[cleanId] = { - name: `${label} (Windsurf)`, - limit: { - context: 200000, - output: 8192 - } + name: `${finalLabel} (Windsurf)`, + limit: { context: 200000, output: 8192 } }; } } } - // Ensure standard defaults are present if not found + // 3. Add standard defaults const defaults: Record = { "gpt-4o": "GPT-4o", "claude-3-5-sonnet": "Claude 3.5 Sonnet", - "claude-3-7-sonnet": "Claude 3.7 Sonnet" + "claude-3-7-sonnet": "Claude 3.7 Sonnet", + "windsurf-fast": "Windsurf Fast" }; for (const [id, name] of Object.entries(defaults)) { @@ -116,37 +116,19 @@ function discoverModels(configData: Buffer, allowedData?: Buffer): Record Buffer.from(p, 'base64'))); - } - - const discovered = discoverModels(configBuf, allowedBuf); - const count = Object.keys(discovered).length; - - if (count === 0) { - console.error("No models could be discovered."); - return; - } - if (!fs.existsSync(CONFIG_PATH)) { console.error(`OpenCode config not found at ${CONFIG_PATH}`); return; @@ -154,20 +136,16 @@ async function main() { const opencodeConfig = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8')); if (!opencodeConfig.provider) opencodeConfig.provider = {}; - if (!opencodeConfig.provider.windsurf) { - opencodeConfig.provider.windsurf = { - npm: "@ai-sdk/openai-compatible", - options: { baseURL: "http://127.0.0.1:42100/v1" }, - models: {} - }; - } + if (!opencodeConfig.provider.windsurf) opencodeConfig.provider.windsurf = { + npm: "@ai-sdk/openai-compatible", + options: { baseURL: "http://127.0.0.1:42100/v1" }, + models: {} + }; opencodeConfig.provider.windsurf.models = discovered; - fs.writeFileSync(CONFIG_PATH, JSON.stringify(opencodeConfig, null, 2)); - console.log(`\nSuccess! Updated ${count} models in opencode.json.`); - console.log("Discovered models:"); + console.log(`\nSuccess! Updated ${Object.keys(discovered).length} models.`); Object.entries(discovered).forEach(([id, meta]: [string, any]) => { console.log(` - ${id.padEnd(30)} -> ${meta.name}`); }); From bb1e54aa5b37f5ec9065e0295dee0cfa7ab5d576 Mon Sep 17 00:00:00 2001 From: Teo Miscia Date: Fri, 10 Apr 2026 00:52:46 -0700 Subject: [PATCH 5/7] feat: implement definitive dynamic model discovery with Enterprise anchors --- extension-raw.js | 3 + extension-readable.js | 176338 ++++++++++++++++++++++++++++++++++++++ scripts/sync-models.ts | 178 +- 3 files changed, 176408 insertions(+), 111 deletions(-) create mode 100644 extension-raw.js create mode 100644 extension-readable.js diff --git a/extension-raw.js b/extension-raw.js new file mode 100644 index 0000000..d747299 --- /dev/null +++ b/extension-raw.js @@ -0,0 +1,3 @@ +/*! For license information please see extension.js.LICENSE.txt */ +(()=>{var __webpack_modules__={72587(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.enumToString=function(A,e){return Object.keys(e).find(t=>e[t]===A)},e.stringToEnum=function(A,e){const t=Object.keys(e);for(const i of t)if(A===i)return e[i]},e.valToEnum=function(A,e){for(const[t,i]of Object.entries(e))if(A===i)return e[t]}},15816(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isValidHostname=void 0,e.isValidHostname=A=>/^(localhost|127(?:\.[0-9]+){0,2}\.[0-9]+)$/.test(A)||/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(A)||/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/.test(A)},16569(A,e,t){"use strict";A=t.nmd(A);var i,n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,g=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,r=(A,e)=>{for(var t in e)n(A,t,{get:e[t],enumerable:!0})},I={};r(I,{AGENT_NOTIFICATION_METHODS:()=>a,AcpConnectionClosedError:()=>ud,AcpRegistryAgentSchema:()=>Rd,AcpRegistrySchema:()=>Nd,AgentDistributionSchema:()=>fd,AgentSideConnection:()=>Bd,BinaryDistributionSchema:()=>md,BinaryTargetSchema:()=>wd,ClientSideConnection:()=>Ed,PackageDistributionSchema:()=>pd,RequestError:()=>ld,WebSocketDistributionSchema:()=>yd,WindsurfAcpConnection:()=>dd,applySessionEvent:()=>Oe,asGenericToolCall:()=>J,constructMessageHistory:()=>Pe,deriveTitleFromMessages:()=>qe,filterMessages:()=>ve,getDiffMetaContentsKey:()=>v,getFirstContentFromMessage:()=>Td,getMsgEventType:()=>Ud,getMsgTimestamp:()=>Jd,getPlatformKey:()=>kd,hasConfigOptionMeta:()=>x,hasSetConfigOptionRequestMeta:()=>O,isAcpContentBlock:()=>L,isAgentNotificationMethod:()=>C,isAuthenticateResponse:()=>p,isCancellationRequest:()=>l,isCognitionContentChunk:()=>U,isCognitionExitPlanCall:()=>T,isCognitionPromptResponse:()=>h,isCognitionSessionUpdate:()=>D,isCognitionShowContentWithExternalLinks:()=>b,isCognitionToolCall:()=>_,isCreateTerminalResponse:()=>N,isDiffMeta:()=>H,isDirectoryListing:()=>Y,isHiddenResourceBlock:()=>F,isInitializeResponse:()=>B,isKillTerminalCommandResponse:()=>G,isListSessionsResponse:()=>c,isLoadSessionResponse:()=>E,isNewSessionResponse:()=>Q,isPermissionRequest:()=>m,isPromptRequest:()=>u,isPromptResponse:()=>d,isReadTextFileResponse:()=>f,isReleaseTerminalResponse:()=>S,isRequestPermissionResponse:()=>y,isSetSessionModeResponse:()=>w,isTerminalOutputResponse:()=>M,isWaitForTerminalExitResponse:()=>k,isWriteTextFileResponse:()=>R,ndJsonStream:()=>Cd,parseRegistry:()=>Sd,resolveAgentCommand:()=>Gd,supportsMultiRootWorkspace:()=>K,webSocketStream:()=>Fd}),A.exports=(i=I,((A,e,t,i)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let t of g(e))s.call(A,t)||void 0===t||n(A,t,{get:()=>e[t],enumerable:!(i=o(e,t))||i.enumerable});return A})(n({},"__esModule",{value:!0}),i));var a=["session/cancel"];function C(A){return a.includes(A)}function B(A,e){return"initialize"===A.method&&null!=e}function Q(A,e){return"session/new"===A.method&&null!=e}function E(A,e){return"session/load"===A.method&&null!=e}function c(A,e){return"session/list"===A.method&&null!=e}function l(A){return"session/cancel"===A.method}function u(A){return"session/prompt"===A.method}function d(A,e){return"session/prompt"===A.method&&null!=e}function h(A){return null!=A._meta&&null!=A._meta["cognition.ai/session"]}function D(A){return null!=A._meta&&null!=A._meta["cognition.ai/session"]}function p(A,e){return"authenticate"===A.method&&null!=e}function w(A,e){return"session/set_mode"===A.method&&null!=e}function m(A){return"session/request_permission"===A.method}function y(A,e){return"session/request_permission"===A.method&&null!=e}function f(A,e){return"fs/read_text_file"===A.method&&null!=e}function R(A,e){return"fs/write_text_file"===A.method&&null!=e}function N(A,e){return"terminal/create"===A.method&&null!=e}function M(A,e){return"terminal/output"===A.method&&null!=e}function S(A,e){return"terminal/release"===A.method&&null!=e}function k(A,e){return"terminal/wait_for_exit"===A.method&&null!=e}function G(A,e){return"terminal/kill"===A.method&&null!=e}function L(A){return!0}function F(A){return!0===A._meta?.["cognition.ai/hiddenResource"]}function T(A){const e=A._meta;return null!=e&&"cognition.ai/isExitPlan"in e&&!0===e["cognition.ai/isExitPlan"]}function U(A){const e=A._meta;return null!=e&&"cognition.ai/eventType"in e&&"string"==typeof e["cognition.ai/eventType"]}function J(A){return A}function _(A){return null!=A._meta}function Y(A){return!!A._meta&&"cognition.ai/listDirectory"in A._meta&&!0===A._meta["cognition.ai/listDirectory"]}function b(A){return!!A._meta&&"cognition.ai/showContentWithExternalLinks"in A._meta&&!0===A._meta["cognition.ai/showContentWithExternalLinks"]}function H(A){return null!==A&&"object"==typeof A}function x(A){return null!=A._meta&&"object"==typeof A._meta}function K(A){if(!A?._meta)return!1;const e=A._meta["cognition.ai"];return"object"==typeof(t=e)&&null!==t&&"multiRootWorkspace"in t&&"boolean"==typeof t.multiRootWorkspace&&!0===e.multiRootWorkspace;var t}function O(A){return null!=A._meta&&"object"==typeof A._meta}function v(A){if(!A||!H(A))return;const e=A["cognition.ai/contentsKey"];return"string"==typeof e?e:void 0}var q=function(A,e){return A===e||A!=A&&e!=e},P=function(A,e){for(var t=A.length;t--;)if(q(A[t][0],e))return t;return-1},V=Array.prototype.splice;function j(A){var e=-1,t=null==A?0:A.length;for(this.clear();++e-1},j.prototype.set=function(A,e){var t=this.__data__,i=P(t,A);return i<0?(++this.size,t.push([A,e])):t[i][1]=e,this};var W,Z=j,z="object"==typeof global&&global&&global.Object===Object&&global,X="object"==typeof self&&self&&self.Object===Object&&self,$=z||X||Function("return this")(),AA=$.Symbol,eA=Object.prototype,tA=eA.hasOwnProperty,iA=eA.toString,nA=AA?AA.toStringTag:void 0,oA=Object.prototype.toString,gA=AA?AA.toStringTag:void 0,sA=function(A){return null==A?void 0===A?"[object Undefined]":"[object Null]":gA&&gA in Object(A)?function(A){var e=tA.call(A,nA),t=A[nA];try{A[nA]=void 0;var i=!0}catch(A){}var n=iA.call(A);return i&&(e?A[nA]=t:delete A[nA]),n}(A):function(A){return oA.call(A)}(A)},rA=function(A){var e=typeof A;return null!=A&&("object"==e||"function"==e)},IA=function(A){if(!rA(A))return!1;var e=sA(A);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},aA=$["__core-js_shared__"],CA=(W=/[^.]+$/.exec(aA&&aA.keys&&aA.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",BA=Function.prototype.toString,QA=/^\[object .+?Constructor\]$/,EA=Function.prototype,cA=Object.prototype,lA=EA.toString,uA=cA.hasOwnProperty,dA=RegExp("^"+lA.call(uA).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),hA=function(A){return!(!rA(A)||(e=A,CA&&CA in e))&&(IA(A)?dA:QA).test(function(A){if(null!=A){try{return BA.call(A)}catch(A){}try{return A+""}catch(A){}}return""}(A));var e},DA=function(A,e){var t=function(A,e){return null==A?void 0:A[e]}(A,e);return hA(t)?t:void 0},pA=DA($,"Map"),wA=DA(Object,"create"),mA=Object.prototype.hasOwnProperty,yA=Object.prototype.hasOwnProperty;function fA(A){var e=-1,t=null==A?0:A.length;for(this.clear();++e-1&&A%1==0&&A<=9007199254740991},ne=function(A){return null!=A&&ie(A.length)&&!IA(A)},oe=e&&!e.nodeType&&e,ge=oe&&A&&!A.nodeType&&A,se=ge&&ge.exports===oe?$.Buffer:void 0,re=(se?se.isBuffer:void 0)||function(){return!1},Ie=Function.prototype,ae=Object.prototype,Ce=Ie.toString,Be=ae.hasOwnProperty,Qe=Ce.call(Object),Ee={};Ee["[object Float32Array]"]=Ee["[object Float64Array]"]=Ee["[object Int8Array]"]=Ee["[object Int16Array]"]=Ee["[object Int32Array]"]=Ee["[object Uint8Array]"]=Ee["[object Uint8ClampedArray]"]=Ee["[object Uint16Array]"]=Ee["[object Uint32Array]"]=!0,Ee["[object Arguments]"]=Ee["[object Array]"]=Ee["[object ArrayBuffer]"]=Ee["[object Boolean]"]=Ee["[object DataView]"]=Ee["[object Date]"]=Ee["[object Error]"]=Ee["[object Function]"]=Ee["[object Map]"]=Ee["[object Number]"]=Ee["[object Object]"]=Ee["[object RegExp]"]=Ee["[object Set]"]=Ee["[object String]"]=Ee["[object WeakMap]"]=!1;var ce,le=e&&!e.nodeType&&e,ue=le&&A&&!A.nodeType&&A,de=ue&&ue.exports===le&&z.process,he=function(){try{return ue&&ue.require&&ue.require("util").types||de&&de.binding&&de.binding("util")}catch(A){}}(),De=he&&he.isTypedArray,pe=De?function(A){return function(e){return A(e)}}(De):function(A){return WA(A)&&ie(A.length)&&!!Ee[sA(A)]},we=function(A,e){if(("constructor"!==e||"function"!=typeof A[e])&&"__proto__"!=e)return A[e]},me=Object.prototype.hasOwnProperty,ye=function(A,e,t){var i=A[e];me.call(A,e)&&q(i,t)&&(void 0!==t||e in A)||UA(A,e,t)},fe=/^(?:0|[1-9]\d*)$/,Re=function(A,e){var t=typeof A;return!!(e=null==e?9007199254740991:e)&&("number"==t||"symbol"!=t&&fe.test(A))&&A>-1&&A%1==0&&A0){if(++e>=800)return arguments[0]}else e=0;return A.apply(void 0,arguments)}}(_e),He=function(A,e){return be(function(A,e,t){return e=Je(void 0===e?A.length-1:e,0),function(){for(var i=arguments,n=-1,o=Je(i.length-e,0),g=Array(o);++n1?e[i-1]:void 0,o=i>2?e[2]:void 0;for(n=ce.length>3&&"function"==typeof n?(i--,n):void 0,o&&function(A,e,t){if(!rA(t))return!1;var i=typeof e;return!!("number"==i?ne(t)&&Re(e,t.length):"string"==i&&e in t)&&q(t[e],A)}(e[0],e[1],o)&&(n=i<3?void 0:n,i=1),A=Object(A);++tA._meta?.["cognition.ai/clientMessageId"]===t&&A._meta?.["cognition.ai/messageSubIndex"]===i)}(e.content,t);if(n){n._meta?.["cognition.ai/isOptimistic"]&&delete n._meta["cognition.ai/isOptimistic"];break}const o=e.content[0]?._meta?.["cognition.ai/clientMessageId"];"string"==typeof o&&"string"==typeof i&&o===i?e.content.push(t):A.push({kind:"user_message",content:[t]})}else A.push({kind:"user_message",content:[t]});break}case"agent_message_chunk":{const e=A[A.length-1];"agent_message"===e?.kind?e.content.push(t):Ke(t)||A.push({kind:"agent_message",content:[t]});break}case"agent_thought_chunk":{const e=A[A.length-1];"agent_thought"===e?.kind?e.content.push(t):Ke(t)||A.push({kind:"agent_thought",content:[t]});break}case"tool_call":case"tool_call_update":{const e=function(A,e,t){const i=t[e];if(null!=i&&void 0!==i){const n=A[i];if("tool_call"===n?.kind&&n.content.toolCallId===e)return n;delete t[e]}for(let i=A.length-1;i>=0;i--){const n=A[i];if("tool_call"===n.kind&&n.content.toolCallId===e)return t[e]=i,n}}(A,t.toolCallId,i);if(e){const{sessionUpdate:A,toolCallId:i,_meta:n,...o}=t;for(const[A,t]of Object.entries(o))void 0!==t&&(e.content[A]=t);n&&(e.content._meta=xe({},e.content._meta,n)),"tool_call"===t.sessionUpdate&&e.warnings.push({level:"debug",message:`Duplicate tool calls with ID ${t.toolCallId} received -- updates should use tool_call_update.`})}else{const{sessionUpdate:e,...n}=t,o={kind:"tool_call",content:n,warnings:[]};A.push(o),i[t.toolCallId]=A.length-1}break}case"plan":for(let e=A.length-1;e>=0;e--){const t=A[e];if("plan"===t.kind&&"current"===t.status){t.status="stale";break}}A.push({kind:"plan",content:t,status:"current"});break;case"available_commands_update":e.availableCommands=t.availableCommands;break;case"session_info_update":null!=t.title&&(e.title=t.title),null!=t.updatedAt&&(e.updatedAt=t.updatedAt);break;case"current_mode_update":{const A=e.configOptions.find(A=>"mode"===A.id);A&&"select"===A.type?A.currentValue=t.currentModeId:(e.configOptions=e.configOptions.filter(A=>"mode"!==A.id),e.configOptions.push({id:"mode",name:"Mode",type:"select",currentValue:t.currentModeId,options:[{value:t.currentModeId,name:t.currentModeId}]}));break}case"config_option_update":for(const A of t.configOptions){const t=e.configOptions.findIndex(e=>e.id===A.id);t>=0?e.configOptions[t]=A:e.configOptions.push(A)}break;default:{const e=t;A.push({kind:"unknown",content:e})}}}function ve(A){return A.filter(A=>{return!("agent_thought"===(e=A).kind&&e.content.every(Ke)||function(A){return"agent_message"===A.kind&&A.content.every(Ke)}(A));var e})}function qe(A){const e=A.find(A=>"user_message"===A.kind);if(e&&"user_message"===e.kind){const A=(t=e.content,t.filter(A=>"text"===A.content.type).map(A=>A.content.text).join("")).trim();if(A.length>0)return A.slice(0,100)}var t}function Pe(A){const e=[],t={},i={configOptions:[],availableCommands:[]};for(const n of A)Oe(e,i,n,t);const n=ve(e);if(!("title"in i)||void 0===i.title){const A=qe(n);void 0!==A&&(i.title=A)}return{messages:n,info:i}}var Ve,je,We,Ze={};r(Ze,{BRAND:()=>ki,DIRTY:()=>Qt,EMPTY_PATH:()=>st,INVALID:()=>Bt,NEVER:()=>fn,OK:()=>Et,ParseStatus:()=>Ct,Schema:()=>mt,ZodAny:()=>ei,ZodArray:()=>oi,ZodBigInt:()=>Wt,ZodBoolean:()=>Zt,ZodBranded:()=>Gi,ZodCatch:()=>Mi,ZodDate:()=>zt,ZodDefault:()=>Ni,ZodDiscriminatedUnion:()=>ai,ZodEffects:()=>yi,ZodEnum:()=>pi,ZodError:()=>et,ZodFirstPartyTypeKind:()=>Ji,ZodFunction:()=>ui,ZodIntersection:()=>Bi,ZodIssueCode:()=>$e,ZodLazy:()=>di,ZodLiteral:()=>hi,ZodMap:()=>ci,ZodNaN:()=>Si,ZodNativeEnum:()=>wi,ZodNever:()=>ii,ZodNull:()=>Ai,ZodNullable:()=>Ri,ZodNumber:()=>jt,ZodObject:()=>si,ZodOptional:()=>fi,ZodParsedType:()=>ze,ZodPipeline:()=>Li,ZodPromise:()=>mi,ZodReadonly:()=>Fi,ZodRecord:()=>Ei,ZodSchema:()=>mt,ZodSet:()=>li,ZodString:()=>Pt,ZodSymbol:()=>Xt,ZodTransformer:()=>yi,ZodTuple:()=>Qi,ZodType:()=>mt,ZodUndefined:()=>$t,ZodUnion:()=>ri,ZodUnknown:()=>ti,ZodVoid:()=>ni,addIssueToContext:()=>rt,any:()=>Wi,array:()=>$i,bigint:()=>Oi,boolean:()=>vi,coerce:()=>yn,custom:()=>Ui,date:()=>qi,datetimeRegex:()=>Kt,defaultErrorMap:()=>tt,discriminatedUnion:()=>nn,effect:()=>ln,enum:()=>Qn,function:()=>an,getErrorMap:()=>ot,getParsedType:()=>Xe,instanceof:()=>bi,intersection:()=>on,isAborted:()=>ct,isAsync:()=>dt,isDirty:()=>lt,isValid:()=>ut,late:()=>Yi,lazy:()=>Cn,literal:()=>Bn,makeIssue:()=>gt,map:()=>rn,nan:()=>Ki,nativeEnum:()=>En,never:()=>zi,null:()=>ji,nullable:()=>dn,number:()=>xi,object:()=>An,objectUtil:()=>We,oboolean:()=>mn,onumber:()=>wn,optional:()=>un,ostring:()=>pn,pipeline:()=>Dn,preprocess:()=>hn,promise:()=>cn,quotelessJson:()=>At,record:()=>sn,set:()=>In,setErrorMap:()=>nt,strictObject:()=>en,string:()=>Hi,symbol:()=>Pi,transformer:()=>ln,tuple:()=>gn,undefined:()=>Vi,union:()=>tn,unknown:()=>Zi,util:()=>Ve,void:()=>Xi}),(je=Ve||(Ve={})).assertEqual=A=>{},je.assertIs=function(A){},je.assertNever=function(A){throw new Error},je.arrayToEnum=A=>{const e={};for(const t of A)e[t]=t;return e},je.getValidEnumValues=A=>{const e=je.objectKeys(A).filter(e=>"number"!=typeof A[A[e]]),t={};for(const i of e)t[i]=A[i];return je.objectValues(t)},je.objectValues=A=>je.objectKeys(A).map(function(e){return A[e]}),je.objectKeys="function"==typeof Object.keys?A=>Object.keys(A):A=>{const e=[];for(const t in A)Object.prototype.hasOwnProperty.call(A,t)&&e.push(t);return e},je.find=(A,e)=>{for(const t of A)if(e(t))return t},je.isInteger="function"==typeof Number.isInteger?A=>Number.isInteger(A):A=>"number"==typeof A&&Number.isFinite(A)&&Math.floor(A)===A,je.joinValues=function(A,e=" | "){return A.map(A=>"string"==typeof A?`'${A}'`:A).join(e)},je.jsonStringifyReplacer=(A,e)=>"bigint"==typeof e?e.toString():e,(We||(We={})).mergeShapes=(A,e)=>({...A,...e});var ze=Ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Xe=A=>{switch(typeof A){case"undefined":return ze.undefined;case"string":return ze.string;case"number":return Number.isNaN(A)?ze.nan:ze.number;case"boolean":return ze.boolean;case"function":return ze.function;case"bigint":return ze.bigint;case"symbol":return ze.symbol;case"object":return Array.isArray(A)?ze.array:null===A?ze.null:A.then&&"function"==typeof A.then&&A.catch&&"function"==typeof A.catch?ze.promise:"undefined"!=typeof Map&&A instanceof Map?ze.map:"undefined"!=typeof Set&&A instanceof Set?ze.set:"undefined"!=typeof Date&&A instanceof Date?ze.date:ze.object;default:return ze.unknown}},$e=Ve.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"]),At=A=>JSON.stringify(A,null,2).replace(/"([^"]+)":/g,"$1:"),et=class A extends Error{get errors(){return this.issues}constructor(A){super(),this.issues=[],this.addIssue=A=>{this.issues=[...this.issues,A]},this.addIssues=(A=[])=>{this.issues=[...this.issues,...A]};const e=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,e):this.__proto__=e,this.name="ZodError",this.issues=A}format(A){const e=A||function(A){return A.message},t={_errors:[]},i=A=>{for(const n of A.issues)if("invalid_union"===n.code)n.unionErrors.map(i);else if("invalid_return_type"===n.code)i(n.returnTypeError);else if("invalid_arguments"===n.code)i(n.argumentsError);else if(0===n.path.length)t._errors.push(e(n));else{let A=t,i=0;for(;iA.message){const e={},t=[];for(const i of this.issues)if(i.path.length>0){const t=i.path[0];e[t]=e[t]||[],e[t].push(A(i))}else t.push(A(i));return{formErrors:t,fieldErrors:e}}get formErrors(){return this.flatten()}};et.create=A=>new et(A);var tt=(A,e)=>{let t;switch(A.code){case $e.invalid_type:t=A.received===ze.undefined?"Required":`Expected ${A.expected}, received ${A.received}`;break;case $e.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(A.expected,Ve.jsonStringifyReplacer)}`;break;case $e.unrecognized_keys:t=`Unrecognized key(s) in object: ${Ve.joinValues(A.keys,", ")}`;break;case $e.invalid_union:t="Invalid input";break;case $e.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Ve.joinValues(A.options)}`;break;case $e.invalid_enum_value:t=`Invalid enum value. Expected ${Ve.joinValues(A.options)}, received '${A.received}'`;break;case $e.invalid_arguments:t="Invalid function arguments";break;case $e.invalid_return_type:t="Invalid function return type";break;case $e.invalid_date:t="Invalid date";break;case $e.invalid_string:"object"==typeof A.validation?"includes"in A.validation?(t=`Invalid input: must include "${A.validation.includes}"`,"number"==typeof A.validation.position&&(t=`${t} at one or more positions greater than or equal to ${A.validation.position}`)):"startsWith"in A.validation?t=`Invalid input: must start with "${A.validation.startsWith}"`:"endsWith"in A.validation?t=`Invalid input: must end with "${A.validation.endsWith}"`:Ve.assertNever(A.validation):t="regex"!==A.validation?`Invalid ${A.validation}`:"Invalid";break;case $e.too_small:t="array"===A.type?`Array must contain ${A.exact?"exactly":A.inclusive?"at least":"more than"} ${A.minimum} element(s)`:"string"===A.type?`String must contain ${A.exact?"exactly":A.inclusive?"at least":"over"} ${A.minimum} character(s)`:"number"===A.type||"bigint"===A.type?`Number must be ${A.exact?"exactly equal to ":A.inclusive?"greater than or equal to ":"greater than "}${A.minimum}`:"date"===A.type?`Date must be ${A.exact?"exactly equal to ":A.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(A.minimum))}`:"Invalid input";break;case $e.too_big:t="array"===A.type?`Array must contain ${A.exact?"exactly":A.inclusive?"at most":"less than"} ${A.maximum} element(s)`:"string"===A.type?`String must contain ${A.exact?"exactly":A.inclusive?"at most":"under"} ${A.maximum} character(s)`:"number"===A.type?`Number must be ${A.exact?"exactly":A.inclusive?"less than or equal to":"less than"} ${A.maximum}`:"bigint"===A.type?`BigInt must be ${A.exact?"exactly":A.inclusive?"less than or equal to":"less than"} ${A.maximum}`:"date"===A.type?`Date must be ${A.exact?"exactly":A.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(A.maximum))}`:"Invalid input";break;case $e.custom:t="Invalid input";break;case $e.invalid_intersection_types:t="Intersection results could not be merged";break;case $e.not_multiple_of:t=`Number must be a multiple of ${A.multipleOf}`;break;case $e.not_finite:t="Number must be finite";break;default:t=e.defaultError,Ve.assertNever(A)}return{message:t}},it=tt;function nt(A){it=A}function ot(){return it}var gt=A=>{const{data:e,path:t,errorMaps:i,issueData:n}=A,o=[...t,...n.path||[]],g={...n,path:o};if(void 0!==n.message)return{...n,path:o,message:n.message};let s="";const r=i.filter(A=>!!A).slice().reverse();for(const A of r)s=A(g,{data:e,defaultError:s}).message;return{...n,path:o,message:s}},st=[];function rt(A,e){const t=ot(),i=gt({issueData:e,data:A.data,path:A.path,errorMaps:[A.common.contextualErrorMap,A.schemaErrorMap,t,t===tt?void 0:tt].filter(A=>!!A)});A.common.issues.push(i)}var It,at,Ct=class A{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(A,e){const t=[];for(const i of e){if("aborted"===i.status)return Bt;"dirty"===i.status&&A.dirty(),t.push(i.value)}return{status:A.value,value:t}}static async mergeObjectAsync(e,t){const i=[];for(const A of t){const e=await A.key,t=await A.value;i.push({key:e,value:t})}return A.mergeObjectSync(e,i)}static mergeObjectSync(A,e){const t={};for(const i of e){const{key:e,value:n}=i;if("aborted"===e.status)return Bt;if("aborted"===n.status)return Bt;"dirty"===e.status&&A.dirty(),"dirty"===n.status&&A.dirty(),"__proto__"===e.value||void 0===n.value&&!i.alwaysSet||(t[e.value]=n.value)}return{status:A.value,value:t}}},Bt=Object.freeze({status:"aborted"}),Qt=A=>({status:"dirty",value:A}),Et=A=>({status:"valid",value:A}),ct=A=>"aborted"===A.status,lt=A=>"dirty"===A.status,ut=A=>"valid"===A.status,dt=A=>"undefined"!=typeof Promise&&A instanceof Promise;(at=It||(It={})).errToObj=A=>"string"==typeof A?{message:A}:A||{},at.toString=A=>"string"==typeof A?A:A?.message;var ht=class{constructor(A,e,t,i){this._cachedPath=[],this.parent=A,this.data=e,this._path=t,this._key=i}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}},Dt=(A,e)=>{if(ut(e))return{success:!0,data:e.value};if(!A.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const e=new et(A.common.issues);return this._error=e,this._error}}};function pt(A){if(!A)return{};const{errorMap:e,invalid_type_error:t,required_error:i,description:n}=A;if(e&&(t||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return e?{errorMap:e,description:n}:{errorMap:(e,n)=>{const{message:o}=A;return"invalid_enum_value"===e.code?{message:o??n.defaultError}:void 0===n.data?{message:o??i??n.defaultError}:"invalid_type"!==e.code?{message:n.defaultError}:{message:o??t??n.defaultError}},description:n}}var wt,mt=class{get description(){return this._def.description}_getType(A){return Xe(A.data)}_getOrReturnCtx(A,e){return e||{common:A.parent.common,data:A.data,parsedType:Xe(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}_processInputParams(A){return{status:new Ct,ctx:{common:A.parent.common,data:A.data,parsedType:Xe(A.data),schemaErrorMap:this._def.errorMap,path:A.path,parent:A.parent}}}_parseSync(A){const e=this._parse(A);if(dt(e))throw new Error("Synchronous parse encountered promise.");return e}_parseAsync(A){const e=this._parse(A);return Promise.resolve(e)}parse(A,e){const t=this.safeParse(A,e);if(t.success)return t.data;throw t.error}safeParse(A,e){const t={common:{issues:[],async:e?.async??!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:Xe(A)},i=this._parseSync({data:A,path:t.path,parent:t});return Dt(t,i)}"~validate"(A){const e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:Xe(A)};if(!this["~standard"].async)try{const t=this._parseSync({data:A,path:[],parent:e});return ut(t)?{value:t.value}:{issues:e.common.issues}}catch(A){A?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),e.common={issues:[],async:!0}}return this._parseAsync({data:A,path:[],parent:e}).then(A=>ut(A)?{value:A.value}:{issues:e.common.issues})}async parseAsync(A,e){const t=await this.safeParseAsync(A,e);if(t.success)return t.data;throw t.error}async safeParseAsync(A,e){const t={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:A,parsedType:Xe(A)},i=this._parse({data:A,path:t.path,parent:t}),n=await(dt(i)?i:Promise.resolve(i));return Dt(t,n)}refine(A,e){const t=A=>"string"==typeof e||void 0===e?{message:e}:"function"==typeof e?e(A):e;return this._refinement((e,i)=>{const n=A(e),o=()=>i.addIssue({code:$e.custom,...t(e)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then(A=>!!A||(o(),!1)):!!n||(o(),!1)})}refinement(A,e){return this._refinement((t,i)=>!!A(t)||(i.addIssue("function"==typeof e?e(t,i):e),!1))}_refinement(A){return new yi({schema:this,typeName:Ji.ZodEffects,effect:{type:"refinement",refinement:A}})}superRefine(A){return this._refinement(A)}constructor(A){this.spa=this.safeParseAsync,this._def=A,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:A=>this["~validate"](A)}}optional(){return fi.create(this,this._def)}nullable(){return Ri.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return oi.create(this)}promise(){return mi.create(this,this._def)}or(A){return ri.create([this,A],this._def)}and(A){return Bi.create(this,A,this._def)}transform(A){return new yi({...pt(this._def),schema:this,typeName:Ji.ZodEffects,effect:{type:"transform",transform:A}})}default(A){const e="function"==typeof A?A:()=>A;return new Ni({...pt(this._def),innerType:this,defaultValue:e,typeName:Ji.ZodDefault})}brand(){return new Gi({typeName:Ji.ZodBranded,type:this,...pt(this._def)})}catch(A){const e="function"==typeof A?A:()=>A;return new Mi({...pt(this._def),innerType:this,catchValue:e,typeName:Ji.ZodCatch})}describe(A){return new(0,this.constructor)({...this._def,description:A})}pipe(A){return Li.create(this,A)}readonly(){return Fi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},yt=/^c[^\s-]{8,}$/i,ft=/^[0-9a-z]+$/,Rt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Nt=/^[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,Mt=/^[a-z0-9_-]{21}$/i,St=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,kt=/^[-+]?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)?)??$/,Gt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Lt=/^(?:(?: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])$/,Ft=/^(?:(?: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])$/,Tt=/^(([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]))$/,Ut=/^(([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])$/,Jt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,_t=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Yt="((\\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])))",bt=new RegExp(`^${Yt}$`);function Ht(A){let e="[0-5]\\d";return A.precision?e=`${e}\\.\\d{${A.precision}}`:null==A.precision&&(e=`${e}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${e})${A.precision?"+":"?"}`}function xt(A){return new RegExp(`^${Ht(A)}$`)}function Kt(A){let e=`${Yt}T${Ht(A)}`;const t=[];return t.push(A.local?"Z?":"Z"),A.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ot(A,e){return!("v4"!==e&&e||!Lt.test(A))||!("v6"!==e&&e||!Tt.test(A))}function vt(A,e){if(!St.test(A))return!1;try{const[t]=A.split(".");if(!t)return!1;const i=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(i));return!("object"!=typeof n||null===n||"typ"in n&&"JWT"!==n?.typ||!n.alg||e&&n.alg!==e)}catch{return!1}}function qt(A,e){return!("v4"!==e&&e||!Ft.test(A))||!("v6"!==e&&e||!Ut.test(A))}var Pt=class A extends mt{_parse(A){if(this._def.coerce&&(A.data=String(A.data)),this._getType(A)!==ze.string){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.string,received:e.parsedType}),Bt}const e=new Ct;let t;for(const i of this._def.checks)if("min"===i.kind)A.data.lengthi.value&&(t=this._getOrReturnCtx(A,t),rt(t,{code:$e.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),e.dirty());else if("length"===i.kind){const n=A.data.length>i.value,o=A.data.lengthA.test(e),{validation:e,code:$e.invalid_string,...It.errToObj(t)})}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}email(A){return this._addCheck({kind:"email",...It.errToObj(A)})}url(A){return this._addCheck({kind:"url",...It.errToObj(A)})}emoji(A){return this._addCheck({kind:"emoji",...It.errToObj(A)})}uuid(A){return this._addCheck({kind:"uuid",...It.errToObj(A)})}nanoid(A){return this._addCheck({kind:"nanoid",...It.errToObj(A)})}cuid(A){return this._addCheck({kind:"cuid",...It.errToObj(A)})}cuid2(A){return this._addCheck({kind:"cuid2",...It.errToObj(A)})}ulid(A){return this._addCheck({kind:"ulid",...It.errToObj(A)})}base64(A){return this._addCheck({kind:"base64",...It.errToObj(A)})}base64url(A){return this._addCheck({kind:"base64url",...It.errToObj(A)})}jwt(A){return this._addCheck({kind:"jwt",...It.errToObj(A)})}ip(A){return this._addCheck({kind:"ip",...It.errToObj(A)})}cidr(A){return this._addCheck({kind:"cidr",...It.errToObj(A)})}datetime(A){return"string"==typeof A?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:A}):this._addCheck({kind:"datetime",precision:void 0===A?.precision?null:A?.precision,offset:A?.offset??!1,local:A?.local??!1,...It.errToObj(A?.message)})}date(A){return this._addCheck({kind:"date",message:A})}time(A){return"string"==typeof A?this._addCheck({kind:"time",precision:null,message:A}):this._addCheck({kind:"time",precision:void 0===A?.precision?null:A?.precision,...It.errToObj(A?.message)})}duration(A){return this._addCheck({kind:"duration",...It.errToObj(A)})}regex(A,e){return this._addCheck({kind:"regex",regex:A,...It.errToObj(e)})}includes(A,e){return this._addCheck({kind:"includes",value:A,position:e?.position,...It.errToObj(e?.message)})}startsWith(A,e){return this._addCheck({kind:"startsWith",value:A,...It.errToObj(e)})}endsWith(A,e){return this._addCheck({kind:"endsWith",value:A,...It.errToObj(e)})}min(A,e){return this._addCheck({kind:"min",value:A,...It.errToObj(e)})}max(A,e){return this._addCheck({kind:"max",value:A,...It.errToObj(e)})}length(A,e){return this._addCheck({kind:"length",value:A,...It.errToObj(e)})}nonempty(A){return this.min(1,It.errToObj(A))}trim(){return new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(A=>"datetime"===A.kind)}get isDate(){return!!this._def.checks.find(A=>"date"===A.kind)}get isTime(){return!!this._def.checks.find(A=>"time"===A.kind)}get isDuration(){return!!this._def.checks.find(A=>"duration"===A.kind)}get isEmail(){return!!this._def.checks.find(A=>"email"===A.kind)}get isURL(){return!!this._def.checks.find(A=>"url"===A.kind)}get isEmoji(){return!!this._def.checks.find(A=>"emoji"===A.kind)}get isUUID(){return!!this._def.checks.find(A=>"uuid"===A.kind)}get isNANOID(){return!!this._def.checks.find(A=>"nanoid"===A.kind)}get isCUID(){return!!this._def.checks.find(A=>"cuid"===A.kind)}get isCUID2(){return!!this._def.checks.find(A=>"cuid2"===A.kind)}get isULID(){return!!this._def.checks.find(A=>"ulid"===A.kind)}get isIP(){return!!this._def.checks.find(A=>"ip"===A.kind)}get isCIDR(){return!!this._def.checks.find(A=>"cidr"===A.kind)}get isBase64(){return!!this._def.checks.find(A=>"base64"===A.kind)}get isBase64url(){return!!this._def.checks.find(A=>"base64url"===A.kind)}get minLength(){let A=null;for(const e of this._def.checks)"min"===e.kind&&(null===A||e.value>A)&&(A=e.value);return A}get maxLength(){let A=null;for(const e of this._def.checks)"max"===e.kind&&(null===A||e.valuei?t:i;return Number.parseInt(A.toFixed(n).replace(".",""))%Number.parseInt(e.toFixed(n).replace(".",""))/10**n}Pt.create=A=>new Pt({checks:[],typeName:Ji.ZodString,coerce:A?.coerce??!1,...pt(A)});var jt=class A extends mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(A){if(this._def.coerce&&(A.data=Number(A.data)),this._getType(A)!==ze.number){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.number,received:e.parsedType}),Bt}let e;const t=new Ct;for(const i of this._def.checks)"int"===i.kind?Ve.isInteger(A.data)||(e=this._getOrReturnCtx(A,e),rt(e,{code:$e.invalid_type,expected:"integer",received:"float",message:i.message}),t.dirty()):"min"===i.kind?(i.inclusive?A.datai.value:A.data>=i.value)&&(e=this._getOrReturnCtx(A,e),rt(e,{code:$e.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),t.dirty()):"multipleOf"===i.kind?0!==Vt(A.data,i.value)&&(e=this._getOrReturnCtx(A,e),rt(e,{code:$e.not_multiple_of,multipleOf:i.value,message:i.message}),t.dirty()):"finite"===i.kind?Number.isFinite(A.data)||(e=this._getOrReturnCtx(A,e),rt(e,{code:$e.not_finite,message:i.message}),t.dirty()):Ve.assertNever(i);return{status:t.value,value:A.data}}gte(A,e){return this.setLimit("min",A,!0,It.toString(e))}gt(A,e){return this.setLimit("min",A,!1,It.toString(e))}lte(A,e){return this.setLimit("max",A,!0,It.toString(e))}lt(A,e){return this.setLimit("max",A,!1,It.toString(e))}setLimit(e,t,i,n){return new A({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:It.toString(n)}]})}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}int(A){return this._addCheck({kind:"int",message:It.toString(A)})}positive(A){return this._addCheck({kind:"min",value:0,inclusive:!1,message:It.toString(A)})}negative(A){return this._addCheck({kind:"max",value:0,inclusive:!1,message:It.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:0,inclusive:!0,message:It.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:0,inclusive:!0,message:It.toString(A)})}multipleOf(A,e){return this._addCheck({kind:"multipleOf",value:A,message:It.toString(e)})}finite(A){return this._addCheck({kind:"finite",message:It.toString(A)})}safe(A){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:It.toString(A)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:It.toString(A)})}get minValue(){let A=null;for(const e of this._def.checks)"min"===e.kind&&(null===A||e.value>A)&&(A=e.value);return A}get maxValue(){let A=null;for(const e of this._def.checks)"max"===e.kind&&(null===A||e.value"int"===A.kind||"multipleOf"===A.kind&&Ve.isInteger(A.value))}get isFinite(){let A=null,e=null;for(const t of this._def.checks){if("finite"===t.kind||"int"===t.kind||"multipleOf"===t.kind)return!0;"min"===t.kind?(null===e||t.value>e)&&(e=t.value):"max"===t.kind&&(null===A||t.valuenew jt({checks:[],typeName:Ji.ZodNumber,coerce:A?.coerce||!1,...pt(A)});var Wt=class A extends mt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(A){if(this._def.coerce)try{A.data=BigInt(A.data)}catch{return this._getInvalidInput(A)}if(this._getType(A)!==ze.bigint)return this._getInvalidInput(A);let e;const t=new Ct;for(const i of this._def.checks)"min"===i.kind?(i.inclusive?A.datai.value:A.data>=i.value)&&(e=this._getOrReturnCtx(A,e),rt(e,{code:$e.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),t.dirty()):"multipleOf"===i.kind?A.data%i.value!==BigInt(0)&&(e=this._getOrReturnCtx(A,e),rt(e,{code:$e.not_multiple_of,multipleOf:i.value,message:i.message}),t.dirty()):Ve.assertNever(i);return{status:t.value,value:A.data}}_getInvalidInput(A){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.bigint,received:e.parsedType}),Bt}gte(A,e){return this.setLimit("min",A,!0,It.toString(e))}gt(A,e){return this.setLimit("min",A,!1,It.toString(e))}lte(A,e){return this.setLimit("max",A,!0,It.toString(e))}lt(A,e){return this.setLimit("max",A,!1,It.toString(e))}setLimit(e,t,i,n){return new A({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:It.toString(n)}]})}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}positive(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:It.toString(A)})}negative(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:It.toString(A)})}nonpositive(A){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:It.toString(A)})}nonnegative(A){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:It.toString(A)})}multipleOf(A,e){return this._addCheck({kind:"multipleOf",value:A,message:It.toString(e)})}get minValue(){let A=null;for(const e of this._def.checks)"min"===e.kind&&(null===A||e.value>A)&&(A=e.value);return A}get maxValue(){let A=null;for(const e of this._def.checks)"max"===e.kind&&(null===A||e.valuenew Wt({checks:[],typeName:Ji.ZodBigInt,coerce:A?.coerce??!1,...pt(A)});var Zt=class extends mt{_parse(A){if(this._def.coerce&&(A.data=Boolean(A.data)),this._getType(A)!==ze.boolean){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.boolean,received:e.parsedType}),Bt}return Et(A.data)}};Zt.create=A=>new Zt({typeName:Ji.ZodBoolean,coerce:A?.coerce||!1,...pt(A)});var zt=class A extends mt{_parse(A){if(this._def.coerce&&(A.data=new Date(A.data)),this._getType(A)!==ze.date){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.date,received:e.parsedType}),Bt}if(Number.isNaN(A.data.getTime()))return rt(this._getOrReturnCtx(A),{code:$e.invalid_date}),Bt;const e=new Ct;let t;for(const i of this._def.checks)"min"===i.kind?A.data.getTime()i.value&&(t=this._getOrReturnCtx(A,t),rt(t,{code:$e.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),e.dirty()):Ve.assertNever(i);return{status:e.value,value:new Date(A.data.getTime())}}_addCheck(e){return new A({...this._def,checks:[...this._def.checks,e]})}min(A,e){return this._addCheck({kind:"min",value:A.getTime(),message:It.toString(e)})}max(A,e){return this._addCheck({kind:"max",value:A.getTime(),message:It.toString(e)})}get minDate(){let A=null;for(const e of this._def.checks)"min"===e.kind&&(null===A||e.value>A)&&(A=e.value);return null!=A?new Date(A):null}get maxDate(){let A=null;for(const e of this._def.checks)"max"===e.kind&&(null===A||e.valuenew zt({checks:[],coerce:A?.coerce||!1,typeName:Ji.ZodDate,...pt(A)});var Xt=class extends mt{_parse(A){if(this._getType(A)!==ze.symbol){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.symbol,received:e.parsedType}),Bt}return Et(A.data)}};Xt.create=A=>new Xt({typeName:Ji.ZodSymbol,...pt(A)});var $t=class extends mt{_parse(A){if(this._getType(A)!==ze.undefined){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.undefined,received:e.parsedType}),Bt}return Et(A.data)}};$t.create=A=>new $t({typeName:Ji.ZodUndefined,...pt(A)});var Ai=class extends mt{_parse(A){if(this._getType(A)!==ze.null){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.null,received:e.parsedType}),Bt}return Et(A.data)}};Ai.create=A=>new Ai({typeName:Ji.ZodNull,...pt(A)});var ei=class extends mt{constructor(){super(...arguments),this._any=!0}_parse(A){return Et(A.data)}};ei.create=A=>new ei({typeName:Ji.ZodAny,...pt(A)});var ti=class extends mt{constructor(){super(...arguments),this._unknown=!0}_parse(A){return Et(A.data)}};ti.create=A=>new ti({typeName:Ji.ZodUnknown,...pt(A)});var ii=class extends mt{_parse(A){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.never,received:e.parsedType}),Bt}};ii.create=A=>new ii({typeName:Ji.ZodNever,...pt(A)});var ni=class extends mt{_parse(A){if(this._getType(A)!==ze.undefined){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.void,received:e.parsedType}),Bt}return Et(A.data)}};ni.create=A=>new ni({typeName:Ji.ZodVoid,...pt(A)});var oi=class A extends mt{_parse(A){const{ctx:e,status:t}=this._processInputParams(A),i=this._def;if(e.parsedType!==ze.array)return rt(e,{code:$e.invalid_type,expected:ze.array,received:e.parsedType}),Bt;if(null!==i.exactLength){const A=e.data.length>i.exactLength.value,n=e.data.lengthi.maxLength.value&&(rt(e,{code:$e.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),t.dirty()),e.common.async)return Promise.all([...e.data].map((A,t)=>i.type._parseAsync(new ht(e,A,e.path,t)))).then(A=>Ct.mergeArray(t,A));const n=[...e.data].map((A,t)=>i.type._parseSync(new ht(e,A,e.path,t)));return Ct.mergeArray(t,n)}get element(){return this._def.type}min(e,t){return new A({...this._def,minLength:{value:e,message:It.toString(t)}})}max(e,t){return new A({...this._def,maxLength:{value:e,message:It.toString(t)}})}length(e,t){return new A({...this._def,exactLength:{value:e,message:It.toString(t)}})}nonempty(A){return this.min(1,A)}};function gi(A){if(A instanceof si){const e={};for(const t in A.shape){const i=A.shape[t];e[t]=fi.create(gi(i))}return new si({...A._def,shape:()=>e})}return A instanceof oi?new oi({...A._def,type:gi(A.element)}):A instanceof fi?fi.create(gi(A.unwrap())):A instanceof Ri?Ri.create(gi(A.unwrap())):A instanceof Qi?Qi.create(A.items.map(A=>gi(A))):A}oi.create=(A,e)=>new oi({type:A,minLength:null,maxLength:null,exactLength:null,typeName:Ji.ZodArray,...pt(e)});var si=class A extends mt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const A=this._def.shape(),e=Ve.objectKeys(A);return this._cached={shape:A,keys:e},this._cached}_parse(A){if(this._getType(A)!==ze.object){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.object,received:e.parsedType}),Bt}const{status:e,ctx:t}=this._processInputParams(A),{shape:i,keys:n}=this._getCached(),o=[];if(!(this._def.catchall instanceof ii&&"strip"===this._def.unknownKeys))for(const A in t.data)n.includes(A)||o.push(A);const g=[];for(const A of n){const e=i[A],n=t.data[A];g.push({key:{status:"valid",value:A},value:e._parse(new ht(t,n,t.path,A)),alwaysSet:A in t.data})}if(this._def.catchall instanceof ii){const A=this._def.unknownKeys;if("passthrough"===A)for(const A of o)g.push({key:{status:"valid",value:A},value:{status:"valid",value:t.data[A]}});else if("strict"===A)o.length>0&&(rt(t,{code:$e.unrecognized_keys,keys:o}),e.dirty());else if("strip"!==A)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const A=this._def.catchall;for(const e of o){const i=t.data[e];g.push({key:{status:"valid",value:e},value:A._parse(new ht(t,i,t.path,e)),alwaysSet:e in t.data})}}return t.common.async?Promise.resolve().then(async()=>{const A=[];for(const e of g){const t=await e.key,i=await e.value;A.push({key:t,value:i,alwaysSet:e.alwaysSet})}return A}).then(A=>Ct.mergeObjectSync(e,A)):Ct.mergeObjectSync(e,g)}get shape(){return this._def.shape()}strict(e){return It.errToObj,new A({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(A,t)=>{const i=this._def.errorMap?.(A,t).message??t.defaultError;return"unrecognized_keys"===A.code?{message:It.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new A({...this._def,unknownKeys:"strip"})}passthrough(){return new A({...this._def,unknownKeys:"passthrough"})}extend(e){return new A({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new A({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ji.ZodObject})}setKey(A,e){return this.augment({[A]:e})}catchall(e){return new A({...this._def,catchall:e})}pick(e){const t={};for(const A of Ve.objectKeys(e))e[A]&&this.shape[A]&&(t[A]=this.shape[A]);return new A({...this._def,shape:()=>t})}omit(e){const t={};for(const A of Ve.objectKeys(this.shape))e[A]||(t[A]=this.shape[A]);return new A({...this._def,shape:()=>t})}deepPartial(){return gi(this)}partial(e){const t={};for(const A of Ve.objectKeys(this.shape)){const i=this.shape[A];e&&!e[A]?t[A]=i:t[A]=i.optional()}return new A({...this._def,shape:()=>t})}required(e){const t={};for(const A of Ve.objectKeys(this.shape))if(e&&!e[A])t[A]=this.shape[A];else{let e=this.shape[A];for(;e instanceof fi;)e=e._def.innerType;t[A]=e}return new A({...this._def,shape:()=>t})}keyof(){return Di(Ve.objectKeys(this.shape))}};si.create=(A,e)=>new si({shape:()=>A,unknownKeys:"strip",catchall:ii.create(),typeName:Ji.ZodObject,...pt(e)}),si.strictCreate=(A,e)=>new si({shape:()=>A,unknownKeys:"strict",catchall:ii.create(),typeName:Ji.ZodObject,...pt(e)}),si.lazycreate=(A,e)=>new si({shape:A,unknownKeys:"strip",catchall:ii.create(),typeName:Ji.ZodObject,...pt(e)});var ri=class extends mt{_parse(A){const{ctx:e}=this._processInputParams(A),t=this._def.options;if(e.common.async)return Promise.all(t.map(async A=>{const t={...e,common:{...e.common,issues:[]},parent:null};return{result:await A._parseAsync({data:e.data,path:e.path,parent:t}),ctx:t}})).then(function(A){for(const e of A)if("valid"===e.result.status)return e.result;for(const t of A)if("dirty"===t.result.status)return e.common.issues.push(...t.ctx.common.issues),t.result;const t=A.map(A=>new et(A.ctx.common.issues));return rt(e,{code:$e.invalid_union,unionErrors:t}),Bt});{let A;const i=[];for(const n of t){const t={...e,common:{...e.common,issues:[]},parent:null},o=n._parseSync({data:e.data,path:e.path,parent:t});if("valid"===o.status)return o;"dirty"!==o.status||A||(A={result:o,ctx:t}),t.common.issues.length&&i.push(t.common.issues)}if(A)return e.common.issues.push(...A.ctx.common.issues),A.result;const n=i.map(A=>new et(A));return rt(e,{code:$e.invalid_union,unionErrors:n}),Bt}}get options(){return this._def.options}};ri.create=(A,e)=>new ri({options:A,typeName:Ji.ZodUnion,...pt(e)});var Ii=A=>A instanceof di?Ii(A.schema):A instanceof yi?Ii(A.innerType()):A instanceof hi?[A.value]:A instanceof pi?A.options:A instanceof wi?Ve.objectValues(A.enum):A instanceof Ni?Ii(A._def.innerType):A instanceof $t?[void 0]:A instanceof Ai?[null]:A instanceof fi?[void 0,...Ii(A.unwrap())]:A instanceof Ri?[null,...Ii(A.unwrap())]:A instanceof Gi||A instanceof Fi?Ii(A.unwrap()):A instanceof Mi?Ii(A._def.innerType):[],ai=class A extends mt{_parse(A){const{ctx:e}=this._processInputParams(A);if(e.parsedType!==ze.object)return rt(e,{code:$e.invalid_type,expected:ze.object,received:e.parsedType}),Bt;const t=this.discriminator,i=e.data[t],n=this.optionsMap.get(i);return n?e.common.async?n._parseAsync({data:e.data,path:e.path,parent:e}):n._parseSync({data:e.data,path:e.path,parent:e}):(rt(e,{code:$e.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[t]}),Bt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,i){const n=new Map;for(const A of t){const t=Ii(A.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,A)}}return new A({typeName:Ji.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...pt(i)})}};function Ci(A,e){const t=Xe(A),i=Xe(e);if(A===e)return{valid:!0,data:A};if(t===ze.object&&i===ze.object){const t=Ve.objectKeys(e),i=Ve.objectKeys(A).filter(A=>-1!==t.indexOf(A)),n={...A,...e};for(const t of i){const i=Ci(A[t],e[t]);if(!i.valid)return{valid:!1};n[t]=i.data}return{valid:!0,data:n}}if(t===ze.array&&i===ze.array){if(A.length!==e.length)return{valid:!1};const t=[];for(let i=0;i{if(ct(A)||ct(i))return Bt;const n=Ci(A.value,i.value);return n.valid?((lt(A)||lt(i))&&e.dirty(),{status:e.value,value:n.data}):(rt(t,{code:$e.invalid_intersection_types}),Bt)};return t.common.async?Promise.all([this._def.left._parseAsync({data:t.data,path:t.path,parent:t}),this._def.right._parseAsync({data:t.data,path:t.path,parent:t})]).then(([A,e])=>i(A,e)):i(this._def.left._parseSync({data:t.data,path:t.path,parent:t}),this._def.right._parseSync({data:t.data,path:t.path,parent:t}))}};Bi.create=(A,e,t)=>new Bi({left:A,right:e,typeName:Ji.ZodIntersection,...pt(t)});var Qi=class A extends mt{_parse(A){const{status:e,ctx:t}=this._processInputParams(A);if(t.parsedType!==ze.array)return rt(t,{code:$e.invalid_type,expected:ze.array,received:t.parsedType}),Bt;if(t.data.lengththis._def.items.length&&(rt(t,{code:$e.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty());const i=[...t.data].map((A,e)=>{const i=this._def.items[e]||this._def.rest;return i?i._parse(new ht(t,A,t.path,e)):null}).filter(A=>!!A);return t.common.async?Promise.all(i).then(A=>Ct.mergeArray(e,A)):Ct.mergeArray(e,i)}get items(){return this._def.items}rest(e){return new A({...this._def,rest:e})}};Qi.create=(A,e)=>{if(!Array.isArray(A))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Qi({items:A,typeName:Ji.ZodTuple,rest:null,...pt(e)})};var Ei=class A extends mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(A){const{status:e,ctx:t}=this._processInputParams(A);if(t.parsedType!==ze.object)return rt(t,{code:$e.invalid_type,expected:ze.object,received:t.parsedType}),Bt;const i=[],n=this._def.keyType,o=this._def.valueType;for(const A in t.data)i.push({key:n._parse(new ht(t,A,t.path,A)),value:o._parse(new ht(t,t.data[A],t.path,A)),alwaysSet:A in t.data});return t.common.async?Ct.mergeObjectAsync(e,i):Ct.mergeObjectSync(e,i)}get element(){return this._def.valueType}static create(e,t,i){return new A(t instanceof mt?{keyType:e,valueType:t,typeName:Ji.ZodRecord,...pt(i)}:{keyType:Pt.create(),valueType:e,typeName:Ji.ZodRecord,...pt(t)})}},ci=class extends mt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(A){const{status:e,ctx:t}=this._processInputParams(A);if(t.parsedType!==ze.map)return rt(t,{code:$e.invalid_type,expected:ze.map,received:t.parsedType}),Bt;const i=this._def.keyType,n=this._def.valueType,o=[...t.data.entries()].map(([A,e],o)=>({key:i._parse(new ht(t,A,t.path,[o,"key"])),value:n._parse(new ht(t,e,t.path,[o,"value"]))}));if(t.common.async){const A=new Map;return Promise.resolve().then(async()=>{for(const t of o){const i=await t.key,n=await t.value;if("aborted"===i.status||"aborted"===n.status)return Bt;"dirty"!==i.status&&"dirty"!==n.status||e.dirty(),A.set(i.value,n.value)}return{status:e.value,value:A}})}{const A=new Map;for(const t of o){const i=t.key,n=t.value;if("aborted"===i.status||"aborted"===n.status)return Bt;"dirty"!==i.status&&"dirty"!==n.status||e.dirty(),A.set(i.value,n.value)}return{status:e.value,value:A}}}};ci.create=(A,e,t)=>new ci({valueType:e,keyType:A,typeName:Ji.ZodMap,...pt(t)});var li=class A extends mt{_parse(A){const{status:e,ctx:t}=this._processInputParams(A);if(t.parsedType!==ze.set)return rt(t,{code:$e.invalid_type,expected:ze.set,received:t.parsedType}),Bt;const i=this._def;null!==i.minSize&&t.data.sizei.maxSize.value&&(rt(t,{code:$e.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),e.dirty());const n=this._def.valueType;function o(A){const t=new Set;for(const i of A){if("aborted"===i.status)return Bt;"dirty"===i.status&&e.dirty(),t.add(i.value)}return{status:e.value,value:t}}const g=[...t.data.values()].map((A,e)=>n._parse(new ht(t,A,t.path,e)));return t.common.async?Promise.all(g).then(A=>o(A)):o(g)}min(e,t){return new A({...this._def,minSize:{value:e,message:It.toString(t)}})}max(e,t){return new A({...this._def,maxSize:{value:e,message:It.toString(t)}})}size(A,e){return this.min(A,e).max(A,e)}nonempty(A){return this.min(1,A)}};li.create=(A,e)=>new li({valueType:A,minSize:null,maxSize:null,typeName:Ji.ZodSet,...pt(e)});var ui=class A extends mt{constructor(){super(...arguments),this.validate=this.implement}_parse(A){const{ctx:e}=this._processInputParams(A);if(e.parsedType!==ze.function)return rt(e,{code:$e.invalid_type,expected:ze.function,received:e.parsedType}),Bt;function t(A,t){return gt({data:A,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,ot(),tt].filter(A=>!!A),issueData:{code:$e.invalid_arguments,argumentsError:t}})}function i(A,t){return gt({data:A,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,ot(),tt].filter(A=>!!A),issueData:{code:$e.invalid_return_type,returnTypeError:t}})}const n={errorMap:e.common.contextualErrorMap},o=e.data;if(this._def.returns instanceof mi){const A=this;return Et(async function(...e){const g=new et([]),s=await A._def.args.parseAsync(e,n).catch(A=>{throw g.addIssue(t(e,A)),g}),r=await Reflect.apply(o,this,s);return await A._def.returns._def.type.parseAsync(r,n).catch(A=>{throw g.addIssue(i(r,A)),g})})}{const A=this;return Et(function(...e){const g=A._def.args.safeParse(e,n);if(!g.success)throw new et([t(e,g.error)]);const s=Reflect.apply(o,this,g.data),r=A._def.returns.safeParse(s,n);if(!r.success)throw new et([i(s,r.error)]);return r.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new A({...this._def,args:Qi.create(e).rest(ti.create())})}returns(e){return new A({...this._def,returns:e})}implement(A){return this.parse(A)}strictImplement(A){return this.parse(A)}static create(e,t,i){return new A({args:e||Qi.create([]).rest(ti.create()),returns:t||ti.create(),typeName:Ji.ZodFunction,...pt(i)})}},di=class extends mt{get schema(){return this._def.getter()}_parse(A){const{ctx:e}=this._processInputParams(A);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}};di.create=(A,e)=>new di({getter:A,typeName:Ji.ZodLazy,...pt(e)});var hi=class extends mt{_parse(A){if(A.data!==this._def.value){const e=this._getOrReturnCtx(A);return rt(e,{received:e.data,code:$e.invalid_literal,expected:this._def.value}),Bt}return{status:"valid",value:A.data}}get value(){return this._def.value}};function Di(A,e){return new pi({values:A,typeName:Ji.ZodEnum,...pt(e)})}hi.create=(A,e)=>new hi({value:A,typeName:Ji.ZodLiteral,...pt(e)});var pi=class A extends mt{_parse(A){if("string"!=typeof A.data){const e=this._getOrReturnCtx(A),t=this._def.values;return rt(e,{expected:Ve.joinValues(t),received:e.parsedType,code:$e.invalid_type}),Bt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(A.data)){const e=this._getOrReturnCtx(A),t=this._def.values;return rt(e,{received:e.data,code:$e.invalid_enum_value,options:t}),Bt}return Et(A.data)}get options(){return this._def.values}get enum(){const A={};for(const e of this._def.values)A[e]=e;return A}get Values(){const A={};for(const e of this._def.values)A[e]=e;return A}get Enum(){const A={};for(const e of this._def.values)A[e]=e;return A}extract(e,t=this._def){return A.create(e,{...this._def,...t})}exclude(e,t=this._def){return A.create(this.options.filter(A=>!e.includes(A)),{...this._def,...t})}};pi.create=Di;var wi=class extends mt{_parse(A){const e=Ve.getValidEnumValues(this._def.values),t=this._getOrReturnCtx(A);if(t.parsedType!==ze.string&&t.parsedType!==ze.number){const A=Ve.objectValues(e);return rt(t,{expected:Ve.joinValues(A),received:t.parsedType,code:$e.invalid_type}),Bt}if(this._cache||(this._cache=new Set(Ve.getValidEnumValues(this._def.values))),!this._cache.has(A.data)){const A=Ve.objectValues(e);return rt(t,{received:t.data,code:$e.invalid_enum_value,options:A}),Bt}return Et(A.data)}get enum(){return this._def.values}};wi.create=(A,e)=>new wi({values:A,typeName:Ji.ZodNativeEnum,...pt(e)});var mi=class extends mt{unwrap(){return this._def.type}_parse(A){const{ctx:e}=this._processInputParams(A);if(e.parsedType!==ze.promise&&!1===e.common.async)return rt(e,{code:$e.invalid_type,expected:ze.promise,received:e.parsedType}),Bt;const t=e.parsedType===ze.promise?e.data:Promise.resolve(e.data);return Et(t.then(A=>this._def.type.parseAsync(A,{path:e.path,errorMap:e.common.contextualErrorMap})))}};mi.create=(A,e)=>new mi({type:A,typeName:Ji.ZodPromise,...pt(e)});var yi=class extends mt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ji.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(A){const{status:e,ctx:t}=this._processInputParams(A),i=this._def.effect||null,n={addIssue:A=>{rt(t,A),A.fatal?e.abort():e.dirty()},get path(){return t.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===i.type){const A=i.transform(t.data,n);if(t.common.async)return Promise.resolve(A).then(async A=>{if("aborted"===e.value)return Bt;const i=await this._def.schema._parseAsync({data:A,path:t.path,parent:t});return"aborted"===i.status?Bt:"dirty"===i.status||"dirty"===e.value?Qt(i.value):i});{if("aborted"===e.value)return Bt;const i=this._def.schema._parseSync({data:A,path:t.path,parent:t});return"aborted"===i.status?Bt:"dirty"===i.status||"dirty"===e.value?Qt(i.value):i}}if("refinement"===i.type){const A=A=>{const e=i.refinement(A,n);if(t.common.async)return Promise.resolve(e);if(e instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return A};if(!1===t.common.async){const i=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});return"aborted"===i.status?Bt:("dirty"===i.status&&e.dirty(),A(i.value),{status:e.value,value:i.value})}return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(t=>"aborted"===t.status?Bt:("dirty"===t.status&&e.dirty(),A(t.value).then(()=>({status:e.value,value:t.value}))))}if("transform"===i.type){if(!1===t.common.async){const A=this._def.schema._parseSync({data:t.data,path:t.path,parent:t});if(!ut(A))return Bt;const o=i.transform(A.value,n);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:o}}return this._def.schema._parseAsync({data:t.data,path:t.path,parent:t}).then(A=>ut(A)?Promise.resolve(i.transform(A.value,n)).then(A=>({status:e.value,value:A})):Bt)}Ve.assertNever(i)}};yi.create=(A,e,t)=>new yi({schema:A,typeName:Ji.ZodEffects,effect:e,...pt(t)}),yi.createWithPreprocess=(A,e,t)=>new yi({schema:e,effect:{type:"preprocess",transform:A},typeName:Ji.ZodEffects,...pt(t)});var fi=class extends mt{_parse(A){return this._getType(A)===ze.undefined?Et(void 0):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}};fi.create=(A,e)=>new fi({innerType:A,typeName:Ji.ZodOptional,...pt(e)});var Ri=class extends mt{_parse(A){return this._getType(A)===ze.null?Et(null):this._def.innerType._parse(A)}unwrap(){return this._def.innerType}};Ri.create=(A,e)=>new Ri({innerType:A,typeName:Ji.ZodNullable,...pt(e)});var Ni=class extends mt{_parse(A){const{ctx:e}=this._processInputParams(A);let t=e.data;return e.parsedType===ze.undefined&&(t=this._def.defaultValue()),this._def.innerType._parse({data:t,path:e.path,parent:e})}removeDefault(){return this._def.innerType}};Ni.create=(A,e)=>new Ni({innerType:A,typeName:Ji.ZodDefault,defaultValue:"function"==typeof e.default?e.default:()=>e.default,...pt(e)});var Mi=class extends mt{_parse(A){const{ctx:e}=this._processInputParams(A),t={...e,common:{...e.common,issues:[]}},i=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t}});return dt(i)?i.then(A=>({status:"valid",value:"valid"===A.status?A.value:this._def.catchValue({get error(){return new et(t.common.issues)},input:t.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new et(t.common.issues)},input:t.data})}}removeCatch(){return this._def.innerType}};Mi.create=(A,e)=>new Mi({innerType:A,typeName:Ji.ZodCatch,catchValue:"function"==typeof e.catch?e.catch:()=>e.catch,...pt(e)});var Si=class extends mt{_parse(A){if(this._getType(A)!==ze.nan){const e=this._getOrReturnCtx(A);return rt(e,{code:$e.invalid_type,expected:ze.nan,received:e.parsedType}),Bt}return{status:"valid",value:A.data}}};Si.create=A=>new Si({typeName:Ji.ZodNaN,...pt(A)});var ki=Symbol("zod_brand"),Gi=class extends mt{_parse(A){const{ctx:e}=this._processInputParams(A),t=e.data;return this._def.type._parse({data:t,path:e.path,parent:e})}unwrap(){return this._def.type}},Li=class A extends mt{_parse(A){const{status:e,ctx:t}=this._processInputParams(A);if(t.common.async)return(async()=>{const A=await this._def.in._parseAsync({data:t.data,path:t.path,parent:t});return"aborted"===A.status?Bt:"dirty"===A.status?(e.dirty(),Qt(A.value)):this._def.out._parseAsync({data:A.value,path:t.path,parent:t})})();{const A=this._def.in._parseSync({data:t.data,path:t.path,parent:t});return"aborted"===A.status?Bt:"dirty"===A.status?(e.dirty(),{status:"dirty",value:A.value}):this._def.out._parseSync({data:A.value,path:t.path,parent:t})}}static create(e,t){return new A({in:e,out:t,typeName:Ji.ZodPipeline})}},Fi=class extends mt{_parse(A){const e=this._def.innerType._parse(A),t=A=>(ut(A)&&(A.value=Object.freeze(A.value)),A);return dt(e)?e.then(A=>t(A)):t(e)}unwrap(){return this._def.innerType}};function Ti(A,e){const t="function"==typeof A?A(e):"string"==typeof A?{message:A}:A;return"string"==typeof t?{message:t}:t}function Ui(A,e={},t){return A?ei.create().superRefine((i,n)=>{const o=A(i);if(o instanceof Promise)return o.then(A=>{if(!A){const A=Ti(e,i),o=A.fatal??t??!0;n.addIssue({code:"custom",...A,fatal:o})}});if(!o){const A=Ti(e,i),o=A.fatal??t??!0;n.addIssue({code:"custom",...A,fatal:o})}}):ei.create()}Fi.create=(A,e)=>new Fi({innerType:A,typeName:Ji.ZodReadonly,...pt(e)});var Ji,_i,Yi={object:si.lazycreate};(_i=Ji||(Ji={})).ZodString="ZodString",_i.ZodNumber="ZodNumber",_i.ZodNaN="ZodNaN",_i.ZodBigInt="ZodBigInt",_i.ZodBoolean="ZodBoolean",_i.ZodDate="ZodDate",_i.ZodSymbol="ZodSymbol",_i.ZodUndefined="ZodUndefined",_i.ZodNull="ZodNull",_i.ZodAny="ZodAny",_i.ZodUnknown="ZodUnknown",_i.ZodNever="ZodNever",_i.ZodVoid="ZodVoid",_i.ZodArray="ZodArray",_i.ZodObject="ZodObject",_i.ZodUnion="ZodUnion",_i.ZodDiscriminatedUnion="ZodDiscriminatedUnion",_i.ZodIntersection="ZodIntersection",_i.ZodTuple="ZodTuple",_i.ZodRecord="ZodRecord",_i.ZodMap="ZodMap",_i.ZodSet="ZodSet",_i.ZodFunction="ZodFunction",_i.ZodLazy="ZodLazy",_i.ZodLiteral="ZodLiteral",_i.ZodEnum="ZodEnum",_i.ZodEffects="ZodEffects",_i.ZodNativeEnum="ZodNativeEnum",_i.ZodOptional="ZodOptional",_i.ZodNullable="ZodNullable",_i.ZodDefault="ZodDefault",_i.ZodCatch="ZodCatch",_i.ZodPromise="ZodPromise",_i.ZodBranded="ZodBranded",_i.ZodPipeline="ZodPipeline",_i.ZodReadonly="ZodReadonly";var bi=(A,e={message:`Input not instance of ${A.name}`})=>Ui(e=>e instanceof A,e),Hi=Pt.create,xi=jt.create,Ki=Si.create,Oi=Wt.create,vi=Zt.create,qi=zt.create,Pi=Xt.create,Vi=$t.create,ji=Ai.create,Wi=ei.create,Zi=ti.create,zi=ii.create,Xi=ni.create,$i=oi.create,An=si.create,en=si.strictCreate,tn=ri.create,nn=ai.create,on=Bi.create,gn=Qi.create,sn=Ei.create,rn=ci.create,In=li.create,an=ui.create,Cn=di.create,Bn=hi.create,Qn=pi.create,En=wi.create,cn=mi.create,ln=yi.create,un=fi.create,dn=Ri.create,hn=yi.createWithPreprocess,Dn=Li.create,pn=()=>Hi().optional(),wn=()=>xi().optional(),mn=()=>vi().optional(),yn={string:A=>Pt.create({...A,coerce:!0}),number:A=>jt.create({...A,coerce:!0}),boolean:A=>Zt.create({...A,coerce:!0}),bigint:A=>Wt.create({...A,coerce:!0}),date:A=>zt.create({...A,coerce:!0})},fn=Bt,Rn="authenticate",Nn="initialize",Mn="session/cancel",Sn="session/fork",kn="session/list",Gn="session/load",Ln="session/new",Fn="session/prompt",Tn="session/resume",Un="session/set_config_option",Jn="session/set_mode",_n="session/set_model",Yn="fs/read_text_file",bn="fs/write_text_file",Hn="session/request_permission",xn="session/update",Kn="terminal/create",On="terminal/kill",vn="terminal/output",qn="terminal/release",Pn="terminal/wait_for_exit",Vn={};r(Vn,{$brand:()=>zn,$input:()=>Ta,$output:()=>Fa,NEVER:()=>Wn,TimePrecision:()=>rC,ZodAny:()=>pE,ZodArray:()=>GE,ZodBase64:()=>vQ,ZodBase64URL:()=>PQ,ZodBigInt:()=>aE,ZodBigIntFormat:()=>BE,ZodBoolean:()=>rE,ZodCIDRv4:()=>HQ,ZodCIDRv6:()=>KQ,ZodCUID:()=>RQ,ZodCUID2:()=>MQ,ZodCatch:()=>pc,ZodCustom:()=>Uc,ZodCustomStringFormat:()=>XQ,ZodDate:()=>SE,ZodDefault:()=>Qc,ZodDiscriminatedUnion:()=>HE,ZodE164:()=>jQ,ZodEmail:()=>CQ,ZodEmoji:()=>wQ,ZodEnum:()=>$E,ZodError:()=>AQ,ZodFile:()=>nc,ZodGUID:()=>QQ,ZodIPv4:()=>JQ,ZodIPv6:()=>YQ,ZodISODate:()=>VB,ZodISODateTime:()=>qB,ZodISODuration:()=>zB,ZodISOTime:()=>WB,ZodIntersection:()=>KE,ZodIssueCode:()=>vc,ZodJWT:()=>ZQ,ZodKSUID:()=>TQ,ZodLazy:()=>Gc,ZodLiteral:()=>tc,ZodMap:()=>WE,ZodNaN:()=>mc,ZodNanoID:()=>yQ,ZodNever:()=>fE,ZodNonOptional:()=>uc,ZodNull:()=>hE,ZodNullable:()=>ac,ZodNumber:()=>AE,ZodNumberFormat:()=>tE,ZodObject:()=>TE,ZodOptional:()=>rc,ZodPipe:()=>fc,ZodPrefault:()=>cc,ZodPromise:()=>Fc,ZodReadonly:()=>Nc,ZodRealError:()=>eQ,ZodRecord:()=>PE,ZodSet:()=>zE,ZodString:()=>rQ,ZodStringFormat:()=>aQ,ZodSuccess:()=>hc,ZodSymbol:()=>cE,ZodTemplateLiteral:()=>Sc,ZodTransform:()=>gc,ZodTuple:()=>vE,ZodType:()=>gQ,ZodULID:()=>kQ,ZodURL:()=>DQ,ZodUUID:()=>cQ,ZodUndefined:()=>uE,ZodUnion:()=>YE,ZodUnknown:()=>mE,ZodVoid:()=>NE,ZodXID:()=>LQ,_ZodString:()=>sQ,_default:()=>Ec,any:()=>wE,array:()=>LE,base64:()=>qQ,base64url:()=>VQ,bigint:()=>CE,boolean:()=>IE,catch:()=>wc,check:()=>Jc,cidrv4:()=>xQ,cidrv6:()=>OQ,clone:()=>ko,coerce:()=>Vc,config:()=>Ao,core:()=>jn,cuid:()=>NQ,cuid2:()=>SQ,custom:()=>_c,date:()=>kE,discriminatedUnion:()=>xE,e164:()=>WQ,email:()=>BQ,emoji:()=>mQ,endsWith:()=>tB,enum:()=>Ac,file:()=>oc,flattenError:()=>eg,float32:()=>nE,float64:()=>oE,formatError:()=>tg,function:()=>bB,getErrorMap:()=>Pc,globalRegistry:()=>_a,gt:()=>YC,gte:()=>bC,guid:()=>EQ,includes:()=>AB,instanceof:()=>Hc,int:()=>iE,int32:()=>gE,int64:()=>QE,intersection:()=>OE,ipv4:()=>_Q,ipv6:()=>bQ,iso:()=>vB,json:()=>Kc,jwt:()=>zQ,keyof:()=>FE,ksuid:()=>UQ,lazy:()=>Lc,length:()=>ZC,literal:()=>ic,locales:()=>gI,looseObject:()=>_E,lowercase:()=>XC,lt:()=>JC,lte:()=>_C,map:()=>ZE,maxLength:()=>jC,maxSize:()=>qC,mime:()=>nB,minLength:()=>WC,minSize:()=>PC,multipleOf:()=>vC,nan:()=>yc,nanoid:()=>fQ,nativeEnum:()=>ec,negative:()=>xC,never:()=>RE,nonnegative:()=>OC,nonoptional:()=>dc,nonpositive:()=>KC,normalize:()=>gB,null:()=>DE,nullable:()=>Cc,nullish:()=>Bc,number:()=>eE,object:()=>UE,optional:()=>Ic,overwrite:()=>oB,parse:()=>tQ,parseAsync:()=>iQ,partialRecord:()=>jE,pipe:()=>Rc,positive:()=>HC,prefault:()=>lc,preprocess:()=>Oc,prettifyError:()=>og,promise:()=>Tc,property:()=>iB,readonly:()=>Mc,record:()=>VE,refine:()=>Yc,regex:()=>zC,regexes:()=>Eg,registry:()=>Ja,safeParse:()=>nQ,safeParseAsync:()=>oQ,set:()=>XE,setErrorMap:()=>qc,size:()=>VC,startsWith:()=>eB,strictObject:()=>JE,string:()=>IQ,stringFormat:()=>$Q,stringbool:()=>xc,success:()=>Dc,superRefine:()=>bc,symbol:()=>lE,templateLiteral:()=>kc,toJSONSchema:()=>xB,toLowerCase:()=>rB,toUpperCase:()=>IB,transform:()=>sc,treeifyError:()=>ig,trim:()=>sB,tuple:()=>qE,uint32:()=>sE,uint64:()=>EE,ulid:()=>GQ,undefined:()=>dE,union:()=>bE,unknown:()=>yE,uppercase:()=>$C,url:()=>pQ,uuid:()=>lQ,uuidv4:()=>uQ,uuidv6:()=>dQ,uuidv7:()=>hQ,void:()=>ME,xid:()=>FQ});var jn={};r(jn,{$ZodAny:()=>Er,$ZodArray:()=>Dr,$ZodAsyncError:()=>Xn,$ZodBase64:()=>$s,$ZodBase64URL:()=>er,$ZodBigInt:()=>Ir,$ZodBigIntFormat:()=>ar,$ZodBoolean:()=>rr,$ZodCIDRv4:()=>Zs,$ZodCIDRv6:()=>zs,$ZodCUID:()=>bs,$ZodCUID2:()=>Hs,$ZodCatch:()=>Wr,$ZodCheck:()=>ns,$ZodCheckBigIntFormat:()=>as,$ZodCheckEndsWith:()=>ms,$ZodCheckGreaterThan:()=>ss,$ZodCheckIncludes:()=>ps,$ZodCheckLengthEquals:()=>ls,$ZodCheckLessThan:()=>gs,$ZodCheckLowerCase:()=>hs,$ZodCheckMaxLength:()=>Es,$ZodCheckMaxSize:()=>Cs,$ZodCheckMimeType:()=>Rs,$ZodCheckMinLength:()=>cs,$ZodCheckMinSize:()=>Bs,$ZodCheckMultipleOf:()=>rs,$ZodCheckNumberFormat:()=>Is,$ZodCheckOverwrite:()=>Ns,$ZodCheckProperty:()=>fs,$ZodCheckRegex:()=>ds,$ZodCheckSizeEquals:()=>Qs,$ZodCheckStartsWith:()=>ws,$ZodCheckStringFormat:()=>us,$ZodCheckUpperCase:()=>Ds,$ZodCustom:()=>nI,$ZodCustomStringFormat:()=>or,$ZodDate:()=>dr,$ZodDefault:()=>Or,$ZodDiscriminatedUnion:()=>Rr,$ZodE164:()=>tr,$ZodEmail:()=>Us,$ZodEmoji:()=>_s,$ZodEnum:()=>_r,$ZodError:()=>$o,$ZodFile:()=>br,$ZodFunction:()=>YB,$ZodGUID:()=>Fs,$ZodIPv4:()=>js,$ZodIPv6:()=>Ws,$ZodISODate:()=>qs,$ZodISODateTime:()=>vs,$ZodISODuration:()=>Vs,$ZodISOTime:()=>Ps,$ZodIntersection:()=>Nr,$ZodJWT:()=>nr,$ZodKSUID:()=>Os,$ZodLazy:()=>iI,$ZodLiteral:()=>Yr,$ZodMap:()=>Fr,$ZodNaN:()=>Zr,$ZodNanoID:()=>Ys,$ZodNever:()=>lr,$ZodNonOptional:()=>Pr,$ZodNull:()=>Qr,$ZodNullable:()=>Kr,$ZodNumber:()=>gr,$ZodNumberFormat:()=>sr,$ZodObject:()=>mr,$ZodOptional:()=>xr,$ZodPipe:()=>zr,$ZodPrefault:()=>qr,$ZodPromise:()=>tI,$ZodReadonly:()=>$r,$ZodRealError:()=>Ag,$ZodRecord:()=>Lr,$ZodRegistry:()=>Ua,$ZodSet:()=>Ur,$ZodString:()=>Gs,$ZodStringFormat:()=>Ls,$ZodSuccess:()=>jr,$ZodSymbol:()=>Cr,$ZodTemplateLiteral:()=>eI,$ZodTransform:()=>Hr,$ZodTuple:()=>kr,$ZodType:()=>ks,$ZodULID:()=>xs,$ZodURL:()=>Js,$ZodUUID:()=>Ts,$ZodUndefined:()=>Br,$ZodUnion:()=>fr,$ZodUnknown:()=>cr,$ZodVoid:()=>ur,$ZodXID:()=>Ks,$brand:()=>zn,$constructor:()=>Zn,$input:()=>Ta,$output:()=>Fa,Doc:()=>Ms,JSONSchema:()=>OB,JSONSchemaGenerator:()=>HB,NEVER:()=>Wn,TimePrecision:()=>rC,_any:()=>SC,_array:()=>aB,_base64:()=>nC,_base64url:()=>oC,_bigint:()=>wC,_boolean:()=>DC,_catch:()=>MB,_cidrv4:()=>tC,_cidrv6:()=>iC,_coercedBigint:()=>mC,_coercedBoolean:()=>pC,_coercedDate:()=>TC,_coercedNumber:()=>EC,_coercedString:()=>ba,_cuid:()=>Wa,_cuid2:()=>Za,_custom:()=>TB,_date:()=>FC,_default:()=>fB,_discriminatedUnion:()=>BB,_e164:()=>gC,_email:()=>Ha,_emoji:()=>Va,_endsWith:()=>tB,_enum:()=>dB,_file:()=>pB,_float32:()=>lC,_float64:()=>uC,_gt:()=>YC,_gte:()=>bC,_guid:()=>xa,_includes:()=>AB,_int:()=>cC,_int32:()=>dC,_int64:()=>yC,_intersection:()=>QB,_ipv4:()=>AC,_ipv6:()=>eC,_isoDate:()=>aC,_isoDateTime:()=>IC,_isoDuration:()=>BC,_isoTime:()=>CC,_jwt:()=>sC,_ksuid:()=>$a,_lazy:()=>LB,_length:()=>ZC,_literal:()=>DB,_lowercase:()=>XC,_lt:()=>JC,_lte:()=>_C,_map:()=>lB,_max:()=>_C,_maxLength:()=>jC,_maxSize:()=>qC,_mime:()=>nB,_min:()=>bC,_minLength:()=>WC,_minSize:()=>PC,_multipleOf:()=>vC,_nan:()=>UC,_nanoid:()=>ja,_nativeEnum:()=>hB,_negative:()=>xC,_never:()=>GC,_nonnegative:()=>OC,_nonoptional:()=>RB,_nonpositive:()=>KC,_normalize:()=>gB,_null:()=>MC,_nullable:()=>yB,_number:()=>QC,_optional:()=>mB,_overwrite:()=>oB,_parse:()=>gg,_parseAsync:()=>rg,_pipe:()=>SB,_positive:()=>HC,_promise:()=>FB,_property:()=>iB,_readonly:()=>kB,_record:()=>cB,_refine:()=>UB,_regex:()=>zC,_safeParse:()=>ag,_safeParseAsync:()=>Bg,_set:()=>uB,_size:()=>VC,_startsWith:()=>eB,_string:()=>Ya,_stringFormat:()=>_B,_stringbool:()=>JB,_success:()=>NB,_symbol:()=>RC,_templateLiteral:()=>GB,_toLowerCase:()=>rB,_toUpperCase:()=>IB,_transform:()=>wB,_trim:()=>sB,_tuple:()=>EB,_uint32:()=>hC,_uint64:()=>fC,_ulid:()=>za,_undefined:()=>NC,_union:()=>CB,_unknown:()=>kC,_uppercase:()=>$C,_url:()=>Pa,_uuid:()=>Ka,_uuidv4:()=>Oa,_uuidv6:()=>va,_uuidv7:()=>qa,_void:()=>LC,_xid:()=>Xa,clone:()=>ko,config:()=>Ao,flattenError:()=>eg,formatError:()=>tg,function:()=>bB,globalConfig:()=>$n,globalRegistry:()=>_a,isValidBase64:()=>Xs,isValidBase64URL:()=>Ar,isValidJWT:()=>ir,locales:()=>gI,parse:()=>sg,parseAsync:()=>Ig,prettifyError:()=>og,regexes:()=>Eg,registry:()=>Ja,safeParse:()=>Cg,safeParseAsync:()=>Qg,toDotPath:()=>ng,toJSONSchema:()=>xB,treeifyError:()=>ig,util:()=>eo,version:()=>Ss});var Wn=Object.freeze({status:"aborted"});function Zn(A,e,t){function i(t,i){var n;Object.defineProperty(t,"_zod",{value:t._zod??{},enumerable:!1}),(n=t._zod).traits??(n.traits=new Set),t._zod.traits.add(A),e(t,i);for(const A in g.prototype)A in t||Object.defineProperty(t,A,{value:g.prototype[A].bind(t)});t._zod.constr=g,t._zod.def=i}const n=t?.Parent??Object;class o extends n{}function g(A){var e;const n=t?.Parent?new o:this;i(n,A),(e=n._zod).deferred??(e.deferred=[]);for(const A of n._zod.deferred)A();return n}return Object.defineProperty(o,"name",{value:A}),Object.defineProperty(g,"init",{value:i}),Object.defineProperty(g,Symbol.hasInstance,{value:e=>!!(t?.Parent&&e instanceof t.Parent)||e?._zod?.traits?.has(A)}),Object.defineProperty(g,"name",{value:A}),g}var zn=Symbol("zod_brand"),Xn=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$n={};function Ao(A){return A&&Object.assign($n,A),$n}var eo={};function to(A){return A}function io(A){return A}function no(A){}function oo(A){throw new Error}function go(A){}function so(A){const e=Object.values(A).filter(A=>"number"==typeof A);return Object.entries(A).filter(([A,t])=>-1===e.indexOf(+A)).map(([A,e])=>e)}function ro(A,e="|"){return A.map(A=>Fo(A)).join(e)}function Io(A,e){return"bigint"==typeof e?e.toString():e}function ao(A){return{get value(){{const e=A();return Object.defineProperty(this,"value",{value:e}),e}}}}function Co(A){return null==A}function Bo(A){const e=A.startsWith("^")?1:0,t=A.endsWith("$")?A.length-1:A.length;return A.slice(e,t)}function Qo(A,e){const t=(A.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=t>i?t:i;return Number.parseInt(A.toFixed(n).replace(".",""))%Number.parseInt(e.toFixed(n).replace(".",""))/10**n}function Eo(A,e,t){Object.defineProperty(A,e,{get(){{const i=t();return A[e]=i,i}},set(t){Object.defineProperty(A,e,{value:t})},configurable:!0})}function co(A,e,t){Object.defineProperty(A,e,{value:t,writable:!0,enumerable:!0,configurable:!0})}function lo(A,e){return e?e.reduce((A,e)=>A?.[e],A):A}function uo(A){const e=Object.keys(A),t=e.map(e=>A[e]);return Promise.all(t).then(A=>{const t={};for(let i=0;iJo,Class:()=>zo,NUMBER_FORMAT_RANGES:()=>Uo,aborted:()=>Oo,allowsEval:()=>mo,assert:()=>go,assertEqual:()=>to,assertIs:()=>no,assertNever:()=>oo,assertNotEqual:()=>io,assignProp:()=>co,cached:()=>ao,captureStackTrace:()=>po,cleanEnum:()=>Zo,cleanRegex:()=>Bo,clone:()=>ko,createTransparentProxy:()=>Lo,defineLazy:()=>Eo,esc:()=>Do,escapeRegex:()=>So,extend:()=>bo,finalizeIssue:()=>Po,floatSafeRemainder:()=>Qo,getElementAtPath:()=>lo,getEnumValues:()=>so,getLengthableOrigin:()=>jo,getParsedType:()=>Ro,getSizableOrigin:()=>Vo,isObject:()=>wo,isPlainObject:()=>yo,issue:()=>Wo,joinValues:()=>ro,jsonStringifyReplacer:()=>Io,merge:()=>Ho,normalizeParams:()=>Go,nullish:()=>Co,numKeys:()=>fo,omit:()=>Yo,optionalKeys:()=>To,partial:()=>xo,pick:()=>_o,prefixIssues:()=>vo,primitiveTypes:()=>Mo,promiseAllObject:()=>uo,propertyKeyTypes:()=>No,randomString:()=>ho,required:()=>Ko,stringifyPrimitive:()=>Fo,unwrapMessage:()=>qo});var po=Error.captureStackTrace?Error.captureStackTrace:(...A)=>{};function wo(A){return"object"==typeof A&&null!==A&&!Array.isArray(A)}var mo=ao(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(A){return!1}});function yo(A){if(!1===wo(A))return!1;const e=A.constructor;if(void 0===e)return!0;const t=e.prototype;return!1!==wo(t)&&!1!==Object.prototype.hasOwnProperty.call(t,"isPrototypeOf")}function fo(A){let e=0;for(const t in A)Object.prototype.hasOwnProperty.call(A,t)&&e++;return e}var Ro=A=>{const e=typeof A;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(A)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(A)?"array":null===A?"null":A.then&&"function"==typeof A.then&&A.catch&&"function"==typeof A.catch?"promise":"undefined"!=typeof Map&&A instanceof Map?"map":"undefined"!=typeof Set&&A instanceof Set?"set":"undefined"!=typeof Date&&A instanceof Date?"date":"undefined"!=typeof File&&A instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},No=new Set(["string","number","symbol"]),Mo=new Set(["string","number","bigint","boolean","symbol","undefined"]);function So(A){return A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ko(A,e,t){const i=new A._zod.constr(e??A._zod.def);return e&&!t?.parent||(i._zod.parent=A),i}function Go(A){const e=A;if(!e)return{};if("string"==typeof e)return{error:()=>e};if(void 0!==e?.message){if(void 0!==e?.error)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,"string"==typeof e.error?{...e,error:()=>e.error}:e}function Lo(A){let e;return new Proxy({},{get:(t,i,n)=>(e??(e=A()),Reflect.get(e,i,n)),set:(t,i,n,o)=>(e??(e=A()),Reflect.set(e,i,n,o)),has:(t,i)=>(e??(e=A()),Reflect.has(e,i)),deleteProperty:(t,i)=>(e??(e=A()),Reflect.deleteProperty(e,i)),ownKeys:t=>(e??(e=A()),Reflect.ownKeys(e)),getOwnPropertyDescriptor:(t,i)=>(e??(e=A()),Reflect.getOwnPropertyDescriptor(e,i)),defineProperty:(t,i,n)=>(e??(e=A()),Reflect.defineProperty(e,i,n))})}function Fo(A){return"bigint"==typeof A?A.toString()+"n":"string"==typeof A?`"${A}"`:`${A}`}function To(A){return Object.keys(A).filter(e=>"optional"===A[e]._zod.optin&&"optional"===A[e]._zod.optout)}var Uo={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]},Jo={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function _o(A,e){const t={},i=A._zod.def;for(const A in e){if(!(A in i.shape))throw new Error(`Unrecognized key: "${A}"`);e[A]&&(t[A]=i.shape[A])}return ko(A,{...A._zod.def,shape:t,checks:[]})}function Yo(A,e){const t={...A._zod.def.shape},i=A._zod.def;for(const A in e){if(!(A in i.shape))throw new Error(`Unrecognized key: "${A}"`);e[A]&&delete t[A]}return ko(A,{...A._zod.def,shape:t,checks:[]})}function bo(A,e){if(!yo(e))throw new Error("Invalid input to extend: expected a plain object");const t={...A._zod.def,get shape(){const t={...A._zod.def.shape,...e};return co(this,"shape",t),t},checks:[]};return ko(A,t)}function Ho(A,e){return ko(A,{...A._zod.def,get shape(){const t={...A._zod.def.shape,...e._zod.def.shape};return co(this,"shape",t),t},catchall:e._zod.def.catchall,checks:[]})}function xo(A,e,t){const i=e._zod.def.shape,n={...i};if(t)for(const e in t){if(!(e in i))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=A?new A({type:"optional",innerType:i[e]}):i[e])}else for(const e in i)n[e]=A?new A({type:"optional",innerType:i[e]}):i[e];return ko(e,{...e._zod.def,shape:n,checks:[]})}function Ko(A,e,t){const i=e._zod.def.shape,n={...i};if(t)for(const e in t){if(!(e in n))throw new Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=new A({type:"nonoptional",innerType:i[e]}))}else for(const e in i)n[e]=new A({type:"nonoptional",innerType:i[e]});return ko(e,{...e._zod.def,shape:n,checks:[]})}function Oo(A,e=0){for(let t=e;t{var t;return(t=e).path??(t.path=[]),e.path.unshift(A),e})}function qo(A){return"string"==typeof A?A:A?.message}function Po(A,e,t){const i={...A,path:A.path??[]};if(!A.message){const n=qo(A.inst?._zod.def?.error?.(A))??qo(e?.error?.(A))??qo(t.customError?.(A))??qo(t.localeError?.(A))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function Vo(A){return A instanceof Set?"set":A instanceof Map?"map":A instanceof File?"file":"unknown"}function jo(A){return Array.isArray(A)?"array":"string"==typeof A?"string":"unknown"}function Wo(...A){const[e,t,i]=A;return"string"==typeof e?{message:e,code:"custom",input:t,inst:i}:{...e}}function Zo(A){return Object.entries(A).filter(([A,e])=>Number.isNaN(Number.parseInt(A,10))).map(A=>A[1])}var zo=class{constructor(...A){}},Xo=(A,e)=>{A.name="$ZodError",Object.defineProperty(A,"_zod",{value:A._zod,enumerable:!1}),Object.defineProperty(A,"issues",{value:e,enumerable:!1}),Object.defineProperty(A,"message",{get:()=>JSON.stringify(e,Io,2),enumerable:!0}),Object.defineProperty(A,"toString",{value:()=>A.message,enumerable:!1})},$o=Zn("$ZodError",Xo),Ag=Zn("$ZodError",Xo,{Parent:Error});function eg(A,e=A=>A.message){const t={},i=[];for(const n of A.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:t}}function tg(A,e){const t=e||function(A){return A.message},i={_errors:[]},n=A=>{for(const e of A.issues)if("invalid_union"===e.code&&e.errors.length)e.errors.map(A=>n({issues:A}));else if("invalid_key"===e.code)n({issues:e.issues});else if("invalid_element"===e.code)n({issues:e.issues});else if(0===e.path.length)i._errors.push(t(e));else{let A=i,n=0;for(;n{var o,g;for(const s of A.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(A=>n({issues:A},s.path));else if("invalid_key"===s.code)n({issues:s.issues},s.path);else if("invalid_element"===s.code)n({issues:s.issues},s.path);else{const A=[...e,...s.path];if(0===A.length){i.errors.push(t(s));continue}let n=i,r=0;for(;rA.path.length-e.path.length);for(const A of t)e.push(`✖ ${A.message}`),A.path?.length&&e.push(` → at ${ng(A.path)}`);return e.join("\n")}var gg=A=>(e,t,i,n)=>{const o=i?Object.assign(i,{async:!1}):{async:!1},g=e._zod.run({value:t,issues:[]},o);if(g instanceof Promise)throw new Xn;if(g.issues.length){const e=new(n?.Err??A)(g.issues.map(A=>Po(A,o,Ao())));throw po(e,n?.callee),e}return g.value},sg=gg(Ag),rg=A=>async(e,t,i,n)=>{const o=i?Object.assign(i,{async:!0}):{async:!0};let g=e._zod.run({value:t,issues:[]},o);if(g instanceof Promise&&(g=await g),g.issues.length){const e=new(n?.Err??A)(g.issues.map(A=>Po(A,o,Ao())));throw po(e,n?.callee),e}return g.value},Ig=rg(Ag),ag=A=>(e,t,i)=>{const n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)throw new Xn;return o.issues.length?{success:!1,error:new(A??$o)(o.issues.map(A=>Po(A,n,Ao())))}:{success:!0,data:o.value}},Cg=ag(Ag),Bg=A=>async(e,t,i)=>{const n=i?Object.assign(i,{async:!0}):{async:!0};let o=e._zod.run({value:t,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new A(o.issues.map(A=>Po(A,n,Ao())))}:{success:!0,data:o.value}},Qg=Bg(Ag),Eg={};r(Eg,{_emoji:()=>Fg,base64:()=>bg,base64url:()=>Hg,bigint:()=>Zg,boolean:()=>$g,browserEmail:()=>Lg,cidrv4:()=>_g,cidrv6:()=>Yg,cuid:()=>cg,cuid2:()=>lg,date:()=>qg,datetime:()=>jg,domain:()=>Kg,duration:()=>pg,e164:()=>Og,email:()=>Mg,emoji:()=>Tg,extendedDuration:()=>wg,guid:()=>mg,hostname:()=>xg,html5Email:()=>Sg,integer:()=>zg,ipv4:()=>Ug,ipv6:()=>Jg,ksuid:()=>hg,lowercase:()=>ts,nanoid:()=>Dg,null:()=>As,number:()=>Xg,rfc5322Email:()=>kg,string:()=>Wg,time:()=>Vg,ulid:()=>ug,undefined:()=>es,unicodeEmail:()=>Gg,uppercase:()=>is,uuid:()=>yg,uuid4:()=>fg,uuid6:()=>Rg,uuid7:()=>Ng,xid:()=>dg});var cg=/^[cC][^\s-]{8,}$/,lg=/^[0-9a-z]+$/,ug=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,dg=/^[0-9a-vA-V]{20}$/,hg=/^[A-Za-z0-9]{27}$/,Dg=/^[a-zA-Z0-9_-]{21}$/,pg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wg=/^[-+]?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)?)??$/,mg=/^([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})$/,yg=A=>A?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${A}[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)$/,fg=yg(4),Rg=yg(6),Ng=yg(7),Mg=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Sg=/^[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])?)*$/,kg=/^(([^<>()\[\]\\.,;:\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,}))$/,Gg=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Lg=/^[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])?)*$/,Fg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Tg(){return new RegExp(Fg,"u")}var Ug=/^(?:(?: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])$/,Jg=/^(([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})$/,_g=/^((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])$/,Yg=/^(([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])$/,bg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Hg=/^[A-Za-z0-9_-]*$/,xg=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Kg=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Og=/^\+(?:[0-9]){6,14}[0-9]$/,vg="(?:(?:\\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])))",qg=new RegExp(`^${vg}$`);function Pg(A){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof A.precision?-1===A.precision?`${e}`:0===A.precision?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${A.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vg(A){return new RegExp(`^${Pg(A)}$`)}function jg(A){const e=Pg({precision:A.precision}),t=["Z"];A.local&&t.push(""),A.offset&&t.push("([+-]\\d{2}:\\d{2})");const i=`${e}(?:${t.join("|")})`;return new RegExp(`^${vg}T(?:${i})$`)}var Wg=A=>new RegExp(`^${A?`[\\s\\S]{${A?.minimum??0},${A?.maximum??""}}`:"[\\s\\S]*"}$`),Zg=/^\d+n?$/,zg=/^\d+$/,Xg=/^-?\d+(?:\.\d+)?/i,$g=/true|false/i,As=/null/i,es=/undefined/i,ts=/^[^A-Z]*$/,is=/^[^a-z]*$/,ns=Zn("$ZodCheck",(A,e)=>{var t;A._zod??(A._zod={}),A._zod.def=e,(t=A._zod).onattach??(t.onattach=[])}),os={number:"number",bigint:"bigint",object:"date"},gs=Zn("$ZodCheckLessThan",(A,e)=>{ns.init(A,e);const t=os[typeof e.value];A._zod.onattach.push(A=>{const t=A._zod.bag,i=(e.inclusive?t.maximum:t.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?i.value<=e.value:i.value{ns.init(A,e);const t=os[typeof e.value];A._zod.onattach.push(A=>{const t=A._zod.bag,i=(e.inclusive?t.minimum:t.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>i&&(e.inclusive?t.minimum=e.value:t.exclusiveMinimum=e.value)}),A._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:t,code:"too_small",minimum:e.value,input:i.value,inclusive:e.inclusive,inst:A,continue:!e.abort})}}),rs=Zn("$ZodCheckMultipleOf",(A,e)=>{ns.init(A,e),A._zod.onattach.push(A=>{var t;(t=A._zod.bag).multipleOf??(t.multipleOf=e.value)}),A._zod.check=t=>{if(typeof t.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof t.value?t.value%e.value===BigInt(0):0===Qo(t.value,e.value))||t.issues.push({origin:typeof t.value,code:"not_multiple_of",divisor:e.value,input:t.value,inst:A,continue:!e.abort})}}),Is=Zn("$ZodCheckNumberFormat",(A,e)=>{ns.init(A,e),e.format=e.format||"float64";const t=e.format?.includes("int"),i=t?"int":"number",[n,o]=Uo[e.format];A._zod.onattach.push(A=>{const i=A._zod.bag;i.format=e.format,i.minimum=n,i.maximum=o,t&&(i.pattern=zg)}),A._zod.check=g=>{const s=g.value;if(t){if(!Number.isInteger(s))return void g.issues.push({expected:i,format:e.format,code:"invalid_type",input:s,inst:A});if(!Number.isSafeInteger(s))return void(s>0?g.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:A,origin:i,continue:!e.abort}):g.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:A,origin:i,continue:!e.abort}))}so&&g.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inst:A})}}),as=Zn("$ZodCheckBigIntFormat",(A,e)=>{ns.init(A,e);const[t,i]=Jo[e.format];A._zod.onattach.push(A=>{const n=A._zod.bag;n.format=e.format,n.minimum=t,n.maximum=i}),A._zod.check=n=>{const o=n.value;oi&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:A})}}),Cs=Zn("$ZodCheckMaxSize",(A,e)=>{var t;ns.init(A,e),(t=A._zod.def).when??(t.when=A=>{const e=A.value;return!Co(e)&&void 0!==e.size}),A._zod.onattach.push(A=>{const t=A._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const i=t.value;i.size<=e.maximum||t.issues.push({origin:Vo(i),code:"too_big",maximum:e.maximum,input:i,inst:A,continue:!e.abort})}}),Bs=Zn("$ZodCheckMinSize",(A,e)=>{var t;ns.init(A,e),(t=A._zod.def).when??(t.when=A=>{const e=A.value;return!Co(e)&&void 0!==e.size}),A._zod.onattach.push(A=>{const t=A._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(A._zod.bag.minimum=e.minimum)}),A._zod.check=t=>{const i=t.value;i.size>=e.minimum||t.issues.push({origin:Vo(i),code:"too_small",minimum:e.minimum,input:i,inst:A,continue:!e.abort})}}),Qs=Zn("$ZodCheckSizeEquals",(A,e)=>{var t;ns.init(A,e),(t=A._zod.def).when??(t.when=A=>{const e=A.value;return!Co(e)&&void 0!==e.size}),A._zod.onattach.push(A=>{const t=A._zod.bag;t.minimum=e.size,t.maximum=e.size,t.size=e.size}),A._zod.check=t=>{const i=t.value,n=i.size;if(n===e.size)return;const o=n>e.size;t.issues.push({origin:Vo(i),...o?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:t.value,inst:A,continue:!e.abort})}}),Es=Zn("$ZodCheckMaxLength",(A,e)=>{var t;ns.init(A,e),(t=A._zod.def).when??(t.when=A=>{const e=A.value;return!Co(e)&&void 0!==e.length}),A._zod.onattach.push(A=>{const t=A._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{const i=t.value;if(i.length<=e.maximum)return;const n=jo(i);t.issues.push({origin:n,code:"too_big",maximum:e.maximum,inclusive:!0,input:i,inst:A,continue:!e.abort})}}),cs=Zn("$ZodCheckMinLength",(A,e)=>{var t;ns.init(A,e),(t=A._zod.def).when??(t.when=A=>{const e=A.value;return!Co(e)&&void 0!==e.length}),A._zod.onattach.push(A=>{const t=A._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>t&&(A._zod.bag.minimum=e.minimum)}),A._zod.check=t=>{const i=t.value;if(i.length>=e.minimum)return;const n=jo(i);t.issues.push({origin:n,code:"too_small",minimum:e.minimum,inclusive:!0,input:i,inst:A,continue:!e.abort})}}),ls=Zn("$ZodCheckLengthEquals",(A,e)=>{var t;ns.init(A,e),(t=A._zod.def).when??(t.when=A=>{const e=A.value;return!Co(e)&&void 0!==e.length}),A._zod.onattach.push(A=>{const t=A._zod.bag;t.minimum=e.length,t.maximum=e.length,t.length=e.length}),A._zod.check=t=>{const i=t.value,n=i.length;if(n===e.length)return;const o=jo(i),g=n>e.length;t.issues.push({origin:o,...g?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:t.value,inst:A,continue:!e.abort})}}),us=Zn("$ZodCheckStringFormat",(A,e)=>{var t,i;ns.init(A,e),A._zod.onattach.push(A=>{const t=A._zod.bag;t.format=e.format,e.pattern&&(t.patterns??(t.patterns=new Set),t.patterns.add(e.pattern))}),e.pattern?(t=A._zod).check??(t.check=t=>{e.pattern.lastIndex=0,e.pattern.test(t.value)||t.issues.push({origin:"string",code:"invalid_format",format:e.format,input:t.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:A,continue:!e.abort})}):(i=A._zod).check??(i.check=()=>{})}),ds=Zn("$ZodCheckRegex",(A,e)=>{us.init(A,e),A._zod.check=t=>{e.pattern.lastIndex=0,e.pattern.test(t.value)||t.issues.push({origin:"string",code:"invalid_format",format:"regex",input:t.value,pattern:e.pattern.toString(),inst:A,continue:!e.abort})}}),hs=Zn("$ZodCheckLowerCase",(A,e)=>{e.pattern??(e.pattern=ts),us.init(A,e)}),Ds=Zn("$ZodCheckUpperCase",(A,e)=>{e.pattern??(e.pattern=is),us.init(A,e)}),ps=Zn("$ZodCheckIncludes",(A,e)=>{ns.init(A,e);const t=So(e.includes),i=new RegExp("number"==typeof e.position?`^.{${e.position}}${t}`:t);e.pattern=i,A._zod.onattach.push(A=>{const e=A._zod.bag;e.patterns??(e.patterns=new Set),e.patterns.add(i)}),A._zod.check=t=>{t.value.includes(e.includes,e.position)||t.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:t.value,inst:A,continue:!e.abort})}}),ws=Zn("$ZodCheckStartsWith",(A,e)=>{ns.init(A,e);const t=new RegExp(`^${So(e.prefix)}.*`);e.pattern??(e.pattern=t),A._zod.onattach.push(A=>{const e=A._zod.bag;e.patterns??(e.patterns=new Set),e.patterns.add(t)}),A._zod.check=t=>{t.value.startsWith(e.prefix)||t.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:t.value,inst:A,continue:!e.abort})}}),ms=Zn("$ZodCheckEndsWith",(A,e)=>{ns.init(A,e);const t=new RegExp(`.*${So(e.suffix)}$`);e.pattern??(e.pattern=t),A._zod.onattach.push(A=>{const e=A._zod.bag;e.patterns??(e.patterns=new Set),e.patterns.add(t)}),A._zod.check=t=>{t.value.endsWith(e.suffix)||t.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:t.value,inst:A,continue:!e.abort})}});function ys(A,e,t){A.issues.length&&e.issues.push(...vo(t,A.issues))}var fs=Zn("$ZodCheckProperty",(A,e)=>{ns.init(A,e),A._zod.check=A=>{const t=e.schema._zod.run({value:A.value[e.property],issues:[]},{});if(t instanceof Promise)return t.then(t=>ys(t,A,e.property));ys(t,A,e.property)}}),Rs=Zn("$ZodCheckMimeType",(A,e)=>{ns.init(A,e);const t=new Set(e.mime);A._zod.onattach.push(A=>{A._zod.bag.mime=e.mime}),A._zod.check=i=>{t.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:A})}}),Ns=Zn("$ZodCheckOverwrite",(A,e)=>{ns.init(A,e),A._zod.check=A=>{A.value=e.tx(A.value)}}),Ms=class{constructor(A=[]){this.content=[],this.indent=0,this&&(this.args=A)}indented(A){this.indent+=1,A(this),this.indent-=1}write(A){if("function"==typeof A)return A(this,{execution:"sync"}),void A(this,{execution:"async"});const e=A.split("\n").filter(A=>A),t=Math.min(...e.map(A=>A.length-A.trimStart().length)),i=e.map(A=>A.slice(t)).map(A=>" ".repeat(2*this.indent)+A);for(const A of i)this.content.push(A)}compile(){const A=Function,e=this?.args;return new A(...e,[...(this?.content??[""]).map(A=>` ${A}`)].join("\n"))}},Ss={major:4,minor:0,patch:0},ks=Zn("$ZodType",(A,e)=>{var t;A??(A={}),A._zod.def=e,A._zod.bag=A._zod.bag||{},A._zod.version=Ss;const i=[...A._zod.def.checks??[]];A._zod.traits.has("$ZodCheck")&&i.unshift(A);for(const e of i)for(const t of e._zod.onattach)t(A);if(0===i.length)(t=A._zod).deferred??(t.deferred=[]),A._zod.deferred?.push(()=>{A._zod.run=A._zod.parse});else{const e=(A,e,t)=>{let i,n=Oo(A);for(const o of e){if(o._zod.def.when){if(!o._zod.def.when(A))continue}else if(n)continue;const e=A.issues.length,g=o._zod.check(A);if(g instanceof Promise&&!1===t?.async)throw new Xn;if(i||g instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await g,A.issues.length!==e&&(n||(n=Oo(A,e)))});else{if(A.issues.length===e)continue;n||(n=Oo(A,e))}}return i?i.then(()=>A):A};A._zod.run=(t,n)=>{const o=A._zod.parse(t,n);if(o instanceof Promise){if(!1===n.async)throw new Xn;return o.then(A=>e(A,i,n))}return e(o,i,n)}}A["~standard"]={validate:e=>{try{const t=Cg(A,e);return t.success?{value:t.data}:{issues:t.error?.issues}}catch(t){return Qg(A,e).then(A=>A.success?{value:A.data}:{issues:A.error?.issues})}},vendor:"zod",version:1}}),Gs=Zn("$ZodString",(A,e)=>{ks.init(A,e),A._zod.pattern=[...A?._zod.bag?.patterns??[]].pop()??Wg(A._zod.bag),A._zod.parse=(t,i)=>{if(e.coerce)try{t.value=String(t.value)}catch(A){}return"string"==typeof t.value||t.issues.push({expected:"string",code:"invalid_type",input:t.value,inst:A}),t}}),Ls=Zn("$ZodStringFormat",(A,e)=>{us.init(A,e),Gs.init(A,e)}),Fs=Zn("$ZodGUID",(A,e)=>{e.pattern??(e.pattern=mg),Ls.init(A,e)}),Ts=Zn("$ZodUUID",(A,e)=>{if(e.version){const A={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(void 0===A)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=yg(A))}else e.pattern??(e.pattern=yg());Ls.init(A,e)}),Us=Zn("$ZodEmail",(A,e)=>{e.pattern??(e.pattern=Mg),Ls.init(A,e)}),Js=Zn("$ZodURL",(A,e)=>{Ls.init(A,e),A._zod.check=t=>{try{const i=t.value,n=new URL(i),o=n.href;return e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:xg.source,input:t.value,inst:A,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||t.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:t.value,inst:A,continue:!e.abort})),void(!i.endsWith("/")&&o.endsWith("/")?t.value=o.slice(0,-1):t.value=o)}catch(i){t.issues.push({code:"invalid_format",format:"url",input:t.value,inst:A,continue:!e.abort})}}}),_s=Zn("$ZodEmoji",(A,e)=>{e.pattern??(e.pattern=Tg()),Ls.init(A,e)}),Ys=Zn("$ZodNanoID",(A,e)=>{e.pattern??(e.pattern=Dg),Ls.init(A,e)}),bs=Zn("$ZodCUID",(A,e)=>{e.pattern??(e.pattern=cg),Ls.init(A,e)}),Hs=Zn("$ZodCUID2",(A,e)=>{e.pattern??(e.pattern=lg),Ls.init(A,e)}),xs=Zn("$ZodULID",(A,e)=>{e.pattern??(e.pattern=ug),Ls.init(A,e)}),Ks=Zn("$ZodXID",(A,e)=>{e.pattern??(e.pattern=dg),Ls.init(A,e)}),Os=Zn("$ZodKSUID",(A,e)=>{e.pattern??(e.pattern=hg),Ls.init(A,e)}),vs=Zn("$ZodISODateTime",(A,e)=>{e.pattern??(e.pattern=jg(e)),Ls.init(A,e)}),qs=Zn("$ZodISODate",(A,e)=>{e.pattern??(e.pattern=qg),Ls.init(A,e)}),Ps=Zn("$ZodISOTime",(A,e)=>{e.pattern??(e.pattern=Vg(e)),Ls.init(A,e)}),Vs=Zn("$ZodISODuration",(A,e)=>{e.pattern??(e.pattern=pg),Ls.init(A,e)}),js=Zn("$ZodIPv4",(A,e)=>{e.pattern??(e.pattern=Ug),Ls.init(A,e),A._zod.onattach.push(A=>{A._zod.bag.format="ipv4"})}),Ws=Zn("$ZodIPv6",(A,e)=>{e.pattern??(e.pattern=Jg),Ls.init(A,e),A._zod.onattach.push(A=>{A._zod.bag.format="ipv6"}),A._zod.check=t=>{try{new URL(`http://[${t.value}]`)}catch{t.issues.push({code:"invalid_format",format:"ipv6",input:t.value,inst:A,continue:!e.abort})}}}),Zs=Zn("$ZodCIDRv4",(A,e)=>{e.pattern??(e.pattern=_g),Ls.init(A,e)}),zs=Zn("$ZodCIDRv6",(A,e)=>{e.pattern??(e.pattern=Yg),Ls.init(A,e),A._zod.check=t=>{const[i,n]=t.value.split("/");try{if(!n)throw new Error;const A=Number(n);if(`${A}`!==n)throw new Error;if(A<0||A>128)throw new Error;new URL(`http://[${i}]`)}catch{t.issues.push({code:"invalid_format",format:"cidrv6",input:t.value,inst:A,continue:!e.abort})}}});function Xs(A){if(""===A)return!0;if(A.length%4!=0)return!1;try{return atob(A),!0}catch{return!1}}var $s=Zn("$ZodBase64",(A,e)=>{e.pattern??(e.pattern=bg),Ls.init(A,e),A._zod.onattach.push(A=>{A._zod.bag.contentEncoding="base64"}),A._zod.check=t=>{Xs(t.value)||t.issues.push({code:"invalid_format",format:"base64",input:t.value,inst:A,continue:!e.abort})}});function Ar(A){if(!Hg.test(A))return!1;const e=A.replace(/[-_]/g,A=>"-"===A?"+":"/");return Xs(e.padEnd(4*Math.ceil(e.length/4),"="))}var er=Zn("$ZodBase64URL",(A,e)=>{e.pattern??(e.pattern=Hg),Ls.init(A,e),A._zod.onattach.push(A=>{A._zod.bag.contentEncoding="base64url"}),A._zod.check=t=>{Ar(t.value)||t.issues.push({code:"invalid_format",format:"base64url",input:t.value,inst:A,continue:!e.abort})}}),tr=Zn("$ZodE164",(A,e)=>{e.pattern??(e.pattern=Og),Ls.init(A,e)});function ir(A,e=null){try{const t=A.split(".");if(3!==t.length)return!1;const[i]=t;if(!i)return!1;const n=JSON.parse(atob(i));return!("typ"in n&&"JWT"!==n?.typ||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var nr=Zn("$ZodJWT",(A,e)=>{Ls.init(A,e),A._zod.check=t=>{ir(t.value,e.alg)||t.issues.push({code:"invalid_format",format:"jwt",input:t.value,inst:A,continue:!e.abort})}}),or=Zn("$ZodCustomStringFormat",(A,e)=>{Ls.init(A,e),A._zod.check=t=>{e.fn(t.value)||t.issues.push({code:"invalid_format",format:e.format,input:t.value,inst:A,continue:!e.abort})}}),gr=Zn("$ZodNumber",(A,e)=>{ks.init(A,e),A._zod.pattern=A._zod.bag.pattern??Xg,A._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Number(t.value)}catch(A){}const n=t.value;if("number"==typeof n&&!Number.isNaN(n)&&Number.isFinite(n))return t;const o="number"==typeof n?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return t.issues.push({expected:"number",code:"invalid_type",input:n,inst:A,...o?{received:o}:{}}),t}}),sr=Zn("$ZodNumber",(A,e)=>{Is.init(A,e),gr.init(A,e)}),rr=Zn("$ZodBoolean",(A,e)=>{ks.init(A,e),A._zod.pattern=$g,A._zod.parse=(t,i)=>{if(e.coerce)try{t.value=Boolean(t.value)}catch(A){}const n=t.value;return"boolean"==typeof n||t.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:A}),t}}),Ir=Zn("$ZodBigInt",(A,e)=>{ks.init(A,e),A._zod.pattern=Zg,A._zod.parse=(t,i)=>{if(e.coerce)try{t.value=BigInt(t.value)}catch(A){}return"bigint"==typeof t.value||t.issues.push({expected:"bigint",code:"invalid_type",input:t.value,inst:A}),t}}),ar=Zn("$ZodBigInt",(A,e)=>{as.init(A,e),Ir.init(A,e)}),Cr=Zn("$ZodSymbol",(A,e)=>{ks.init(A,e),A._zod.parse=(e,t)=>{const i=e.value;return"symbol"==typeof i||e.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:A}),e}}),Br=Zn("$ZodUndefined",(A,e)=>{ks.init(A,e),A._zod.pattern=es,A._zod.values=new Set([void 0]),A._zod.optin="optional",A._zod.optout="optional",A._zod.parse=(e,t)=>{const i=e.value;return void 0===i||e.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:A}),e}}),Qr=Zn("$ZodNull",(A,e)=>{ks.init(A,e),A._zod.pattern=As,A._zod.values=new Set([null]),A._zod.parse=(e,t)=>{const i=e.value;return null===i||e.issues.push({expected:"null",code:"invalid_type",input:i,inst:A}),e}}),Er=Zn("$ZodAny",(A,e)=>{ks.init(A,e),A._zod.parse=A=>A}),cr=Zn("$ZodUnknown",(A,e)=>{ks.init(A,e),A._zod.parse=A=>A}),lr=Zn("$ZodNever",(A,e)=>{ks.init(A,e),A._zod.parse=(e,t)=>(e.issues.push({expected:"never",code:"invalid_type",input:e.value,inst:A}),e)}),ur=Zn("$ZodVoid",(A,e)=>{ks.init(A,e),A._zod.parse=(e,t)=>{const i=e.value;return void 0===i||e.issues.push({expected:"void",code:"invalid_type",input:i,inst:A}),e}}),dr=Zn("$ZodDate",(A,e)=>{ks.init(A,e),A._zod.parse=(t,i)=>{if(e.coerce)try{t.value=new Date(t.value)}catch(A){}const n=t.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||t.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:A}),t}});function hr(A,e,t){A.issues.length&&e.issues.push(...vo(t,A.issues)),e.value[t]=A.value}var Dr=Zn("$ZodArray",(A,e)=>{ks.init(A,e),A._zod.parse=(t,i)=>{const n=t.value;if(!Array.isArray(n))return t.issues.push({expected:"array",code:"invalid_type",input:n,inst:A}),t;t.value=Array(n.length);const o=[];for(let A=0;Ahr(e,t,A))):hr(s,t,A)}return o.length?Promise.all(o).then(()=>t):t}});function pr(A,e,t){A.issues.length&&e.issues.push(...vo(t,A.issues)),e.value[t]=A.value}function wr(A,e,t,i){A.issues.length?void 0===i[t]?e.value[t]=t in i?void 0:A.value:e.issues.push(...vo(t,A.issues)):void 0===A.value?t in i&&(e.value[t]=void 0):e.value[t]=A.value}var mr=Zn("$ZodObject",(A,e)=>{ks.init(A,e);const t=ao(()=>{const A=Object.keys(e.shape);for(const t of A)if(!(e.shape[t]instanceof ks))throw new Error(`Invalid element at key "${t}": expected a Zod schema`);const t=To(e.shape);return{shape:e.shape,keys:A,keySet:new Set(A),numKeys:A.length,optionalKeys:new Set(t)}});let i;Eo(A._zod,"propValues",()=>{const A=e.shape,t={};for(const e in A){const i=A[e]._zod;if(i.values){t[e]??(t[e]=new Set);for(const A of i.values)t[e].add(A)}}return t});const n=wo,o=!$n.jitless,g=o&&mo.value,s=e.catchall;let r;A._zod.parse=(I,a)=>{r??(r=t.value);const C=I.value;if(!n(C))return I.issues.push({expected:"object",code:"invalid_type",input:C,inst:A}),I;const B=[];if(o&&g&&!1===a?.async&&!0!==a.jitless)i||(i=(A=>{const e=new Ms(["shape","payload","ctx"]),i=t.value,n=A=>{const e=Do(A);return`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`};e.write("const input = payload.value;");const o=Object.create(null);let g=0;for(const A of i.keys)o[A]="key_"+g++;e.write("const newResult = {}");for(const A of i.keys)if(i.optionalKeys.has(A)){const t=o[A];e.write(`const ${t} = ${n(A)};`);const i=Do(A);e.write(`\n if (${t}.issues.length) {\n if (input[${i}] === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${t}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}],\n }))\n );\n }\n } else if (${t}.value === undefined) {\n if (${i} in input) newResult[${i}] = undefined;\n } else {\n newResult[${i}] = ${t}.value;\n }\n `)}else{const t=o[A];e.write(`const ${t} = ${n(A)};`),e.write(`\n if (${t}.issues.length) payload.issues = payload.issues.concat(${t}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${Do(A)}, ...iss.path] : [${Do(A)}]\n })));`),e.write(`newResult[${Do(A)}] = ${t}.value`)}e.write("payload.value = newResult;"),e.write("return payload;");const s=e.compile();return(e,t)=>s(A,e,t)})(e.shape)),I=i(I,a);else{I.value={};const A=r.shape;for(const e of r.keys){const t=A[e],i=t._zod.run({value:C[e],issues:[]},a),n="optional"===t._zod.optin&&"optional"===t._zod.optout;i instanceof Promise?B.push(i.then(A=>n?wr(A,I,e,C):pr(A,I,e))):n?wr(i,I,e,C):pr(i,I,e)}}if(!s)return B.length?Promise.all(B).then(()=>I):I;const Q=[],E=r.keySet,c=s._zod,l=c.def.type;for(const A of Object.keys(C)){if(E.has(A))continue;if("never"===l){Q.push(A);continue}const e=c.run({value:C[A],issues:[]},a);e instanceof Promise?B.push(e.then(e=>pr(e,I,A))):pr(e,I,A)}return Q.length&&I.issues.push({code:"unrecognized_keys",keys:Q,input:C,inst:A}),B.length?Promise.all(B).then(()=>I):I}});function yr(A,e,t,i){for(const t of A)if(0===t.issues.length)return e.value=t.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:t,errors:A.map(A=>A.issues.map(A=>Po(A,i,Ao())))}),e}var fr=Zn("$ZodUnion",(A,e)=>{ks.init(A,e),Eo(A._zod,"optin",()=>e.options.some(A=>"optional"===A._zod.optin)?"optional":void 0),Eo(A._zod,"optout",()=>e.options.some(A=>"optional"===A._zod.optout)?"optional":void 0),Eo(A._zod,"values",()=>{if(e.options.every(A=>A._zod.values))return new Set(e.options.flatMap(A=>Array.from(A._zod.values)))}),Eo(A._zod,"pattern",()=>{if(e.options.every(A=>A._zod.pattern)){const A=e.options.map(A=>A._zod.pattern);return new RegExp(`^(${A.map(A=>Bo(A.source)).join("|")})$`)}}),A._zod.parse=(t,i)=>{let n=!1;const o=[];for(const A of e.options){const e=A._zod.run({value:t.value,issues:[]},i);if(e instanceof Promise)o.push(e),n=!0;else{if(0===e.issues.length)return e;o.push(e)}}return n?Promise.all(o).then(e=>yr(e,t,A,i)):yr(o,t,A,i)}}),Rr=Zn("$ZodDiscriminatedUnion",(A,e)=>{fr.init(A,e);const t=A._zod.parse;Eo(A._zod,"propValues",()=>{const A={};for(const t of e.options){const i=t._zod.propValues;if(!i||0===Object.keys(i).length)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(t)}"`);for(const[e,t]of Object.entries(i)){A[e]||(A[e]=new Set);for(const i of t)A[e].add(i)}}return A});const i=ao(()=>{const A=e.options,t=new Map;for(const i of A){const A=i._zod.propValues[e.discriminator];if(!A||0===A.size)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(const e of A){if(t.has(e))throw new Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,i)}}return t});A._zod.parse=(n,o)=>{const g=n.value;if(!wo(g))return n.issues.push({code:"invalid_type",expected:"object",input:g,inst:A}),n;const s=i.value.get(g?.[e.discriminator]);return s?s._zod.run(n,o):e.unionFallback?t(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:g,path:[e.discriminator],inst:A}),n)}}),Nr=Zn("$ZodIntersection",(A,e)=>{ks.init(A,e),A._zod.parse=(A,t)=>{const i=A.value,n=e.left._zod.run({value:i,issues:[]},t),o=e.right._zod.run({value:i,issues:[]},t);return n instanceof Promise||o instanceof Promise?Promise.all([n,o]).then(([e,t])=>Sr(A,e,t)):Sr(A,n,o)}});function Mr(A,e){if(A===e)return{valid:!0,data:A};if(A instanceof Date&&e instanceof Date&&+A===+e)return{valid:!0,data:A};if(yo(A)&&yo(e)){const t=Object.keys(e),i=Object.keys(A).filter(A=>-1!==t.indexOf(A)),n={...A,...e};for(const t of i){const i=Mr(A[t],e[t]);if(!i.valid)return{valid:!1,mergeErrorPath:[t,...i.mergeErrorPath]};n[t]=i.data}return{valid:!0,data:n}}if(Array.isArray(A)&&Array.isArray(e)){if(A.length!==e.length)return{valid:!1,mergeErrorPath:[]};const t=[];for(let i=0;i{ks.init(A,e);const t=e.items,i=t.length-[...t].reverse().findIndex(A=>"optional"!==A._zod.optin);A._zod.parse=(n,o)=>{const g=n.value;if(!Array.isArray(g))return n.issues.push({input:g,inst:A,expected:"tuple",code:"invalid_type"}),n;n.value=[];const s=[];if(!e.rest){const e=g.length>t.length,o=g.length=g.length&&r>=i)continue;const e=A._zod.run({value:g[r],issues:[]},o);e instanceof Promise?s.push(e.then(A=>Gr(A,n,r))):Gr(e,n,r)}if(e.rest){const A=g.slice(t.length);for(const t of A){r++;const A=e.rest._zod.run({value:t,issues:[]},o);A instanceof Promise?s.push(A.then(A=>Gr(A,n,r))):Gr(A,n,r)}}return s.length?Promise.all(s).then(()=>n):n}});function Gr(A,e,t){A.issues.length&&e.issues.push(...vo(t,A.issues)),e.value[t]=A.value}var Lr=Zn("$ZodRecord",(A,e)=>{ks.init(A,e),A._zod.parse=(t,i)=>{const n=t.value;if(!yo(n))return t.issues.push({expected:"record",code:"invalid_type",input:n,inst:A}),t;const o=[];if(e.keyType._zod.values){const g=e.keyType._zod.values;t.value={};for(const A of g)if("string"==typeof A||"number"==typeof A||"symbol"==typeof A){const g=e.valueType._zod.run({value:n[A],issues:[]},i);g instanceof Promise?o.push(g.then(e=>{e.issues.length&&t.issues.push(...vo(A,e.issues)),t.value[A]=e.value})):(g.issues.length&&t.issues.push(...vo(A,g.issues)),t.value[A]=g.value)}let s;for(const A in n)g.has(A)||(s=s??[],s.push(A));s&&s.length>0&&t.issues.push({code:"unrecognized_keys",input:n,inst:A,keys:s})}else{t.value={};for(const g of Reflect.ownKeys(n)){if("__proto__"===g)continue;const s=e.keyType._zod.run({value:g,issues:[]},i);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){t.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(A=>Po(A,i,Ao())),input:g,path:[g],inst:A}),t.value[s.value]=s.value;continue}const r=e.valueType._zod.run({value:n[g],issues:[]},i);r instanceof Promise?o.push(r.then(A=>{A.issues.length&&t.issues.push(...vo(g,A.issues)),t.value[s.value]=A.value})):(r.issues.length&&t.issues.push(...vo(g,r.issues)),t.value[s.value]=r.value)}}return o.length?Promise.all(o).then(()=>t):t}}),Fr=Zn("$ZodMap",(A,e)=>{ks.init(A,e),A._zod.parse=(t,i)=>{const n=t.value;if(!(n instanceof Map))return t.issues.push({expected:"map",code:"invalid_type",input:n,inst:A}),t;const o=[];t.value=new Map;for(const[g,s]of n){const r=e.keyType._zod.run({value:g,issues:[]},i),I=e.valueType._zod.run({value:s,issues:[]},i);r instanceof Promise||I instanceof Promise?o.push(Promise.all([r,I]).then(([e,o])=>{Tr(e,o,t,g,n,A,i)})):Tr(r,I,t,g,n,A,i)}return o.length?Promise.all(o).then(()=>t):t}});function Tr(A,e,t,i,n,o,g){A.issues.length&&(No.has(typeof i)?t.issues.push(...vo(i,A.issues)):t.issues.push({origin:"map",code:"invalid_key",input:n,inst:o,issues:A.issues.map(A=>Po(A,g,Ao()))})),e.issues.length&&(No.has(typeof i)?t.issues.push(...vo(i,e.issues)):t.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(A=>Po(A,g,Ao()))})),t.value.set(A.value,e.value)}var Ur=Zn("$ZodSet",(A,e)=>{ks.init(A,e),A._zod.parse=(t,i)=>{const n=t.value;if(!(n instanceof Set))return t.issues.push({input:n,inst:A,expected:"set",code:"invalid_type"}),t;const o=[];t.value=new Set;for(const A of n){const n=e.valueType._zod.run({value:A,issues:[]},i);n instanceof Promise?o.push(n.then(A=>Jr(A,t))):Jr(n,t)}return o.length?Promise.all(o).then(()=>t):t}});function Jr(A,e){A.issues.length&&e.issues.push(...A.issues),e.value.add(A.value)}var _r=Zn("$ZodEnum",(A,e)=>{ks.init(A,e);const t=so(e.entries);A._zod.values=new Set(t),A._zod.pattern=new RegExp(`^(${t.filter(A=>No.has(typeof A)).map(A=>"string"==typeof A?So(A):A.toString()).join("|")})$`),A._zod.parse=(e,i)=>{const n=e.value;return A._zod.values.has(n)||e.issues.push({code:"invalid_value",values:t,input:n,inst:A}),e}}),Yr=Zn("$ZodLiteral",(A,e)=>{ks.init(A,e),A._zod.values=new Set(e.values),A._zod.pattern=new RegExp(`^(${e.values.map(A=>"string"==typeof A?So(A):A?A.toString():String(A)).join("|")})$`),A._zod.parse=(t,i)=>{const n=t.value;return A._zod.values.has(n)||t.issues.push({code:"invalid_value",values:e.values,input:n,inst:A}),t}}),br=Zn("$ZodFile",(A,e)=>{ks.init(A,e),A._zod.parse=(e,t)=>{const i=e.value;return i instanceof File||e.issues.push({expected:"file",code:"invalid_type",input:i,inst:A}),e}}),Hr=Zn("$ZodTransform",(A,e)=>{ks.init(A,e),A._zod.parse=(A,t)=>{const i=e.transform(A.value,A);if(t.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(A.value=e,A));if(i instanceof Promise)throw new Xn;return A.value=i,A}}),xr=Zn("$ZodOptional",(A,e)=>{ks.init(A,e),A._zod.optin="optional",A._zod.optout="optional",Eo(A._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Eo(A._zod,"pattern",()=>{const A=e.innerType._zod.pattern;return A?new RegExp(`^(${Bo(A.source)})?$`):void 0}),A._zod.parse=(A,t)=>"optional"===e.innerType._zod.optin?e.innerType._zod.run(A,t):void 0===A.value?A:e.innerType._zod.run(A,t)}),Kr=Zn("$ZodNullable",(A,e)=>{ks.init(A,e),Eo(A._zod,"optin",()=>e.innerType._zod.optin),Eo(A._zod,"optout",()=>e.innerType._zod.optout),Eo(A._zod,"pattern",()=>{const A=e.innerType._zod.pattern;return A?new RegExp(`^(${Bo(A.source)}|null)$`):void 0}),Eo(A._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),A._zod.parse=(A,t)=>null===A.value?A:e.innerType._zod.run(A,t)}),Or=Zn("$ZodDefault",(A,e)=>{ks.init(A,e),A._zod.optin="optional",Eo(A._zod,"values",()=>e.innerType._zod.values),A._zod.parse=(A,t)=>{if(void 0===A.value)return A.value=e.defaultValue,A;const i=e.innerType._zod.run(A,t);return i instanceof Promise?i.then(A=>vr(A,e)):vr(i,e)}});function vr(A,e){return void 0===A.value&&(A.value=e.defaultValue),A}var qr=Zn("$ZodPrefault",(A,e)=>{ks.init(A,e),A._zod.optin="optional",Eo(A._zod,"values",()=>e.innerType._zod.values),A._zod.parse=(A,t)=>(void 0===A.value&&(A.value=e.defaultValue),e.innerType._zod.run(A,t))}),Pr=Zn("$ZodNonOptional",(A,e)=>{ks.init(A,e),Eo(A._zod,"values",()=>{const A=e.innerType._zod.values;return A?new Set([...A].filter(A=>void 0!==A)):void 0}),A._zod.parse=(t,i)=>{const n=e.innerType._zod.run(t,i);return n instanceof Promise?n.then(e=>Vr(e,A)):Vr(n,A)}});function Vr(A,e){return A.issues.length||void 0!==A.value||A.issues.push({code:"invalid_type",expected:"nonoptional",input:A.value,inst:e}),A}var jr=Zn("$ZodSuccess",(A,e)=>{ks.init(A,e),A._zod.parse=(A,t)=>{const i=e.innerType._zod.run(A,t);return i instanceof Promise?i.then(e=>(A.value=0===e.issues.length,A)):(A.value=0===i.issues.length,A)}}),Wr=Zn("$ZodCatch",(A,e)=>{ks.init(A,e),A._zod.optin="optional",Eo(A._zod,"optout",()=>e.innerType._zod.optout),Eo(A._zod,"values",()=>e.innerType._zod.values),A._zod.parse=(A,t)=>{const i=e.innerType._zod.run(A,t);return i instanceof Promise?i.then(i=>(A.value=i.value,i.issues.length&&(A.value=e.catchValue({...A,error:{issues:i.issues.map(A=>Po(A,t,Ao()))},input:A.value}),A.issues=[]),A)):(A.value=i.value,i.issues.length&&(A.value=e.catchValue({...A,error:{issues:i.issues.map(A=>Po(A,t,Ao()))},input:A.value}),A.issues=[]),A)}}),Zr=Zn("$ZodNaN",(A,e)=>{ks.init(A,e),A._zod.parse=(e,t)=>("number"==typeof e.value&&Number.isNaN(e.value)||e.issues.push({input:e.value,inst:A,expected:"nan",code:"invalid_type"}),e)}),zr=Zn("$ZodPipe",(A,e)=>{ks.init(A,e),Eo(A._zod,"values",()=>e.in._zod.values),Eo(A._zod,"optin",()=>e.in._zod.optin),Eo(A._zod,"optout",()=>e.out._zod.optout),A._zod.parse=(A,t)=>{const i=e.in._zod.run(A,t);return i instanceof Promise?i.then(A=>Xr(A,e,t)):Xr(i,e,t)}});function Xr(A,e,t){return Oo(A)?A:e.out._zod.run({value:A.value,issues:A.issues},t)}var $r=Zn("$ZodReadonly",(A,e)=>{ks.init(A,e),Eo(A._zod,"propValues",()=>e.innerType._zod.propValues),Eo(A._zod,"values",()=>e.innerType._zod.values),Eo(A._zod,"optin",()=>e.innerType._zod.optin),Eo(A._zod,"optout",()=>e.innerType._zod.optout),A._zod.parse=(A,t)=>{const i=e.innerType._zod.run(A,t);return i instanceof Promise?i.then(AI):AI(i)}});function AI(A){return A.value=Object.freeze(A.value),A}var eI=Zn("$ZodTemplateLiteral",(A,e)=>{ks.init(A,e);const t=[];for(const A of e.parts)if(A instanceof ks){if(!A._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...A._zod.traits].shift()}`);const e=A._zod.pattern instanceof RegExp?A._zod.pattern.source:A._zod.pattern;if(!e)throw new Error(`Invalid template literal part: ${A._zod.traits}`);const i=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;t.push(e.slice(i,n))}else{if(null!==A&&!Mo.has(typeof A))throw new Error(`Invalid template literal part: ${A}`);t.push(So(`${A}`))}A._zod.pattern=new RegExp(`^${t.join("")}$`),A._zod.parse=(e,t)=>"string"!=typeof e.value?(e.issues.push({input:e.value,inst:A,expected:"template_literal",code:"invalid_type"}),e):(A._zod.pattern.lastIndex=0,A._zod.pattern.test(e.value)||e.issues.push({input:e.value,inst:A,code:"invalid_format",format:"template_literal",pattern:A._zod.pattern.source}),e)}),tI=Zn("$ZodPromise",(A,e)=>{ks.init(A,e),A._zod.parse=(A,t)=>Promise.resolve(A.value).then(A=>e.innerType._zod.run({value:A,issues:[]},t))}),iI=Zn("$ZodLazy",(A,e)=>{ks.init(A,e),Eo(A._zod,"innerType",()=>e.getter()),Eo(A._zod,"pattern",()=>A._zod.innerType._zod.pattern),Eo(A._zod,"propValues",()=>A._zod.innerType._zod.propValues),Eo(A._zod,"optin",()=>A._zod.innerType._zod.optin),Eo(A._zod,"optout",()=>A._zod.innerType._zod.optout),A._zod.parse=(e,t)=>A._zod.innerType._zod.run(e,t)}),nI=Zn("$ZodCustom",(A,e)=>{ns.init(A,e),ks.init(A,e),A._zod.parse=(A,e)=>A,A._zod.check=t=>{const i=t.value,n=e.fn(i);if(n instanceof Promise)return n.then(e=>oI(e,t,i,A));oI(n,t,i,A)}});function oI(A,e,t,i){if(!A){const A={code:"custom",input:t,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(A.params=i._zod.def.params),e.issues.push(Wo(A))}}var gI={};r(gI,{ar:()=>rI,az:()=>aI,be:()=>QI,ca:()=>cI,cs:()=>uI,de:()=>hI,en:()=>pI,eo:()=>mI,es:()=>fI,fa:()=>NI,fi:()=>SI,fr:()=>GI,frCA:()=>FI,he:()=>UI,hu:()=>_I,id:()=>bI,it:()=>xI,ja:()=>OI,kh:()=>qI,ko:()=>VI,mk:()=>WI,ms:()=>zI,nl:()=>$I,no:()=>ea,ota:()=>ia,pl:()=>sa,ps:()=>oa,pt:()=>Ia,ru:()=>Ba,sl:()=>Ea,sv:()=>la,ta:()=>da,th:()=>Da,tr:()=>wa,ua:()=>ya,ur:()=>Ra,vi:()=>Ma,zhCN:()=>ka,zhTW:()=>La});var sI=()=>{const A={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function e(e){return A[e]??null}const t={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:"مدخل"};return A=>{switch(A.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${A.expected}، ولكن تم إدخال ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`مدخلات غير مقبولة: يفترض إدخال ${Fo(A.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?` أكبر من اللازم: يفترض أن تكون ${A.origin??"القيمة"} ${t} ${A.maximum.toString()} ${i.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${A.origin??"القيمة"} ${t} ${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`أصغر من اللازم: يفترض لـ ${A.origin} أن يكون ${t} ${A.minimum.toString()} ${i.unit}`:`أصغر من اللازم: يفترض لـ ${A.origin} أن يكون ${t} ${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`نَص غير مقبول: يجب أن يبدأ بـ "${A.prefix}"`:"ends_with"===e.format?`نَص غير مقبول: يجب أن ينتهي بـ "${e.suffix}"`:"includes"===e.format?`نَص غير مقبول: يجب أن يتضمَّن "${e.includes}"`:"regex"===e.format?`نَص غير مقبول: يجب أن يطابق النمط ${e.pattern}`:`${t[e.format]??A.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${A.divisor}`;case"unrecognized_keys":return`معرف${A.keys.length>1?"ات":""} غريب${A.keys.length>1?"ة":""}: ${ro(A.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${A.origin}`;case"invalid_union":default:return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${A.origin}`}}};function rI(){return{localeError:sI()}}var II=()=>{const A={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 e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Yanlış dəyər: gözlənilən ${A.expected}, daxil olan ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Yanlış dəyər: gözlənilən ${Fo(A.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Çox böyük: gözlənilən ${A.origin??"dəyər"} ${t}${A.maximum.toString()} ${i.unit??"element"}`:`Çox böyük: gözlənilən ${A.origin??"dəyər"} ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Çox kiçik: gözlənilən ${A.origin} ${t}${A.minimum.toString()} ${i.unit}`:`Çox kiçik: gözlənilən ${A.origin} ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Yanlış mətn: "${e.prefix}" ilə başlamalıdır`:"ends_with"===e.format?`Yanlış mətn: "${e.suffix}" ilə bitməlidir`:"includes"===e.format?`Yanlış mətn: "${e.includes}" daxil olmalıdır`:"regex"===e.format?`Yanlış mətn: ${e.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${t[e.format]??A.format}`}case"not_multiple_of":return`Yanlış ədəd: ${A.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${A.keys.length>1?"lar":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`${A.origin} daxilində yanlış açar`;case"invalid_union":default:return"Yanlış dəyər";case"invalid_element":return`${A.origin} daxilində yanlış dəyər`}}};function aI(){return{localeError:II()}}function CI(A,e,t,i){const n=Math.abs(A),o=n%10,g=n%100;return g>=11&&g<=19?i:1===o?e:o>=2&&o<=4?t:i}var BI=()=>{const A={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 e(e){return A[e]??null}const t={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:"увод"};return A=>{switch(A.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${A.expected}, атрымана ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"лік";case"object":if(Array.isArray(A))return"масіў";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Няправільны ўвод: чакалася ${Fo(A.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);if(i){const e=CI(Number(A.maximum),i.unit.one,i.unit.few,i.unit.many);return`Занадта вялікі: чакалася, што ${A.origin??"значэнне"} павінна ${i.verb} ${t}${A.maximum.toString()} ${e}`}return`Занадта вялікі: чакалася, што ${A.origin??"значэнне"} павінна быць ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);if(i){const e=CI(Number(A.minimum),i.unit.one,i.unit.few,i.unit.many);return`Занадта малы: чакалася, што ${A.origin} павінна ${i.verb} ${t}${A.minimum.toString()} ${e}`}return`Занадта малы: чакалася, што ${A.origin} павінна быць ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Няправільны радок: павінен пачынацца з "${e.prefix}"`:"ends_with"===e.format?`Няправільны радок: павінен заканчвацца на "${e.suffix}"`:"includes"===e.format?`Няправільны радок: павінен змяшчаць "${e.includes}"`:"regex"===e.format?`Няправільны радок: павінен адпавядаць шаблону ${e.pattern}`:`Няправільны ${t[e.format]??A.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${A.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${A.keys.length>1?"ключы":"ключ"}: ${ro(A.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${A.origin}`;case"invalid_union":default:return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${A.origin}`}}};function QI(){return{localeError:BI()}}var EI=()=>{const A={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Tipus invàlid: s'esperava ${A.expected}, s'ha rebut ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Valor invàlid: s'esperava ${Fo(A.values[0])}`:`Opció invàlida: s'esperava una de ${ro(A.values," o ")}`;case"too_big":{const t=A.inclusive?"com a màxim":"menys de",i=e(A.origin);return i?`Massa gran: s'esperava que ${A.origin??"el valor"} contingués ${t} ${A.maximum.toString()} ${i.unit??"elements"}`:`Massa gran: s'esperava que ${A.origin??"el valor"} fos ${t} ${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?"com a mínim":"més de",i=e(A.origin);return i?`Massa petit: s'esperava que ${A.origin} contingués ${t} ${A.minimum.toString()} ${i.unit}`:`Massa petit: s'esperava que ${A.origin} fos ${t} ${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Format invàlid: ha de començar amb "${e.prefix}"`:"ends_with"===e.format?`Format invàlid: ha d'acabar amb "${e.suffix}"`:"includes"===e.format?`Format invàlid: ha d'incloure "${e.includes}"`:"regex"===e.format?`Format invàlid: ha de coincidir amb el patró ${e.pattern}`:`Format invàlid per a ${t[e.format]??A.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${A.divisor}`;case"unrecognized_keys":return`Clau${A.keys.length>1?"s":""} no reconeguda${A.keys.length>1?"s":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${A.origin}`;case"invalid_union":default:return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${A.origin}`}}};function cI(){return{localeError:EI()}}var lI=()=>{const A={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 e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Neplatný vstup: očekáváno ${A.expected}, obdrženo ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":if(Array.isArray(A))return"pole";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Neplatný vstup: očekáváno ${Fo(A.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Hodnota je příliš velká: ${A.origin??"hodnota"} musí mít ${t}${A.maximum.toString()} ${i.unit??"prvků"}`:`Hodnota je příliš velká: ${A.origin??"hodnota"} musí být ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Hodnota je příliš malá: ${A.origin??"hodnota"} musí mít ${t}${A.minimum.toString()} ${i.unit??"prvků"}`:`Hodnota je příliš malá: ${A.origin??"hodnota"} musí být ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Neplatný řetězec: musí začínat na "${e.prefix}"`:"ends_with"===e.format?`Neplatný řetězec: musí končit na "${e.suffix}"`:"includes"===e.format?`Neplatný řetězec: musí obsahovat "${e.includes}"`:"regex"===e.format?`Neplatný řetězec: musí odpovídat vzoru ${e.pattern}`:`Neplatný formát ${t[e.format]??A.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${A.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${ro(A.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${A.origin}`;case"invalid_union":default:return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${A.origin}`}}};function uI(){return{localeError:lI()}}var dI=()=>{const A={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 e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Ungültige Eingabe: erwartet ${A.expected}, erhalten ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"Zahl";case"object":if(Array.isArray(A))return"Array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Ungültige Eingabe: erwartet ${Fo(A.values[0])}`:`Ungültige Option: erwartet eine von ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Zu groß: erwartet, dass ${A.origin??"Wert"} ${t}${A.maximum.toString()} ${i.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${A.origin??"Wert"} ${t}${A.maximum.toString()} ist`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Zu klein: erwartet, dass ${A.origin} ${t}${A.minimum.toString()} ${i.unit} hat`:`Zu klein: erwartet, dass ${A.origin} ${t}${A.minimum.toString()} ist`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Ungültiger String: muss mit "${e.prefix}" beginnen`:"ends_with"===e.format?`Ungültiger String: muss mit "${e.suffix}" enden`:"includes"===e.format?`Ungültiger String: muss "${e.includes}" enthalten`:"regex"===e.format?`Ungültiger String: muss dem Muster ${e.pattern} entsprechen`:`Ungültig: ${t[e.format]??A.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${A.divisor} sein`;case"unrecognized_keys":return`${A.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${ro(A.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${A.origin}`;case"invalid_union":default:return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${A.origin}`}}};function hI(){return{localeError:dI()}}var DI=()=>{const A={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Invalid input: expected ${A.expected}, received ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Invalid input: expected ${Fo(A.values[0])}`:`Invalid option: expected one of ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Too big: expected ${A.origin??"value"} to have ${t}${A.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${A.origin??"value"} to be ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Too small: expected ${A.origin} to have ${t}${A.minimum.toString()} ${i.unit}`:`Too small: expected ${A.origin} to be ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Invalid string: must start with "${e.prefix}"`:"ends_with"===e.format?`Invalid string: must end with "${e.suffix}"`:"includes"===e.format?`Invalid string: must include "${e.includes}"`:"regex"===e.format?`Invalid string: must match pattern ${e.pattern}`:`Invalid ${t[e.format]??A.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${A.divisor}`;case"unrecognized_keys":return`Unrecognized key${A.keys.length>1?"s":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Invalid key in ${A.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${A.origin}`}}};function pI(){return{localeError:DI()}}var wI=()=>{const A={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${A.expected}, riceviĝis ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"nombro";case"object":if(Array.isArray(A))return"tabelo";if(null===A)return"senvalora";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Nevalida enigo: atendiĝis ${Fo(A.values[0])}`:`Nevalida opcio: atendiĝis unu el ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Tro granda: atendiĝis ke ${A.origin??"valoro"} havu ${t}${A.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${A.origin??"valoro"} havu ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Tro malgranda: atendiĝis ke ${A.origin} havu ${t}${A.minimum.toString()} ${i.unit}`:`Tro malgranda: atendiĝis ke ${A.origin} estu ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Nevalida karaktraro: devas komenciĝi per "${e.prefix}"`:"ends_with"===e.format?`Nevalida karaktraro: devas finiĝi per "${e.suffix}"`:"includes"===e.format?`Nevalida karaktraro: devas inkluzivi "${e.includes}"`:"regex"===e.format?`Nevalida karaktraro: devas kongrui kun la modelo ${e.pattern}`:`Nevalida ${t[e.format]??A.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${A.divisor}`;case"unrecognized_keys":return`Nekonata${A.keys.length>1?"j":""} ŝlosilo${A.keys.length>1?"j":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${A.origin}`;case"invalid_union":default:return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${A.origin}`}}};function mI(){return{localeError:wI()}}var yI=()=>{const A={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Entrada inválida: se esperaba ${A.expected}, recibido ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"número";case"object":if(Array.isArray(A))return"arreglo";if(null===A)return"nulo";if(Object.getPrototypeOf(A)!==Object.prototype)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Entrada inválida: se esperaba ${Fo(A.values[0])}`:`Opción inválida: se esperaba una de ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Demasiado grande: se esperaba que ${A.origin??"valor"} tuviera ${t}${A.maximum.toString()} ${i.unit??"elementos"}`:`Demasiado grande: se esperaba que ${A.origin??"valor"} fuera ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Demasiado pequeño: se esperaba que ${A.origin} tuviera ${t}${A.minimum.toString()} ${i.unit}`:`Demasiado pequeño: se esperaba que ${A.origin} fuera ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Cadena inválida: debe comenzar con "${e.prefix}"`:"ends_with"===e.format?`Cadena inválida: debe terminar en "${e.suffix}"`:"includes"===e.format?`Cadena inválida: debe incluir "${e.includes}"`:"regex"===e.format?`Cadena inválida: debe coincidir con el patrón ${e.pattern}`:`Inválido ${t[e.format]??A.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${A.divisor}`;case"unrecognized_keys":return`Llave${A.keys.length>1?"s":""} desconocida${A.keys.length>1?"s":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Llave inválida en ${A.origin}`;case"invalid_union":default:return"Entrada inválida";case"invalid_element":return`Valor inválido en ${A.origin}`}}};function fI(){return{localeError:yI()}}var RI=()=>{const A={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function e(e){return A[e]??null}const t={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:"ورودی"};return A=>{switch(A.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${A.expected} می‌بود، ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"عدد";case"object":if(Array.isArray(A))return"آرایه";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)} دریافت شد`;case"invalid_value":return 1===A.values.length?`ورودی نامعتبر: می‌بایست ${Fo(A.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${ro(A.values,"|")} می‌بود`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`خیلی بزرگ: ${A.origin??"مقدار"} باید ${t}${A.maximum.toString()} ${i.unit??"عنصر"} باشد`:`خیلی بزرگ: ${A.origin??"مقدار"} باید ${t}${A.maximum.toString()} باشد`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`خیلی کوچک: ${A.origin} باید ${t}${A.minimum.toString()} ${i.unit} باشد`:`خیلی کوچک: ${A.origin} باید ${t}${A.minimum.toString()} باشد`}case"invalid_format":{const e=A;return"starts_with"===e.format?`رشته نامعتبر: باید با "${e.prefix}" شروع شود`:"ends_with"===e.format?`رشته نامعتبر: باید با "${e.suffix}" تمام شود`:"includes"===e.format?`رشته نامعتبر: باید شامل "${e.includes}" باشد`:"regex"===e.format?`رشته نامعتبر: باید با الگوی ${e.pattern} مطابقت داشته باشد`:`${t[e.format]??A.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${A.divisor} باشد`;case"unrecognized_keys":return`کلید${A.keys.length>1?"های":""} ناشناس: ${ro(A.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${A.origin}`;case"invalid_union":default:return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${A.origin}`}}};function NI(){return{localeError:RI()}}var MI=()=>{const A={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 e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${A.expected}, oli ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Virheellinen syöte: täytyy olla ${Fo(A.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Liian suuri: ${i.subject} täytyy olla ${t}${A.maximum.toString()} ${i.unit}`.trim():`Liian suuri: arvon täytyy olla ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Liian pieni: ${i.subject} täytyy olla ${t}${A.minimum.toString()} ${i.unit}`.trim():`Liian pieni: arvon täytyy olla ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Virheellinen syöte: täytyy alkaa "${e.prefix}"`:"ends_with"===e.format?`Virheellinen syöte: täytyy loppua "${e.suffix}"`:"includes"===e.format?`Virheellinen syöte: täytyy sisältää "${e.includes}"`:"regex"===e.format?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${e.pattern}`:`Virheellinen ${t[e.format]??A.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${A.divisor} monikerta`;case"unrecognized_keys":return`${A.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${ro(A.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 SI(){return{localeError:MI()}}var kI=()=>{const A={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Entrée invalide : ${A.expected} attendu, ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"nombre";case"object":if(Array.isArray(A))return"tableau";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)} reçu`;case"invalid_value":return 1===A.values.length?`Entrée invalide : ${Fo(A.values[0])} attendu`:`Option invalide : une valeur parmi ${ro(A.values,"|")} attendue`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Trop grand : ${A.origin??"valeur"} doit ${i.verb} ${t}${A.maximum.toString()} ${i.unit??"élément(s)"}`:`Trop grand : ${A.origin??"valeur"} doit être ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Trop petit : ${A.origin} doit ${i.verb} ${t}${A.minimum.toString()} ${i.unit}`:`Trop petit : ${A.origin} doit être ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Chaîne invalide : doit commencer par "${e.prefix}"`:"ends_with"===e.format?`Chaîne invalide : doit se terminer par "${e.suffix}"`:"includes"===e.format?`Chaîne invalide : doit inclure "${e.includes}"`:"regex"===e.format?`Chaîne invalide : doit correspondre au modèle ${e.pattern}`:`${t[e.format]??A.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${A.divisor}`;case"unrecognized_keys":return`Clé${A.keys.length>1?"s":""} non reconnue${A.keys.length>1?"s":""} : ${ro(A.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${A.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${A.origin}`}}};function GI(){return{localeError:kI()}}var LI=()=>{const A={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Entrée invalide : attendu ${A.expected}, reçu ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Entrée invalide : attendu ${Fo(A.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"≤":"<",i=e(A.origin);return i?`Trop grand : attendu que ${A.origin??"la valeur"} ait ${t}${A.maximum.toString()} ${i.unit}`:`Trop grand : attendu que ${A.origin??"la valeur"} soit ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?"≥":">",i=e(A.origin);return i?`Trop petit : attendu que ${A.origin} ait ${t}${A.minimum.toString()} ${i.unit}`:`Trop petit : attendu que ${A.origin} soit ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Chaîne invalide : doit commencer par "${e.prefix}"`:"ends_with"===e.format?`Chaîne invalide : doit se terminer par "${e.suffix}"`:"includes"===e.format?`Chaîne invalide : doit inclure "${e.includes}"`:"regex"===e.format?`Chaîne invalide : doit correspondre au motif ${e.pattern}`:`${t[e.format]??A.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${A.divisor}`;case"unrecognized_keys":return`Clé${A.keys.length>1?"s":""} non reconnue${A.keys.length>1?"s":""} : ${ro(A.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${A.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${A.origin}`}}};function FI(){return{localeError:LI()}}var TI=()=>{const A={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}};function e(e){return A[e]??null}const t={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:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"};return A=>{switch(A.code){case"invalid_type":return`קלט לא תקין: צריך ${A.expected}, התקבל ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`קלט לא תקין: צריך ${Fo(A.values[0])}`:`קלט לא תקין: צריך אחת מהאפשרויות ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`גדול מדי: ${A.origin??"value"} צריך להיות ${t}${A.maximum.toString()} ${i.unit??"elements"}`:`גדול מדי: ${A.origin??"value"} צריך להיות ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`קטן מדי: ${A.origin} צריך להיות ${t}${A.minimum.toString()} ${i.unit}`:`קטן מדי: ${A.origin} צריך להיות ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`מחרוזת לא תקינה: חייבת להתחיל ב"${e.prefix}"`:"ends_with"===e.format?`מחרוזת לא תקינה: חייבת להסתיים ב "${e.suffix}"`:"includes"===e.format?`מחרוזת לא תקינה: חייבת לכלול "${e.includes}"`:"regex"===e.format?`מחרוזת לא תקינה: חייבת להתאים לתבנית ${e.pattern}`:`${t[e.format]??A.format} לא תקין`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${A.divisor}`;case"unrecognized_keys":return`מפתח${A.keys.length>1?"ות":""} לא מזוה${A.keys.length>1?"ים":"ה"}: ${ro(A.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${A.origin}`;case"invalid_union":default:return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${A.origin}`}}};function UI(){return{localeError:TI()}}var JI=()=>{const A={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Érvénytelen bemenet: a várt érték ${A.expected}, a kapott érték ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"szám";case"object":if(Array.isArray(A))return"tömb";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Érvénytelen bemenet: a várt érték ${Fo(A.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Túl nagy: ${A.origin??"érték"} mérete túl nagy ${t}${A.maximum.toString()} ${i.unit??"elem"}`:`Túl nagy: a bemeneti érték ${A.origin??"érték"} túl nagy: ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Túl kicsi: a bemeneti érték ${A.origin} mérete túl kicsi ${t}${A.minimum.toString()} ${i.unit}`:`Túl kicsi: a bemeneti érték ${A.origin} túl kicsi ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Érvénytelen string: "${e.prefix}" értékkel kell kezdődnie`:"ends_with"===e.format?`Érvénytelen string: "${e.suffix}" értékkel kell végződnie`:"includes"===e.format?`Érvénytelen string: "${e.includes}" értéket kell tartalmaznia`:"regex"===e.format?`Érvénytelen string: ${e.pattern} mintának kell megfelelnie`:`Érvénytelen ${t[e.format]??A.format}`}case"not_multiple_of":return`Érvénytelen szám: ${A.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${A.keys.length>1?"s":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${A.origin}`;case"invalid_union":default:return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${A.origin}`}}};function _I(){return{localeError:JI()}}var YI=()=>{const A={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Input tidak valid: diharapkan ${A.expected}, diterima ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Input tidak valid: diharapkan ${Fo(A.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Terlalu besar: diharapkan ${A.origin??"value"} memiliki ${t}${A.maximum.toString()} ${i.unit??"elemen"}`:`Terlalu besar: diharapkan ${A.origin??"value"} menjadi ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Terlalu kecil: diharapkan ${A.origin} memiliki ${t}${A.minimum.toString()} ${i.unit}`:`Terlalu kecil: diharapkan ${A.origin} menjadi ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`String tidak valid: harus dimulai dengan "${e.prefix}"`:"ends_with"===e.format?`String tidak valid: harus berakhir dengan "${e.suffix}"`:"includes"===e.format?`String tidak valid: harus menyertakan "${e.includes}"`:"regex"===e.format?`String tidak valid: harus sesuai pola ${e.pattern}`:`${t[e.format]??A.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${A.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${A.keys.length>1?"s":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${A.origin}`;case"invalid_union":default:return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${A.origin}`}}};function bI(){return{localeError:YI()}}var HI=()=>{const A={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Input non valido: atteso ${A.expected}, ricevuto ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"numero";case"object":if(Array.isArray(A))return"vettore";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Input non valido: atteso ${Fo(A.values[0])}`:`Opzione non valida: atteso uno tra ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Troppo grande: ${A.origin??"valore"} deve avere ${t}${A.maximum.toString()} ${i.unit??"elementi"}`:`Troppo grande: ${A.origin??"valore"} deve essere ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Troppo piccolo: ${A.origin} deve avere ${t}${A.minimum.toString()} ${i.unit}`:`Troppo piccolo: ${A.origin} deve essere ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Stringa non valida: deve iniziare con "${e.prefix}"`:"ends_with"===e.format?`Stringa non valida: deve terminare con "${e.suffix}"`:"includes"===e.format?`Stringa non valida: deve includere "${e.includes}"`:"regex"===e.format?`Stringa non valida: deve corrispondere al pattern ${e.pattern}`:`Invalid ${t[e.format]??A.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${A.divisor}`;case"unrecognized_keys":return`Chiav${A.keys.length>1?"i":"e"} non riconosciut${A.keys.length>1?"e":"a"}: ${ro(A.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${A.origin}`;case"invalid_union":default:return"Input non valido";case"invalid_element":return`Valore non valido in ${A.origin}`}}};function xI(){return{localeError:HI()}}var KI=()=>{const A={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function e(e){return A[e]??null}const t={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:"入力値"};return A=>{switch(A.code){case"invalid_type":return`無効な入力: ${A.expected}が期待されましたが、${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"数値";case"object":if(Array.isArray(A))return"配列";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}が入力されました`;case"invalid_value":return 1===A.values.length?`無効な入力: ${Fo(A.values[0])}が期待されました`:`無効な選択: ${ro(A.values,"、")}のいずれかである必要があります`;case"too_big":{const t=A.inclusive?"以下である":"より小さい",i=e(A.origin);return i?`大きすぎる値: ${A.origin??"値"}は${A.maximum.toString()}${i.unit??"要素"}${t}必要があります`:`大きすぎる値: ${A.origin??"値"}は${A.maximum.toString()}${t}必要があります`}case"too_small":{const t=A.inclusive?"以上である":"より大きい",i=e(A.origin);return i?`小さすぎる値: ${A.origin}は${A.minimum.toString()}${i.unit}${t}必要があります`:`小さすぎる値: ${A.origin}は${A.minimum.toString()}${t}必要があります`}case"invalid_format":{const e=A;return"starts_with"===e.format?`無効な文字列: "${e.prefix}"で始まる必要があります`:"ends_with"===e.format?`無効な文字列: "${e.suffix}"で終わる必要があります`:"includes"===e.format?`無効な文字列: "${e.includes}"を含む必要があります`:"regex"===e.format?`無効な文字列: パターン${e.pattern}に一致する必要があります`:`無効な${t[e.format]??A.format}`}case"not_multiple_of":return`無効な数値: ${A.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${A.keys.length>1?"群":""}: ${ro(A.keys,"、")}`;case"invalid_key":return`${A.origin}内の無効なキー`;case"invalid_union":default:return"無効な入力";case"invalid_element":return`${A.origin}内の無効な値`}}};function OI(){return{localeError:KI()}}var vI=()=>{const A={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function e(e){return A[e]??null}const t={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:"ទិន្នន័យបញ្ចូល"};return A=>{switch(A.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${A.expected} ប៉ុន្តែទទួលបាន ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":if(Array.isArray(A))return"អារេ (Array)";if(null===A)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${Fo(A.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`ធំពេក៖ ត្រូវការ ${A.origin??"តម្លៃ"} ${t} ${A.maximum.toString()} ${i.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${A.origin??"តម្លៃ"} ${t} ${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`តូចពេក៖ ត្រូវការ ${A.origin} ${t} ${A.minimum.toString()} ${i.unit}`:`តូចពេក៖ ត្រូវការ ${A.origin} ${t} ${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${e.prefix}"`:"ends_with"===e.format?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${e.suffix}"`:"includes"===e.format?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${e.includes}"`:"regex"===e.format?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${e.pattern}`:`មិនត្រឹមត្រូវ៖ ${t[e.format]??A.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${A.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${ro(A.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${A.origin}`;case"invalid_union":default:return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${A.origin}`}}};function qI(){return{localeError:vI()}}var PI=()=>{const A={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function e(e){return A[e]??null}const t={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:"입력"};return A=>{switch(A.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${A.expected}, 받은 타입은 ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}입니다`;case"invalid_value":return 1===A.values.length?`잘못된 입력: 값은 ${Fo(A.values[0])} 이어야 합니다`:`잘못된 옵션: ${ro(A.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const t=A.inclusive?"이하":"미만",i="미만"===t?"이어야 합니다":"여야 합니다",n=e(A.origin),o=n?.unit??"요소";return n?`${A.origin??"값"}이 너무 큽니다: ${A.maximum.toString()}${o} ${t}${i}`:`${A.origin??"값"}이 너무 큽니다: ${A.maximum.toString()} ${t}${i}`}case"too_small":{const t=A.inclusive?"이상":"초과",i="이상"===t?"이어야 합니다":"여야 합니다",n=e(A.origin),o=n?.unit??"요소";return n?`${A.origin??"값"}이 너무 작습니다: ${A.minimum.toString()}${o} ${t}${i}`:`${A.origin??"값"}이 너무 작습니다: ${A.minimum.toString()} ${t}${i}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`잘못된 문자열: "${e.prefix}"(으)로 시작해야 합니다`:"ends_with"===e.format?`잘못된 문자열: "${e.suffix}"(으)로 끝나야 합니다`:"includes"===e.format?`잘못된 문자열: "${e.includes}"을(를) 포함해야 합니다`:"regex"===e.format?`잘못된 문자열: 정규식 ${e.pattern} 패턴과 일치해야 합니다`:`잘못된 ${t[e.format]??A.format}`}case"not_multiple_of":return`잘못된 숫자: ${A.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${ro(A.keys,", ")}`;case"invalid_key":return`잘못된 키: ${A.origin}`;case"invalid_union":default:return"잘못된 입력";case"invalid_element":return`잘못된 값: ${A.origin}`}}};function VI(){return{localeError:PI()}}var jI=()=>{const A={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function e(e){return A[e]??null}const t={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:"внес"};return A=>{switch(A.code){case"invalid_type":return`Грешен внес: се очекува ${A.expected}, примено ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"број";case"object":if(Array.isArray(A))return"низа";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Invalid input: expected ${Fo(A.values[0])}`:`Грешана опција: се очекува една ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Премногу голем: се очекува ${A.origin??"вредноста"} да има ${t}${A.maximum.toString()} ${i.unit??"елементи"}`:`Премногу голем: се очекува ${A.origin??"вредноста"} да биде ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Премногу мал: се очекува ${A.origin} да има ${t}${A.minimum.toString()} ${i.unit}`:`Премногу мал: се очекува ${A.origin} да биде ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Неважечка низа: мора да започнува со "${e.prefix}"`:"ends_with"===e.format?`Неважечка низа: мора да завршува со "${e.suffix}"`:"includes"===e.format?`Неважечка низа: мора да вклучува "${e.includes}"`:"regex"===e.format?`Неважечка низа: мора да одгоара на патернот ${e.pattern}`:`Invalid ${t[e.format]??A.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${A.divisor}`;case"unrecognized_keys":return`${A.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${ro(A.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${A.origin}`;case"invalid_union":default:return"Грешен внес";case"invalid_element":return`Грешна вредност во ${A.origin}`}}};function WI(){return{localeError:jI()}}var ZI=()=>{const A={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Input tidak sah: dijangka ${A.expected}, diterima ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"nombor";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Input tidak sah: dijangka ${Fo(A.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Terlalu besar: dijangka ${A.origin??"nilai"} ${i.verb} ${t}${A.maximum.toString()} ${i.unit??"elemen"}`:`Terlalu besar: dijangka ${A.origin??"nilai"} adalah ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Terlalu kecil: dijangka ${A.origin} ${i.verb} ${t}${A.minimum.toString()} ${i.unit}`:`Terlalu kecil: dijangka ${A.origin} adalah ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`String tidak sah: mesti bermula dengan "${e.prefix}"`:"ends_with"===e.format?`String tidak sah: mesti berakhir dengan "${e.suffix}"`:"includes"===e.format?`String tidak sah: mesti mengandungi "${e.includes}"`:"regex"===e.format?`String tidak sah: mesti sepadan dengan corak ${e.pattern}`:`${t[e.format]??A.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${A.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${ro(A.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${A.origin}`;case"invalid_union":default:return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${A.origin}`}}};function zI(){return{localeError:ZI()}}var XI=()=>{const A={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Ongeldige invoer: verwacht ${A.expected}, ontving ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"getal";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Ongeldige invoer: verwacht ${Fo(A.values[0])}`:`Ongeldige optie: verwacht één van ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Te lang: verwacht dat ${A.origin??"waarde"} ${t}${A.maximum.toString()} ${i.unit??"elementen"} bevat`:`Te lang: verwacht dat ${A.origin??"waarde"} ${t}${A.maximum.toString()} is`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Te kort: verwacht dat ${A.origin} ${t}${A.minimum.toString()} ${i.unit} bevat`:`Te kort: verwacht dat ${A.origin} ${t}${A.minimum.toString()} is`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Ongeldige tekst: moet met "${e.prefix}" beginnen`:"ends_with"===e.format?`Ongeldige tekst: moet op "${e.suffix}" eindigen`:"includes"===e.format?`Ongeldige tekst: moet "${e.includes}" bevatten`:"regex"===e.format?`Ongeldige tekst: moet overeenkomen met patroon ${e.pattern}`:`Ongeldig: ${t[e.format]??A.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${A.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${A.keys.length>1?"s":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${A.origin}`;case"invalid_union":default:return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${A.origin}`}}};function $I(){return{localeError:XI()}}var Aa=()=>{const A={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Ugyldig input: forventet ${A.expected}, fikk ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"tall";case"object":if(Array.isArray(A))return"liste";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Ugyldig verdi: forventet ${Fo(A.values[0])}`:`Ugyldig valg: forventet en av ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`For stor(t): forventet ${A.origin??"value"} til å ha ${t}${A.maximum.toString()} ${i.unit??"elementer"}`:`For stor(t): forventet ${A.origin??"value"} til å ha ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`For lite(n): forventet ${A.origin} til å ha ${t}${A.minimum.toString()} ${i.unit}`:`For lite(n): forventet ${A.origin} til å ha ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Ugyldig streng: må starte med "${e.prefix}"`:"ends_with"===e.format?`Ugyldig streng: må ende med "${e.suffix}"`:"includes"===e.format?`Ugyldig streng: må inneholde "${e.includes}"`:"regex"===e.format?`Ugyldig streng: må matche mønsteret ${e.pattern}`:`Ugyldig ${t[e.format]??A.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${A.divisor}`;case"unrecognized_keys":return`${A.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${ro(A.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${A.origin}`;case"invalid_union":default:return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${A.origin}`}}};function ea(){return{localeError:Aa()}}var ta=()=>{const A={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 e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Fâsit giren: umulan ${A.expected}, alınan ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"numara";case"object":if(Array.isArray(A))return"saf";if(null===A)return"gayb";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Fâsit giren: umulan ${Fo(A.values[0])}`:`Fâsit tercih: mûteberler ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Fazla büyük: ${A.origin??"value"}, ${t}${A.maximum.toString()} ${i.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${A.origin??"value"}, ${t}${A.maximum.toString()} olmalıydı.`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Fazla küçük: ${A.origin}, ${t}${A.minimum.toString()} ${i.unit} sahip olmalıydı.`:`Fazla küçük: ${A.origin}, ${t}${A.minimum.toString()} olmalıydı.`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Fâsit metin: "${e.prefix}" ile başlamalı.`:"ends_with"===e.format?`Fâsit metin: "${e.suffix}" ile bitmeli.`:"includes"===e.format?`Fâsit metin: "${e.includes}" ihtivâ etmeli.`:"regex"===e.format?`Fâsit metin: ${e.pattern} nakşına uymalı.`:`Fâsit ${t[e.format]??A.format}`}case"not_multiple_of":return`Fâsit sayı: ${A.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${A.keys.length>1?"s":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`${A.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${A.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function ia(){return{localeError:ta()}}var na=()=>{const A={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function e(e){return A[e]??null}const t={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:"ورودي"};return A=>{switch(A.code){case"invalid_type":return`ناسم ورودي: باید ${A.expected} وای, مګر ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"عدد";case"object":if(Array.isArray(A))return"ارې";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)} ترلاسه شو`;case"invalid_value":return 1===A.values.length?`ناسم ورودي: باید ${Fo(A.values[0])} وای`:`ناسم انتخاب: باید یو له ${ro(A.values,"|")} څخه وای`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`ډیر لوی: ${A.origin??"ارزښت"} باید ${t}${A.maximum.toString()} ${i.unit??"عنصرونه"} ولري`:`ډیر لوی: ${A.origin??"ارزښت"} باید ${t}${A.maximum.toString()} وي`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`ډیر کوچنی: ${A.origin} باید ${t}${A.minimum.toString()} ${i.unit} ولري`:`ډیر کوچنی: ${A.origin} باید ${t}${A.minimum.toString()} وي`}case"invalid_format":{const e=A;return"starts_with"===e.format?`ناسم متن: باید د "${e.prefix}" سره پیل شي`:"ends_with"===e.format?`ناسم متن: باید د "${e.suffix}" سره پای ته ورسيږي`:"includes"===e.format?`ناسم متن: باید "${e.includes}" ولري`:"regex"===e.format?`ناسم متن: باید د ${e.pattern} سره مطابقت ولري`:`${t[e.format]??A.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${A.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${A.keys.length>1?"کلیډونه":"کلیډ"}: ${ro(A.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${A.origin} کې`;case"invalid_union":default:return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${A.origin} کې`}}};function oa(){return{localeError:na()}}var ga=()=>{const A={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 e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${A.expected}, otrzymano ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"liczba";case"object":if(Array.isArray(A))return"tablica";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Nieprawidłowe dane wejściowe: oczekiwano ${Fo(A.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Za duża wartość: oczekiwano, że ${A.origin??"wartość"} będzie mieć ${t}${A.maximum.toString()} ${i.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${A.origin??"wartość"} będzie wynosić ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Za mała wartość: oczekiwano, że ${A.origin??"wartość"} będzie mieć ${t}${A.minimum.toString()} ${i.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${A.origin??"wartość"} będzie wynosić ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${e.prefix}"`:"ends_with"===e.format?`Nieprawidłowy ciąg znaków: musi kończyć się na "${e.suffix}"`:"includes"===e.format?`Nieprawidłowy ciąg znaków: musi zawierać "${e.includes}"`:"regex"===e.format?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${e.pattern}`:`Nieprawidłow(y/a/e) ${t[e.format]??A.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${A.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${A.keys.length>1?"s":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${A.origin}`;case"invalid_union":default:return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${A.origin}`}}};function sa(){return{localeError:ga()}}var ra=()=>{const A={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Tipo inválido: esperado ${A.expected}, recebido ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"número";case"object":if(Array.isArray(A))return"array";if(null===A)return"nulo";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Entrada inválida: esperado ${Fo(A.values[0])}`:`Opção inválida: esperada uma das ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Muito grande: esperado que ${A.origin??"valor"} tivesse ${t}${A.maximum.toString()} ${i.unit??"elementos"}`:`Muito grande: esperado que ${A.origin??"valor"} fosse ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Muito pequeno: esperado que ${A.origin} tivesse ${t}${A.minimum.toString()} ${i.unit}`:`Muito pequeno: esperado que ${A.origin} fosse ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Texto inválido: deve começar com "${e.prefix}"`:"ends_with"===e.format?`Texto inválido: deve terminar com "${e.suffix}"`:"includes"===e.format?`Texto inválido: deve incluir "${e.includes}"`:"regex"===e.format?`Texto inválido: deve corresponder ao padrão ${e.pattern}`:`${t[e.format]??A.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${A.divisor}`;case"unrecognized_keys":return`Chave${A.keys.length>1?"s":""} desconhecida${A.keys.length>1?"s":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Chave inválida em ${A.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${A.origin}`;default:return"Campo inválido"}}};function Ia(){return{localeError:ra()}}function aa(A,e,t,i){const n=Math.abs(A),o=n%10,g=n%100;return g>=11&&g<=19?i:1===o?e:o>=2&&o<=4?t:i}var Ca=()=>{const A={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 e(e){return A[e]??null}const t={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:"ввод"};return A=>{switch(A.code){case"invalid_type":return`Неверный ввод: ожидалось ${A.expected}, получено ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"число";case"object":if(Array.isArray(A))return"массив";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Неверный ввод: ожидалось ${Fo(A.values[0])}`:`Неверный вариант: ожидалось одно из ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);if(i){const e=aa(Number(A.maximum),i.unit.one,i.unit.few,i.unit.many);return`Слишком большое значение: ожидалось, что ${A.origin??"значение"} будет иметь ${t}${A.maximum.toString()} ${e}`}return`Слишком большое значение: ожидалось, что ${A.origin??"значение"} будет ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);if(i){const e=aa(Number(A.minimum),i.unit.one,i.unit.few,i.unit.many);return`Слишком маленькое значение: ожидалось, что ${A.origin} будет иметь ${t}${A.minimum.toString()} ${e}`}return`Слишком маленькое значение: ожидалось, что ${A.origin} будет ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Неверная строка: должна начинаться с "${e.prefix}"`:"ends_with"===e.format?`Неверная строка: должна заканчиваться на "${e.suffix}"`:"includes"===e.format?`Неверная строка: должна содержать "${e.includes}"`:"regex"===e.format?`Неверная строка: должна соответствовать шаблону ${e.pattern}`:`Неверный ${t[e.format]??A.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${A.divisor}`;case"unrecognized_keys":return`Нераспознанн${A.keys.length>1?"ые":"ый"} ключ${A.keys.length>1?"и":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${A.origin}`;case"invalid_union":default:return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${A.origin}`}}};function Ba(){return{localeError:Ca()}}var Qa=()=>{const A={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${A.expected}, prejeto ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"število";case"object":if(Array.isArray(A))return"tabela";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Neveljaven vnos: pričakovano ${Fo(A.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Preveliko: pričakovano, da bo ${A.origin??"vrednost"} imelo ${t}${A.maximum.toString()} ${i.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${A.origin??"vrednost"} ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Premajhno: pričakovano, da bo ${A.origin} imelo ${t}${A.minimum.toString()} ${i.unit}`:`Premajhno: pričakovano, da bo ${A.origin} ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Neveljaven niz: mora se začeti z "${e.prefix}"`:"ends_with"===e.format?`Neveljaven niz: mora se končati z "${e.suffix}"`:"includes"===e.format?`Neveljaven niz: mora vsebovati "${e.includes}"`:"regex"===e.format?`Neveljaven niz: mora ustrezati vzorcu ${e.pattern}`:`Neveljaven ${t[e.format]??A.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${A.divisor}`;case"unrecognized_keys":return`Neprepoznan${A.keys.length>1?"i ključi":" ključ"}: ${ro(A.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${A.origin}`;case"invalid_union":default:return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${A.origin}`}}};function Ea(){return{localeError:Qa()}}var ca=()=>{const A={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 e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Ogiltig inmatning: förväntat ${A.expected}, fick ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"antal";case"object":if(Array.isArray(A))return"lista";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Ogiltig inmatning: förväntat ${Fo(A.values[0])}`:`Ogiltigt val: förväntade en av ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`För stor(t): förväntade ${A.origin??"värdet"} att ha ${t}${A.maximum.toString()} ${i.unit??"element"}`:`För stor(t): förväntat ${A.origin??"värdet"} att ha ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`För lite(t): förväntade ${A.origin??"värdet"} att ha ${t}${A.minimum.toString()} ${i.unit}`:`För lite(t): förväntade ${A.origin??"värdet"} att ha ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Ogiltig sträng: måste börja med "${e.prefix}"`:"ends_with"===e.format?`Ogiltig sträng: måste sluta med "${e.suffix}"`:"includes"===e.format?`Ogiltig sträng: måste innehålla "${e.includes}"`:"regex"===e.format?`Ogiltig sträng: måste matcha mönstret "${e.pattern}"`:`Ogiltig(t) ${t[e.format]??A.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${A.divisor}`;case"unrecognized_keys":return`${A.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${ro(A.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${A.origin??"värdet"}`;case"invalid_union":default:return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${A.origin??"värdet"}`}}};function la(){return{localeError:ca()}}var ua=()=>{const A={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${A.expected}, பெறப்பட்டது ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"எண் அல்லாதது":"எண்";case"object":if(Array.isArray(A))return"அணி";if(null===A)return"வெறுமை";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${Fo(A.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${ro(A.values,"|")} இல் ஒன்று`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${A.origin??"மதிப்பு"} ${t}${A.maximum.toString()} ${i.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${A.origin??"மதிப்பு"} ${t}${A.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${A.origin} ${t}${A.minimum.toString()} ${i.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${A.origin} ${t}${A.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const e=A;return"starts_with"===e.format?`தவறான சரம்: "${e.prefix}" இல் தொடங்க வேண்டும்`:"ends_with"===e.format?`தவறான சரம்: "${e.suffix}" இல் முடிவடைய வேண்டும்`:"includes"===e.format?`தவறான சரம்: "${e.includes}" ஐ உள்ளடக்க வேண்டும்`:"regex"===e.format?`தவறான சரம்: ${e.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${t[e.format]??A.format}`}case"not_multiple_of":return`தவறான எண்: ${A.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${A.keys.length>1?"கள்":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`${A.origin} இல் தவறான விசை`;case"invalid_union":default:return"தவறான உள்ளீடு";case"invalid_element":return`${A.origin} இல் தவறான மதிப்பு`}}};function da(){return{localeError:ua()}}var ha=()=>{const A={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function e(e){return A[e]??null}const t={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:"ข้อมูลที่ป้อน"};return A=>{switch(A.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${A.expected} แต่ได้รับ ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":if(Array.isArray(A))return"อาร์เรย์ (Array)";if(null===A)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`ค่าไม่ถูกต้อง: ควรเป็น ${Fo(A.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"ไม่เกิน":"น้อยกว่า",i=e(A.origin);return i?`เกินกำหนด: ${A.origin??"ค่า"} ควรมี${t} ${A.maximum.toString()} ${i.unit??"รายการ"}`:`เกินกำหนด: ${A.origin??"ค่า"} ควรมี${t} ${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?"อย่างน้อย":"มากกว่า",i=e(A.origin);return i?`น้อยกว่ากำหนด: ${A.origin} ควรมี${t} ${A.minimum.toString()} ${i.unit}`:`น้อยกว่ากำหนด: ${A.origin} ควรมี${t} ${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${e.prefix}"`:"ends_with"===e.format?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${e.suffix}"`:"includes"===e.format?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${e.includes}" อยู่ในข้อความ`:"regex"===e.format?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${e.pattern}`:`รูปแบบไม่ถูกต้อง: ${t[e.format]??A.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${A.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${ro(A.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${A.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${A.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function Da(){return{localeError:ha()}}var pa=()=>{const A={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Geçersiz değer: beklenen ${A.expected}, alınan ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Geçersiz değer: beklenen ${Fo(A.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Çok büyük: beklenen ${A.origin??"değer"} ${t}${A.maximum.toString()} ${i.unit??"öğe"}`:`Çok büyük: beklenen ${A.origin??"değer"} ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Çok küçük: beklenen ${A.origin} ${t}${A.minimum.toString()} ${i.unit}`:`Çok küçük: beklenen ${A.origin} ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Geçersiz metin: "${e.prefix}" ile başlamalı`:"ends_with"===e.format?`Geçersiz metin: "${e.suffix}" ile bitmeli`:"includes"===e.format?`Geçersiz metin: "${e.includes}" içermeli`:"regex"===e.format?`Geçersiz metin: ${e.pattern} desenine uymalı`:`Geçersiz ${t[e.format]??A.format}`}case"not_multiple_of":return`Geçersiz sayı: ${A.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${A.keys.length>1?"lar":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`${A.origin} içinde geçersiz anahtar`;case"invalid_union":default:return"Geçersiz değer";case"invalid_element":return`${A.origin} içinde geçersiz değer`}}};function wa(){return{localeError:pa()}}var ma=()=>{const A={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function e(e){return A[e]??null}const t={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:"вхідні дані"};return A=>{switch(A.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${A.expected}, отримано ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"число";case"object":if(Array.isArray(A))return"масив";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Неправильні вхідні дані: очікується ${Fo(A.values[0])}`:`Неправильна опція: очікується одне з ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Занадто велике: очікується, що ${A.origin??"значення"} ${i.verb} ${t}${A.maximum.toString()} ${i.unit??"елементів"}`:`Занадто велике: очікується, що ${A.origin??"значення"} буде ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Занадто мале: очікується, що ${A.origin} ${i.verb} ${t}${A.minimum.toString()} ${i.unit}`:`Занадто мале: очікується, що ${A.origin} буде ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Неправильний рядок: повинен починатися з "${e.prefix}"`:"ends_with"===e.format?`Неправильний рядок: повинен закінчуватися на "${e.suffix}"`:"includes"===e.format?`Неправильний рядок: повинен містити "${e.includes}"`:"regex"===e.format?`Неправильний рядок: повинен відповідати шаблону ${e.pattern}`:`Неправильний ${t[e.format]??A.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${A.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${A.keys.length>1?"і":""}: ${ro(A.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${A.origin}`;case"invalid_union":default:return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${A.origin}`}}};function ya(){return{localeError:ma()}}var fa=()=>{const A={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function e(e){return A[e]??null}const t={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:"ان پٹ"};return A=>{switch(A.code){case"invalid_type":return`غلط ان پٹ: ${A.expected} متوقع تھا، ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"نمبر";case"object":if(Array.isArray(A))return"آرے";if(null===A)return"نل";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)} موصول ہوا`;case"invalid_value":return 1===A.values.length?`غلط ان پٹ: ${Fo(A.values[0])} متوقع تھا`:`غلط آپشن: ${ro(A.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`بہت بڑا: ${A.origin??"ویلیو"} کے ${t}${A.maximum.toString()} ${i.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${A.origin??"ویلیو"} کا ${t}${A.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`بہت چھوٹا: ${A.origin} کے ${t}${A.minimum.toString()} ${i.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${A.origin} کا ${t}${A.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const e=A;return"starts_with"===e.format?`غلط سٹرنگ: "${e.prefix}" سے شروع ہونا چاہیے`:"ends_with"===e.format?`غلط سٹرنگ: "${e.suffix}" پر ختم ہونا چاہیے`:"includes"===e.format?`غلط سٹرنگ: "${e.includes}" شامل ہونا چاہیے`:"regex"===e.format?`غلط سٹرنگ: پیٹرن ${e.pattern} سے میچ ہونا چاہیے`:`غلط ${t[e.format]??A.format}`}case"not_multiple_of":return`غلط نمبر: ${A.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${A.keys.length>1?"ز":""}: ${ro(A.keys,"، ")}`;case"invalid_key":return`${A.origin} میں غلط کی`;case"invalid_union":default:return"غلط ان پٹ";case"invalid_element":return`${A.origin} میں غلط ویلیو`}}};function Ra(){return{localeError:fa()}}var Na=()=>{const A={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 e(e){return A[e]??null}const t={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"};return A=>{switch(A.code){case"invalid_type":return`Đầu vào không hợp lệ: mong đợi ${A.expected}, nhận được ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"số";case"object":if(Array.isArray(A))return"mảng";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`Đầu vào không hợp lệ: mong đợi ${Fo(A.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`Quá lớn: mong đợi ${A.origin??"giá trị"} ${i.verb} ${t}${A.maximum.toString()} ${i.unit??"phần tử"}`:`Quá lớn: mong đợi ${A.origin??"giá trị"} ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`Quá nhỏ: mong đợi ${A.origin} ${i.verb} ${t}${A.minimum.toString()} ${i.unit}`:`Quá nhỏ: mong đợi ${A.origin} ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`Chuỗi không hợp lệ: phải bắt đầu bằng "${e.prefix}"`:"ends_with"===e.format?`Chuỗi không hợp lệ: phải kết thúc bằng "${e.suffix}"`:"includes"===e.format?`Chuỗi không hợp lệ: phải bao gồm "${e.includes}"`:"regex"===e.format?`Chuỗi không hợp lệ: phải khớp với mẫu ${e.pattern}`:`${t[e.format]??A.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 ${A.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${ro(A.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${A.origin}`;case"invalid_union":default:return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${A.origin}`}}};function Ma(){return{localeError:Na()}}var Sa=()=>{const A={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function e(e){return A[e]??null}const t={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:"输入"};return A=>{switch(A.code){case"invalid_type":return`无效输入:期望 ${A.expected},实际接收 ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"非数字(NaN)":"数字";case"object":if(Array.isArray(A))return"数组";if(null===A)return"空值(null)";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`无效输入:期望 ${Fo(A.values[0])}`:`无效选项:期望以下之一 ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`数值过大:期望 ${A.origin??"值"} ${t}${A.maximum.toString()} ${i.unit??"个元素"}`:`数值过大:期望 ${A.origin??"值"} ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`数值过小:期望 ${A.origin} ${t}${A.minimum.toString()} ${i.unit}`:`数值过小:期望 ${A.origin} ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`无效字符串:必须以 "${e.prefix}" 开头`:"ends_with"===e.format?`无效字符串:必须以 "${e.suffix}" 结尾`:"includes"===e.format?`无效字符串:必须包含 "${e.includes}"`:"regex"===e.format?`无效字符串:必须满足正则表达式 ${e.pattern}`:`无效${t[e.format]??A.format}`}case"not_multiple_of":return`无效数字:必须是 ${A.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${ro(A.keys,", ")}`;case"invalid_key":return`${A.origin} 中的键(key)无效`;case"invalid_union":default:return"无效输入";case"invalid_element":return`${A.origin} 中包含无效值(value)`}}};function ka(){return{localeError:Sa()}}var Ga=()=>{const A={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function e(e){return A[e]??null}const t={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:"輸入"};return A=>{switch(A.code){case"invalid_type":return`無效的輸入值:預期為 ${A.expected},但收到 ${(A=>{const e=typeof A;switch(e){case"number":return Number.isNaN(A)?"NaN":"number";case"object":if(Array.isArray(A))return"array";if(null===A)return"null";if(Object.getPrototypeOf(A)!==Object.prototype&&A.constructor)return A.constructor.name}return e})(A.input)}`;case"invalid_value":return 1===A.values.length?`無效的輸入值:預期為 ${Fo(A.values[0])}`:`無效的選項:預期為以下其中之一 ${ro(A.values,"|")}`;case"too_big":{const t=A.inclusive?"<=":"<",i=e(A.origin);return i?`數值過大:預期 ${A.origin??"值"} 應為 ${t}${A.maximum.toString()} ${i.unit??"個元素"}`:`數值過大:預期 ${A.origin??"值"} 應為 ${t}${A.maximum.toString()}`}case"too_small":{const t=A.inclusive?">=":">",i=e(A.origin);return i?`數值過小:預期 ${A.origin} 應為 ${t}${A.minimum.toString()} ${i.unit}`:`數值過小:預期 ${A.origin} 應為 ${t}${A.minimum.toString()}`}case"invalid_format":{const e=A;return"starts_with"===e.format?`無效的字串:必須以 "${e.prefix}" 開頭`:"ends_with"===e.format?`無效的字串:必須以 "${e.suffix}" 結尾`:"includes"===e.format?`無效的字串:必須包含 "${e.includes}"`:"regex"===e.format?`無效的字串:必須符合格式 ${e.pattern}`:`無效的 ${t[e.format]??A.format}`}case"not_multiple_of":return`無效的數字:必須為 ${A.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${A.keys.length>1?"們":""}:${ro(A.keys,"、")}`;case"invalid_key":return`${A.origin} 中有無效的鍵值`;case"invalid_union":default:return"無效的輸入值";case"invalid_element":return`${A.origin} 中有無效的值`}}};function La(){return{localeError:Ga()}}var Fa=Symbol("ZodOutput"),Ta=Symbol("ZodInput"),Ua=class{constructor(){this._map=new Map,this._idmap=new Map}add(A,...e){const t=e[0];if(this._map.set(A,t),t&&"object"==typeof t&&"id"in t){if(this._idmap.has(t.id))throw new Error(`ID ${t.id} already exists in the registry`);this._idmap.set(t.id,A)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(A){const e=this._map.get(A);return e&&"object"==typeof e&&"id"in e&&this._idmap.delete(e.id),this._map.delete(A),this}get(A){const e=A._zod.parent;if(e){const t={...this.get(e)??{}};return delete t.id,{...t,...this._map.get(A)}}return this._map.get(A)}has(A){return this._map.has(A)}};function Ja(){return new Ua}var _a=Ja();function Ya(A,e){return new A({type:"string",...Go(e)})}function ba(A,e){return new A({type:"string",coerce:!0,...Go(e)})}function Ha(A,e){return new A({type:"string",format:"email",check:"string_format",abort:!1,...Go(e)})}function xa(A,e){return new A({type:"string",format:"guid",check:"string_format",abort:!1,...Go(e)})}function Ka(A,e){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,...Go(e)})}function Oa(A,e){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Go(e)})}function va(A,e){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Go(e)})}function qa(A,e){return new A({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Go(e)})}function Pa(A,e){return new A({type:"string",format:"url",check:"string_format",abort:!1,...Go(e)})}function Va(A,e){return new A({type:"string",format:"emoji",check:"string_format",abort:!1,...Go(e)})}function ja(A,e){return new A({type:"string",format:"nanoid",check:"string_format",abort:!1,...Go(e)})}function Wa(A,e){return new A({type:"string",format:"cuid",check:"string_format",abort:!1,...Go(e)})}function Za(A,e){return new A({type:"string",format:"cuid2",check:"string_format",abort:!1,...Go(e)})}function za(A,e){return new A({type:"string",format:"ulid",check:"string_format",abort:!1,...Go(e)})}function Xa(A,e){return new A({type:"string",format:"xid",check:"string_format",abort:!1,...Go(e)})}function $a(A,e){return new A({type:"string",format:"ksuid",check:"string_format",abort:!1,...Go(e)})}function AC(A,e){return new A({type:"string",format:"ipv4",check:"string_format",abort:!1,...Go(e)})}function eC(A,e){return new A({type:"string",format:"ipv6",check:"string_format",abort:!1,...Go(e)})}function tC(A,e){return new A({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Go(e)})}function iC(A,e){return new A({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Go(e)})}function nC(A,e){return new A({type:"string",format:"base64",check:"string_format",abort:!1,...Go(e)})}function oC(A,e){return new A({type:"string",format:"base64url",check:"string_format",abort:!1,...Go(e)})}function gC(A,e){return new A({type:"string",format:"e164",check:"string_format",abort:!1,...Go(e)})}function sC(A,e){return new A({type:"string",format:"jwt",check:"string_format",abort:!1,...Go(e)})}var rC={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function IC(A,e){return new A({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Go(e)})}function aC(A,e){return new A({type:"string",format:"date",check:"string_format",...Go(e)})}function CC(A,e){return new A({type:"string",format:"time",check:"string_format",precision:null,...Go(e)})}function BC(A,e){return new A({type:"string",format:"duration",check:"string_format",...Go(e)})}function QC(A,e){return new A({type:"number",checks:[],...Go(e)})}function EC(A,e){return new A({type:"number",coerce:!0,checks:[],...Go(e)})}function cC(A,e){return new A({type:"number",check:"number_format",abort:!1,format:"safeint",...Go(e)})}function lC(A,e){return new A({type:"number",check:"number_format",abort:!1,format:"float32",...Go(e)})}function uC(A,e){return new A({type:"number",check:"number_format",abort:!1,format:"float64",...Go(e)})}function dC(A,e){return new A({type:"number",check:"number_format",abort:!1,format:"int32",...Go(e)})}function hC(A,e){return new A({type:"number",check:"number_format",abort:!1,format:"uint32",...Go(e)})}function DC(A,e){return new A({type:"boolean",...Go(e)})}function pC(A,e){return new A({type:"boolean",coerce:!0,...Go(e)})}function wC(A,e){return new A({type:"bigint",...Go(e)})}function mC(A,e){return new A({type:"bigint",coerce:!0,...Go(e)})}function yC(A,e){return new A({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Go(e)})}function fC(A,e){return new A({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Go(e)})}function RC(A,e){return new A({type:"symbol",...Go(e)})}function NC(A,e){return new A({type:"undefined",...Go(e)})}function MC(A,e){return new A({type:"null",...Go(e)})}function SC(A){return new A({type:"any"})}function kC(A){return new A({type:"unknown"})}function GC(A,e){return new A({type:"never",...Go(e)})}function LC(A,e){return new A({type:"void",...Go(e)})}function FC(A,e){return new A({type:"date",...Go(e)})}function TC(A,e){return new A({type:"date",coerce:!0,...Go(e)})}function UC(A,e){return new A({type:"nan",...Go(e)})}function JC(A,e){return new gs({check:"less_than",...Go(e),value:A,inclusive:!1})}function _C(A,e){return new gs({check:"less_than",...Go(e),value:A,inclusive:!0})}function YC(A,e){return new ss({check:"greater_than",...Go(e),value:A,inclusive:!1})}function bC(A,e){return new ss({check:"greater_than",...Go(e),value:A,inclusive:!0})}function HC(A){return YC(0,A)}function xC(A){return JC(0,A)}function KC(A){return _C(0,A)}function OC(A){return bC(0,A)}function vC(A,e){return new rs({check:"multiple_of",...Go(e),value:A})}function qC(A,e){return new Cs({check:"max_size",...Go(e),maximum:A})}function PC(A,e){return new Bs({check:"min_size",...Go(e),minimum:A})}function VC(A,e){return new Qs({check:"size_equals",...Go(e),size:A})}function jC(A,e){return new Es({check:"max_length",...Go(e),maximum:A})}function WC(A,e){return new cs({check:"min_length",...Go(e),minimum:A})}function ZC(A,e){return new ls({check:"length_equals",...Go(e),length:A})}function zC(A,e){return new ds({check:"string_format",format:"regex",...Go(e),pattern:A})}function XC(A){return new hs({check:"string_format",format:"lowercase",...Go(A)})}function $C(A){return new Ds({check:"string_format",format:"uppercase",...Go(A)})}function AB(A,e){return new ps({check:"string_format",format:"includes",...Go(e),includes:A})}function eB(A,e){return new ws({check:"string_format",format:"starts_with",...Go(e),prefix:A})}function tB(A,e){return new ms({check:"string_format",format:"ends_with",...Go(e),suffix:A})}function iB(A,e,t){return new fs({check:"property",property:A,schema:e,...Go(t)})}function nB(A,e){return new Rs({check:"mime_type",mime:A,...Go(e)})}function oB(A){return new Ns({check:"overwrite",tx:A})}function gB(A){return oB(e=>e.normalize(A))}function sB(){return oB(A=>A.trim())}function rB(){return oB(A=>A.toLowerCase())}function IB(){return oB(A=>A.toUpperCase())}function aB(A,e,t){return new A({type:"array",element:e,...Go(t)})}function CB(A,e,t){return new A({type:"union",options:e,...Go(t)})}function BB(A,e,t,i){return new A({type:"union",options:t,discriminator:e,...Go(i)})}function QB(A,e,t){return new A({type:"intersection",left:e,right:t})}function EB(A,e,t,i){const n=t instanceof ks;return new A({type:"tuple",items:e,rest:n?t:null,...Go(n?i:t)})}function cB(A,e,t,i){return new A({type:"record",keyType:e,valueType:t,...Go(i)})}function lB(A,e,t,i){return new A({type:"map",keyType:e,valueType:t,...Go(i)})}function uB(A,e,t){return new A({type:"set",valueType:e,...Go(t)})}function dB(A,e,t){return new A({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(A=>[A,A])):e,...Go(t)})}function hB(A,e,t){return new A({type:"enum",entries:e,...Go(t)})}function DB(A,e,t){return new A({type:"literal",values:Array.isArray(e)?e:[e],...Go(t)})}function pB(A,e){return new A({type:"file",...Go(e)})}function wB(A,e){return new A({type:"transform",transform:e})}function mB(A,e){return new A({type:"optional",innerType:e})}function yB(A,e){return new A({type:"nullable",innerType:e})}function fB(A,e,t){return new A({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})}function RB(A,e,t){return new A({type:"nonoptional",innerType:e,...Go(t)})}function NB(A,e){return new A({type:"success",innerType:e})}function MB(A,e,t){return new A({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}function SB(A,e,t){return new A({type:"pipe",in:e,out:t})}function kB(A,e){return new A({type:"readonly",innerType:e})}function GB(A,e,t){return new A({type:"template_literal",parts:e,...Go(t)})}function LB(A,e){return new A({type:"lazy",getter:e})}function FB(A,e){return new A({type:"promise",innerType:e})}function TB(A,e,t){const i=Go(t);return i.abort??(i.abort=!0),new A({type:"custom",check:"custom",fn:e,...i})}function UB(A,e,t){return new A({type:"custom",check:"custom",fn:e,...Go(t)})}function JB(A,e){const t=Go(e);let i=t.truthy??["true","1","yes","on","y","enabled"],n=t.falsy??["false","0","no","off","n","disabled"];"sensitive"!==t.case&&(i=i.map(A=>"string"==typeof A?A.toLowerCase():A),n=n.map(A=>"string"==typeof A?A.toLowerCase():A));const o=new Set(i),g=new Set(n),s=A.Pipe??zr,r=A.Boolean??rr,I=A.String??Gs,a=new(A.Transform??Hr)({type:"transform",transform:(A,e)=>{let i=A;return"sensitive"!==t.case&&(i=i.toLowerCase()),!!o.has(i)||!g.has(i)&&(e.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...g],input:e.value,inst:a}),{})},error:t.error}),C=new s({type:"pipe",in:new I({type:"string",error:t.error}),out:a,error:t.error});return new s({type:"pipe",in:C,out:new r({type:"boolean",error:t.error}),error:t.error})}function _B(A,e,t,i={}){const n=Go(i),o={...Go(i),check:"string_format",type:"string",format:e,fn:"function"==typeof t?t:A=>t.test(A),...n};return t instanceof RegExp&&(o.pattern=t),new A(o)}var YB=class{constructor(A){this._def=A,this.def=A}implement(A){if("function"!=typeof A)throw new Error("implement() must be called with a function");const e=(...t)=>{const i=this._def.input?sg(this._def.input,t,void 0,{callee:e}):t;if(!Array.isArray(i))throw new Error("Invalid arguments schema: not an array or tuple schema.");const n=A(...i);return this._def.output?sg(this._def.output,n,void 0,{callee:e}):n};return e}implementAsync(A){if("function"!=typeof A)throw new Error("implement() must be called with a function");const e=async(...t)=>{const i=this._def.input?await Ig(this._def.input,t,void 0,{callee:e}):t;if(!Array.isArray(i))throw new Error("Invalid arguments schema: not an array or tuple schema.");const n=await A(...i);return this._def.output?Ig(this._def.output,n,void 0,{callee:e}):n};return e}input(...A){const e=this.constructor;return Array.isArray(A[0])?new e({type:"function",input:new kr({type:"tuple",items:A[0],rest:A[1]}),output:this._def.output}):new e({type:"function",input:A[0],output:this._def.output})}output(A){return new(0,this.constructor)({type:"function",input:this._def.input,output:A})}};function bB(A){return new YB({type:"function",input:Array.isArray(A?.input)?EB(kr,A?.input):A?.input??aB(Dr,kC(cr)),output:A?.output??kC(cr)})}var HB=class{constructor(A){this.counter=0,this.metadataRegistry=A?.metadata??_a,this.target=A?.target??"draft-2020-12",this.unrepresentable=A?.unrepresentable??"throw",this.override=A?.override??(()=>{}),this.io=A?.io??"output",this.seen=new Map}process(A,e={path:[],schemaPath:[]}){var t;const i=A._zod.def,n={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o=this.seen.get(A);if(o)return o.count++,e.schemaPath.includes(A)&&(o.cycle=e.path),o.schema;const g={schema:{},count:1,cycle:void 0,path:e.path};this.seen.set(A,g);const s=A._zod.toJSONSchema?.();if(s)g.schema=s;else{const t={...e,schemaPath:[...e.schemaPath,A],path:e.path},o=A._zod.parent;if(o)g.ref=o,this.process(o,t),this.seen.get(o).isParent=!0;else{const e=g.schema;switch(i.type){case"string":{const t=e;t.type="string";const{minimum:i,maximum:o,format:s,patterns:r,contentEncoding:I}=A._zod.bag;if("number"==typeof i&&(t.minLength=i),"number"==typeof o&&(t.maxLength=o),s&&(t.format=n[s]??s,""===t.format&&delete t.format),I&&(t.contentEncoding=I),r&&r.size>0){const A=[...r];1===A.length?t.pattern=A[0].source:A.length>1&&(g.schema.allOf=[...A.map(A=>({..."draft-7"===this.target?{type:"string"}:{},pattern:A.source}))])}break}case"number":{const t=e,{minimum:i,maximum:n,format:o,multipleOf:g,exclusiveMaximum:s,exclusiveMinimum:r}=A._zod.bag;"string"==typeof o&&o.includes("int")?t.type="integer":t.type="number","number"==typeof r&&(t.exclusiveMinimum=r),"number"==typeof i&&(t.minimum=i,"number"==typeof r&&(r>=i?delete t.minimum:delete t.exclusiveMinimum)),"number"==typeof s&&(t.exclusiveMaximum=s),"number"==typeof n&&(t.maximum=n,"number"==typeof s&&(s<=n?delete t.maximum:delete t.exclusiveMaximum)),"number"==typeof g&&(t.multipleOf=g);break}case"boolean":case"success":e.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw new Error("Symbols cannot be represented in JSON Schema");break;case"null":e.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw new Error("Void cannot be represented in JSON Schema");break;case"never":e.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":{const n=e,{minimum:o,maximum:g}=A._zod.bag;"number"==typeof o&&(n.minItems=o),"number"==typeof g&&(n.maxItems=g),n.type="array",n.items=this.process(i.element,{...t,path:[...t.path,"items"]});break}case"object":{const A=e;A.type="object",A.properties={};const n=i.shape;for(const e in n)A.properties[e]=this.process(n[e],{...t,path:[...t.path,"properties",e]});const o=new Set(Object.keys(n)),g=new Set([...o].filter(A=>{const e=i.shape[A]._zod;return"input"===this.io?void 0===e.optin:void 0===e.optout}));g.size>0&&(A.required=Array.from(g)),"never"===i.catchall?._zod.def.type?A.additionalProperties=!1:i.catchall?i.catchall&&(A.additionalProperties=this.process(i.catchall,{...t,path:[...t.path,"additionalProperties"]})):"output"===this.io&&(A.additionalProperties=!1);break}case"union":e.anyOf=i.options.map((A,e)=>this.process(A,{...t,path:[...t.path,"anyOf",e]}));break;case"intersection":{const A=e,n=this.process(i.left,{...t,path:[...t.path,"allOf",0]}),o=this.process(i.right,{...t,path:[...t.path,"allOf",1]}),g=A=>"allOf"in A&&1===Object.keys(A).length,s=[...g(n)?n.allOf:[n],...g(o)?o.allOf:[o]];A.allOf=s;break}case"tuple":{const n=e;n.type="array";const o=i.items.map((A,e)=>this.process(A,{...t,path:[...t.path,"prefixItems",e]}));if("draft-2020-12"===this.target?n.prefixItems=o:n.items=o,i.rest){const A=this.process(i.rest,{...t,path:[...t.path,"items"]});"draft-2020-12"===this.target?n.items=A:n.additionalItems=A}i.rest&&(n.items=this.process(i.rest,{...t,path:[...t.path,"items"]}));const{minimum:g,maximum:s}=A._zod.bag;"number"==typeof g&&(n.minItems=g),"number"==typeof s&&(n.maxItems=s);break}case"record":{const A=e;A.type="object",A.propertyNames=this.process(i.keyType,{...t,path:[...t.path,"propertyNames"]}),A.additionalProperties=this.process(i.valueType,{...t,path:[...t.path,"additionalProperties"]});break}case"map":if("throw"===this.unrepresentable)throw new Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw new Error("Set cannot be represented in JSON Schema");break;case"enum":{const A=e,t=so(i.entries);t.every(A=>"number"==typeof A)&&(A.type="number"),t.every(A=>"string"==typeof A)&&(A.type="string"),A.enum=t;break}case"literal":{const A=e,t=[];for(const A of i.values)if(void 0===A){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof A){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");t.push(Number(A))}else t.push(A);if(0===t.length);else if(1===t.length){const e=t[0];A.type=null===e?"null":typeof e,A.const=e}else t.every(A=>"number"==typeof A)&&(A.type="number"),t.every(A=>"string"==typeof A)&&(A.type="string"),t.every(A=>"boolean"==typeof A)&&(A.type="string"),t.every(A=>null===A)&&(A.type="null"),A.enum=t;break}case"file":{const t=e,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:n,maximum:o,mime:g}=A._zod.bag;void 0!==n&&(i.minLength=n),void 0!==o&&(i.maxLength=o),g?1===g.length?(i.contentMediaType=g[0],Object.assign(t,i)):t.anyOf=g.map(A=>({...i,contentMediaType:A})):Object.assign(t,i);break}case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":{const A=this.process(i.innerType,t);e.anyOf=[A,{type:"null"}];break}case"nonoptional":case"promise":case"optional":this.process(i.innerType,t),g.ref=i.innerType;break;case"default":this.process(i.innerType,t),g.ref=i.innerType,e.default=JSON.parse(JSON.stringify(i.defaultValue));break;case"prefault":this.process(i.innerType,t),g.ref=i.innerType,"input"===this.io&&(e._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break;case"catch":{let A;this.process(i.innerType,t),g.ref=i.innerType;try{A=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}e.default=A;break}case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{const t=e,i=A._zod.pattern;if(!i)throw new Error("Pattern not found in template literal");t.type="string",t.pattern=i.source;break}case"pipe":{const A="input"===this.io?"transform"===i.in._zod.def.type?i.out:i.in:i.out;this.process(A,t),g.ref=A;break}case"readonly":this.process(i.innerType,t),g.ref=i.innerType,e.readOnly=!0;break;case"lazy":{const e=A._zod.innerType;this.process(e,t),g.ref=e;break}case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")}}}const r=this.metadataRegistry.get(A);return r&&Object.assign(g.schema,r),"input"===this.io&&KB(A)&&(delete g.schema.examples,delete g.schema.default),"input"===this.io&&g.schema._prefault&&((t=g.schema).default??(t.default=g.schema._prefault)),delete g.schema._prefault,this.seen.get(A).schema}emit(A,e){const t={cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0},i=this.seen.get(A);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=A=>{const e="draft-2020-12"===this.target?"$defs":"definitions";if(t.external){const i=t.external.registry.get(A[0])?.id,n=t.external.uri??(A=>A);if(i)return{ref:n(i)};const o=A[1].defId??A[1].schema.id??"schema"+this.counter++;return A[1].defId=o,{defId:o,ref:`${n("__shared")}#/${e}/${o}`}}if(A[1]===i)return{ref:"#"};const n=`#/${e}/`,o=A[1].schema.id??"__schema"+this.counter++;return{defId:o,ref:n+o}},o=A=>{if(A[1].schema.$ref)return;const e=A[1],{ref:t,defId:i}=n(A);e.def={...e.schema},i&&(e.defId=i);const o=e.schema;for(const A in o)delete o[A];o.$ref=t};if("throw"===t.cycles)for(const A of this.seen.entries()){const e=A[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const e of this.seen.entries()){const i=e[1];if(A===e[0]){o(e);continue}if(t.external){const i=t.external.registry.get(e[0])?.id;if(A!==e[0]&&i){o(e);continue}}const n=this.metadataRegistry.get(e[0])?.id;(n||i.cycle||i.count>1&&"ref"===t.reused)&&o(e)}const g=(A,e)=>{const t=this.seen.get(A),i=t.def??t.schema,n={...i};if(null===t.ref)return;const o=t.ref;if(t.ref=null,o){g(o,e);const A=this.seen.get(o).schema;A.$ref&&"draft-7"===e.target?(i.allOf=i.allOf??[],i.allOf.push(A)):(Object.assign(i,A),Object.assign(i,n))}t.isParent||this.override({zodSchema:A,jsonSchema:i,path:t.path??[]})};for(const A of[...this.seen.entries()].reverse())g(A[0],{target:this.target});const s={};if("draft-2020-12"===this.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?s.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),t.external?.uri){const e=t.external.registry.get(A)?.id;if(!e)throw new Error("Schema is missing an `id` property");s.$id=t.external.uri(e)}Object.assign(s,i.def);const r=t.external?.defs??{};for(const A of this.seen.entries()){const e=A[1];e.def&&e.defId&&(r[e.defId]=e.def)}t.external||Object.keys(r).length>0&&("draft-2020-12"===this.target?s.$defs=r:s.definitions=r);try{return JSON.parse(JSON.stringify(s))}catch(A){throw new Error("Error converting schema to JSON.")}}};function xB(A,e){if(A instanceof Ua){const t=new HB(e),i={};for(const e of A._idmap.entries()){const[A,i]=e;t.process(i)}const n={},o={registry:A,uri:e?.uri,defs:i};for(const i of A._idmap.entries()){const[A,g]=i;n[A]=t.emit(g,{...e,external:o})}if(Object.keys(i).length>0){const A="draft-2020-12"===t.target?"$defs":"definitions";n.__shared={[A]:i}}return{schemas:n}}const t=new HB(e);return t.process(A),t.emit(A,e)}function KB(A,e){const t=e??{seen:new Set};if(t.seen.has(A))return!1;t.seen.add(A);const i=A._zod.def;switch(i.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":case"custom":case"success":case"catch":return!1;case"array":return KB(i.element,t);case"object":for(const A in i.shape)if(KB(i.shape[A],t))return!0;return!1;case"union":for(const A of i.options)if(KB(A,t))return!0;return!1;case"intersection":return KB(i.left,t)||KB(i.right,t);case"tuple":for(const A of i.items)if(KB(A,t))return!0;return!(!i.rest||!KB(i.rest,t));case"record":case"map":return KB(i.keyType,t)||KB(i.valueType,t);case"set":return KB(i.valueType,t);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return KB(i.innerType,t);case"lazy":return KB(i.getter(),t);case"transform":return!0;case"pipe":return KB(i.in,t)||KB(i.out,t)}throw new Error(`Unknown schema type: ${i.type}`)}var OB={},vB={};r(vB,{ZodISODate:()=>VB,ZodISODateTime:()=>qB,ZodISODuration:()=>zB,ZodISOTime:()=>WB,date:()=>jB,datetime:()=>PB,duration:()=>XB,time:()=>ZB});var qB=Zn("ZodISODateTime",(A,e)=>{vs.init(A,e),aQ.init(A,e)});function PB(A){return IC(qB,A)}var VB=Zn("ZodISODate",(A,e)=>{qs.init(A,e),aQ.init(A,e)});function jB(A){return aC(VB,A)}var WB=Zn("ZodISOTime",(A,e)=>{Ps.init(A,e),aQ.init(A,e)});function ZB(A){return CC(WB,A)}var zB=Zn("ZodISODuration",(A,e)=>{Vs.init(A,e),aQ.init(A,e)});function XB(A){return BC(zB,A)}var $B=(A,e)=>{$o.init(A,e),A.name="ZodError",Object.defineProperties(A,{format:{value:e=>tg(A,e)},flatten:{value:e=>eg(A,e)},addIssue:{value:e=>A.issues.push(e)},addIssues:{value:e=>A.issues.push(...e)},isEmpty:{get:()=>0===A.issues.length}})},AQ=Zn("ZodError",$B),eQ=Zn("ZodError",$B,{Parent:Error}),tQ=gg(eQ),iQ=rg(eQ),nQ=ag(eQ),oQ=Bg(eQ),gQ=Zn("ZodType",(A,e)=>(ks.init(A,e),A.def=e,Object.defineProperty(A,"_def",{value:e}),A.check=(...t)=>A.clone({...e,checks:[...e.checks??[],...t.map(A=>"function"==typeof A?{_zod:{check:A,def:{check:"custom"},onattach:[]}}:A)]}),A.clone=(e,t)=>ko(A,e,t),A.brand=()=>A,A.register=(e,t)=>(e.add(A,t),A),A.parse=(e,t)=>tQ(A,e,t,{callee:A.parse}),A.safeParse=(e,t)=>nQ(A,e,t),A.parseAsync=async(e,t)=>iQ(A,e,t,{callee:A.parseAsync}),A.safeParseAsync=async(e,t)=>oQ(A,e,t),A.spa=A.safeParseAsync,A.refine=(e,t)=>A.check(Yc(e,t)),A.superRefine=e=>A.check(bc(e)),A.overwrite=e=>A.check(oB(e)),A.optional=()=>Ic(A),A.nullable=()=>Cc(A),A.nullish=()=>Ic(Cc(A)),A.nonoptional=e=>dc(A,e),A.array=()=>LE(A),A.or=e=>bE([A,e]),A.and=e=>OE(A,e),A.transform=e=>Rc(A,sc(e)),A.default=e=>Ec(A,e),A.prefault=e=>lc(A,e),A.catch=e=>wc(A,e),A.pipe=e=>Rc(A,e),A.readonly=()=>Mc(A),A.describe=e=>{const t=A.clone();return _a.add(t,{description:e}),t},Object.defineProperty(A,"description",{get:()=>_a.get(A)?.description,configurable:!0}),A.meta=(...e)=>{if(0===e.length)return _a.get(A);const t=A.clone();return _a.add(t,e[0]),t},A.isOptional=()=>A.safeParse(void 0).success,A.isNullable=()=>A.safeParse(null).success,A)),sQ=Zn("_ZodString",(A,e)=>{Gs.init(A,e),gQ.init(A,e);const t=A._zod.bag;A.format=t.format??null,A.minLength=t.minimum??null,A.maxLength=t.maximum??null,A.regex=(...e)=>A.check(zC(...e)),A.includes=(...e)=>A.check(AB(...e)),A.startsWith=(...e)=>A.check(eB(...e)),A.endsWith=(...e)=>A.check(tB(...e)),A.min=(...e)=>A.check(WC(...e)),A.max=(...e)=>A.check(jC(...e)),A.length=(...e)=>A.check(ZC(...e)),A.nonempty=(...e)=>A.check(WC(1,...e)),A.lowercase=e=>A.check(XC(e)),A.uppercase=e=>A.check($C(e)),A.trim=()=>A.check(sB()),A.normalize=(...e)=>A.check(gB(...e)),A.toLowerCase=()=>A.check(rB()),A.toUpperCase=()=>A.check(IB())}),rQ=Zn("ZodString",(A,e)=>{Gs.init(A,e),sQ.init(A,e),A.email=e=>A.check(Ha(CQ,e)),A.url=e=>A.check(Pa(DQ,e)),A.jwt=e=>A.check(sC(ZQ,e)),A.emoji=e=>A.check(Va(wQ,e)),A.guid=e=>A.check(xa(QQ,e)),A.uuid=e=>A.check(Ka(cQ,e)),A.uuidv4=e=>A.check(Oa(cQ,e)),A.uuidv6=e=>A.check(va(cQ,e)),A.uuidv7=e=>A.check(qa(cQ,e)),A.nanoid=e=>A.check(ja(yQ,e)),A.guid=e=>A.check(xa(QQ,e)),A.cuid=e=>A.check(Wa(RQ,e)),A.cuid2=e=>A.check(Za(MQ,e)),A.ulid=e=>A.check(za(kQ,e)),A.base64=e=>A.check(nC(vQ,e)),A.base64url=e=>A.check(oC(PQ,e)),A.xid=e=>A.check(Xa(LQ,e)),A.ksuid=e=>A.check($a(TQ,e)),A.ipv4=e=>A.check(AC(JQ,e)),A.ipv6=e=>A.check(eC(YQ,e)),A.cidrv4=e=>A.check(tC(HQ,e)),A.cidrv6=e=>A.check(iC(KQ,e)),A.e164=e=>A.check(gC(jQ,e)),A.datetime=e=>A.check(PB(e)),A.date=e=>A.check(jB(e)),A.time=e=>A.check(ZB(e)),A.duration=e=>A.check(XB(e))});function IQ(A){return Ya(rQ,A)}var aQ=Zn("ZodStringFormat",(A,e)=>{Ls.init(A,e),sQ.init(A,e)}),CQ=Zn("ZodEmail",(A,e)=>{Us.init(A,e),aQ.init(A,e)});function BQ(A){return Ha(CQ,A)}var QQ=Zn("ZodGUID",(A,e)=>{Fs.init(A,e),aQ.init(A,e)});function EQ(A){return xa(QQ,A)}var cQ=Zn("ZodUUID",(A,e)=>{Ts.init(A,e),aQ.init(A,e)});function lQ(A){return Ka(cQ,A)}function uQ(A){return Oa(cQ,A)}function dQ(A){return va(cQ,A)}function hQ(A){return qa(cQ,A)}var DQ=Zn("ZodURL",(A,e)=>{Js.init(A,e),aQ.init(A,e)});function pQ(A){return Pa(DQ,A)}var wQ=Zn("ZodEmoji",(A,e)=>{_s.init(A,e),aQ.init(A,e)});function mQ(A){return Va(wQ,A)}var yQ=Zn("ZodNanoID",(A,e)=>{Ys.init(A,e),aQ.init(A,e)});function fQ(A){return ja(yQ,A)}var RQ=Zn("ZodCUID",(A,e)=>{bs.init(A,e),aQ.init(A,e)});function NQ(A){return Wa(RQ,A)}var MQ=Zn("ZodCUID2",(A,e)=>{Hs.init(A,e),aQ.init(A,e)});function SQ(A){return Za(MQ,A)}var kQ=Zn("ZodULID",(A,e)=>{xs.init(A,e),aQ.init(A,e)});function GQ(A){return za(kQ,A)}var LQ=Zn("ZodXID",(A,e)=>{Ks.init(A,e),aQ.init(A,e)});function FQ(A){return Xa(LQ,A)}var TQ=Zn("ZodKSUID",(A,e)=>{Os.init(A,e),aQ.init(A,e)});function UQ(A){return $a(TQ,A)}var JQ=Zn("ZodIPv4",(A,e)=>{js.init(A,e),aQ.init(A,e)});function _Q(A){return AC(JQ,A)}var YQ=Zn("ZodIPv6",(A,e)=>{Ws.init(A,e),aQ.init(A,e)});function bQ(A){return eC(YQ,A)}var HQ=Zn("ZodCIDRv4",(A,e)=>{Zs.init(A,e),aQ.init(A,e)});function xQ(A){return tC(HQ,A)}var KQ=Zn("ZodCIDRv6",(A,e)=>{zs.init(A,e),aQ.init(A,e)});function OQ(A){return iC(KQ,A)}var vQ=Zn("ZodBase64",(A,e)=>{$s.init(A,e),aQ.init(A,e)});function qQ(A){return nC(vQ,A)}var PQ=Zn("ZodBase64URL",(A,e)=>{er.init(A,e),aQ.init(A,e)});function VQ(A){return oC(PQ,A)}var jQ=Zn("ZodE164",(A,e)=>{tr.init(A,e),aQ.init(A,e)});function WQ(A){return gC(jQ,A)}var ZQ=Zn("ZodJWT",(A,e)=>{nr.init(A,e),aQ.init(A,e)});function zQ(A){return sC(ZQ,A)}var XQ=Zn("ZodCustomStringFormat",(A,e)=>{or.init(A,e),aQ.init(A,e)});function $Q(A,e,t={}){return _B(XQ,A,e,t)}var AE=Zn("ZodNumber",(A,e)=>{gr.init(A,e),gQ.init(A,e),A.gt=(e,t)=>A.check(YC(e,t)),A.gte=(e,t)=>A.check(bC(e,t)),A.min=(e,t)=>A.check(bC(e,t)),A.lt=(e,t)=>A.check(JC(e,t)),A.lte=(e,t)=>A.check(_C(e,t)),A.max=(e,t)=>A.check(_C(e,t)),A.int=e=>A.check(iE(e)),A.safe=e=>A.check(iE(e)),A.positive=e=>A.check(YC(0,e)),A.nonnegative=e=>A.check(bC(0,e)),A.negative=e=>A.check(JC(0,e)),A.nonpositive=e=>A.check(_C(0,e)),A.multipleOf=(e,t)=>A.check(vC(e,t)),A.step=(e,t)=>A.check(vC(e,t)),A.finite=()=>A;const t=A._zod.bag;A.minValue=Math.max(t.minimum??Number.NEGATIVE_INFINITY,t.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,A.maxValue=Math.min(t.maximum??Number.POSITIVE_INFINITY,t.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,A.isInt=(t.format??"").includes("int")||Number.isSafeInteger(t.multipleOf??.5),A.isFinite=!0,A.format=t.format??null});function eE(A){return QC(AE,A)}var tE=Zn("ZodNumberFormat",(A,e)=>{sr.init(A,e),AE.init(A,e)});function iE(A){return cC(tE,A)}function nE(A){return lC(tE,A)}function oE(A){return uC(tE,A)}function gE(A){return dC(tE,A)}function sE(A){return hC(tE,A)}var rE=Zn("ZodBoolean",(A,e)=>{rr.init(A,e),gQ.init(A,e)});function IE(A){return DC(rE,A)}var aE=Zn("ZodBigInt",(A,e)=>{Ir.init(A,e),gQ.init(A,e),A.gte=(e,t)=>A.check(bC(e,t)),A.min=(e,t)=>A.check(bC(e,t)),A.gt=(e,t)=>A.check(YC(e,t)),A.gte=(e,t)=>A.check(bC(e,t)),A.min=(e,t)=>A.check(bC(e,t)),A.lt=(e,t)=>A.check(JC(e,t)),A.lte=(e,t)=>A.check(_C(e,t)),A.max=(e,t)=>A.check(_C(e,t)),A.positive=e=>A.check(YC(BigInt(0),e)),A.negative=e=>A.check(JC(BigInt(0),e)),A.nonpositive=e=>A.check(_C(BigInt(0),e)),A.nonnegative=e=>A.check(bC(BigInt(0),e)),A.multipleOf=(e,t)=>A.check(vC(e,t));const t=A._zod.bag;A.minValue=t.minimum??null,A.maxValue=t.maximum??null,A.format=t.format??null});function CE(A){return wC(aE,A)}var BE=Zn("ZodBigIntFormat",(A,e)=>{ar.init(A,e),aE.init(A,e)});function QE(A){return yC(BE,A)}function EE(A){return fC(BE,A)}var cE=Zn("ZodSymbol",(A,e)=>{Cr.init(A,e),gQ.init(A,e)});function lE(A){return RC(cE,A)}var uE=Zn("ZodUndefined",(A,e)=>{Br.init(A,e),gQ.init(A,e)});function dE(A){return NC(uE,A)}var hE=Zn("ZodNull",(A,e)=>{Qr.init(A,e),gQ.init(A,e)});function DE(A){return MC(hE,A)}var pE=Zn("ZodAny",(A,e)=>{Er.init(A,e),gQ.init(A,e)});function wE(){return SC(pE)}var mE=Zn("ZodUnknown",(A,e)=>{cr.init(A,e),gQ.init(A,e)});function yE(){return kC(mE)}var fE=Zn("ZodNever",(A,e)=>{lr.init(A,e),gQ.init(A,e)});function RE(A){return GC(fE,A)}var NE=Zn("ZodVoid",(A,e)=>{ur.init(A,e),gQ.init(A,e)});function ME(A){return LC(NE,A)}var SE=Zn("ZodDate",(A,e)=>{dr.init(A,e),gQ.init(A,e),A.min=(e,t)=>A.check(bC(e,t)),A.max=(e,t)=>A.check(_C(e,t));const t=A._zod.bag;A.minDate=t.minimum?new Date(t.minimum):null,A.maxDate=t.maximum?new Date(t.maximum):null});function kE(A){return FC(SE,A)}var GE=Zn("ZodArray",(A,e)=>{Dr.init(A,e),gQ.init(A,e),A.element=e.element,A.min=(e,t)=>A.check(WC(e,t)),A.nonempty=e=>A.check(WC(1,e)),A.max=(e,t)=>A.check(jC(e,t)),A.length=(e,t)=>A.check(ZC(e,t)),A.unwrap=()=>A.element});function LE(A,e){return aB(GE,A,e)}function FE(A){const e=A._zod.def.shape;return ic(Object.keys(e))}var TE=Zn("ZodObject",(A,e)=>{mr.init(A,e),gQ.init(A,e),eo.defineLazy(A,"shape",()=>e.shape),A.keyof=()=>Ac(Object.keys(A._zod.def.shape)),A.catchall=e=>A.clone({...A._zod.def,catchall:e}),A.passthrough=()=>A.clone({...A._zod.def,catchall:yE()}),A.loose=()=>A.clone({...A._zod.def,catchall:yE()}),A.strict=()=>A.clone({...A._zod.def,catchall:RE()}),A.strip=()=>A.clone({...A._zod.def,catchall:void 0}),A.extend=e=>eo.extend(A,e),A.merge=e=>eo.merge(A,e),A.pick=e=>eo.pick(A,e),A.omit=e=>eo.omit(A,e),A.partial=(...e)=>eo.partial(rc,A,e[0]),A.required=(...e)=>eo.required(uc,A,e[0])});function UE(A,e){const t={type:"object",get shape(){return eo.assignProp(this,"shape",{...A}),this.shape},...eo.normalizeParams(e)};return new TE(t)}function JE(A,e){return new TE({type:"object",get shape(){return eo.assignProp(this,"shape",{...A}),this.shape},catchall:RE(),...eo.normalizeParams(e)})}function _E(A,e){return new TE({type:"object",get shape(){return eo.assignProp(this,"shape",{...A}),this.shape},catchall:yE(),...eo.normalizeParams(e)})}var YE=Zn("ZodUnion",(A,e)=>{fr.init(A,e),gQ.init(A,e),A.options=e.options});function bE(A,e){return new YE({type:"union",options:A,...eo.normalizeParams(e)})}var HE=Zn("ZodDiscriminatedUnion",(A,e)=>{YE.init(A,e),Rr.init(A,e)});function xE(A,e,t){return new HE({type:"union",options:e,discriminator:A,...eo.normalizeParams(t)})}var KE=Zn("ZodIntersection",(A,e)=>{Nr.init(A,e),gQ.init(A,e)});function OE(A,e){return new KE({type:"intersection",left:A,right:e})}var vE=Zn("ZodTuple",(A,e)=>{kr.init(A,e),gQ.init(A,e),A.rest=e=>A.clone({...A._zod.def,rest:e})});function qE(A,e,t){const i=e instanceof ks,n=i?t:e;return new vE({type:"tuple",items:A,rest:i?e:null,...eo.normalizeParams(n)})}var PE=Zn("ZodRecord",(A,e)=>{Lr.init(A,e),gQ.init(A,e),A.keyType=e.keyType,A.valueType=e.valueType});function VE(A,e,t){return new PE({type:"record",keyType:A,valueType:e,...eo.normalizeParams(t)})}function jE(A,e,t){return new PE({type:"record",keyType:bE([A,RE()]),valueType:e,...eo.normalizeParams(t)})}var WE=Zn("ZodMap",(A,e)=>{Fr.init(A,e),gQ.init(A,e),A.keyType=e.keyType,A.valueType=e.valueType});function ZE(A,e,t){return new WE({type:"map",keyType:A,valueType:e,...eo.normalizeParams(t)})}var zE=Zn("ZodSet",(A,e)=>{Ur.init(A,e),gQ.init(A,e),A.min=(...e)=>A.check(PC(...e)),A.nonempty=e=>A.check(PC(1,e)),A.max=(...e)=>A.check(qC(...e)),A.size=(...e)=>A.check(VC(...e))});function XE(A,e){return new zE({type:"set",valueType:A,...eo.normalizeParams(e)})}var $E=Zn("ZodEnum",(A,e)=>{_r.init(A,e),gQ.init(A,e),A.enum=e.entries,A.options=Object.values(e.entries);const t=new Set(Object.keys(e.entries));A.extract=(A,i)=>{const n={};for(const i of A){if(!t.has(i))throw new Error(`Key ${i} not found in enum`);n[i]=e.entries[i]}return new $E({...e,checks:[],...eo.normalizeParams(i),entries:n})},A.exclude=(A,i)=>{const n={...e.entries};for(const e of A){if(!t.has(e))throw new Error(`Key ${e} not found in enum`);delete n[e]}return new $E({...e,checks:[],...eo.normalizeParams(i),entries:n})}});function Ac(A,e){const t=Array.isArray(A)?Object.fromEntries(A.map(A=>[A,A])):A;return new $E({type:"enum",entries:t,...eo.normalizeParams(e)})}function ec(A,e){return new $E({type:"enum",entries:A,...eo.normalizeParams(e)})}var tc=Zn("ZodLiteral",(A,e)=>{Yr.init(A,e),gQ.init(A,e),A.values=new Set(e.values),Object.defineProperty(A,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function ic(A,e){return new tc({type:"literal",values:Array.isArray(A)?A:[A],...eo.normalizeParams(e)})}var nc=Zn("ZodFile",(A,e)=>{br.init(A,e),gQ.init(A,e),A.min=(e,t)=>A.check(PC(e,t)),A.max=(e,t)=>A.check(qC(e,t)),A.mime=(e,t)=>A.check(nB(Array.isArray(e)?e:[e],t))});function oc(A){return pB(nc,A)}var gc=Zn("ZodTransform",(A,e)=>{Hr.init(A,e),gQ.init(A,e),A._zod.parse=(t,i)=>{t.addIssue=i=>{if("string"==typeof i)t.issues.push(eo.issue(i,t.value,e));else{const e=i;e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=t.value),e.inst??(e.inst=A),e.continue??(e.continue=!0),t.issues.push(eo.issue(e))}};const n=e.transform(t.value,t);return n instanceof Promise?n.then(A=>(t.value=A,t)):(t.value=n,t)}});function sc(A){return new gc({type:"transform",transform:A})}var rc=Zn("ZodOptional",(A,e)=>{xr.init(A,e),gQ.init(A,e),A.unwrap=()=>A._zod.def.innerType});function Ic(A){return new rc({type:"optional",innerType:A})}var ac=Zn("ZodNullable",(A,e)=>{Kr.init(A,e),gQ.init(A,e),A.unwrap=()=>A._zod.def.innerType});function Cc(A){return new ac({type:"nullable",innerType:A})}function Bc(A){return Ic(Cc(A))}var Qc=Zn("ZodDefault",(A,e)=>{Or.init(A,e),gQ.init(A,e),A.unwrap=()=>A._zod.def.innerType,A.removeDefault=A.unwrap});function Ec(A,e){return new Qc({type:"default",innerType:A,get defaultValue(){return"function"==typeof e?e():e}})}var cc=Zn("ZodPrefault",(A,e)=>{qr.init(A,e),gQ.init(A,e),A.unwrap=()=>A._zod.def.innerType});function lc(A,e){return new cc({type:"prefault",innerType:A,get defaultValue(){return"function"==typeof e?e():e}})}var uc=Zn("ZodNonOptional",(A,e)=>{Pr.init(A,e),gQ.init(A,e),A.unwrap=()=>A._zod.def.innerType});function dc(A,e){return new uc({type:"nonoptional",innerType:A,...eo.normalizeParams(e)})}var hc=Zn("ZodSuccess",(A,e)=>{jr.init(A,e),gQ.init(A,e),A.unwrap=()=>A._zod.def.innerType});function Dc(A){return new hc({type:"success",innerType:A})}var pc=Zn("ZodCatch",(A,e)=>{Wr.init(A,e),gQ.init(A,e),A.unwrap=()=>A._zod.def.innerType,A.removeCatch=A.unwrap});function wc(A,e){return new pc({type:"catch",innerType:A,catchValue:"function"==typeof e?e:()=>e})}var mc=Zn("ZodNaN",(A,e)=>{Zr.init(A,e),gQ.init(A,e)});function yc(A){return UC(mc,A)}var fc=Zn("ZodPipe",(A,e)=>{zr.init(A,e),gQ.init(A,e),A.in=e.in,A.out=e.out});function Rc(A,e){return new fc({type:"pipe",in:A,out:e})}var Nc=Zn("ZodReadonly",(A,e)=>{$r.init(A,e),gQ.init(A,e)});function Mc(A){return new Nc({type:"readonly",innerType:A})}var Sc=Zn("ZodTemplateLiteral",(A,e)=>{eI.init(A,e),gQ.init(A,e)});function kc(A,e){return new Sc({type:"template_literal",parts:A,...eo.normalizeParams(e)})}var Gc=Zn("ZodLazy",(A,e)=>{iI.init(A,e),gQ.init(A,e),A.unwrap=()=>A._zod.def.getter()});function Lc(A){return new Gc({type:"lazy",getter:A})}var Fc=Zn("ZodPromise",(A,e)=>{tI.init(A,e),gQ.init(A,e),A.unwrap=()=>A._zod.def.innerType});function Tc(A){return new Fc({type:"promise",innerType:A})}var Uc=Zn("ZodCustom",(A,e)=>{nI.init(A,e),gQ.init(A,e)});function Jc(A){const e=new ns({check:"custom"});return e._zod.check=A,e}function _c(A,e){return TB(Uc,A??(()=>!0),e)}function Yc(A,e={}){return UB(Uc,A,e)}function bc(A){const e=Jc(t=>(t.addIssue=A=>{if("string"==typeof A)t.issues.push(eo.issue(A,t.value,e._zod.def));else{const i=A;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=e),i.continue??(i.continue=!e._zod.def.abort),t.issues.push(eo.issue(i))}},A(t.value,t)));return e}function Hc(A,e={error:`Input not instance of ${A.name}`}){const t=new Uc({type:"custom",check:"custom",fn:e=>e instanceof A,abort:!0,...eo.normalizeParams(e)});return t._zod.bag.Class=A,t}var xc=(...A)=>JB({Pipe:fc,Boolean:rE,String:rQ,Transform:gc},...A);function Kc(A){const e=Lc(()=>bE([IQ(A),eE(),IE(),DE(),LE(e),VE(IQ(),e)]));return e}function Oc(A,e){return Rc(sc(A),e)}var vc={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 qc(A){Ao({customError:A})}function Pc(){return Ao().customError}var Vc={};function jc(A){return ba(rQ,A)}function Wc(A){return EC(AE,A)}function Zc(A){return pC(rE,A)}function zc(A){return mC(aE,A)}function Xc(A){return TC(SE,A)}r(Vc,{bigint:()=>zc,boolean:()=>Zc,date:()=>Xc,number:()=>Wc,string:()=>jc}),Ao(pI());var $c=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),description:Vn.union([Vn.string(),Vn.null()]).optional(),id:Vn.string(),name:Vn.string()}),Al=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),methodId:Vn.string()}),el=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional()}),tl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),blob:Vn.string(),mimeType:Vn.union([Vn.string(),Vn.null()]).optional(),uri:Vn.string()}),il=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),terminalId:Vn.string()}),nl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),newText:Vn.string(),oldText:Vn.union([Vn.string(),Vn.null()]).optional(),path:Vn.string()}),ol=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),name:Vn.string(),value:Vn.string()}),gl=Vn.union([Vn.literal(-32700),Vn.literal(-32600),Vn.literal(-32601),Vn.literal(-32602),Vn.literal(-32603),Vn.literal(-32800),Vn.literal(-32e3),Vn.literal(-32002),Vn.number().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),sl=Vn.object({code:gl,data:Vn.unknown().optional(),message:Vn.string()}),rl=Vn.unknown(),Il=Vn.unknown(),al=Vn.unknown(),Cl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),readTextFile:Vn.boolean().optional().default(!1),writeTextFile:Vn.boolean().optional().default(!1)}),Bl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),fs:Cl.optional().default({readTextFile:!1,writeTextFile:!1}),terminal:Vn.boolean().optional().default(!1)}),Ql=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),name:Vn.string(),value:Vn.string()}),El=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),name:Vn.string(),title:Vn.union([Vn.string(),Vn.null()]).optional(),version:Vn.string()}),cl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional()}),ll=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),cursor:Vn.union([Vn.string(),Vn.null()]).optional(),cwd:Vn.union([Vn.string(),Vn.null()]).optional()}),ul=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),http:Vn.boolean().optional().default(!1),sse:Vn.boolean().optional().default(!1)}),dl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),headers:Vn.array(Ql),name:Vn.string(),url:Vn.string()}),hl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),headers:Vn.array(Ql),name:Vn.string(),url:Vn.string()}),Dl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),args:Vn.array(Vn.string()),command:Vn.string(),env:Vn.array(ol),name:Vn.string()}),pl=Vn.union([dl.and(Vn.object({type:Vn.literal("http")})),hl.and(Vn.object({type:Vn.literal("sse")})),Dl]),wl=Vn.string(),ml=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),description:Vn.union([Vn.string(),Vn.null()]).optional(),modelId:wl,name:Vn.string()}),yl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),cwd:Vn.string(),mcpServers:Vn.array(pl)}),fl=Vn.string(),Rl=Vn.union([Vn.literal("allow_once"),Vn.literal("allow_always"),Vn.literal("reject_once"),Vn.literal("reject_always")]),Nl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),kind:Rl,name:Vn.string(),optionId:fl}),Ml=Vn.union([Vn.literal("high"),Vn.literal("medium"),Vn.literal("low")]),Sl=Vn.union([Vn.literal("pending"),Vn.literal("in_progress"),Vn.literal("completed")]),kl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),content:Vn.string(),priority:Ml,status:Sl}),Gl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),entries:Vn.array(kl)}),Ll=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),audio:Vn.boolean().optional().default(!1),embeddedContext:Vn.boolean().optional().default(!1),image:Vn.boolean().optional().default(!1)}),Fl=Vn.number().int().gte(0).lte(65535),Tl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),clientCapabilities:Bl.optional().default({fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:Vn.union([El,Vn.null()]).optional(),protocolVersion:Fl}),Ul=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),content:Vn.string()}),Jl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional()}),_l=Vn.union([Vn.null(),Vn.coerce.bigint().min(BigInt("-9223372036854775808"),{message:"Invalid value: Expected int64 to be >= -9223372036854775808"}).max(BigInt("9223372036854775807"),{message:"Invalid value: Expected int64 to be <= 9223372036854775807"}),Vn.string()]),Yl=(Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),requestId:_l}),Vn.enum(["assistant","user"])),bl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),audience:Vn.union([Vn.array(Yl),Vn.null()]).optional(),lastModified:Vn.union([Vn.string(),Vn.null()]).optional(),priority:Vn.union([Vn.number(),Vn.null()]).optional()}),Hl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),annotations:Vn.union([bl,Vn.null()]).optional(),data:Vn.string(),mimeType:Vn.string()}),xl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),annotations:Vn.union([bl,Vn.null()]).optional(),data:Vn.string(),mimeType:Vn.string(),uri:Vn.union([Vn.string(),Vn.null()]).optional()}),Kl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),annotations:Vn.union([bl,Vn.null()]).optional(),description:Vn.union([Vn.string(),Vn.null()]).optional(),mimeType:Vn.union([Vn.string(),Vn.null()]).optional(),name:Vn.string(),size:Vn.union([Vn.coerce.bigint().min(BigInt("-9223372036854775808"),{message:"Invalid value: Expected int64 to be >= -9223372036854775808"}).max(BigInt("9223372036854775807"),{message:"Invalid value: Expected int64 to be <= 9223372036854775807"}),Vn.null()]).optional(),title:Vn.union([Vn.string(),Vn.null()]).optional(),uri:Vn.string()}),Ol=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),optionId:fl}),vl=Vn.union([Vn.object({outcome:Vn.literal("cancelled")}),Ol.and(Vn.object({outcome:Vn.literal("selected")}))]),ql=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),outcome:vl}),Pl=Vn.string(),Vl=Vn.string(),jl=Vn.union([Vn.literal("mode"),Vn.literal("model"),Vn.literal("thought_level"),Vn.string()]),Wl=Vn.string(),Zl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),description:Vn.union([Vn.string(),Vn.null()]).optional(),name:Vn.string(),value:Wl}),zl=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),group:Pl,name:Vn.string(),options:Vn.array(Zl)}),Xl=Vn.union([Vn.array(Zl),Vn.array(zl)]),$l=Vn.object({currentValue:Wl,options:Xl}).and(Vn.object({type:Vn.literal("select")})).and(Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),category:Vn.union([jl,Vn.null()]).optional(),description:Vn.union([Vn.string(),Vn.null()]).optional(),id:Vl,name:Vn.string()})),Au=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),configOptions:Vn.array($l)}),eu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional()}),tu=Vn.string(),iu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),sessionId:tu}),nu=(Vn.object({method:Vn.string(),params:Vn.union([Vn.union([iu,rl]),Vn.null()]).optional()}),Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),args:Vn.array(Vn.string()).optional(),command:Vn.string(),cwd:Vn.union([Vn.string(),Vn.null()]).optional(),env:Vn.array(ol).optional(),outputByteLimit:Vn.union([Vn.coerce.bigint().gte(BigInt(0)).max(BigInt("18446744073709551615"),{message:"Invalid value: Expected uint64 to be <= 18446744073709551615"}),Vn.null()]).optional(),sessionId:tu})),ou=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),cwd:Vn.string(),mcpServers:Vn.array(pl).optional(),sessionId:tu}),gu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),sessionId:tu,terminalId:Vn.string()}),su=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),cwd:Vn.string(),mcpServers:Vn.array(pl),sessionId:tu}),ru=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),limit:Vn.union([Vn.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),Vn.null()]).optional(),line:Vn.union([Vn.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),Vn.null()]).optional(),path:Vn.string(),sessionId:tu}),Iu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),sessionId:tu,terminalId:Vn.string()}),au=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),cwd:Vn.string(),mcpServers:Vn.array(pl).optional(),sessionId:tu}),Cu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),cwd:Vn.string(),sessionId:tu,title:Vn.union([Vn.string(),Vn.null()]).optional(),updatedAt:Vn.union([Vn.string(),Vn.null()]).optional()}),Bu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),nextCursor:Vn.union([Vn.string(),Vn.null()]).optional(),sessions:Vn.array(Cu)}),Qu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),title:Vn.union([Vn.string(),Vn.null()]).optional(),updatedAt:Vn.union([Vn.string(),Vn.null()]).optional()}),Eu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional()}),cu=Vn.string(),lu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),currentModeId:cu}),uu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),description:Vn.union([Vn.string(),Vn.null()]).optional(),id:cu,name:Vn.string()}),du=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),availableModes:Vn.array(uu),currentModeId:cu}),hu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),availableModels:Vn.array(ml),currentModelId:wl}),Du=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),configOptions:Vn.union([Vn.array($l),Vn.null()]).optional(),models:Vn.union([hu,Vn.null()]).optional(),modes:Vn.union([du,Vn.null()]).optional(),sessionId:tu}),pu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),configOptions:Vn.union([Vn.array($l),Vn.null()]).optional(),models:Vn.union([hu,Vn.null()]).optional(),modes:Vn.union([du,Vn.null()]).optional()}),wu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),configOptions:Vn.union([Vn.array($l),Vn.null()]).optional(),models:Vn.union([hu,Vn.null()]).optional(),modes:Vn.union([du,Vn.null()]).optional(),sessionId:tu}),mu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),configOptions:Vn.union([Vn.array($l),Vn.null()]).optional(),models:Vn.union([hu,Vn.null()]).optional(),modes:Vn.union([du,Vn.null()]).optional()}),yu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional()}),fu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),fork:Vn.union([eu,Vn.null()]).optional(),list:Vn.union([Eu,Vn.null()]).optional(),resume:Vn.union([yu,Vn.null()]).optional()}),Ru=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),loadSession:Vn.boolean().optional().default(!1),mcpCapabilities:ul.optional().default({http:!1,sse:!1}),promptCapabilities:Ll.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:fu.optional().default({})}),Nu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),agentCapabilities:Ru.optional().default({loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:Vn.union([El,Vn.null()]).optional(),authMethods:Vn.array($c).optional().default([]),protocolVersion:Fl}),Mu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),configId:Vl,sessionId:tu,value:Wl}),Su=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),configOptions:Vn.array($l)}),ku=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),modeId:cu,sessionId:tu}),Gu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional()}),Lu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),modelId:wl,sessionId:tu}),Fu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional()}),Tu=Vn.union([Vn.literal("end_turn"),Vn.literal("max_tokens"),Vn.literal("max_turn_requests"),Vn.literal("refusal"),Vn.literal("cancelled")]),Uu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),stopReason:Tu}),Ju=(Vn.union([Vn.object({id:_l,result:Vn.union([Nu,el,wu,pu,Bu,Du,mu,Gu,Su,Uu,Fu,al])}),Vn.object({error:sl,id:_l})]),Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),terminalId:Vn.string()})),_u=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),exitCode:Vn.union([Vn.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),Vn.null()]).optional(),signal:Vn.union([Vn.string(),Vn.null()]).optional()}),Yu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),sessionId:tu,terminalId:Vn.string()}),bu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),exitStatus:Vn.union([_u,Vn.null()]).optional(),output:Vn.string(),truncated:Vn.boolean()}),Hu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),annotations:Vn.union([bl,Vn.null()]).optional(),text:Vn.string()}),xu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),mimeType:Vn.union([Vn.string(),Vn.null()]).optional(),text:Vn.string(),uri:Vn.string()}),Ku=Vn.union([xu,tl]),Ou=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),annotations:Vn.union([bl,Vn.null()]).optional(),resource:Ku}),vu=Vn.union([Hu.and(Vn.object({type:Vn.literal("text")})),xl.and(Vn.object({type:Vn.literal("image")})),Hl.and(Vn.object({type:Vn.literal("audio")})),Kl.and(Vn.object({type:Vn.literal("resource_link")})),Ou.and(Vn.object({type:Vn.literal("resource")}))]),qu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),content:vu}),Pu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),content:vu}),Vu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),prompt:Vn.array(vu),sessionId:tu}),ju=(Vn.object({id:_l,method:Vn.string(),params:Vn.union([Vn.union([Tl,Al,yl,su,ll,ou,au,ku,Mu,Vu,Lu,Il]),Vn.null()]).optional()}),Vn.union([qu.and(Vn.object({type:Vn.literal("content")})),nl.and(Vn.object({type:Vn.literal("diff")})),Ju.and(Vn.object({type:Vn.literal("terminal")}))])),Wu=Vn.string(),Zu=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),line:Vn.union([Vn.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),Vn.null()]).optional(),path:Vn.string()}),zu=Vn.union([Vn.literal("pending"),Vn.literal("in_progress"),Vn.literal("completed"),Vn.literal("failed")]),Xu=Vn.union([Vn.literal("read"),Vn.literal("edit"),Vn.literal("delete"),Vn.literal("move"),Vn.literal("search"),Vn.literal("execute"),Vn.literal("think"),Vn.literal("fetch"),Vn.literal("switch_mode"),Vn.literal("other")]),$u=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),content:Vn.array(ju).optional(),kind:Xu.optional(),locations:Vn.array(Zu).optional(),rawInput:Vn.unknown().optional(),rawOutput:Vn.unknown().optional(),status:zu.optional(),title:Vn.string(),toolCallId:Wu}),Ad=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),content:Vn.union([Vn.array(ju),Vn.null()]).optional(),kind:Vn.union([Xu,Vn.null()]).optional(),locations:Vn.union([Vn.array(Zu),Vn.null()]).optional(),rawInput:Vn.unknown().optional(),rawOutput:Vn.unknown().optional(),status:Vn.union([zu,Vn.null()]).optional(),title:Vn.union([Vn.string(),Vn.null()]).optional(),toolCallId:Wu}),ed=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),options:Vn.array(Nl),sessionId:tu,toolCall:Ad}),td=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),hint:Vn.string()}),id=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),description:Vn.string(),input:Vn.union([td,Vn.null()]).optional(),name:Vn.string()}),nd=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),availableCommands:Vn.array(id)}),od=Vn.union([Pu.and(Vn.object({sessionUpdate:Vn.literal("user_message_chunk")})),Pu.and(Vn.object({sessionUpdate:Vn.literal("agent_message_chunk")})),Pu.and(Vn.object({sessionUpdate:Vn.literal("agent_thought_chunk")})),$u.and(Vn.object({sessionUpdate:Vn.literal("tool_call")})),Ad.and(Vn.object({sessionUpdate:Vn.literal("tool_call_update")})),Gl.and(Vn.object({sessionUpdate:Vn.literal("plan")})),nd.and(Vn.object({sessionUpdate:Vn.literal("available_commands_update")})),lu.and(Vn.object({sessionUpdate:Vn.literal("current_mode_update")})),Au.and(Vn.object({sessionUpdate:Vn.literal("config_option_update")})),Qu.and(Vn.object({sessionUpdate:Vn.literal("session_info_update")}))]),gd=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),sessionId:tu,update:od}),sd=(Vn.object({method:Vn.string(),params:Vn.union([Vn.union([gd,rl]),Vn.null()]).optional()}),Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),sessionId:tu,terminalId:Vn.string()})),rd=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),exitCode:Vn.union([Vn.number().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),Vn.null()]).optional(),signal:Vn.union([Vn.string(),Vn.null()]).optional()}),Id=Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional(),content:Vn.string(),path:Vn.string(),sessionId:tu}),ad=(Vn.object({id:_l,method:Vn.string(),params:Vn.union([Vn.union([Id,ru,ed,nu,Yu,Iu,sd,gu,Il]),Vn.null()]).optional()}),Vn.object({_meta:Vn.union([Vn.record(Vn.string(),Vn.unknown()),Vn.null()]).optional()}));function Cd(A,e){const t=new TextEncoder,i=new TextDecoder;return{readable:new ReadableStream({async start(A){let t="";const n=e.getReader();try{for(;;){const{value:e,done:o}=await n.read();if(o)break;if(!e)continue;t+=i.decode(e,{stream:!0});const g=t.split("\n");t=g.pop()||"";for(const e of g){const t=e.trim();if(t)try{const e=JSON.parse(t);A.enqueue(e)}catch(A){console.error("Failed to parse JSON message:",t,A)}}}}finally{n.releaseLock(),A.close()}}}),writable:new WritableStream({async write(e){const i=JSON.stringify(e)+"\n",n=A.getWriter();try{await n.write(t.encode(i))}finally{n.releaseLock()}}})}}Vn.union([Vn.object({id:_l,result:Vn.union([ad,Ul,ql,il,bu,Jl,rd,cl,al])}),Vn.object({error:sl,id:_l})]);var Bd=class{#A;constructor(A,e){const t=A(this);this.#A=new cd(async(A,e)=>{switch(A){case Nn:{const A=Tl.parse(e);return t.initialize(A)}case Ln:{const A=yl.parse(e);return t.newSession(A)}case Gn:{if(!t.loadSession)throw ld.methodNotFound(A);const i=su.parse(e);return t.loadSession(i)}case kn:{if(!t.unstable_listSessions)throw ld.methodNotFound(A);const i=ll.parse(e);return t.unstable_listSessions(i)}case Sn:{if(!t.unstable_forkSession)throw ld.methodNotFound(A);const i=ou.parse(e);return t.unstable_forkSession(i)}case Tn:{if(!t.unstable_resumeSession)throw ld.methodNotFound(A);const i=au.parse(e);return t.unstable_resumeSession(i)}case Jn:{if(!t.setSessionMode)throw ld.methodNotFound(A);const i=ku.parse(e);return await t.setSessionMode(i)??{}}case Rn:{const A=Al.parse(e);return await t.authenticate(A)??{}}case Fn:{const A=Vu.parse(e);return t.prompt(A)}case _n:{if(!t.unstable_setSessionModel)throw ld.methodNotFound(A);const i=Lu.parse(e);return await t.unstable_setSessionModel(i)??{}}case Un:{if(!t.unstable_setSessionConfigOption)throw ld.methodNotFound(A);const i=Mu.parse(e);return t.unstable_setSessionConfigOption(i)}default:if(t.extMethod)return t.extMethod(A,e);throw ld.methodNotFound(A)}},async(A,e)=>{if(A===Mn){const A=iu.parse(e);return t.cancel(A)}if(t.extNotification)return t.extNotification(A,e);throw ld.methodNotFound(A)},e)}async sessionUpdate(A){return await this.#A.sendNotification(xn,A)}async requestPermission(A){return await this.#A.sendRequest(Hn,A)}async readTextFile(A){return await this.#A.sendRequest(Yn,A)}async writeTextFile(A){return await this.#A.sendRequest(bn,A)??{}}async createTerminal(A){const e=await this.#A.sendRequest(Kn,A);return new Qd(e.terminalId,A.sessionId,this.#A)}async extMethod(A,e){return await this.#A.sendRequest(A,e)}async extNotification(A,e){return await this.#A.sendNotification(A,e)}get signal(){return this.#A.signal}get closed(){return this.#A.closed}},Qd=class{id;#e;#A;constructor(A,e,t){this.id=A,this.#e=e,this.#A=t}async currentOutput(){return await this.#A.sendRequest(vn,{sessionId:this.#e,terminalId:this.id})}async waitForExit(){return await this.#A.sendRequest(Pn,{sessionId:this.#e,terminalId:this.id})}async kill(){return await this.#A.sendRequest(On,{sessionId:this.#e,terminalId:this.id})??{}}async release(){return await this.#A.sendRequest(qn,{sessionId:this.#e,terminalId:this.id})??{}}async[Symbol.asyncDispose](){await this.release()}},Ed=class{#A;constructor(A,e){const t=A(this);this.#A=new cd(async(A,e)=>{switch(A){case bn:{const A=Id.parse(e);return t.writeTextFile?.(A)}case Yn:{const A=ru.parse(e);return t.readTextFile?.(A)}case Hn:{const A=ed.parse(e);return t.requestPermission(A)}case Kn:{const A=nu.parse(e);return t.createTerminal?.(A)}case vn:{const A=Yu.parse(e);return t.terminalOutput?.(A)}case qn:{const A=Iu.parse(e);return await(t.releaseTerminal?.(A))??{}}case Pn:{const A=sd.parse(e);return t.waitForTerminalExit?.(A)}case On:{const A=gu.parse(e);return await(t.killTerminal?.(A))??{}}default:if(t.extMethod)return t.extMethod(A,e);throw ld.methodNotFound(A)}},async(A,e)=>{if(A===xn){const A=gd.parse(e);return t.sessionUpdate(A)}if(t.extNotification)return t.extNotification(A,e);throw ld.methodNotFound(A)},e)}async initialize(A){return await this.#A.sendRequest(Nn,A)}async newSession(A){return await this.#A.sendRequest(Ln,A)}async loadSession(A){return await this.#A.sendRequest(Gn,A)??{}}async unstable_forkSession(A){return await this.#A.sendRequest(Sn,A)}async unstable_listSessions(A){return await this.#A.sendRequest(kn,A)}async unstable_resumeSession(A){return await this.#A.sendRequest(Tn,A)}async setSessionMode(A){return await this.#A.sendRequest(Jn,A)??{}}async unstable_setSessionModel(A){return await this.#A.sendRequest(_n,A)??{}}async unstable_setSessionConfigOption(A){return await this.#A.sendRequest(Un,A)}async authenticate(A){return await this.#A.sendRequest(Rn,A)??{}}async prompt(A){return await this.#A.sendRequest(Fn,A)}async cancel(A){return await this.#A.sendNotification(Mn,A)}async extMethod(A,e){return await this.#A.sendRequest(A,e)}async extNotification(A,e){return await this.#A.sendNotification(A,e)}get signal(){return this.#A.signal}get closed(){return this.#A.closed}},cd=class{#t=new Map;#i=0;#n;#o;#g;#s=Promise.resolve();#r=new AbortController;#I;constructor(A,e,t){this.#n=A,this.#o=e,this.#g=t,this.#I=new Promise(A=>{this.#r.signal.addEventListener("abort",()=>A())}),this.#a()}get signal(){return this.#r.signal}get closed(){return this.#I}async#a(){const A=this.#g.readable.getReader();try{for(;;){const{value:e,done:t}=await A.read();if(t)break;if(e)try{this.#C(e)}catch(A){console.error("Unexpected error during message processing:",e,A),"id"in e&&void 0!==e.id&&this.#B({jsonrpc:"2.0",id:e.id,error:{code:-32700,message:"Parse error"}})}}}finally{A.releaseLock(),this.#r.abort()}}async#C(A){if("method"in A&&"id"in A){const e=await this.#Q(A.method,A.params);"error"in e&&console.error("Error handling request",A,e.error),await this.#B({jsonrpc:"2.0",id:A.id,...e})}else if("method"in A){const e=await this.#E(A.method,A.params);"error"in e&&console.error("Error handling notification",A,e.error)}else"id"in A?this.#c(A):console.error("Invalid message",{message:A})}async#Q(A,e){try{return{result:await this.#n(A,e)??null}}catch(A){if(A instanceof ld)return A.toResult();if(A instanceof Ze.ZodError)return ld.invalidParams(A.format()).toResult();let e;(A instanceof Error||"object"==typeof A&&null!=A&&"message"in A&&"string"==typeof A.message)&&(e=A.message);try{return ld.internalError(e?JSON.parse(e):{}).toResult()}catch{return ld.internalError({details:e}).toResult()}}}async#E(A,e){try{return await this.#o(A,e),{result:null}}catch(A){if(A instanceof ld)return A.toResult();if(A instanceof Ze.ZodError)return ld.invalidParams(A.format()).toResult();let e;(A instanceof Error||"object"==typeof A&&null!=A&&"message"in A&&"string"==typeof A.message)&&(e=A.message);try{return ld.internalError(e?JSON.parse(e):{}).toResult()}catch{return ld.internalError({details:e}).toResult()}}}#c(A){const e=this.#t.get(A.id);e?("result"in A?e.resolve(A.result):"error"in A&&e.reject(A.error),this.#t.delete(A.id)):console.error("Got response to unknown request",A.id)}async sendRequest(A,e){const t=this.#i++,i=new Promise((A,e)=>{this.#t.set(t,{resolve:A,reject:e})});return await this.#B({jsonrpc:"2.0",id:t,method:A,params:e}),i}async sendNotification(A,e){await this.#B({jsonrpc:"2.0",method:A,params:e})}async#B(A){return this.#s=this.#s.then(async()=>{const e=this.#g.writable.getWriter();try{await e.write(A)}finally{e.releaseLock()}}).catch(A=>{console.error("ACP write error:",A)}),this.#s}},ld=class A extends Error{code;data;constructor(A,e,t){super(e),this.code=A,this.name="RequestError",this.data=t}static parseError(e,t){return new A(-32700,"Parse error"+(t?`: ${t}`:""),e)}static invalidRequest(e,t){return new A(-32600,"Invalid request"+(t?`: ${t}`:""),e)}static methodNotFound(e){return new A(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,t){return new A(-32602,"Invalid params"+(t?`: ${t}`:""),e)}static internalError(e,t){return new A(-32603,"Internal error"+(t?`: ${t}`:""),e)}static authRequired(e,t){return new A(-32e3,"Authentication required"+(t?`: ${t}`:""),e)}static resourceNotFound(e){return new A(-32002,"Resource not found"+(e?`: ${e}`:""),e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}},ud=class extends Error{constructor(A="ACP connection closed"){super(A),this.name="AcpConnectionClosedError"}},dd=class{constructor(A,e){this.handler=A,this.connection=new Ed(A=>this.createClient(),e)}connection;_nextRequestId=1;_nextId(){return String(this._nextRequestId++)}createClient(){return{sessionUpdate:A=>this.handler.onClientRequest({method:"session/update",params:A}),requestPermission:A=>this.handler.onClientRequest({id:this._nextId(),method:"session/request_permission",params:A}),readTextFile:A=>this.handler.onClientRequest({id:this._nextId(),method:"fs/read_text_file",params:A}),writeTextFile:A=>this.handler.onClientRequest({id:this._nextId(),method:"fs/write_text_file",params:A}),createTerminal:A=>this.handler.onClientRequest({id:this._nextId(),method:"terminal/create",params:A}),terminalOutput:A=>this.handler.onClientRequest({id:this._nextId(),method:"terminal/output",params:A}),releaseTerminal:A=>this.handler.onClientRequest({id:this._nextId(),method:"terminal/release",params:A}),waitForTerminalExit:A=>this.handler.onClientRequest({id:this._nextId(),method:"terminal/wait_for_exit",params:A}),killTerminal:A=>this.handler.onClientRequest({id:this._nextId(),method:"terminal/kill",params:A}),extMethod:(A,e)=>this.handler.onClientRequest({id:this._nextId(),method:"ext/method",params:{method:A,params:e}}),extNotification:(A,e)=>this.handler.onClientRequest({method:"ext/notification",params:{method:A,params:e}})}}async sendRequest(A){if(!this.connection.extMethod)throw new Error("Connection not ready");if(C(A.method))return this.connection.extNotification(A.method,A.params);if(this.connection.signal.aborted)throw new ud;const e=this.connection.extMethod(A.method,A.params),t=this.connection.closed.then(()=>{throw e.catch(()=>{}),new ud});return t.catch(()=>{}),await Promise.race([e,t])}get signal(){return this.connection.signal}get closed(){return this.connection.closed}getAgent(){return this.connection}},hd=/^[0-9]+\.[0-9]+\.[0-9]+/,Dd=["darwin-aarch64","darwin-x86_64","linux-aarch64","linux-x86_64","windows-aarch64","windows-x86_64"],pd=Ze.object({package:Ze.string().min(1),args:Ze.array(Ze.string()).optional(),env:Ze.record(Ze.string(),Ze.string()).optional()}),wd=Ze.object({archive:Ze.string(),cmd:Ze.string(),args:Ze.array(Ze.string()).optional(),env:Ze.record(Ze.string(),Ze.string()).optional()}),md=Ze.record(Ze.enum(Dd),wd).refine(A=>Object.keys(A).length>0,{message:"Binary distribution must have at least one platform target"}),yd=Ze.object({url:Ze.string().min(1)}),fd=Ze.object({binary:md.optional(),npx:pd.optional(),uvx:pd.optional(),websocket:yd.optional()}).refine(A=>void 0!==A.binary||void 0!==A.npx||void 0!==A.uvx||void 0!==A.websocket,{message:"Distribution must have at least one method (binary, npx, uvx, or websocket)"}),Rd=Ze.object({id:Ze.string().regex(/^[a-z][a-z0-9-]*$/),name:Ze.string().min(1),version:Ze.string().regex(hd),description:Ze.string().min(1),repository:Ze.string().optional(),authors:Ze.array(Ze.string()).optional(),license:Ze.string().optional(),icon:Ze.string().optional(),distribution:fd,"cognition.ai/featured":Ze.boolean().optional(),"cognition.ai/bundled":Ze.boolean().optional()}),Nd=Ze.object({version:Ze.string().regex(hd),agents:Ze.array(Rd)}),Md=Nd.extend({agents:Ze.array(Ze.unknown()).transform(A=>A.flatMap(A=>{const e=Rd.safeParse(A);return e.success?[e.data]:[]}))});function Sd(A){const e=Nd.safeParse(A);if(e.success)return e.data;const t=Md.safeParse(A);return t.success?t.data:void 0}function kd(A,e){let t,i;if("darwin"===A)t="darwin";else if("linux"===A)t="linux";else{if("win32"!==A)return;t="windows"}if("arm64"===e)i="aarch64";else{if("x64"!==e)return;i="x86_64"}const n=`${t}-${i}`,o=Ze.enum(Dd).safeParse(n);if(o.success)return o.data}function Gd(A,e,t,i){const n=A.distribution;if(n.npx)return{command:"npx",args:["-y",n.npx.package,...n.npx.args??[]],env:n.npx.env};if(n.uvx)return{command:"uvx",args:[n.uvx.package,...n.uvx.args??[]],env:n.uvx.env};if(e&&n.binary){const A=kd(t,i);if(void 0===A)return;const e=n.binary[A];if(void 0===e)return;return{command:e.cmd,args:e.args??[],env:e.env}}}function Ld(A){return"string"==typeof A?A:A instanceof ArrayBuffer?(new TextDecoder).decode(A):Array.isArray(A)?A.map(A=>Ld(A)).join(""):"object"==typeof A&&null!==A&&"toString"in A&&"function"==typeof A.toString?A.toString("utf8"):String(A)}function Fd(A){return{readable:new ReadableStream({start(e){A.addEventListener("message",A=>{try{const t=Ld(A.data),i=JSON.parse(t);e.enqueue(i)}catch(A){console.error("[webSocketStream] Failed to parse message:",A)}}),A.addEventListener("close",()=>{try{e.close()}catch{}}),A.addEventListener("error",A=>{try{e.error(A)}catch{}})}}),writable:new WritableStream({write(e){A.send(JSON.stringify(e))},close(){A.close(1e3,"Stream closed")},abort(e){const t=function(A){const e=new TextEncoder;if(e.encode(A).length<=123)return A;let t=A;for(;t.length>0&&e.encode(t).length>123;)t=t.slice(0,-1);return t}(String(e??"Stream aborted"));A.close(1011,t)}})}}function Td(A){return"user_message"===A.kind||"agent_message"===A.kind||"agent_thought"===A.kind?A.content[0]:"tool_call"===A.kind||"plan"===A.kind?A.content:void 0}function Ud(A){const e=Td(A);if(e&&U(e))return e._meta["cognition.ai/eventType"]??void 0}function Jd(A){const e=Td(A);if(e&&U(e))return e._meta["cognition.ai/timestamp"]??void 0}},19587(A,e,t){"use strict";const i=t(69278),n=t(64756),{once:o}=t(24434),g=t(16460),{normalizeOptions:s,cacheOptions:r}=t(56395),{getProxy:I,getProxyAgent:a,proxyCache:C}=t(83817),B=t(45382),{Agent:Q}=t(64112);A.exports=class extends Q{#l;#u;#d;#h;#D;constructor(A={}){const{timeouts:e,proxy:t,noProxy:i,...n}=s(A);super(n),this.#l=n,this.#u=e,t&&(this.#d=new URL(t),this.#h=i,this.#D=a(t))}get proxy(){return this.#d?{url:this.#d}:{}}#p(A){if(!this.#d)return;const e=I(`${A.protocol}//${A.host}:${A.port}`,{proxy:this.#d,noProxy:this.#h});if(!e)return;const t=r({...A,...this.#l,timeouts:this.#u,proxy:e});if(C.has(t))return C.get(t);let i=this.#D;Array.isArray(i)&&(i=this.isSecureEndpoint(A)?i[1]:i[0]);const n=new i(e,{...this.#l,socketOptions:{family:this.#l.family}});return C.set(t,n),n}async#w({promises:A,options:e,timeout:t},i=new AbortController){if(t){const n=g.setTimeout(t,null,{signal:i.signal}).then(()=>{throw new B.ConnectionTimeoutError(`${e.host}:${e.port}`)}).catch(A=>{if("AbortError"!==A.name)throw A});A.push(n)}let n;try{n=await Promise.race(A),i.abort()}catch(A){throw i.abort(),A}return n}async connect(A,e){let t;e.lookup??=this.#l.lookup;let g=this.#u.connection;const s=this.isSecureEndpoint(e),r=this.#p(e);if(r){const i=Date.now();t=await this.#w({options:e,timeout:g,promises:[r.connect(A,e)]}),g&&(g-=Date.now()-i)}else t=(s?n:i).connect(e);t.setKeepAlive(this.keepAlive,this.keepAliveMsecs),t.setNoDelay(this.keepAlive);const I=new AbortController,{signal:a}=I,C=t[s?"secureConnecting":"connecting"]?o(t,s?"secureConnect":"connect",{signal:a}):Promise.resolve();return await this.#w({options:e,timeout:g,promises:[C,o(t,"error",{signal:a}).then(A=>{throw A[0]})]},I),this.#u.idle&&t.setTimeout(this.#u.idle,()=>{t.destroy(new B.IdleTimeoutError(`${e.host}:${e.port}`))}),t}addRequest(A,e){const t=this.#p(e);if(t?.setRequestProps&&t.setRequestProps(A,e),A.setHeader("connection",this.keepAlive?"keep-alive":"close"),this.#u.response){let e;A.once("finish",()=>{setTimeout(()=>{A.destroy(new B.ResponseTimeoutError(A,this.#d))},this.#u.response)}),A.once("response",()=>{clearTimeout(e)})}if(this.#u.transfer){let e;A.once("response",t=>{setTimeout(()=>{t.destroy(new B.TransferTimeoutError(A,this.#d))},this.#u.transfer),t.once("close",()=>{clearTimeout(e)})})}return super.addRequest(A,e)}}},21358(A,e,t){"use strict";const{LRUCache:i}=t(16145),n=t(72250),o=new i({max:50});A.exports={cache:o,getOptions:({family:A=0,hints:e=n.ADDRCONFIG,all:t=!1,verbatim:i,ttl:g=3e5,lookup:s=n.lookup})=>({hints:e,lookup:(n,...r)=>{const I=r.pop(),a=r[0]??{},C={family:A,hints:e,all:t,verbatim:i,..."number"==typeof a?{family:a}:a},B=JSON.stringify({hostname:n,...C});if(o.has(B)){const A=o.get(B);return process.nextTick(I,null,...A)}s(n,C,(A,...e)=>A?I(A):(o.set(B,e,{ttl:g}),I(null,...e)))}})}},45382(A){"use strict";class e extends Error{constructor(A){super(`Invalid protocol \`${A.protocol}\` connecting to proxy \`${A.host}\``),this.code="EINVALIDPROXY",this.proxy=A}}class t extends Error{constructor(A){super(`Timeout connecting to host \`${A}\``),this.code="ECONNECTIONTIMEOUT",this.host=A}}class i extends Error{constructor(A){super(`Idle timeout reached for host \`${A}\``),this.code="EIDLETIMEOUT",this.host=A}}class n extends Error{constructor(A,e){let t="Response timeout ";e&&(t+=`from proxy \`${e.host}\` `),t+=`connecting to host \`${A.host}\``,super(t),this.code="ERESPONSETIMEOUT",this.proxy=e,this.request=A}}class o extends Error{constructor(A,e){let t="Transfer timeout ";e&&(t+=`from proxy \`${e.host}\` `),t+=`for \`${A.host}\``,super(t),this.code="ETRANSFERTIMEOUT",this.proxy=e,this.request=A}}A.exports={InvalidProxyProtocolError:e,ConnectionTimeoutError:t,IdleTimeoutError:i,ResponseTimeoutError:n,TransferTimeoutError:o}},29873(A,e,t){"use strict";const{LRUCache:i}=t(16145),{normalizeOptions:n,cacheOptions:o}=t(56395),{getProxy:g,proxyCache:s}=t(83817),r=t(21358),I=t(19587),a=new i({max:20});A.exports={getAgent:(A,{agent:e,proxy:t,noProxy:i,...s}={})=>{if(null!=e)return e;A=new URL(A);const r=g(A,{proxy:t,noProxy:i}),C={...n(s),proxy:r},B=o({...C,secureEndpoint:"https:"===A.protocol});if(a.has(B))return a.get(B);const Q=new I(C);return a.set(B,Q),Q},Agent:I,HttpAgent:I,HttpsAgent:I,cache:{proxy:s,agent:a,dns:r.cache,clear:()=>{s.clear(),a.clear(),r.cache.clear()}}}},56395(A,e,t){"use strict";const i=t(21358),n=A=>{let e="";const t=Object.entries(A).sort((A,e)=>A[0]-e[0]);for(let[A,i]of t)null==i?i="null":i instanceof URL?i=i.toString():"object"==typeof i&&(i=n(i)),e+=`${A}:${i}:`;return e};A.exports={normalizeOptions:A=>{const e=parseInt(A.family??"0",10),t=A.keepAlive??!0,n={keepAliveMsecs:t?1e3:void 0,maxSockets:A.maxSockets??15,maxTotalSockets:1/0,maxFreeSockets:t?256:void 0,scheduling:"fifo",...A,family:e,keepAlive:t,timeouts:{idle:A.timeout??0,connection:0,response:0,transfer:0,...A.timeouts},...i.getOptions({family:e,...A.dns})};return delete n.timeout,n},cacheOptions:({secureEndpoint:A,...e})=>n({secureEndpoint:!!A,family:e.family,hints:e.hints,localAddress:e.localAddress,strictSsl:!!A&&!!e.rejectUnauthorized,ca:A?e.ca:null,cert:A?e.cert:null,key:A?e.key:null,keepAlive:e.keepAlive,keepAliveMsecs:e.keepAliveMsecs,maxSockets:e.maxSockets,maxTotalSockets:e.maxTotalSockets,maxFreeSockets:e.maxFreeSockets,scheduling:e.scheduling,timeouts:e.timeouts,proxy:e.proxy})}},83817(A,e,t){"use strict";const{HttpProxyAgent:i}=t(15756),{HttpsProxyAgent:n}=t(64007),{SocksProxyAgent:o}=t(54439),{LRUCache:g}=t(16145),{InvalidProxyProtocolError:s}=t(45382),r=new g({max:20}),I=new Set(o.protocols),a=new Set(["https_proxy","http_proxy","proxy","no_proxy"]),C=Object.entries(process.env).reduce((A,[e,t])=>(e=e.toLowerCase(),a.has(e)&&(A[e]=t),A),{});A.exports={getProxyAgent:A=>{const e=(A=new URL(A)).protocol.slice(0,-1);if(I.has(e))return o;if("https"===e||"http"===e)return[i,n];throw new s(A)},getProxy:(A,{proxy:e,noProxy:t})=>(A=new URL(A),e||(e="https:"===A.protocol?C.https_proxy:C.https_proxy||C.http_proxy||C.proxy),t||(t=C.no_proxy),!e||((A,e)=>{if("string"==typeof e&&(e=e.split(",").map(A=>A.trim()).filter(Boolean)),!e||!e.length)return!1;const t=A.hostname.split(".").reverse();return e.some(A=>{const e=A.split(".").filter(Boolean).reverse();if(!e.length)return!1;for(let A=0;A{const i={};if(A&&"object"==typeof A)for(const t of e)void 0!==A[t]&&(i[t]=A[t]);else i[t]=A;return i}},917(A,e,t){const i=t(2722);A.exports={satisfies:A=>i.satisfies(process.version,A,{includePrerelease:!0})}},22124(A,e,t){"use strict";const{inspect:i}=t(39023);class n{constructor(A,e,t){let i=`${e}: ${t.syscall} returned ${t.code} (${t.message})`;void 0!==t.path&&(i+=` ${t.path}`),void 0!==t.dest&&(i+=` => ${t.dest}`),this.code=A,Object.defineProperties(this,{name:{value:"SystemError",enumerable:!1,writable:!0,configurable:!0},message:{value:i,enumerable:!1,writable:!0,configurable:!0},info:{value:t,enumerable:!0,configurable:!0,writable:!1},errno:{get:()=>t.errno,set(A){t.errno=A},enumerable:!0,configurable:!0},syscall:{get:()=>t.syscall,set(A){t.syscall=A},enumerable:!0,configurable:!0}}),void 0!==t.path&&Object.defineProperty(this,"path",{get:()=>t.path,set(A){t.path=A},enumerable:!0,configurable:!0}),void 0!==t.dest&&Object.defineProperty(this,"dest",{get:()=>t.dest,set(A){t.dest=A},enumerable:!0,configurable:!0})}toString(){return`${this.name} [${this.code}]: ${this.message}`}[Symbol.for("nodejs.util.inspect.custom")](A,e){return i(this,{...e,getters:!0,customInspect:!1})}}function o(e,t){A.exports[e]=class extends n{constructor(A){super(e,t,A)}}}o("ERR_FS_CP_DIR_TO_NON_DIR","Cannot overwrite directory with non-directory"),o("ERR_FS_CP_EEXIST","Target already exists"),o("ERR_FS_CP_EINVAL","Invalid src or dest"),o("ERR_FS_CP_FIFO_PIPE","Cannot copy a FIFO pipe"),o("ERR_FS_CP_NON_DIR_TO_DIR","Cannot overwrite non-directory with directory"),o("ERR_FS_CP_SOCKET","Cannot copy a socket file"),o("ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY","Cannot overwrite symlink in subdirectory of self"),o("ERR_FS_CP_UNKNOWN","Cannot copy an unknown file type"),o("ERR_FS_EISDIR","Path is a directory"),A.exports.ERR_INVALID_ARG_TYPE=class extends Error{constructor(A,e,t){super(),this.code="ERR_INVALID_ARG_TYPE",this.message=`The ${A} argument must be ${e}. Received ${typeof t}`}}},69539(A,e,t){const i=t(91943),n=t(30182),o=t(917),g=t(26272),s=o.satisfies(">=16.7.0");A.exports=async(A,e,t)=>{const o=n(t,{copy:["dereference","errorOnExist","filter","force","preserveTimestamps","recursive"]});return s?i.cp(A,e,o):g(A,e,o)}},26272(A,e,t){"use strict";const{ERR_FS_CP_DIR_TO_NON_DIR:i,ERR_FS_CP_EEXIST:n,ERR_FS_CP_EINVAL:o,ERR_FS_CP_FIFO_PIPE:g,ERR_FS_CP_NON_DIR_TO_DIR:s,ERR_FS_CP_SOCKET:r,ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY:I,ERR_FS_CP_UNKNOWN:a,ERR_FS_EISDIR:C,ERR_INVALID_ARG_TYPE:B}=t(22124),{constants:{errno:{EEXIST:Q,EISDIR:E,EINVAL:c,ENOTDIR:l}}}=t(70857),{chmod:u,copyFile:d,lstat:h,mkdir:D,readdir:p,readlink:w,stat:m,symlink:y,unlink:f,utimes:R}=t(91943),{dirname:N,isAbsolute:M,join:S,parse:k,resolve:G,sep:L,toNamespacedPath:F}=t(16928),{fileURLToPath:T}=t(87016),U={dereference:!1,errorOnExist:!1,filter:void 0,force:!0,preserveTimestamps:!1,recursive:!1};function J(A){return null!=A&&A.href&&A.origin?T(A):A}async function _(A,e,t){const{0:n,1:g}=await function(A,e,t){const i=t.dereference?A=>m(A,{bigint:!0}):A=>h(A,{bigint:!0});return Promise.all([i(A),i(e).catch(A=>{if("ENOENT"===A.code)return null;throw A})])}(A,e,t);if(g){if(Y(n,g))throw new o({message:"src and dest cannot be the same",path:e,syscall:"cp",errno:c});if(n.isDirectory()&&!g.isDirectory())throw new i({message:`cannot overwrite directory ${A} with non-directory ${e}`,path:e,syscall:"cp",errno:E});if(!n.isDirectory()&&g.isDirectory())throw new s({message:`cannot overwrite non-directory ${A} with directory ${e}`,path:e,syscall:"cp",errno:l})}if(n.isDirectory()&&K(A,e))throw new o({message:`cannot copy ${A} to a subdirectory of self ${e}`,path:e,syscall:"cp",errno:c});return{srcStat:n,destStat:g}}function Y(A,e){return e.ino&&e.dev&&e.ino===A.ino&&e.dev===A.dev}async function b(A,e,t,i){const n=N(t),o=await function(A){return m(A).then(()=>!0,A=>"ENOENT"!==A.code&&Promise.reject(A))}(n);return o||await D(n,{recursive:!0}),q(A,e,t,i)}async function H(A,e,t){const i=G(N(A)),n=G(N(t));if(n===i||n===k(n).root)return;let g;try{g=await m(n,{bigint:!0})}catch(A){if("ENOENT"===A.code)return;throw A}if(Y(e,g))throw new o({message:`cannot copy ${A} to a subdirectory of self ${t}`,path:t,syscall:"cp",errno:c});return H(A,e,n)}const x=A=>G(A).split(L).filter(Boolean);function K(A,e){const t=x(A),i=x(e);return t.every((A,e)=>i[e]===A)}async function O(A,e,t,i,n,o){if(await n.filter(t,i))return A(e,t,i,n,o)}function v(A,e,t,i){return i.filter?O(q,A,e,t,i):q(A,e,t,i)}async function q(A,e,t,i){const s=i.dereference?m:h,B=await s(e);if(B.isDirectory()&&i.recursive)return function(A,e,t,i,n){return e?W(t,i,n):async function(A,e,t,i){return await D(t),await W(e,t,i),j(t,A)}(A.mode,t,i,n)}(B,A,e,t,i);if(B.isDirectory())throw new C({message:`${e} is a directory (not copied)`,path:e,syscall:"cp",errno:c});if(B.isFile()||B.isCharacterDevice()||B.isBlockDevice())return function(A,e,t,i,o){return e?async function(A,e,t,i){if(i.force)return await f(t),P(A,e,t,i);if(i.errorOnExist)throw new n({message:`${t} already exists`,path:t,syscall:"cp",errno:Q})}(A,t,i,o):P(A,t,i,o)}(B,A,e,t,i);if(B.isSymbolicLink())return async function(A,e,t){let i,n=await w(e);if(M(n)||(n=G(N(e),n)),!A)return y(n,t);try{i=await w(t)}catch(A){if("EINVAL"===A.code||"UNKNOWN"===A.code)return y(n,t);throw A}if(M(i)||(i=G(N(t),i)),K(n,i))throw new o({message:`cannot copy ${n} to a subdirectory of self ${i}`,path:t,syscall:"cp",errno:c});if((await m(e)).isDirectory()&&K(i,n))throw new I({message:`cannot overwrite ${i} with ${n}`,path:t,syscall:"cp",errno:c});return async function(A,e){return await f(e),y(A,e)}(n,t)}(A,e,t);if(B.isSocket())throw new r({message:`cannot copy a socket file: ${t}`,path:t,syscall:"cp",errno:c});if(B.isFIFO())throw new g({message:`cannot copy a FIFO pipe: ${t}`,path:t,syscall:"cp",errno:c});throw new a({message:`cannot copy an unknown file type: ${t}`,path:t,syscall:"cp",errno:c})}async function P(A,e,t,i){return await d(e,t),i.preserveTimestamps?async function(A,e,t){return function(A){return!(128&A)}(A)?(await function(A,e){return j(A,128|e)}(t,A),V(A,e,t)):V(A,e,t)}(A.mode,e,t):j(t,A.mode)}async function V(A,e,t){return await async function(A,e){const t=await m(A);return R(e,t.atime,t.mtime)}(e,t),j(t,A)}function j(A,e){return u(A,e)}async function W(A,e,t){const i=await p(A);for(let n=0;n{if(!A||!e)throw new TypeError("`source` and `destination` file required");if(!(t={overwrite:!0,...t}).overwrite&&await(async A=>{try{return await r.access(A),!0}catch(A){return"ENOENT"!==A.code}})(e))throw new Error(`The destination file exists: ${e}`);await r.mkdir(i(e),{recursive:!0});try{await r.rename(A,e)}catch(i){if("EXDEV"!==i.code&&"EPERM"!==i.code)throw i;{const i=await r.lstat(A);if(i.isDirectory()){const i=await r.readdir(A);await Promise.all(i.map(i=>I(n(A,i),n(e,i),t,!1,C)))}else i.isSymbolicLink()?C.push({source:A,destination:e}):await r.copyFile(A,e)}}a&&(await Promise.all(C.map(async({source:A,destination:e})=>{let t=await r.readlink(A);s(t)&&(t=o(e,g(A,t)));let n="file";try{n=await r.stat(o(i(A),t)),n.isDirectory()&&(n="junction")}catch{}await r.symlink(t,e,n)})),await r.rm(A,{recursive:!0,force:!0}))};A.exports=I},5757(A,e,t){const{readdir:i}=t(91943),{join:n}=t(16928);A.exports=async A=>{const e=[];for(const t of await i(A))if(t.startsWith("@"))for(const o of await i(n(A,t)))e.push(n(t,o));else e.push(t);return e}},33300(A,e,t){const{join:i,sep:n}=t(16928),o=t(30182),{mkdir:g,mkdtemp:s,rm:r}=t(91943);A.exports=async(A,e,t)=>{const I=o(t,{copy:["tmpPrefix"]});await g(A,{recursive:!0});const a=await s(i(`${A}${n}`,I.tmpPrefix||""));let C,B;try{B=await e(a)}catch(A){C=A}try{await r(a,{force:!0,recursive:!0})}catch{}if(C)throw C;return B}},83053(A,e,t){"use strict";var i=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),n=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),o=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)"default"!==t&&Object.prototype.hasOwnProperty.call(A,t)&&i(e,A,t);return n(e,A),e};Object.defineProperty(e,"__esModule",{value:!0}),e.req=e.json=e.toBuffer=void 0;const g=o(t(58611)),s=o(t(65692));async function r(A){let e=0;const t=[];for await(const i of A)e+=i.length,t.push(i);return Buffer.concat(t,e)}e.toBuffer=r,e.json=async function(A){const e=(await r(A)).toString("utf8");try{return JSON.parse(e)}catch(A){const t=A;throw t.message+=` (input: ${e})`,t}},e.req=function(A,e={}){const t=(("string"==typeof A?A:A.href).startsWith("https:")?s:g).request(A,e),i=new Promise((A,e)=>{t.once("response",A).once("error",e).end()});return t.then=i.then.bind(i),t}},64112(A,e,t){"use strict";var i=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),n=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),o=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)"default"!==t&&Object.prototype.hasOwnProperty.call(A,t)&&i(e,A,t);return n(e,A),e},g=this&&this.__exportStar||function(A,e){for(var t in A)"default"===t||Object.prototype.hasOwnProperty.call(e,t)||i(e,A,t)};Object.defineProperty(e,"__esModule",{value:!0}),e.Agent=void 0;const s=o(t(69278)),r=o(t(58611)),I=t(65692);g(t(83053),e);const a=Symbol("AgentBaseInternalState");class C extends r.Agent{constructor(A){super(A),this[a]={}}isSecureEndpoint(A){if(A){if("boolean"==typeof A.secureEndpoint)return A.secureEndpoint;if("string"==typeof A.protocol)return"https:"===A.protocol}const{stack:e}=new Error;return"string"==typeof e&&e.split("\n").some(A=>-1!==A.indexOf("(https.js:")||-1!==A.indexOf("node:https:"))}incrementSockets(A){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[A]||(this.sockets[A]=[]);const e=new s.Socket({writable:!1});return this.sockets[A].push(e),this.totalSocketCount++,e}decrementSockets(A,e){if(!this.sockets[A]||null===e)return;const t=this.sockets[A],i=t.indexOf(e);-1!==i&&(t.splice(i,1),this.totalSocketCount--,0===t.length&&delete this.sockets[A])}getName(A){return this.isSecureEndpoint(A)?I.Agent.prototype.getName.call(this,A):super.getName(A)}createSocket(A,e,t){const i={...e,secureEndpoint:this.isSecureEndpoint(e)},n=this.getName(i),o=this.incrementSockets(n);Promise.resolve().then(()=>this.connect(A,i)).then(g=>{if(this.decrementSockets(n,o),g instanceof r.Agent)try{return g.addRequest(A,i)}catch(A){return t(A)}this[a].currentSocket=g,super.createSocket(A,e,t)},A=>{this.decrementSockets(n,o),t(A)})}createConnection(){const A=this[a].currentSocket;if(this[a].currentSocket=void 0,!A)throw new Error("No socket was returned in the `connect()` function");return A}get defaultPort(){return this[a].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(A){this[a]&&(this[a].defaultPort=A)}get protocol(){return this[a].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(A){this[a]&&(this[a].protocol=A)}}e.Agent=C},26858(A,e,t){"use strict";const i=t(49298),n=t(9718);class o extends Error{constructor(A){if(!Array.isArray(A))throw new TypeError("Expected input to be an Array, got "+typeof A);let e=(A=[...A].map(A=>A instanceof Error?A:null!==A&&"object"==typeof A?Object.assign(new Error(A.message),A):new Error(A))).map(A=>"string"==typeof A.stack?n(A.stack).replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""):String(A)).join("\n");e="\n"+i(e,4),super(e),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:A})}*[Symbol.iterator](){for(const A of this._errors)yield A}}A.exports=o},99986(A){"use strict";function e(A,e,n){A instanceof RegExp&&(A=t(A,n)),e instanceof RegExp&&(e=t(e,n));var o=i(A,e,n);return o&&{start:o[0],end:o[1],pre:n.slice(0,o[0]),body:n.slice(o[0]+A.length,o[1]),post:n.slice(o[1]+e.length)}}function t(A,e){var t=e.match(A);return t?t[0]:null}function i(A,e,t){var i,n,o,g,s,r=t.indexOf(A),I=t.indexOf(e,r+1),a=r;if(r>=0&&I>0){if(A===e)return[r,I];for(i=[],o=t.length;a>=0&&!s;)a==r?(i.push(a),r=t.indexOf(A,a+1)):1==i.length?s=[i.pop(),I]:((n=i.pop())=0?r:I;i.length&&(s=[o,g])}return s}A.exports=e,e.range=i},30971(A,e,t){"use strict";const i=t(76315).MH.Q,n=t(77974),o=t(16928),g=t(50289);function s(A){return o.join(A,`content-v${i}`)}A.exports=function(A,e){const t=g.parse(e,{single:!0});return o.join(s(A),t.algorithm,...n(t.hexDigest()))},A.exports.contentDir=s},65020(A,e,t){"use strict";const i=t(91943),n=t(35552),o=t(50289),g=t(30971),s=t(48805);A.exports=async function(A,e,t={}){const{size:n}=t,{stat:g,cpath:I,sri:C}=await a(A,e,async(A,e)=>({stat:n?{size:n}:await i.stat(A),cpath:A,sri:e}));if(g.size>67108864)return r(I,g.size,C,new s).concat();const B=await i.readFile(I,{encoding:null});if(g.size!==B.length)throw function(A,e){const t=new Error(`Bad data size: expected inserted data to be ${A} bytes, but got ${e} instead`);return t.expected=A,t.found=e,t.code="EBADSIZE",t}(g.size,B.length);if(!o.checkData(B,C))throw function(A,e){const t=new Error(`Integrity verification failed for ${A} (${e})`);return t.code="EINTEGRITY",t.sri=A,t.path=e,t}(C,I);return B};const r=(A,e,t,i)=>(i.push(new n.ReadStream(A,{size:e,readSize:67108864}),o.integrityStream({integrity:t,size:e})),i);function I(A,e,t={}){const{size:n}=t,o=new s;return Promise.resolve().then(async()=>{const{stat:t,cpath:g,sri:s}=await a(A,e,async(A,e)=>({stat:n?{size:n}:await i.stat(A),cpath:A,sri:e}));return r(g,t.size,s,o)}).catch(A=>o.emit("error",A)),o}async function a(A,e,t){const i=o.parse(e),n=i.pickAlgorithm(),s=i[n];if(s.length<=1){const e=g(A,s[0]);return t(e,s[0])}{const e=await Promise.all(s.map(async e=>{try{return await a(A,e,t)}catch(A){return"ENOENT"===A.code?Object.assign(new Error("No matching content found for "+i.toString()),{code:"ENOENT"}):A}})),n=e.find(A=>!(A instanceof Error));if(n)return n;const o=e.find(A=>"ENOENT"===A.code);if(o)throw o;throw e.find(A=>A instanceof Error)}}A.exports.stream=I,A.exports.readStream=I,A.exports.copy=function(A,e,t){return a(A,e,A=>i.copyFile(A,t))},A.exports.hasContent=async function(A,e){if(!e)return!1;try{return await a(A,e,async(A,e)=>{const t=await i.stat(A);return{size:t.size,sri:e,stat:t}})}catch(A){if("ENOENT"===A.code)return!1;if("EPERM"===A.code){if("win32"!==process.platform)throw A;return!1}}}},94445(A,e,t){"use strict";const i=t(91943),n=t(30971),{hasContent:o}=t(65020);A.exports=async function(A,e){const t=await o(A,e);return!(!t||!t.sri||(await i.rm(n(A,t.sri),{recursive:!0,force:!0}),0))}},24041(A,e,t){"use strict";const i=t(24434),n=t(30971),o=t(91943),{moveFile:g}=t(54191),{Minipass:s}=t(51270),r=t(48805),I=t(94035),a=t(16928),C=t(50289),B=t(58425),Q=t(35552);A.exports=async function(A,e,t={}){const{algorithms:i,size:n,integrity:g}=t;if("number"==typeof n&&e.length!==n)throw function(A,e){const t=new Error(`Bad data size: expected inserted data to be ${A} bytes, but got ${e} instead`);return t.expected=A,t.found=e,t.code="EBADSIZE",t}(n,e.length);const s=C.fromData(e,i?{algorithms:i}:{});if(g&&!C.checkData(e,g,t))throw function(A,e){const t=new Error(`Integrity check failed:\n Wanted: ${A}\n Found: ${e}`);return t.code="EINTEGRITY",t.expected=A,t.found=e,t}(g,s);for(const i in s){const n=await l(A,t),g=s[i].toString();try{await o.writeFile(n.target,e,{flag:"wx"}),await u(n,A,g)}finally{n.moved||await o.rm(n.target,{recursive:!0,force:!0})}}return{integrity:s,size:e.length}};const E=new Map;A.exports.stream=function(A,e={}){return new c(A,e)};class c extends I{constructor(A,e){super(),this.opts=e,this.cache=A,this.inputStream=new s,this.inputStream.on("error",A=>this.emit("error",A)),this.inputStream.on("drain",()=>this.emit("drain")),this.handleContentP=null}write(A,e,t){return this.handleContentP||(this.handleContentP=async function(A,e,t){const n=await l(e,t);try{const o=await async function(A,e,t,n){const o=new Q.WriteStream(t,{flags:"wx"});if(n.integrityEmitter){const[e,t]=await Promise.all([i.once(n.integrityEmitter,"integrity").then(A=>A[0]),i.once(n.integrityEmitter,"size").then(A=>A[0]),new r(A,o).promise()]);return{integrity:e,size:t}}let g,s;const I=C.integrityStream({integrity:n.integrity,algorithms:n.algorithms,size:n.size});I.on("integrity",A=>{g=A}),I.on("size",A=>{s=A});const a=new r(A,I,o);return await a.promise(),{integrity:g,size:s}}(A,0,n.target,t);return await u(n,e,o.integrity),o}finally{n.moved||await o.rm(n.target,{recursive:!0,force:!0})}}(this.inputStream,this.cache,this.opts),this.handleContentP.catch(A=>this.emit("error",A))),this.inputStream.write(A,e,t)}flush(A){this.inputStream.end(()=>{if(!this.handleContentP){const e=new Error("Cache input stream was empty");return e.code="ENODATA",Promise.reject(e).catch(A)}this.handleContentP.then(e=>{e.integrity&&this.emit("integrity",e.integrity),null!==e.size&&this.emit("size",e.size),A()},e=>A(e))})}}async function l(A,e){const t=B(a.join(A,"tmp"),e.tmpPrefix);return await o.mkdir(a.dirname(t),{recursive:!0}),{target:t,moved:!1}}async function u(A,e,t){const i=n(e,t),s=a.dirname(i);return E.has(i)||E.set(i,o.mkdir(s,{recursive:!0}).then(async()=>(await g(A.target,i,{overwrite:!1}),A.moved=!0,A.moved)).catch(A=>{if(!A.message.startsWith("The destination file exists"))throw Object.assign(A,{code:"EEXIST"})}).finally(()=>{E.delete(i)})),E.get(i)}},17989(A,e,t){"use strict";const i=t(76982),{appendFile:n,mkdir:o,readFile:g,readdir:s,rm:r,writeFile:I}=t(91943),{Minipass:a}=t(51270),C=t(16928),B=t(50289),Q=t(58425),E=t(30971),c=t(77974),l=t(76315).MH.P,{moveFile:u}=t(54191),d=t(2655);async function h(A,e,t,i={}){const{metadata:g,size:s,time:r}=i,I=m(A,e),a={key:e,integrity:t&&B.stringify(t),time:r||Date.now(),size:s,metadata:g};try{await o(C.dirname(I),{recursive:!0});const A=JSON.stringify(a);await n(I,`\n${f(A)}\t${A}`)}catch(A){if("ENOENT"===A.code)return;throw A}return N(A,a)}function D(A){const e=w(A),t=new a({objectMode:!0});return Promise.resolve().then(async()=>{const i=await M(e);return await d(i,async i=>{const n=C.join(e,i),o=await M(n);await d(o,async e=>{const i=C.join(n,e),o=await M(i);await d(o,async e=>{const n=C.join(i,e);try{const e=(await p(n)).reduce((A,e)=>(A.set(e.key,e),A),new Map);for(const i of e.values()){const e=N(A,i);e&&t.write(e)}}catch(A){if("ENOENT"===A.code)return;throw A}},{concurrency:5})},{concurrency:5})},{concurrency:5}),t.end(),t}).catch(A=>t.emit("error",A)),t}async function p(A,e){return function(A){const e=[];return A.split("\n").forEach(A=>{if(!A)return;const t=A.split("\t");if(!t[1]||f(t[1])!==t[0])return;let i;try{i=JSON.parse(t[1])}catch(A){}i&&e.push(i)}),e}(await g(A,"utf8"))}function w(A){return C.join(A,`index-v${l}`)}function m(A,e){const t=y(e);return C.join.apply(C,[w(A)].concat(c(t)))}function y(A){return R(A,"sha256")}function f(A){return R(A,"sha1")}function R(A,e){return i.createHash(e).update(A).digest("hex")}function N(A,e,t){return e.integrity||t?{key:e.key,integrity:e.integrity,path:e.integrity?E(A,e.integrity):void 0,size:e.size,time:e.time,metadata:e.metadata}:null}function M(A){return s(A).catch(A=>{if("ENOENT"===A.code||"ENOTDIR"===A.code)return[];throw A})}A.exports.NotFoundError=class extends Error{constructor(A,e){super(`No cache entry for ${e} found in ${A}`),this.code="ENOENT",this.cache=A,this.key=e}},A.exports.compact=async function(A,e,t,i={}){const n=m(A,e),g=await p(n),s=[];for(let A=g.length-1;A>=0;--A){const e=g[A];if(null===e.integrity&&!i.validateEntry)break;i.validateEntry&&!0!==i.validateEntry(e)||0!==s.length&&s.find(A=>t(A,e))||s.unshift(e)}const a="\n"+s.map(A=>{const e=JSON.stringify(A);return`${f(e)}\t${e}`}).join("\n"),B=await(async()=>{const e=Q(C.join(A,"tmp"),i.tmpPrefix);return await o(C.dirname(e),{recursive:!0}),{target:e,moved:!1}})();try{await(async A=>{await I(A.target,a,{flag:"wx"}),await o(C.dirname(n),{recursive:!0}),await u(A.target,n),A.moved=!0})(B)}finally{await(async A=>{if(!A.moved)return r(A.target,{recursive:!0,force:!0})})(B)}return s.reverse().map(e=>N(A,e,!0))},A.exports.insert=h,A.exports.find=async function(A,e){const t=m(A,e);try{return(await p(t)).reduce((t,i)=>i&&i.key===e?N(A,i):t,null)}catch(A){if("ENOENT"===A.code)return null;throw A}},A.exports.delete=function(A,e,t={}){if(!t.removeFully)return h(A,e,null,t);const i=m(A,e);return r(i,{recursive:!0,force:!0})},A.exports.lsStream=D,A.exports.ls=async function(A){return(await D(A).collect()).reduce((A,e)=>(A[e.key]=e,A),{})},A.exports.bucketEntries=p,A.exports.bucketDir=w,A.exports.bucketPath=m,A.exports.hashKey=y,A.exports.hashEntry=f},55168(A,e,t){"use strict";const i=t(59291),{Minipass:n}=t(51270),o=t(48805),g=t(17989),s=t(78718),r=t(65020);A.exports=async function(A,e,t={}){const{integrity:i,memoize:n,size:o}=t,I=s.get(A,e,t);if(I&&!1!==n)return{metadata:I.entry.metadata,data:I.data,integrity:I.entry.integrity,size:I.entry.size};const a=await g.find(A,e,t);if(!a)throw new g.NotFoundError(A,e);const C=await r(A,a.integrity,{integrity:i,size:o});return n&&s.put(A,a,C,t),{data:C,metadata:a.metadata,size:a.size,integrity:a.integrity}},A.exports.byDigest=async function(A,e,t={}){const{integrity:i,memoize:n,size:o}=t,g=s.get.byDigest(A,e,t);if(g&&!1!==n)return g;const I=await r(A,e,{integrity:i,size:o});return n&&s.put.byDigest(A,e,I,t),I},A.exports.stream=function(A,e,t={}){const{memoize:I,size:a}=t,C=s.get(A,e,t);if(C&&!1!==I)return(A=>{const e=new n;return e.on("newListener",function(e,t){"metadata"===e&&t(A.entry.metadata),"integrity"===e&&t(A.entry.integrity),"size"===e&&t(A.entry.size)}),e.end(A.data),e})(C);const B=new o;return Promise.resolve().then(async()=>{const n=await g.find(A,e);if(!n)throw new g.NotFoundError(A,e);B.emit("metadata",n.metadata),B.emit("integrity",n.integrity),B.emit("size",n.size),B.on("newListener",function(A,e){"metadata"===A&&e(n.metadata),"integrity"===A&&e(n.integrity),"size"===A&&e(n.size)});const o=r.readStream(A,n.integrity,{...t,size:"number"!=typeof a?n.size:a});if(I){const e=new i.PassThrough;e.on("collect",e=>s.put(A,n,e,t)),B.unshift(e)}return B.unshift(o),B}).catch(A=>B.emit("error",A)),B},A.exports.stream.byDigest=function(A,e,t={}){const{memoize:g}=t,I=s.get.byDigest(A,e,t);if(I&&!1!==g){const A=new n;return A.end(I),A}{const n=r.readStream(A,e,t);if(!g)return n;const I=new i.PassThrough;return I.on("collect",i=>s.put.byDigest(A,e,i,t)),new o(n,I)}},A.exports.info=function(A,e,t={}){const{memoize:i}=t,n=s.get(A,e,t);return n&&!1!==i?Promise.resolve(n.entry):g.find(A,e)},A.exports.copy=async function(A,e,t,i={}){const n=await g.find(A,e,i);if(!n)throw new g.NotFoundError(A,e);return await r.copy(A,n.integrity,t,i),{metadata:n.metadata,size:n.size,integrity:n.integrity}},A.exports.copy.byDigest=async function(A,e,t,i={}){return await r.copy(A,e,t,i),e},A.exports.hasContent=r.hasContent},28812(A,e,t){"use strict";const i=t(55168),n=t(43461),o=t(2499),g=t(93207),{clearMemoized:s}=t(78718),r=t(35248),I=t(17989);A.exports.index={},A.exports.index.compact=I.compact,A.exports.index.insert=I.insert,A.exports.ls=I.ls,A.exports.ls.stream=I.lsStream,A.exports.get=i,A.exports.get.byDigest=i.byDigest,A.exports.get.stream=i.stream,A.exports.get.stream.byDigest=i.stream.byDigest,A.exports.get.copy=i.copy,A.exports.get.copy.byDigest=i.copy.byDigest,A.exports.get.info=i.info,A.exports.get.hasContent=i.hasContent,A.exports.put=n,A.exports.put.stream=n.stream,A.exports.rm=o.entry,A.exports.rm.all=o.all,A.exports.rm.entry=A.exports.rm,A.exports.rm.content=o.content,A.exports.clearMemoized=s,A.exports.tmp={},A.exports.tmp.mkdir=r.mkdir,A.exports.tmp.withTmp=r.withTmp,A.exports.verify=g,A.exports.verify.lastRun=g.lastRun},78718(A,e,t){"use strict";const{LRUCache:i}=t(59740),n=new i({max:500,maxSize:52428800,ttl:18e4,sizeCalculation:(A,e)=>e.startsWith("key:")?A.data.length:A.length});function o(A,e,t,i){s(i).set(`digest:${A}:${e}`,t)}A.exports.clearMemoized=function(){const A={};return n.forEach((e,t)=>{A[t]=e}),n.clear(),A},A.exports.put=function(A,e,t,i){s(i).set(`key:${A}:${e.key}`,{entry:e,data:t}),o(A,e.integrity,t,i)},A.exports.put.byDigest=o,A.exports.get=function(A,e,t){return s(t).get(`key:${A}:${e}`)},A.exports.get.byDigest=function(A,e,t){return s(t).get(`digest:${A}:${e}`)};class g{constructor(A){this.obj=A}get(A){return this.obj[A]}set(A,e){this.obj[A]=e}}function s(A){return A&&A.memoize?A.memoize.get&&A.memoize.set?A.memoize:"object"==typeof A.memoize?new g(A.memoize):n:n}},43461(A,e,t){"use strict";const i=t(17989),n=t(78718),o=t(24041),g=t(94035),{PassThrough:s}=t(59291),r=t(48805),I=A=>({algorithms:["sha512"],...A});A.exports=async function(A,e,t,g={}){const{memoize:s}=g;g=I(g);const r=await o(A,t,g),a=await i.insert(A,e,r.integrity,{...g,size:r.size});return s&&n.put(A,a,t,g),r.integrity},A.exports.stream=function(A,e,t={}){const{memoize:a}=t;let C,B,Q,E;t=I(t);const c=new r;if(a){const A=(new s).on("collect",A=>{E=A});c.push(A)}const l=o.stream(A,t).on("integrity",A=>{C=A}).on("size",A=>{B=A}).on("error",A=>{Q=A});return c.push(l),c.push(new g({async flush(){if(!Q){const o=await i.insert(A,e,C,{...t,size:B});a&&E&&n.put(A,o,E,t),c.emit("integrity",C),c.emit("size",B)}}})),c}},2499(A,e,t){"use strict";const{rm:i}=t(91943),n=t(48091),o=t(17989),g=t(78718),s=t(16928),r=t(94445);function I(A,e,t){return g.clearMemoized(),o.delete(A,e,t)}A.exports=I,A.exports.entry=I,A.exports.content=function(A,e){return g.clearMemoized(),r(A,e)},A.exports.all=async function(A){g.clearMemoized();const e=await n(s.join(A,"*(content-*|index-*)"),{silent:!0,nosort:!0});return Promise.all(e.map(A=>i(A,{recursive:!0,force:!0})))}},48091(A,e,t){"use strict";const{glob:i}=t(58290),n=t(16928),o=A=>A.split(n.win32.sep).join(n.posix.sep);A.exports=(A,e)=>i(o(A),e)},77974(A){"use strict";A.exports=function(A){return[A.slice(0,2),A.slice(2,4),A.slice(4)]}},35248(A,e,t){"use strict";const{withTempDir:i}=t(54191),n=t(91943),o=t(16928);A.exports.mkdir=async function(A,e={}){const{tmpPrefix:t}=e,i=o.join(A,"tmp");await n.mkdir(i,{recursive:!0,owner:"inherit"});const g=`${i}${o.sep}${t||""}`;return n.mkdtemp(g,{owner:"inherit"})},A.exports.withTmp=function(A,e,t){return t||(t=e,e={}),i(o.join(A,"tmp"),t,e)}},93207(A,e,t){"use strict";const{mkdir:i,readFile:n,rm:o,stat:g,truncate:s,writeFile:r}=t(91943),I=t(2655),a=t(30971),C=t(35552),B=t(48091),Q=t(17989),E=t(16928),c=t(50289),l=(A,e)=>Object.prototype.hasOwnProperty.call(A,e);async function u(){return{startTime:new Date}}async function d(){return{endTime:new Date}}async function h(A,e){return e.log.silly("verify","fixing cache permissions"),await i(A,{recursive:!0}),null}async function D(A,e){e.log.silly("verify","garbage collecting content");const t=Q.lsStream(A),i=new Set;t.on("data",A=>{if(e.filter&&!e.filter(A))return;const t=c.parse(A.integrity);for(const A in t)i.add(t[A].toString())}),await new Promise((A,e)=>{t.on("end",A).on("error",e)});const n=a.contentDir(A),s=await B(E.join(n,"**"),{follow:!1,nodir:!0,nosort:!0}),r={verifiedContent:0,reclaimedCount:0,reclaimedSize:0,badContentCount:0,keptSize:0};return await I(s,async A=>{const e=A.split(/[/\\]/),t=e.slice(e.length-3).join(""),n=e[e.length-4],s=c.fromHex(t,n);if(i.has(s.toString())){const e=await async function(A,e){const t={};try{const{size:i}=await g(A);t.size=i,t.valid=!0,await c.checkStream(new C.ReadStream(A),e)}catch(e){if("ENOENT"===e.code)return{size:0,valid:!1};if("EINTEGRITY"!==e.code)throw e;await o(A,{recursive:!0,force:!0}),t.valid=!1}return t}(A,s);e.valid?(r.verifiedContent++,r.keptSize+=e.size):(r.reclaimedCount++,r.badContentCount++,r.reclaimedSize+=e.size)}else{r.reclaimedCount++;const e=await g(A);await o(A,{recursive:!0,force:!0}),r.reclaimedSize+=e.size}return r},{concurrency:e.concurrency}),r}async function p(A,e){e.log.silly("verify","rebuilding index");const t=await Q.ls(A),i={missingContent:0,rejectedEntries:0,totalEntries:0},n={};for(const o in t)if(l(t,o)){const g=Q.hashKey(o),s=t[o],r=e.filter&&!e.filter(s);r&&i.rejectedEntries++,n[g]&&!r?n[g].push(s):n[g]&&r||(r?(n[g]=[],n[g]._path=Q.bucketPath(A,o)):(n[g]=[s],n[g]._path=Q.bucketPath(A,o)))}return await I(Object.keys(n),e=>async function(A,e,t){await s(e._path);for(const i of e){const e=a(A,i.integrity);try{await g(e),await Q.insert(A,i.key,i.integrity,{metadata:i.metadata,size:i.size,time:i.time}),t.totalEntries++}catch(A){if("ENOENT"!==A.code)throw A;t.rejectedEntries++,t.missingContent++}}}(A,n[e],i),{concurrency:e.concurrency}),i}function w(A,e){return e.log.silly("verify","cleaning tmp directory"),o(E.join(A,"tmp"),{recursive:!0,force:!0})}async function m(A,e){const t=E.join(A,"_lastverified");return e.log.silly("verify","writing verifile to "+t),r(t,`${Date.now()}`)}A.exports=async function(A,e){(e=(A=>({concurrency:20,log:{silly(){}},...A}))(e)).log.silly("verify","verifying cache at",A);const t=[u,h,D,p,w,m,d],i={};for(const n of t){const t=n.name,o=new Date,g=await n(A,e);g&&Object.keys(g).forEach(A=>{i[A]=g[A]});const s=new Date;i.runTime||(i.runTime={}),i.runTime[t]=s-o}return i.runTime.total=i.endTime-i.startTime,e.log.silly("verify","verification finished for",A,"in",`${i.runTime.total}ms`),i},A.exports.lastRun=async function(A){const e=await n(E.join(A,"_lastverified"),{encoding:"utf8"});return new Date(+e)}},64795(A,e,t){var i=t(99986);A.exports=function(A){return A?("{}"===A.substr(0,2)&&(A="\\{\\}"+A.substr(2)),l(function(A){return A.split("\\\\").join(n).split("\\{").join(o).split("\\}").join(g).split("\\,").join(s).split("\\.").join(r)}(A),!0).map(a)):[]};var n="\0SLASH"+Math.random()+"\0",o="\0OPEN"+Math.random()+"\0",g="\0CLOSE"+Math.random()+"\0",s="\0COMMA"+Math.random()+"\0",r="\0PERIOD"+Math.random()+"\0";function I(A){return parseInt(A,10)==A?parseInt(A,10):A.charCodeAt(0)}function a(A){return A.split(n).join("\\").split(o).join("{").split(g).join("}").split(s).join(",").split(r).join(".")}function C(A){if(!A)return[""];var e=[],t=i("{","}",A);if(!t)return A.split(",");var n=t.pre,o=t.body,g=t.post,s=n.split(",");s[s.length-1]+="{"+o+"}";var r=C(g);return g.length&&(s[s.length-1]+=r.shift(),s.push.apply(s,r)),e.push.apply(e,s),e}function B(A){return"{"+A+"}"}function Q(A){return/^-?0\d/.test(A)}function E(A,e){return A<=e}function c(A,e){return A>=e}function l(A,e){var t=[],n=i("{","}",A);if(!n)return[A];var o=n.pre,s=n.post.length?l(n.post,!1):[""];if(/\$$/.test(n.pre))for(var r=0;r=0;if(!p&&!w)return n.post.match(/,(?!,).*\}/)?l(A=n.pre+"{"+n.body+g+n.post):[A];if(p)u=n.body.split(/\.\./);else if(1===(u=C(n.body)).length&&1===(u=l(u[0],!1).map(B)).length)return s.map(function(A){return n.pre+u[0]+A});if(p){var m=I(u[0]),y=I(u[1]),f=Math.max(u[0].length,u[1].length),R=3==u.length?Math.abs(I(u[2])):1,N=E;y0){var L=new Array(G+1).join("0");k=S<0?"-"+L+k.slice(1):L+k}}d.push(k)}}else{d=[];for(var F=0;Fthis[h](A,e))}[h](A,e){A?this[d](A):(this[a]=e,this.emit("open",e),this[R]())}[c](){return Buffer.allocUnsafe(Math.min(this[N],this[S]))}[R](){if(!this[M]){this[M]=!0;const A=this[c]();if(0===A.length)return process.nextTick(()=>this[D](null,0,A));o.read(this[a],A,0,A.length,null,(A,e,t)=>this[D](A,e,t))}}[D](A,e,t){this[M]=!1,A?this[d](A):this[E](e,t)&&this[R]()}[r](){if(this[s]&&"number"==typeof this[a]){const A=this[a];this[a]=null,o.close(A,A=>A?this.emit("error",A):this.emit("close"))}}[d](A){this[M]=!0,this[r](),this.emit("error",A)}[E](A,e){let t=!1;return this[S]-=A,A>0&&(t=super.write(Athis[h](A,e))}[h](A,e){this[F]&&"r+"===this[B]&&A&&"ENOENT"===A.code?(this[B]="w",this[w]()):A?this[d](A):(this[a]=e,this.emit("open",e),this[L]||this[Q]())}end(A,e){return A&&this.write(A,e),this[I]=!0,this[L]||this[f].length||"number"!=typeof this[a]||this[p](null,0),this}write(A,e){return"string"==typeof A&&(A=Buffer.from(A,e)),this[I]?(this.emit("error",new Error("write() after end()")),!1):null===this[a]||this[L]||this[f].length?(this[f].push(A),this[u]=!0,!1):(this[L]=!0,this[G](A),!0)}[G](A){o.write(this[a],A,0,A.length,this[y],(A,e)=>this[p](A,e))}[p](A,e){A?this[d](A):(null!==this[y]&&(this[y]+=e),this[f].length?this[Q]():(this[L]=!1,this[I]&&!this[C]?(this[C]=!0,this[r](),this.emit("finish")):this[u]&&(this[u]=!1,this.emit("drain"))))}[Q](){if(0===this[f].length)this[I]&&this[p](null,0);else if(1===this[f].length)this[G](this[f].pop());else{const A=this[f];this[f]=[],g(this[a],A,this[y],(A,e)=>this[p](A,e))}}[r](){if(this[s]&&"number"==typeof this[a]){const A=this[a];this[a]=null,o.close(A,A=>A?this.emit("error",A):this.emit("close"))}}}e.ReadStream=U,e.ReadStreamSync=class extends U{[w](){let A=!0;try{this[h](null,o.openSync(this[m],"r")),A=!1}finally{A&&this[r]()}}[R](){let A=!0;try{if(!this[M]){for(this[M]=!0;;){const A=this[c](),e=0===A.length?0:o.readSync(this[a],A,0,A.length,null);if(!this[E](e,A))break}this[M]=!1}A=!1}finally{A&&this[r]()}}[r](){if(this[s]&&"number"==typeof this[a]){const A=this[a];this[a]=null,o.closeSync(A),this.emit("close")}}},e.WriteStream=J,e.WriteStreamSync=class extends J{[w](){let A;if(this[F]&&"r+"===this[B])try{A=o.openSync(this[m],this[B],this[l])}catch(A){if("ENOENT"===A.code)return this[B]="w",this[w]();throw A}else A=o.openSync(this[m],this[B],this[l]);this[h](null,A)}[r](){if(this[s]&&"number"==typeof this[a]){const A=this[a];this[a]=null,o.closeSync(A),this.emit("close")}}[G](A){let e=!0;try{this[p](null,o.writeSync(this[a],A,0,A.length,this[y])),e=!1}finally{if(e)try{this[r]()}catch{}}}}},2655(A,e,t){"use strict";const i=t(26858);A.exports=async(A,e,{concurrency:t=1/0,stopOnError:n=!0}={})=>new Promise((o,g)=>{if("function"!=typeof e)throw new TypeError("Mapper function is required");if(!Number.isSafeInteger(t)&&t!==1/0||!(t>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${t}\` (${typeof t})`);const s=[],r=[],I=A[Symbol.iterator]();let a=!1,C=!1,B=0,Q=0;const E=()=>{if(a)return;const A=I.next(),t=Q;if(Q++,A.done)return C=!0,void(0===B&&(n||0===r.length?o(s):g(new i(r))));B++,(async()=>{try{const i=await A.value;s[t]=await e(i,t),B--,E()}catch(A){n?(a=!0,g(A)):(r.push(A),B--,E())}})()};for(let A=0;A(e=Object.assign({pretty:!1},e),A.replace(/\\/g,"/").split("\n").filter(A=>{const e=A.match(n);if(null===e||!e[1])return!0;const t=e[1];return!t.includes(".app/Contents/Resources/electron.asar")&&!t.includes(".app/Contents/Resources/default_app.asar")&&!o.test(t)}).filter(A=>""!==A.trim()).map(A=>e.pretty?A.replace(n,(A,e)=>A.replace(e,e.replace(g,"~"))):A).join("\n"))},20124(A,e,t){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+A.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;e.splice(1,0,t,"color: inherit");let i=0,n=0;e[0].replace(/%[a-zA-Z%]/g,A=>{"%%"!==A&&(i++,"%c"===A&&(n=i))}),e.splice(n,0,t)},e.save=function(A){try{A?e.storage.setItem("debug",A):e.storage.removeItem("debug")}catch(A){}},e.load=function(){let A;try{A=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch(A){}return!A&&"undefined"!=typeof process&&"env"in process&&(A=process.env.DEBUG),A},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let A;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(A=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(A[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(A){}}(),e.destroy=(()=>{let A=!1;return()=>{A||(A=!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`."))}})(),e.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"],e.log=console.debug||console.log||(()=>{}),A.exports=t(27891)(e);const{formatters:i}=A.exports;i.j=function(A){try{return JSON.stringify(A)}catch(A){return"[UnexpectedJSONParseError]: "+A.message}}},27891(A,e,t){A.exports=function(A){function e(A){let t,n,o,g=null;function s(...A){if(!s.enabled)return;const i=s,n=Number(new Date),o=n-(t||n);i.diff=o,i.prev=t,i.curr=n,t=n,A[0]=e.coerce(A[0]),"string"!=typeof A[0]&&A.unshift("%O");let g=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(t,n)=>{if("%%"===t)return"%";g++;const o=e.formatters[n];if("function"==typeof o){const e=A[g];t=o.call(i,e),A.splice(g,1),g--}return t}),e.formatArgs.call(i,A),(i.log||e.log).apply(i,A)}return s.namespace=A,s.useColors=e.useColors(),s.color=e.selectColor(A),s.extend=i,s.destroy=e.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==g?g:(n!==e.namespaces&&(n=e.namespaces,o=e.enabled(A)),o),set:A=>{g=A}}),"function"==typeof e.init&&e.init(s),s}function i(A,t){const i=e(this.namespace+(void 0===t?":":t)+A);return i.log=this.log,i}function n(A,e){let t=0,i=0,n=-1,o=0;for(;t"-"+A)].join(",");return e.enable(""),A},e.enable=function(A){e.save(A),e.namespaces=A,e.names=[],e.skips=[];const t=("string"==typeof A?A:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const A of t)"-"===A[0]?e.skips.push(A.slice(1)):e.names.push(A)},e.enabled=function(A){for(const t of e.skips)if(n(A,t))return!1;for(const t of e.names)if(n(A,t))return!0;return!1},e.humanize=t(27250),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(A).forEach(t=>{e[t]=A[t]}),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(A){let t=0;for(let e=0;e{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),e.colors=[6,2,3,4,5,1];try{const A=t(65852);A&&(A.stderr||A).level>=2&&(e.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(A){}e.inspectOpts=Object.keys(process.env).filter(A=>/^debug_/i.test(A)).reduce((A,e)=>{const t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(A,e)=>e.toUpperCase());let i=process.env[e];return i=!!/^(yes|on|true|enabled)$/i.test(i)||!/^(no|off|false|disabled)$/i.test(i)&&("null"===i?null:Number(i)),A[t]=i,A},{}),A.exports=t(27891)(e);const{formatters:o}=A.exports;o.o=function(A){return this.inspectOpts.colors=this.useColors,n.inspect(A,this.inspectOpts).split("\n").map(A=>A.trim()).join(" ")},o.O=function(A){return this.inspectOpts.colors=this.useColors,n.inspect(A,this.inspectOpts)}},13622(A,e,t){"use strict";var i=t(93130);function n(A){return(A||"").toString().trim().replace(/^latin[\-_]?(\d+)$/i,"ISO-8859-$1").replace(/^win(?:dows)?[\-_]?(\d+)$/i,"WINDOWS-$1").replace(/^utf[\-_]?(\d+)$/i,"UTF-$1").replace(/^ks_c_5601\-1987$/i,"CP949").replace(/^us[\-_]?ascii$/i,"ASCII").toUpperCase()}A.exports.C=function(A,e,t){var o;if(t=n(t||"UTF-8"),e=n(e||"UTF-8"),A=A||"","UTF-8"!==t&&"string"==typeof A&&(A=Buffer.from(A,"binary")),t===e)o="string"==typeof A?Buffer.from(A):A;else try{o=function(A,e,t){return"UTF-8"===e?i.decode(A,t):"UTF-8"===t?i.encode(A,e):i.encode(i.decode(A,t),e)}(A,e,t)}catch(e){console.error(e),o=A}return"string"==typeof o&&(o=Buffer.from(o,"utf-8")),o}},72425(A){"use strict";function e(A,e){for(const t in e)Object.defineProperty(A,t,{value:e[t],enumerable:!0,configurable:!0});return A}A.exports=function(A,t,i){if(!A||"string"==typeof A)throw new TypeError("Please pass an Error to err-code");i||(i={}),"object"==typeof t&&(i=t,t=void 0),null!=t&&(i.code=t);try{return e(A,i)}catch(t){i.message=A.message,i.stack=A.stack;const n=function(){};return n.prototype=Object.create(Object.getPrototypeOf(A)),e(new n,i)}}},11785(A){"use strict";const e=new Set([200,203,204,206,300,301,308,404,405,410,414,501]),t=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]),i=new Set([500,502,503,504]),n={date:!0,connection:!0,"keep-alive":!0,"proxy-authenticate":!0,"proxy-authorization":!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0},o={"content-length":!0,"content-encoding":!0,"transfer-encoding":!0,"content-range":!0};function g(A){const e=parseInt(A,10);return isFinite(e)?e:0}function s(A){const e={};if(!A)return e;const t=A.trim().split(/,/);for(const A of t){const[t,i]=A.split(/=/,2);e[t.trim()]=void 0===i||i.trim().replace(/^"|"$/g,"")}return e}function r(A){let e=[];for(const t in A){const i=A[t];e.push(!0===i?t:t+"="+i)}if(e.length)return e.join(", ")}A.exports=class{constructor(A,e,{shared:t,cacheHeuristic:i,immutableMinTimeToLive:n,ignoreCargoCult:o,_fromObject:g}={}){if(g)this._fromObject(g);else{if(!e||!e.headers)throw Error("Response headers missing");this._assertRequestHasHeaders(A),this._responseTime=this.now(),this._isShared=!1!==t,this._cacheHeuristic=void 0!==i?i:.1,this._immutableMinTtl=void 0!==n?n:864e5,this._status="status"in e?e.status:200,this._resHeaders=e.headers,this._rescc=s(e.headers["cache-control"]),this._method="method"in A?A.method:"GET",this._url=A.url,this._host=A.headers.host,this._noAuthorization=!A.headers.authorization,this._reqHeaders=e.headers.vary?A.headers:null,this._reqcc=s(A.headers["cache-control"]),o&&"pre-check"in this._rescc&&"post-check"in this._rescc&&(delete this._rescc["pre-check"],delete this._rescc["post-check"],delete this._rescc["no-cache"],delete this._rescc["no-store"],delete this._rescc["must-revalidate"],this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":r(this._rescc)}),delete this._resHeaders.expires,delete this._resHeaders.pragma),null==e.headers["cache-control"]&&/no-cache/.test(e.headers.pragma)&&(this._rescc["no-cache"]=!0)}}now(){return Date.now()}storable(){return!(this._reqcc["no-store"]||!("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())||!t.has(this._status)||this._rescc["no-store"]||this._isShared&&this._rescc.private||this._isShared&&!this._noAuthorization&&!this._allowsStoringAuthenticated()||!(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||e.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(A){if(!A||!A.headers)throw Error("Request headers missing")}satisfiesWithoutRevalidation(A){this._assertRequestHasHeaders(A);const e=s(A.headers["cache-control"]);return!e["no-cache"]&&!/no-cache/.test(A.headers.pragma)&&(!(e["max-age"]&&this.age()>e["max-age"])&&(!(e["min-fresh"]&&this.timeToLive()<1e3*e["min-fresh"])&&(!(this.stale()&&(!e["max-stale"]||this._rescc["must-revalidate"]||!(!0===e["max-stale"]||e["max-stale"]>this.age()-this.maxAge())))&&this._requestMatches(A,!1))))}_requestMatches(A,e){return(!this._url||this._url===A.url)&&this._host===A.headers.host&&(!A.method||this._method===A.method||e&&"HEAD"===A.method)&&this._varyMatches(A)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(A){if(!this._resHeaders.vary)return!0;if("*"===this._resHeaders.vary)return!1;const e=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const t of e)if(A.headers[t]!==this._reqHeaders[t])return!1;return!0}_copyWithoutHopByHopHeaders(A){const e={};for(const t in A)n[t]||(e[t]=A[t]);if(A.connection){const t=A.connection.trim().split(/\s*,\s*/);for(const A of t)delete e[A]}if(e.warning){const A=e.warning.split(/,/).filter(A=>!/^\s*1[0-9][0-9]/.test(A));A.length?e.warning=A.join(",").trim():delete e.warning}return e}responseHeaders(){const A=this._copyWithoutHopByHopHeaders(this._resHeaders),e=this.age();return e>86400&&!this._hasExplicitExpiration()&&this.maxAge()>86400&&(A.warning=(A.warning?`${A.warning}, `:"")+'113 - "rfc7234 5.5.4"'),A.age=`${Math.round(e)}`,A.date=new Date(this.now()).toUTCString(),A}date(){const A=Date.parse(this._resHeaders.date);return isFinite(A)?A:this._responseTime}age(){return this._ageValue()+(this.now()-this._responseTime)/1e3}_ageValue(){return g(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"])return 0;if(this._isShared&&this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)return 0;if("*"===this._resHeaders.vary)return 0;if(this._isShared){if(this._rescc["proxy-revalidate"])return 0;if(this._rescc["s-maxage"])return g(this._rescc["s-maxage"])}if(this._rescc["max-age"])return g(this._rescc["max-age"]);const A=this._rescc.immutable?this._immutableMinTtl:0,e=this.date();if(this._resHeaders.expires){const t=Date.parse(this._resHeaders.expires);return Number.isNaN(t)||tt)return Math.max(A,(e-t)/1e3*this._cacheHeuristic)}return A}timeToLive(){const A=this.maxAge()-this.age(),e=A+g(this._rescc["stale-if-error"]),t=A+g(this._rescc["stale-while-revalidate"]);return 1e3*Math.max(0,A,e,t)}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+g(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+g(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(A){return new this(void 0,void 0,{_fromObject:A})}_fromObject(A){if(this._responseTime)throw Error("Reinitialized");if(!A||1!==A.v)throw Error("Invalid serialization");this._responseTime=A.t,this._isShared=A.sh,this._cacheHeuristic=A.ch,this._immutableMinTtl=void 0!==A.imm?A.imm:864e5,this._status=A.st,this._resHeaders=A.resh,this._rescc=A.rescc,this._method=A.m,this._url=A.u,this._host=A.h,this._noAuthorization=A.a,this._reqHeaders=A.reqh,this._reqcc=A.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(A){this._assertRequestHasHeaders(A);const e=this._copyWithoutHopByHopHeaders(A.headers);if(delete e["if-range"],!this._requestMatches(A,!0)||!this.storable())return delete e["if-none-match"],delete e["if-modified-since"],e;if(this._resHeaders.etag&&(e["if-none-match"]=e["if-none-match"]?`${e["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag),e["accept-ranges"]||e["if-match"]||e["if-unmodified-since"]||this._method&&"GET"!=this._method){if(delete e["if-modified-since"],e["if-none-match"]){const A=e["if-none-match"].split(/,/).filter(A=>!/^\s*W\//.test(A));A.length?e["if-none-match"]=A.join(",").trim():delete e["if-none-match"]}}else this._resHeaders["last-modified"]&&!e["if-modified-since"]&&(e["if-modified-since"]=this._resHeaders["last-modified"]);return e}revalidatedPolicy(A,e){if(this._assertRequestHasHeaders(A),this._useStaleIfError()&&function(A){return!A||i.has(A.status)}(e))return{modified:!1,matches:!1,policy:this};if(!e||!e.headers)throw Error("Response headers missing");let t=!1;if(void 0!==e.status&&304!=e.status?t=!1:e.headers.etag&&!/^\s*W\//.test(e.headers.etag)?t=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===e.headers.etag:this._resHeaders.etag&&e.headers.etag?t=this._resHeaders.etag.replace(/^\s*W\//,"")===e.headers.etag.replace(/^\s*W\//,""):this._resHeaders["last-modified"]?t=this._resHeaders["last-modified"]===e.headers["last-modified"]:this._resHeaders.etag||this._resHeaders["last-modified"]||e.headers.etag||e.headers["last-modified"]||(t=!0),!t)return{policy:new this.constructor(A,e),modified:304!=e.status,matches:!1};const n={};for(const A in this._resHeaders)n[A]=A in e.headers&&!o[A]?e.headers[A]:this._resHeaders[A];const g=Object.assign({},e,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(A,g,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:!1,matches:!0}}}},15756(A,e,t){"use strict";var i=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),n=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),o=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)"default"!==t&&Object.prototype.hasOwnProperty.call(A,t)&&i(e,A,t);return n(e,A),e},g=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpProxyAgent=void 0;const s=o(t(69278)),r=o(t(64756)),I=g(t(3680)),a=t(24434),C=t(64112),B=t(87016),Q=(0,I.default)("http-proxy-agent");class E extends C.Agent{constructor(A,e){super(e),this.proxy="string"==typeof A?new B.URL(A):A,this.proxyHeaders=e?.headers??{},Q("Creating new HttpProxyAgent instance: %o",this.proxy.href);const t=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={...e?c(e,"headers"):null,host:t,port:i}}addRequest(A,e){A._header=null,this.setRequestProps(A,e),super.addRequest(A,e)}setRequestProps(A,e){const{proxy:t}=this,i=`${e.secureEndpoint?"https:":"http:"}//${A.getHeader("host")||"localhost"}`,n=new B.URL(A.path,i);80!==e.port&&(n.port=String(e.port)),A.path=String(n);const o="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders};if(t.username||t.password){const A=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(A).toString("base64")}`}o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const e of Object.keys(o)){const t=o[e];t&&A.setHeader(e,t)}}async connect(A,e){let t,i,n;return A._header=null,A.path.includes("://")||this.setRequestProps(A,e),Q("Regenerating stored HTTP header string for request"),A._implicitHeader(),A.outputData&&A.outputData.length>0&&(Q("Patching connection write() output buffer with updated header"),t=A.outputData[0].data,i=t.indexOf("\r\n\r\n")+4,A.outputData[0].data=A._header+t.substring(i),Q("Output buffer: %o",A.outputData[0].data)),"https:"===this.proxy.protocol?(Q("Creating `tls.Socket`: %o",this.connectOpts),n=r.connect(this.connectOpts)):(Q("Creating `net.Socket`: %o",this.connectOpts),n=s.connect(this.connectOpts)),await(0,a.once)(n,"connect"),n}}function c(A,...e){const t={};let i;for(i in A)e.includes(i)||(t[i]=A[i]);return t}E.protocols=["http","https"],e.HttpProxyAgent=E},64007(A,e,t){"use strict";var i=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),n=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),o=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)"default"!==t&&Object.prototype.hasOwnProperty.call(A,t)&&i(e,A,t);return n(e,A),e},g=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0}),e.HttpsProxyAgent=void 0;const s=o(t(69278)),r=o(t(64756)),I=g(t(42613)),a=g(t(3680)),C=t(64112),B=t(87016),Q=t(36981),E=(0,a.default)("https-proxy-agent"),c=A=>void 0===A.servername&&A.host&&!s.isIP(A.host)?{...A,servername:A.host}:A;class l extends C.Agent{constructor(A,e){super(e),this.options={path:void 0},this.proxy="string"==typeof A?new B.URL(A):A,this.proxyHeaders=e?.headers??{},E("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const t=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...e?d(e,"headers"):null,host:t,port:i}}async connect(A,e){const{proxy:t}=this;if(!e.host)throw new TypeError('No "host" provided');let i;"https:"===t.protocol?(E("Creating `tls.Socket`: %o",this.connectOpts),i=r.connect(c(this.connectOpts))):(E("Creating `net.Socket`: %o",this.connectOpts),i=s.connect(this.connectOpts));const n="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},o=s.isIPv6(e.host)?`[${e.host}]`:e.host;let g=`CONNECT ${o}:${e.port} HTTP/1.1\r\n`;if(t.username||t.password){const A=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;n["Proxy-Authorization"]=`Basic ${Buffer.from(A).toString("base64")}`}n.Host=`${o}:${e.port}`,n["Proxy-Connection"]||(n["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const A of Object.keys(n))g+=`${A}: ${n[A]}\r\n`;const a=(0,Q.parseProxyResponse)(i);i.write(`${g}\r\n`);const{connect:C,buffered:B}=await a;if(A.emit("proxyConnect",C),this.emit("proxyConnect",C,A),200===C.statusCode)return A.once("socket",u),e.secureEndpoint?(E("Upgrading socket connection to TLS"),r.connect({...d(c(e),"host","path","port"),socket:i})):i;i.destroy();const l=new s.Socket({writable:!1});return l.readable=!0,A.once("socket",A=>{E("Replaying proxy buffer for failed request"),(0,I.default)(A.listenerCount("data")>0),A.push(B),A.push(null)}),l}}function u(A){A.resume()}function d(A,...e){const t={};let i;for(i in A)e.includes(i)||(t[i]=A[i]);return t}l.protocols=["http","https"],e.HttpsProxyAgent=l},36981(A,e,t){"use strict";var i=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0}),e.parseProxyResponse=void 0;const n=(0,i(t(3680)).default)("https-proxy-agent:parse-proxy-response");e.parseProxyResponse=function(A){return new Promise((e,t)=>{let i=0;const o=[];function g(){const r=A.read();r?function(r){o.push(r),i+=r.length;const I=Buffer.concat(o,i),a=I.indexOf("\r\n\r\n");if(-1===a)return n("have not received end of HTTP headers yet..."),void g();const C=I.slice(0,a).toString("ascii").split("\r\n"),B=C.shift();if(!B)return A.destroy(),t(new Error("No header received from proxy CONNECT response"));const Q=B.split(" "),E=+Q[1],c=Q.slice(2).join(" "),l={};for(const e of C){if(!e)continue;const i=e.indexOf(":");if(-1===i)return A.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${e}"`));const n=e.slice(0,i).toLowerCase(),o=e.slice(i+1).trimStart(),g=l[n];"string"==typeof g?l[n]=[g,o]:Array.isArray(g)?g.push(o):l[n]=o}n("got proxy server response: %o %o",B,l),s(),e({connect:{statusCode:E,statusText:c,headers:l},buffered:I})}(r):A.once("readable",g)}function s(){A.removeListener("end",r),A.removeListener("error",I),A.removeListener("readable",g)}function r(){s(),n("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function I(A){s(),n("onerror %o",A),t(A)}A.on("error",I),A.on("end",r),g()})}},31132(A,e,t){"use strict";var i=t(19845).Buffer;e._dbcs=I;for(var n=-1,o=-10,g=-1e3,s=new Array(256),r=0;r<256;r++)s[r]=n;function I(A,e){if(this.encodingName=A.encodingName,!A)throw new Error("DBCS codec is called without the data.");if(!A.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var t=A.table();this.decodeTables=[],this.decodeTables[0]=s.slice(0),this.decodeTableSeq=[];for(var i=0;ig)throw new Error("gb18030 decode tables conflict at byte 2");for(var B=this.decodeTables[g-a[C]],Q=129;Q<=254;Q++){if(B[Q]===n)B[Q]=g-r;else{if(B[Q]===g-r)continue;if(B[Q]>g)throw new Error("gb18030 decode tables conflict at byte 3")}for(var E=this.decodeTables[g-B[Q]],c=48;c<=57;c++)E[c]===n&&(E[c]=-2)}}}this.defaultCharUnicode=e.defaultCharUnicode,this.encodeTable=[],this.encodeTableSeq=[];var l={};if(A.encodeSkipVals)for(i=0;ie)return-1;for(var t=0,i=A.length;t>1);A[n]<=e?t=n:i=n}return t}I.prototype.encoder=a,I.prototype.decoder=C,I.prototype._getDecodeTrieNode=function(A){for(var e=[];A>0;A>>>=8)e.push(255&A);0==e.length&&e.push(0);for(var t=this.decodeTables[0],i=e.length-1;i>0;i--){var o=t[e[i]];if(o==n)t[e[i]]=g-this.decodeTables.length,this.decodeTables.push(t=s.slice(0));else{if(!(o<=g))throw new Error("Overwrite byte in "+this.encodingName+", addr: "+A.toString(16));t=this.decodeTables[g-o]}}return t},I.prototype._addDecodeChunk=function(A){var e=parseInt(A[0],16),t=this._getDecodeTrieNode(e);e&=255;for(var i=1;i255)throw new Error("Incorrect chunk in "+this.encodingName+" at addr "+A[0]+": too long"+e)},I.prototype._getEncodeBucket=function(A){var e=A>>8;return void 0===this.encodeTable[e]&&(this.encodeTable[e]=s.slice(0)),this.encodeTable[e]},I.prototype._setEncodeChar=function(A,e){var t=this._getEncodeBucket(A),i=255&A;t[i]<=o?this.encodeTableSeq[o-t[i]][-1]=e:t[i]==n&&(t[i]=e)},I.prototype._setEncodeSequence=function(A,e){var t,i=A[0],g=this._getEncodeBucket(i),s=255&i;g[s]<=o?t=this.encodeTableSeq[o-g[s]]:(t={},g[s]!==n&&(t[-1]=g[s]),g[s]=o-this.encodeTableSeq.length,this.encodeTableSeq.push(t));for(var r=1;r=0)this._setEncodeChar(I,a),n=!0;else if(I<=g){var C=g-I;if(!s[C]){var B=a<<8>>>0;this._fillEncodeTable(C,B,t)?n=!0:s[C]=!0}}else I<=o&&(this._setEncodeSequence(this.decodeTableSeq[o-I],a),n=!0)}return n},a.prototype.write=function(A){for(var e=i.alloc(A.length*(this.gb18030?4:3)),t=this.leadSurrogate,g=this.seqObj,s=-1,r=0,I=0;;){if(-1===s){if(r==A.length)break;var a=A.charCodeAt(r++)}else a=s,s=-1;if(55296<=a&&a<57344)if(a<56320){if(-1===t){t=a;continue}t=a,a=n}else-1!==t?(a=65536+1024*(t-55296)+(a-56320),t=-1):a=n;else-1!==t&&(s=a,a=n,t=-1);var C=n;if(void 0!==g&&a!=n){var Q=g[a];if("object"==typeof Q){g=Q;continue}"number"==typeof Q?C=Q:null==Q&&void 0!==(Q=g[-1])&&(C=Q,s=a),g=void 0}else if(a>=0){var E=this.encodeTable[a>>8];if(void 0!==E&&(C=E[255&a]),C<=o){g=this.encodeTableSeq[o-C];continue}if(C==n&&this.gb18030){var c=B(this.gb18030.uChars,a);if(-1!=c){C=this.gb18030.gbChars[c]+(a-this.gb18030.uChars[c]),e[I++]=129+Math.floor(C/12600),C%=12600,e[I++]=48+Math.floor(C/1260),C%=1260,e[I++]=129+Math.floor(C/10),C%=10,e[I++]=48+C;continue}}}C===n&&(C=this.defaultCharSingleByte),C<256?e[I++]=C:C<65536?(e[I++]=C>>8,e[I++]=255&C):C<16777216?(e[I++]=C>>16,e[I++]=C>>8&255,e[I++]=255&C):(e[I++]=C>>>24,e[I++]=C>>>16&255,e[I++]=C>>>8&255,e[I++]=255&C)}return this.seqObj=g,this.leadSurrogate=t,e.slice(0,I)},a.prototype.end=function(){if(-1!==this.leadSurrogate||void 0!==this.seqObj){var A=i.alloc(10),e=0;if(this.seqObj){var t=this.seqObj[-1];void 0!==t&&(t<256?A[e++]=t:(A[e++]=t>>8,A[e++]=255&t)),this.seqObj=void 0}return-1!==this.leadSurrogate&&(A[e++]=this.defaultCharSingleByte,this.leadSurrogate=-1),A.slice(0,e)}},a.prototype.findIdx=B,C.prototype.write=function(A){for(var e=i.alloc(2*A.length),t=this.nodeIdx,s=this.prevBytes,r=this.prevBytes.length,I=-this.prevBytes.length,a=0,C=0;a=0?A[a]:s[a+r];if((Q=this.decodeTables[t][E])>=0);else if(Q===n)Q=this.defaultCharUnicode.charCodeAt(0),a=I;else if(-2===Q){if(a>=3)var c=12600*(A[a-3]-129)+1260*(A[a-2]-48)+10*(A[a-1]-129)+(E-48);else c=12600*(s[a-3+r]-129)+1260*((a-2>=0?A[a-2]:s[a-2+r])-48)+10*((a-1>=0?A[a-1]:s[a-1+r])-129)+(E-48);var l=B(this.gb18030.gbChars,c);Q=this.gb18030.uChars[l]+c-this.gb18030.gbChars[l]}else{if(Q<=g){t=g-Q;continue}if(!(Q<=o))throw new Error("iconv-lite internal error: invalid decoding table value "+Q+" at "+t+"/"+E);for(var u=this.decodeTableSeq[o-Q],d=0;d>8;Q=u[u.length-1]}if(Q>=65536){var h=55296|(Q-=65536)>>10;e[C++]=255&h,e[C++]=h>>8,Q=56320|1023&Q}e[C++]=255&Q,e[C++]=Q>>8,t=0,I=a+1}return this.nodeIdx=t,this.prevBytes=I>=0?Array.prototype.slice.call(A,I):s.slice(I+r).concat(Array.prototype.slice.call(A)),e.slice(0,C).toString("ucs2")},C.prototype.end=function(){for(var A="";this.prevBytes.length>0;){A+=this.defaultCharUnicode;var e=this.prevBytes.slice(1);this.prevBytes=[],this.nodeIdx=0,e.length>0&&(A+=this.write(e))}return this.prevBytes=[],this.nodeIdx=0,A}},37772(A,e,t){"use strict";A.exports={shiftjis:{type:"_dbcs",table:function(){return t(28716)},encodeAdd:{"¥":92,"‾":126},encodeSkipVals:[{from:60736,to:63808}]},csshiftjis:"shiftjis",mskanji:"shiftjis",sjis:"shiftjis",windows31j:"shiftjis",ms31j:"shiftjis",xsjis:"shiftjis",windows932:"shiftjis",ms932:"shiftjis",932:"shiftjis",cp932:"shiftjis",eucjp:{type:"_dbcs",table:function(){return t(78879)},encodeAdd:{"¥":92,"‾":126}},gb2312:"cp936",gb231280:"cp936",gb23121980:"cp936",csgb2312:"cp936",csiso58gb231280:"cp936",euccn:"cp936",windows936:"cp936",ms936:"cp936",936:"cp936",cp936:{type:"_dbcs",table:function(){return t(14365)}},gbk:{type:"_dbcs",table:function(){return t(14365).concat(t(56299))}},xgbk:"gbk",isoir58:"gbk",gb18030:{type:"_dbcs",table:function(){return t(14365).concat(t(56299))},gb18030:function(){return t(64830)},encodeSkipVals:[128],encodeAdd:{"€":41699}},chinese:"gb18030",windows949:"cp949",ms949:"cp949",949:"cp949",cp949:{type:"_dbcs",table:function(){return t(92235)}},cseuckr:"cp949",csksc56011987:"cp949",euckr:"cp949",isoir149:"cp949",korean:"cp949",ksc56011987:"cp949",ksc56011989:"cp949",ksc5601:"cp949",windows950:"cp950",ms950:"cp950",950:"cp950",cp950:{type:"_dbcs",table:function(){return t(12925)}},big5:"big5hkscs",big5hkscs:{type:"_dbcs",table:function(){return t(12925).concat(t(36220))},encodeSkipVals:[36457,36463,36478,36523,36532,36557,36560,36695,36713,36718,36811,36862,36973,36986,37060,37084,37105,37311,37551,37552,37553,37554,37585,37959,38090,38361,38652,39285,39798,39800,39803,39878,39902,39916,39926,40002,40019,40034,40040,40043,40055,40124,40125,40144,40279,40282,40388,40431,40443,40617,40687,40701,40800,40907,41079,41180,41183,36812,37576,38468,38637,41636,41637,41639,41638,41676,41678]},cnbig5:"big5hkscs",csbig5:"big5hkscs",xxbig5:"big5hkscs"}},32499(A,e,t){"use strict";for(var i=[t(59506),t(96015),t(83025),t(54849),t(16247),t(32929),t(9913),t(31132),t(37772)],n=0;n>>6),e[t++]=128+(63&o)):(e[t++]=224+(o>>>12),e[t++]=128+(o>>>6&63),e[t++]=128+(63&o))}return e.slice(0,t)},I.prototype.end=function(){},a.prototype.write=function(A){for(var e=this.acc,t=this.contBytes,i=this.accBytes,n="",o=0;o0&&(n+=this.defaultCharUnicode,t=0),g<128?n+=String.fromCharCode(g):g<224?(e=31&g,t=1,i=1):g<240?(e=15&g,t=2,i=1):n+=this.defaultCharUnicode):t>0?(e=e<<6|63&g,i++,0===--t&&(n+=2===i&&e<128&&e>0||3===i&&e<2048?this.defaultCharUnicode:String.fromCharCode(e))):n+=this.defaultCharUnicode}return this.acc=e,this.contBytes=t,this.accBytes=i,n},a.prototype.end=function(){var A=0;return this.contBytes>0&&(A+=this.defaultCharUnicode),A}},16247(A,e,t){"use strict";var i=t(19845).Buffer;function n(A,e){if(!A)throw new Error("SBCS codec is called without the data.");if(!A.chars||128!==A.chars.length&&256!==A.chars.length)throw new Error("Encoding '"+A.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(128===A.chars.length){for(var t="",n=0;n<128;n++)t+=String.fromCharCode(n);A.chars=t+A.chars}this.decodeBuf=i.from(A.chars,"ucs2");var o=i.alloc(65536,e.defaultCharSingleByte.charCodeAt(0));for(n=0;n?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"},ibm1163:"cp1163",csibm1163:"cp1163",maccroatian:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"},maccyrillic:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},macgreek:{type:"_sbcs",chars:"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"},maciceland:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macroman:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macromania:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},macthai:{type:"_sbcs",chars:"«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู\ufeff​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"},macturkish:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"},macukraine:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"},koi8r:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8u:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8ru:{type:"_sbcs",chars:"─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},koi8t:{type:"_sbcs",chars:"қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"},armscii8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"},rk1048:{type:"_sbcs",chars:"ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},tcvn:{type:"_sbcs",chars:"\0ÚỤỪỬỮ\b\t\n\v\f\rỨỰỲỶỸÝỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"},georgianacademy:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},georgianps:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"},pt154:{type:"_sbcs",chars:"ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"},viscii:{type:"_sbcs",chars:"\0ẲẴẪ\b\t\n\v\f\rỶỸỴ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"},iso646cn:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},iso646jp:{type:"_sbcs",chars:"\0\b\t\n\v\f\r !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"},hproman8:{type:"_sbcs",chars:"€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"},macintosh:{type:"_sbcs",chars:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"},ascii:{type:"_sbcs",chars:"��������������������������������������������������������������������������������������������������������������������������������"},tis620:{type:"_sbcs",chars:"���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"}}},32929(A){"use strict";A.exports={10029:"maccenteuro",maccenteuro:{type:"_sbcs",chars:"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"},808:"cp808",ibm808:"cp808",cp808:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "},mik:{type:"_sbcs",chars:"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "},cp720:{type:"_sbcs",chars:"€éâ„à†çêëèïّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ "},ascii8bit:"ascii",usascii:"ascii",ansix34:"ascii",ansix341968:"ascii",ansix341986:"ascii",csascii:"ascii",cp367:"ascii",ibm367:"ascii",isoir6:"ascii",iso646us:"ascii",iso646irv:"ascii",us:"ascii",latin1:"iso88591",latin2:"iso88592",latin3:"iso88593",latin4:"iso88594",latin5:"iso88599",latin6:"iso885910",latin7:"iso885913",latin8:"iso885914",latin9:"iso885915",latin10:"iso885916",csisolatin1:"iso88591",csisolatin2:"iso88592",csisolatin3:"iso88593",csisolatin4:"iso88594",csisolatincyrillic:"iso88595",csisolatinarabic:"iso88596",csisolatingreek:"iso88597",csisolatinhebrew:"iso88598",csisolatin5:"iso88599",csisolatin6:"iso885910",l1:"iso88591",l2:"iso88592",l3:"iso88593",l4:"iso88594",l5:"iso88599",l6:"iso885910",l7:"iso885913",l8:"iso885914",l9:"iso885915",l10:"iso885916",isoir14:"iso646jp",isoir57:"iso646cn",isoir100:"iso88591",isoir101:"iso88592",isoir109:"iso88593",isoir110:"iso88594",isoir144:"iso88595",isoir127:"iso88596",isoir126:"iso88597",isoir138:"iso88598",isoir148:"iso88599",isoir157:"iso885910",isoir166:"tis620",isoir179:"iso885913",isoir199:"iso885914",isoir203:"iso885915",isoir226:"iso885916",cp819:"iso88591",ibm819:"iso88591",cyrillic:"iso88595",arabic:"iso88596",arabic8:"iso88596",ecma114:"iso88596",asmo708:"iso88596",greek:"iso88597",greek8:"iso88597",ecma118:"iso88597",elot928:"iso88597",hebrew:"iso88598",hebrew8:"iso88598",turkish:"iso88599",turkish8:"iso88599",thai:"iso885911",thai8:"iso885911",celtic:"iso885914",celtic8:"iso885914",isoceltic:"iso885914",tis6200:"tis620",tis62025291:"tis620",tis62025330:"tis620",1e4:"macroman",10006:"macgreek",10007:"maccyrillic",10079:"maciceland",10081:"macturkish",cspc8codepage437:"cp437",cspc775baltic:"cp775",cspc850multilingual:"cp850",cspcp852:"cp852",cspc862latinhebrew:"cp862",cpgr:"cp869",msee:"cp1250",mscyrl:"cp1251",msansi:"cp1252",msgreek:"cp1253",msturk:"cp1254",mshebr:"cp1255",msarab:"cp1256",winbaltrim:"cp1257",cp20866:"koi8r",20866:"koi8r",ibm878:"koi8r",cskoi8r:"koi8r",cp21866:"koi8u",21866:"koi8u",ibm1168:"koi8u",strk10482002:"rk1048",tcvn5712:"tcvn",tcvn57121:"tcvn",gb198880:"iso646cn",cn:"iso646cn",csiso14jisc6220ro:"iso646jp",jisc62201969ro:"iso646jp",jp:"iso646jp",cshproman8:"hproman8",r8:"hproman8",roman8:"hproman8",xroman8:"hproman8",ibm1051:"hproman8",mac:"macintosh",csmacintosh:"macintosh"}},83025(A,e,t){"use strict";var i=t(19845).Buffer;function n(){}function o(){}function g(){this.overflowByte=-1}function s(A,e){this.iconv=e}function r(A,e){void 0===(A=A||{}).addBOM&&(A.addBOM=!0),this.encoder=e.iconv.getEncoder("utf-16le",A)}function I(A,e){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=A||{},this.iconv=e.iconv}function a(A,e){var t=[],i=0,n=0,o=0;A:for(var g=0;g=100)break A}return o>n?"utf-16be":o1114111)&&(t=i),t>=65536){var n=55296|(t-=65536)>>10;A[e++]=255&n,A[e++]=n>>8,t=56320|1023&t}return A[e++]=255&t,A[e++]=t>>8,e}function r(A,e){this.iconv=e}function I(A,e){void 0===(A=A||{}).addBOM&&(A.addBOM=!0),this.encoder=e.iconv.getEncoder(A.defaultEncoding||"utf-32le",A)}function a(A,e){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=A||{},this.iconv=e.iconv}function C(A,e){var t=[],i=0,n=0,o=0,g=0,s=0;A:for(var r=0;r16)&&o++,(0!==t[3]||t[2]>16)&&n++,0!==t[0]||0!==t[1]||0===t[2]&&0===t[3]||s++,0===t[0]&&0===t[1]||0!==t[2]||0!==t[3]||g++,t.length=0,++i>=100)break A}return s-o>g-n?"utf-32be":s-o0){for(;e0&&(A=this.iconv.decode(i.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",A},e.utf7imap=E,E.prototype.encoder=c,E.prototype.decoder=l,E.prototype.bomAware=!0,c.prototype.write=function(A){for(var e=this.inBase64,t=this.base64Accum,n=this.base64AccumIdx,o=i.alloc(5*A.length+10),g=0,s=0;s0&&(g+=o.write(t.slice(0,n).toString("base64").replace(/\//g,",").replace(/=+$/,""),g),n=0),o[g++]=B,e=!1),e||(o[g++]=r,r===Q&&(o[g++]=B))):(e||(o[g++]=Q,e=!0),e&&(t[n++]=r>>8,t[n++]=255&r,n==t.length&&(g+=o.write(t.toString("base64").replace(/\//g,","),g),n=0)))}return this.inBase64=e,this.base64AccumIdx=n,o.slice(0,g)},c.prototype.end=function(){var A=i.alloc(10),e=0;return this.inBase64&&(this.base64AccumIdx>0&&(e+=A.write(this.base64Accum.slice(0,this.base64AccumIdx).toString("base64").replace(/\//g,",").replace(/=+$/,""),e),this.base64AccumIdx=0),A[e++]=B,this.inBase64=!1),A.slice(0,e)};var u=I.slice();u[",".charCodeAt(0)]=!0,l.prototype.write=function(A){for(var e="",t=0,n=this.inBase64,o=this.base64Accum,g=0;g0&&(A=this.iconv.decode(i.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",A}},38900(A,e){"use strict";function t(A,e){this.encoder=A,this.addBOM=!0}function i(A,e){this.decoder=A,this.pass=!1,this.options=e||{}}e.PrependBOM=t,t.prototype.write=function(A){return this.addBOM&&(A="\ufeff"+A,this.addBOM=!1),this.encoder.write(A)},t.prototype.end=function(){return this.encoder.end()},e.StripBOM=i,i.prototype.write=function(A){var e=this.decoder.write(A);return this.pass||!e||("\ufeff"===e[0]&&(e=e.slice(1),"function"==typeof this.options.stripBOM&&this.options.stripBOM()),this.pass=!0),e},i.prototype.end=function(){return this.decoder.end()}},93130(A,e,t){"use strict";var i,n=t(19845).Buffer,o=t(38900),g=A.exports;g.encodings=null,g.defaultCharUnicode="�",g.defaultCharSingleByte="?",g.encode=function(A,e,t){A=""+(A||"");var i=g.getEncoder(e,t),o=i.write(A),s=i.end();return s&&s.length>0?n.concat([o,s]):o},g.decode=function(A,e,t){"string"==typeof A&&(g.skipDecodeWarning||(console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"),g.skipDecodeWarning=!0),A=n.from(""+(A||""),"binary"));var i=g.getDecoder(e,t),o=i.write(A),s=i.end();return s?o+s:o},g.encodingExists=function(A){try{return g.getCodec(A),!0}catch(A){return!1}},g.toEncoding=g.encode,g.fromEncoding=g.decode,g._codecDataCache={},g.getCodec=function(A){g.encodings||(g.encodings=t(32499));for(var e=g._canonicalizeEncoding(A),i={};;){var n=g._codecDataCache[e];if(n)return n;var o=g.encodings[e];switch(typeof o){case"string":e=o;break;case"object":for(var s in o)i[s]=o[s];i.encodingName||(i.encodingName=e),e=o.type;break;case"function":return i.encodingName||(i.encodingName=e),n=new o(i,g),g._codecDataCache[i.encodingName]=n,n;default:throw new Error("Encoding not recognized: '"+A+"' (searched as: '"+e+"')")}}},g._canonicalizeEncoding=function(A){return(""+A).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g,"")},g.getEncoder=function(A,e){var t=g.getCodec(A),i=new t.encoder(e,t);return t.bomAware&&e&&e.addBOM&&(i=new o.PrependBOM(i,e)),i},g.getDecoder=function(A,e){var t=g.getCodec(A),i=new t.decoder(e,t);return!t.bomAware||e&&!1===e.stripBOM||(i=new o.StripBOM(i,e)),i},g.enableStreamingAPI=function(A){if(!g.supportsStreams){var e=t(4463)(A);g.IconvLiteEncoderStream=e.IconvLiteEncoderStream,g.IconvLiteDecoderStream=e.IconvLiteDecoderStream,g.encodeStream=function(A,e){return new g.IconvLiteEncoderStream(g.getEncoder(A,e),e)},g.decodeStream=function(A,e){return new g.IconvLiteDecoderStream(g.getDecoder(A,e),e)},g.supportsStreams=!0}};try{i=t(2203)}catch(A){}i&&i.Transform?g.enableStreamingAPI(i):g.encodeStream=g.decodeStream=function(){throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.")}},4463(A,e,t){"use strict";var i=t(19845).Buffer;A.exports=function(A){var e=A.Transform;function t(A,t){this.conv=A,(t=t||{}).decodeStrings=!1,e.call(this,t)}function n(A,t){this.conv=A,(t=t||{}).encoding=this.encoding="utf8",e.call(this,t)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),t.prototype._transform=function(A,e,t){if("string"!=typeof A)return t(new Error("Iconv encoding stream needs strings as its input."));try{var i=this.conv.write(A);i&&i.length&&this.push(i),t()}catch(A){t(A)}},t.prototype._flush=function(A){try{var e=this.conv.end();e&&e.length&&this.push(e),A()}catch(e){A(e)}},t.prototype.collect=function(A){var e=[];return this.on("error",A),this.on("data",function(A){e.push(A)}),this.on("end",function(){A(null,i.concat(e))}),this},n.prototype=Object.create(e.prototype,{constructor:{value:n}}),n.prototype._transform=function(A,e,t){if(!(i.isBuffer(A)||A instanceof Uint8Array))return t(new Error("Iconv decoding stream needs buffers as its input."));try{var n=this.conv.write(A);n&&n.length&&this.push(n,this.encoding),t()}catch(A){t(A)}},n.prototype._flush=function(A){try{var e=this.conv.end();e&&e.length&&this.push(e,this.encoding),A()}catch(e){A(e)}},n.prototype.collect=function(A){var e="";return this.on("error",A),this.on("data",function(A){e+=A}),this.on("end",function(){A(null,e)}),this},{IconvLiteEncoderStream:t,IconvLiteDecoderStream:n}}},33918(A){!function(){var e;function t(A,i){var n=this instanceof t?this:e;if(n.reset(i),"string"==typeof A&&A.length>0&&n.hash(A),n!==this)return n}t.prototype.hash=function(A){var e,t,i,n,o;switch(o=A.length,this.len+=o,t=this.k1,i=0,this.rem){case 0:t^=o>i?65535&A.charCodeAt(i++):0;case 1:t^=o>i?(65535&A.charCodeAt(i++))<<8:0;case 2:t^=o>i?(65535&A.charCodeAt(i++))<<16:0;case 3:t^=o>i?(255&A.charCodeAt(i))<<24:0,t^=o>i?(65280&A.charCodeAt(i++))>>8:0}if(this.rem=o+this.rem&3,(o-=this.rem)>0){for(e=this.h1;e=5*(e=(e^=t=13715*(t=(t=11601*t+3432906752*(65535&t)&4294967295)<<15|t>>>17)+461832192*(65535&t)&4294967295)<<13|e>>>19)+3864292196&4294967295,!(i>=o);)t=65535&A.charCodeAt(i++)^(65535&A.charCodeAt(i++))<<8^(65535&A.charCodeAt(i++))<<16,t^=(255&(n=A.charCodeAt(i++)))<<24^(65280&n)>>8;switch(t=0,this.rem){case 3:t^=(65535&A.charCodeAt(i+2))<<16;case 2:t^=(65535&A.charCodeAt(i+1))<<8;case 1:t^=65535&A.charCodeAt(i)}this.h1=e}return this.k1=t,this},t.prototype.result=function(){var A,e;return A=this.k1,e=this.h1,A>0&&(e^=A=13715*(A=(A=11601*A+3432906752*(65535&A)&4294967295)<<15|A>>>17)+461832192*(65535&A)&4294967295),e^=this.len,e=51819*(e^=e>>>16)+2246770688*(65535&e)&4294967295,e=44597*(e^=e>>>13)+3266445312*(65535&e)&4294967295,(e^=e>>>16)>>>0},t.prototype.reset=function(A){return this.h1="number"==typeof A?A:0,this.rem=this.k1=this.len=0,this},e=new t,A.exports=t}()},49298(A){"use strict";A.exports=(A,e=1,t)=>{if(t={indent:" ",includeEmptyLines:!1,...t},"string"!=typeof A)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof A}\``);if("number"!=typeof e)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if("string"!=typeof t.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof t.indent}\``);if(0===e)return A;const i=t.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return A.replace(i,t.indent.repeat(e))}},96744(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AddressError=void 0;class t extends Error{constructor(A,e){super(A),this.name="AddressError",null!==e&&(this.parseMessage=e)}}e.AddressError=t},11606(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isCorrect=e.isInSubnet=void 0,e.isInSubnet=function(A){return!(this.subnetMasks.BITS)throw new r.AddressError("Invalid subnet mask.");A=A.replace(s.RE_SUBNET_STRING,"")}this.addressMinusSuffix=A,this.parsedAddress=this.parse(A)}static isValid(A){try{return new C(A),!0}catch(A){return!1}}parse(A){const e=A.split(".");if(!A.match(s.RE_ADDRESS))throw new r.AddressError("Invalid IPv4 address.");return e}correctForm(){return this.parsedAddress.map(A=>parseInt(A,10)).join(".")}static fromHex(A){const e=A.replace(/:/g,"").padStart(8,"0"),t=[];let i;for(i=0;i<8;i+=2){const A=e.slice(i,i+2);t.push(parseInt(A,16))}return new C(t.join("."))}static fromInteger(A){return C.fromHex(A.toString(16))}static fromArpa(A){const e=A.replace(/(\.in-addr\.arpa)?\.$/,"").split(".").reverse().join(".");return new C(e)}toHex(){return this.parsedAddress.map(A=>(0,a.sprintf)("%02x",parseInt(A,10))).join(":")}toArray(){return this.parsedAddress.map(A=>parseInt(A,10))}toGroup6(){const A=[];let e;for(e=0;e(0,a.sprintf)("%02x",parseInt(A,10))).join(""),16)}_startAddress(){return new I.BigInteger(this.mask()+"0".repeat(s.BITS-this.subnetMask),2)}startAddress(){return C.fromBigInteger(this._startAddress())}startAddressExclusive(){const A=new I.BigInteger("1");return C.fromBigInteger(this._startAddress().add(A))}_endAddress(){return new I.BigInteger(this.mask()+"1".repeat(s.BITS-this.subnetMask),2)}endAddress(){return C.fromBigInteger(this._endAddress())}endAddressExclusive(){const A=new I.BigInteger("1");return C.fromBigInteger(this._endAddress().subtract(A))}static fromBigInteger(A){return C.fromInteger(parseInt(A.toString(),10))}mask(A){return void 0===A&&(A=this.subnetMask),this.getBitsBase2(0,A)}getBitsBase2(A,e){return this.binaryZeroPad().slice(A,e)}reverseForm(A){A||(A={});const e=this.correctForm().split(".").reverse().join(".");return A.omitSuffix?e:(0,a.sprintf)("%s.in-addr.arpa.",e)}isMulticast(){return this.isInSubnet(new C("224.0.0.0/4"))}binaryZeroPad(){return this.bigInteger().toString(2).padStart(s.BITS,"0")}groupForV6(){const A=this.parsedAddress;return this.address.replace(s.RE_ADDRESS,(0,a.sprintf)('%s.%s',A.slice(0,2).join("."),A.slice(2,4).join(".")))}}e.Address4=C},82966(A,e,t){"use strict";var i=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),n=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),o=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)"default"!==t&&Object.prototype.hasOwnProperty.call(A,t)&&i(e,A,t);return n(e,A),e};Object.defineProperty(e,"__esModule",{value:!0}),e.Address6=void 0;const g=o(t(11606)),s=o(t(78275)),r=o(t(91813)),I=o(t(43021)),a=t(87564),C=t(80030),B=t(96744),Q=t(28113),E=t(69471);function c(A){if(!A)throw new Error("Assertion failed.")}function l(A){return(A=A.replace(/^(0{1,})([1-9]+)$/,'$1$2')).replace(/^(0{1,})(0)$/,'$1$2')}function u(A){return(0,E.sprintf)("%04x",parseInt(A,16))}function d(A){return 255&A}class h{constructor(A,e){this.addressMinusSuffix="",this.parsedSubnet="",this.subnet="/128",this.subnetMask=128,this.v4=!1,this.zone="",this.isInSubnet=g.isInSubnet,this.isCorrect=g.isCorrect(r.BITS),this.groups=void 0===e?r.GROUPS:e,this.address=A;const t=r.RE_SUBNET_STRING.exec(A);if(t){if(this.parsedSubnet=t[0].replace("/",""),this.subnetMask=parseInt(this.parsedSubnet,10),this.subnet=`/${this.subnetMask}`,Number.isNaN(this.subnetMask)||this.subnetMask<0||this.subnetMask>r.BITS)throw new B.AddressError("Invalid subnet mask.");A=A.replace(r.RE_SUBNET_STRING,"")}else if(/\//.test(A))throw new B.AddressError("Invalid subnet mask.");const i=r.RE_ZONE_STRING.exec(A);i&&(this.zone=i[0],A=A.replace(r.RE_ZONE_STRING,"")),this.addressMinusSuffix=A,this.parsedAddress=this.parse(this.addressMinusSuffix)}static isValid(A){try{return new h(A),!0}catch(A){return!1}}static fromBigInteger(A){const e=A.toString(16).padStart(32,"0"),t=[];let i;for(i=0;i65536)&&(i=null)):i=null,{address:new h(e),port:i}}static fromAddress4(A){const e=new a.Address4(A),t=r.BITS-(s.BITS-e.subnetMask);return new h(`::ffff:${e.correctForm()}/${t}`)}static fromArpa(A){let e=A.replace(/(\.ip6\.arpa)?\.$/,"");if(63!==e.length)throw new B.AddressError("Invalid 'ip6.arpa' form.");const t=e.split(".").reverse();for(let A=7;A>0;A--){const e=4*A;t.splice(e,0,":")}return e=t.join(""),new h(e)}microsoftTranscription(){return(0,E.sprintf)("%s.ipv6-literal.net",this.correctForm().replace(/:/g,"-"))}mask(A=this.subnetMask){return this.getBitsBase2(0,A)}possibleSubnets(A=128){const e=r.BITS-this.subnetMask-Math.abs(A-r.BITS);return e<0?"0":function(A){const e=/(\d+)(\d{3})/;for(;e.test(A);)A=A.replace(e,"$1,$2");return A}(new Q.BigInteger("2",10).pow(e).toString(10))}_startAddress(){return new Q.BigInteger(this.mask()+"0".repeat(r.BITS-this.subnetMask),2)}startAddress(){return h.fromBigInteger(this._startAddress())}startAddressExclusive(){const A=new Q.BigInteger("1");return h.fromBigInteger(this._startAddress().add(A))}_endAddress(){return new Q.BigInteger(this.mask()+"1".repeat(r.BITS-this.subnetMask),2)}endAddress(){return h.fromBigInteger(this._endAddress())}endAddressExclusive(){const A=new Q.BigInteger("1");return h.fromBigInteger(this._endAddress().subtract(A))}getScope(){let A=r.SCOPES[this.getBits(12,16).intValue()];return"Global unicast"===this.getType()&&"Link local"!==A&&(A="Global"),A||"Unknown"}getType(){for(const A of Object.keys(r.TYPES))if(this.isInSubnet(new h(A)))return r.TYPES[A];return"Global unicast"}getBits(A,e){return new Q.BigInteger(this.getBitsBase2(A,e),2)}getBitsBase2(A,e){return this.binaryZeroPad().slice(A,e)}getBitsBase16(A,e){const t=e-A;if(t%4!=0)throw new Error("Length of bits to retrieve must be divisible by four");return this.getBits(A,e).toString(16).padStart(t/4,"0")}getBitsPastSubnet(){return this.getBitsBase2(this.subnetMask,r.BITS)}reverseForm(A){A||(A={});const e=Math.floor(this.subnetMask/4),t=this.canonicalForm().replace(/:/g,"").split("").slice(0,e).reverse().join(".");return e>0?A.omitSuffix?t:(0,E.sprintf)("%s.ip6.arpa.",t):A.omitSuffix?"":"ip6.arpa."}correctForm(){let A,e=[],t=0;const i=[];for(A=0;A0&&(t>1&&i.push([A-t,A-1]),t=0)}t>1&&i.push([this.parsedAddress.length-t,this.parsedAddress.length-1]);const n=i.map(A=>A[1]-A[0]+1);if(i.length>0){const A=n.indexOf(Math.max(...n));e=function(A,e){const t=[],i=[];let n;for(n=0;ne[1]&&i.push(A[n]);return t.concat(["compact"]).concat(i)}(this.parsedAddress,i[A])}else e=this.parsedAddress;for(A=0;A1?"s":"",e.join("")),A.replace(r.RE_BAD_CHARACTERS,'$1'));const t=A.match(r.RE_BAD_ADDRESS);if(t)throw new B.AddressError((0,E.sprintf)("Address failed regex: %s",t.join("")),A.replace(r.RE_BAD_ADDRESS,'$1'));let i=[];const n=A.split("::");if(2===n.length){let A=n[0].split(":"),e=n[1].split(":");1===A.length&&""===A[0]&&(A=[]),1===e.length&&""===e[0]&&(e=[]);const t=this.groups-(A.length+e.length);if(!t)throw new B.AddressError("Error parsing groups");this.elidedGroups=t,this.elisionBegin=A.length,this.elisionEnd=A.length+this.elidedGroups,i=i.concat(A);for(let A=0;A(0,E.sprintf)("%x",parseInt(A,16))),i.length!==this.groups)throw new B.AddressError("Incorrect number of groups found");return i}canonicalForm(){return this.parsedAddress.map(u).join(":")}decimal(){return this.parsedAddress.map(A=>(0,E.sprintf)("%05d",parseInt(A,16))).join(":")}bigInteger(){return new Q.BigInteger(this.parsedAddress.map(u).join(""),16)}to4(){const A=this.binaryZeroPad().split("");return a.Address4.fromHex(new Q.BigInteger(A.slice(96,128).join(""),2).toString(16))}to4in6(){const A=this.to4(),e=new h(this.parsedAddress.slice(0,6).join(":"),6).correctForm();let t="";return/:$/.test(e)||(t=":"),e+t+A.address}inspectTeredo(){const A=this.getBitsBase16(0,32),e=this.getBits(80,96).xor(new Q.BigInteger("ffff",16)).toString(),t=a.Address4.fromHex(this.getBitsBase16(32,64)),i=a.Address4.fromHex(this.getBits(96,128).xor(new Q.BigInteger("ffffffff",16)).toString(16)),n=this.getBits(64,80),o=this.getBitsBase2(64,80),g=n.testBit(15),s=n.testBit(14),r=n.testBit(8),I=n.testBit(9),C=new Q.BigInteger(o.slice(2,6)+o.slice(8,16),2).toString(10);return{prefix:(0,E.sprintf)("%s:%s",A.slice(0,4),A.slice(4,8)),server4:t.address,client4:i.address,flags:o,coneNat:g,microsoft:{reserved:s,universalLocal:I,groupIndividual:r,nonce:C},udpPort:e}}inspect6to4(){const A=this.getBitsBase16(0,16),e=a.Address4.fromHex(this.getBitsBase16(16,48));return{prefix:(0,E.sprintf)("%s",A.slice(0,4)),gateway:e.address}}to6to4(){if(!this.is4())return null;const A=["2002",this.getBitsBase16(96,112),this.getBitsBase16(112,128),"","/16"].join(":");return new h(A)}toByteArray(){const A=this.bigInteger().toByteArray();return 17===A.length&&0===A[0]?A.slice(1):A}toUnsignedByteArray(){return this.toByteArray().map(d)}static fromByteArray(A){return this.fromUnsignedByteArray(A.map(d))}static fromUnsignedByteArray(A){const e=new Q.BigInteger("256",10);let t=new Q.BigInteger("0",10),i=new Q.BigInteger("1",10);for(let n=A.length-1;n>=0;n--)t=t.add(i.multiply(new Q.BigInteger(A[n].toString(10),10))),i=i.multiply(e);return h.fromBigInteger(t)}isCanonical(){return this.addressMinusSuffix===this.canonicalForm()}isLinkLocal(){return"1111111010000000000000000000000000000000000000000000000000000000"===this.getBitsBase2(0,64)}isMulticast(){return"Multicast"===this.getType()}is4(){return this.v4}isTeredo(){return this.isInSubnet(new h("2001::/32"))}is6to4(){return this.isInSubnet(new h("2002::/16"))}isLoopback(){return"Loopback"===this.getType()}href(A){return A=void 0===A?"":(0,E.sprintf)(":%s",A),(0,E.sprintf)("http://[%s]%s/",this.correctForm(),A)}link(A){A||(A={}),void 0===A.className&&(A.className=""),void 0===A.prefix&&(A.prefix="/#address="),void 0===A.v4&&(A.v4=!1);let e=this.correctForm;return A.v4&&(e=this.to4in6),A.className?(0,E.sprintf)('%2$s',A.prefix,e.call(this),A.className):(0,E.sprintf)('%2$s',A.prefix,e.call(this))}group(){if(0===this.elidedGroups)return I.simpleGroup(this.address).join(":");c("number"==typeof this.elidedGroups),c("number"==typeof this.elisionBegin);const A=[],[e,t]=this.address.split("::");e.length?A.push(...I.simpleGroup(e)):A.push("");const i=["hover-group"];for(let A=this.elisionBegin;A',i.join(" "))),t.length?A.push(...I.simpleGroup(t,this.elisionEnd)):A.push(""),this.is4()&&(c(this.address4 instanceof a.Address4),A.pop(),A.push(this.address4.groupForV6())),A.join(":")}regularExpressionString(A=!1){let e=[];const t=new h(this.correctForm());if(0===t.elidedGroups)e.push((0,C.simpleRegularExpression)(t.parsedAddress));else if(t.elidedGroups===r.GROUPS)e.push((0,C.possibleElisions)(r.GROUPS));else{const A=t.address.split("::");A[0].length&&e.push((0,C.simpleRegularExpression)(A[0].split(":"))),c("number"==typeof t.elidedGroups),e.push((0,C.possibleElisions)(t.elidedGroups,0!==A[0].length,0!==A[1].length)),A[1].length&&e.push((0,C.simpleRegularExpression)(A[1].split(":"))),e=[e.join(":")]}return A||(e=["(?=^|",C.ADDRESS_BOUNDARY,"|[^\\w\\:])(",...e,")(?=[^\\w\\:]|",C.ADDRESS_BOUNDARY,"|$)"]),e.join("")}regularExpression(A=!1){return new RegExp(this.regularExpressionString(A),"i")}}e.Address6=h},78275(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RE_SUBNET_STRING=e.RE_ADDRESS=e.GROUPS=e.BITS=void 0,e.BITS=32,e.GROUPS=4,e.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,e.RE_SUBNET_STRING=/\/\d{1,2}$/},91813(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RE_URL_WITH_PORT=e.RE_URL=e.RE_ZONE_STRING=e.RE_SUBNET_STRING=e.RE_BAD_ADDRESS=e.RE_BAD_CHARACTERS=e.TYPES=e.SCOPES=e.GROUPS=e.BITS=void 0,e.BITS=128,e.GROUPS=8,e.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},e.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"},e.RE_BAD_CHARACTERS=/([^0-9a-f:/%])/gi,e.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,e.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,e.RE_ZONE_STRING=/%.*$/,e.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),e.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)},43021(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.simpleGroup=e.spanLeadingZeroes=e.spanAll=e.spanAllZeroes=void 0;const i=t(69471);function n(A){return A.replace(/(0+)/g,'$1')}function o(A){return A.replace(/^(0+)/,'$1')}e.spanAllZeroes=n,e.spanAll=function(A,e=0){return A.split("").map((A,t)=>(0,i.sprintf)('%s',A,t+e,n(A))).join("")},e.spanLeadingZeroes=function(A){return A.split(":").map(A=>o(A)).join(":")},e.simpleGroup=function(A,e=0){return A.split(":").map((A,t)=>/group-v4/.test(A)?A:(0,i.sprintf)('%s',t+e,o(A)))}},80030(A,e,t){"use strict";var i=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),n=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),o=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)"default"!==t&&Object.prototype.hasOwnProperty.call(A,t)&&i(e,A,t);return n(e,A),e};Object.defineProperty(e,"__esModule",{value:!0}),e.possibleElisions=e.simpleRegularExpression=e.ADDRESS_BOUNDARY=e.padGroup=e.groupPossibilities=void 0;const g=o(t(91813)),s=t(69471);function r(A){return(0,s.sprintf)("(%s)",A.join("|"))}function I(A){return A.length<4?(0,s.sprintf)("0{0,%d}%s",4-A.length,A):A}e.groupPossibilities=r,e.padGroup=I,e.ADDRESS_BOUNDARY="[^A-Fa-f0-9:]",e.simpleRegularExpression=function(A){const e=[];A.forEach((A,t)=>{0===parseInt(A,16)&&e.push(t)});const t=e.map(e=>A.map((A,t)=>{if(t===e){const e=0===t||t===g.GROUPS-1?":":"";return r([I(A),e])}return I(A)}).join(":"));return t.push(A.map(I).join(":")),r(t)},e.possibleElisions=function(A,e,t){const i=e?"":":",n=t?"":":",o=[];e||t||o.push("::"),e&&t&&o.push(""),(t&&!e||!t&&e)&&o.push(":"),o.push((0,s.sprintf)("%s(:0{1,4}){1,%d}",i,A-1)),o.push((0,s.sprintf)("(0{1,4}:){1,%d}%s",A-1,n)),o.push((0,s.sprintf)("(0{1,4}:){%d}0{1,4}",A-1));for(let e=1;e>15;--o>=0;){var r=32767&this[A],I=this[A++]>>15,a=s*r+I*g;n=((r=g*r+((32767&a)<<15)+t[i]+(1073741823&n))>>>30)+(a>>>15)+s*I+(n>>>30),t[i++]=1073741823&r}return n},e=30):n&&"Netscape"!=navigator.appName?(t.prototype.am=function(A,e,t,i,n,o){for(;--o>=0;){var g=e*this[A++]+t[i]+n;n=Math.floor(g/67108864),t[i++]=67108863&g}return n},e=26):(t.prototype.am=function(A,e,t,i,n,o){for(var g=16383&e,s=e>>14;--o>=0;){var r=16383&this[A],I=this[A++]>>14,a=s*r+I*g;n=((r=g*r+((16383&a)<<14)+t[i]+n)>>28)+(a>>14)+s*I,t[i++]=268435455&r}return n},e=28),t.prototype.DB=e,t.prototype.DM=(1<>>16)&&(A=e,t+=16),0!=(e=A>>8)&&(A=e,t+=8),0!=(e=A>>4)&&(A=e,t+=4),0!=(e=A>>2)&&(A=e,t+=2),0!=(e=A>>1)&&(A=e,t+=1),t}function B(A){this.m=A}function Q(A){this.m=A,this.mp=A.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),255&A||(A>>=8,e+=8),15&A||(A>>=4,e+=4),3&A||(A>>=2,e+=2),1&A||++e,e}function h(A){for(var e=0;0!=A;)A&=A-1,++e;return e}function D(){}function p(A){return A}function w(A){this.r2=i(),this.q3=i(),t.ONE.dlShiftTo(2*A.t,this.r2),this.mu=this.r2.divide(A),this.m=A}B.prototype.convert=function(A){return A.s<0||A.compareTo(this.m)>=0?A.mod(this.m):A},B.prototype.revert=function(A){return A},B.prototype.reduce=function(A){A.divRemTo(this.m,null,A)},B.prototype.mulTo=function(A,e,t){A.multiplyTo(e,t),this.reduce(t)},B.prototype.sqrTo=function(A,e){A.squareTo(e),this.reduce(e)},Q.prototype.convert=function(A){var e=i();return A.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),A.s<0&&e.compareTo(t.ZERO)>0&&this.m.subTo(e,e),e},Q.prototype.revert=function(A){var e=i();return A.copyTo(e),this.reduce(e),e},Q.prototype.reduce=function(A){for(;A.t<=this.mt2;)A[A.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&A.DM;for(A[t=e+this.m.t]+=this.m.am(0,i,A,e,0,this.m.t);A[t]>=A.DV;)A[t]-=A.DV,A[++t]++}A.clamp(),A.drShiftTo(this.m.t,A),A.compareTo(this.m)>=0&&A.subTo(this.m,A)},Q.prototype.mulTo=function(A,e,t){A.multiplyTo(e,t),this.reduce(t)},Q.prototype.sqrTo=function(A,e){A.squareTo(e),this.reduce(e)},t.prototype.copyTo=function(A){for(var e=this.t-1;e>=0;--e)A[e]=this[e];A.t=this.t,A.s=this.s},t.prototype.fromInt=function(A){this.t=1,this.s=A<0?-1:0,A>0?this[0]=A:A<-1?this[0]=A+this.DV:this.t=0},t.prototype.fromString=function(A,e){var i;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void this.fromRadix(A,e);i=2}this.t=0,this.s=0;for(var n=A.length,o=!1,g=0;--n>=0;){var s=8==i?255&A[n]:I(A,n);s<0?"-"==A.charAt(n)&&(o=!0):(o=!1,0==g?this[this.t++]=s:g+i>this.DB?(this[this.t-1]|=(s&(1<>this.DB-g):this[this.t-1]|=s<=this.DB&&(g-=this.DB))}8==i&&128&A[0]&&(this.s=-1,g>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==A;)--this.t},t.prototype.dlShiftTo=function(A,e){var t;for(t=this.t-1;t>=0;--t)e[t+A]=this[t];for(t=A-1;t>=0;--t)e[t]=0;e.t=this.t+A,e.s=this.s},t.prototype.drShiftTo=function(A,e){for(var t=A;t=0;--t)e[t+g+1]=this[t]>>n|s,s=(this[t]&o)<=0;--t)e[t]=0;e[g]=s,e.t=this.t+g+1,e.s=this.s,e.clamp()},t.prototype.rShiftTo=function(A,e){e.s=this.s;var t=Math.floor(A/this.DB);if(t>=this.t)e.t=0;else{var i=A%this.DB,n=this.DB-i,o=(1<>i;for(var g=t+1;g>i;i>0&&(e[this.t-t-1]|=(this.s&o)<>=this.DB;if(A.t>=this.DB;i+=this.s}else{for(i+=this.s;t>=this.DB;i-=A.s}e.s=i<0?-1:0,i<-1?e[t++]=this.DV+i:i>0&&(e[t++]=i),e.t=t,e.clamp()},t.prototype.multiplyTo=function(A,e){var i=this.abs(),n=A.abs(),o=i.t;for(e.t=o+n.t;--o>=0;)e[o]=0;for(o=0;o=0;)A[t]=0;for(t=0;t=e.DV&&(A[t+e.t]-=e.DV,A[t+e.t+1]=1)}A.t>0&&(A[A.t-1]+=e.am(t,e[t],A,2*t,0,1)),A.s=0,A.clamp()},t.prototype.divRemTo=function(A,e,n){var o=A.abs();if(!(o.t<=0)){var g=this.abs();if(g.t0?(o.lShiftTo(a,s),g.lShiftTo(a,n)):(o.copyTo(s),g.copyTo(n));var B=s.t,Q=s[B-1];if(0!=Q){var E=Q*(1<1?s[B-2]>>this.F2:0),c=this.FV/E,l=(1<=0&&(n[n.t++]=1,n.subTo(D,n)),t.ONE.dlShiftTo(B,D),D.subTo(s,s);s.t=0;){var p=n[--d]==Q?this.DM:Math.floor(n[d]*c+(n[d-1]+u)*l);if((n[d]+=s.am(0,p,n,h,0,B))0&&n.rShiftTo(a,n),r<0&&t.ZERO.subTo(n,n)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var A=this[0];if(!(1&A))return 0;var e=3&A;return(e=(e=(e=(e=e*(2-(15&A)*e)&15)*(2-(255&A)*e)&255)*(2-((65535&A)*e&65535))&65535)*(2-A*e%this.DV)%this.DV)>0?this.DV-e:-e},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(A,e){if(A>4294967295||A<1)return t.ONE;var n=i(),o=i(),g=e.convert(this),s=C(A)-1;for(g.copyTo(n);--s>=0;)if(e.sqrTo(n,o),(A&1<0)e.mulTo(o,g,n);else{var r=n;n=o,o=r}return e.revert(n)},t.prototype.toString=function(A){if(this.s<0)return"-"+this.negate().toString(A);var e;if(16==A)e=4;else if(8==A)e=3;else if(2==A)e=1;else if(32==A)e=5;else{if(4!=A)return this.toRadix(A);e=2}var t,i=(1<0)for(s>s)>0&&(n=!0,o=r(t));g>=0;)s>(s+=this.DB-e)):(t=this[g]>>(s-=e)&i,s<=0&&(s+=this.DB,--g)),t>0&&(n=!0),n&&(o+=r(t));return n?o:"0"},t.prototype.negate=function(){var A=i();return t.ZERO.subTo(this,A),A},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(A){var e=this.s-A.s;if(0!=e)return e;var t=this.t;if(0!=(e=t-A.t))return this.s<0?-e:e;for(;--t>=0;)if(0!=(e=this[t]-A[t]))return e;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+C(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(A){var e=i();return this.abs().divRemTo(A,null,e),this.s<0&&e.compareTo(t.ZERO)>0&&A.subTo(e,e),e},t.prototype.modPowInt=function(A,e){var t;return t=A<256||e.isEven()?new B(e):new Q(e),this.exp(A,t)},t.ZERO=a(0),t.ONE=a(1),D.prototype.convert=p,D.prototype.revert=p,D.prototype.mulTo=function(A,e,t){A.multiplyTo(e,t)},D.prototype.sqrTo=function(A,e){A.squareTo(e)},w.prototype.convert=function(A){if(A.s<0||A.t>2*this.m.t)return A.mod(this.m);if(A.compareTo(this.m)<0)return A;var e=i();return A.copyTo(e),this.reduce(e),e},w.prototype.revert=function(A){return A},w.prototype.reduce=function(A){for(A.drShiftTo(this.m.t-1,this.r2),A.t>this.m.t+1&&(A.t=this.m.t+1,A.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);A.compareTo(this.r2)<0;)A.dAddOffset(1,this.m.t+1);for(A.subTo(this.r2,A);A.compareTo(this.m)>=0;)A.subTo(this.m,A)},w.prototype.mulTo=function(A,e,t){A.multiplyTo(e,t),this.reduce(t)},w.prototype.sqrTo=function(A,e){A.squareTo(e),this.reduce(e)};var m,y,f,R=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],N=(1<<26)/R[R.length-1];function M(){var A;A=(new Date).getTime(),y[f++]^=255&A,y[f++]^=A>>8&255,y[f++]^=A>>16&255,y[f++]^=A>>24&255,f>=U&&(f-=U)}if(t.prototype.chunkSize=function(A){return Math.floor(Math.LN2*this.DB/Math.log(A))},t.prototype.toRadix=function(A){if(null==A&&(A=10),0==this.signum()||A<2||A>36)return"0";var e=this.chunkSize(A),t=Math.pow(A,e),n=a(t),o=i(),g=i(),s="";for(this.divRemTo(n,o,g);o.signum()>0;)s=(t+g.intValue()).toString(A).substr(1)+s,o.divRemTo(n,o,g);return g.intValue().toString(A)+s},t.prototype.fromRadix=function(A,e){this.fromInt(0),null==e&&(e=10);for(var i=this.chunkSize(e),n=Math.pow(e,i),o=!1,g=0,s=0,r=0;r=i&&(this.dMultiply(n),this.dAddOffset(s,0),g=0,s=0))}g>0&&(this.dMultiply(Math.pow(e,g)),this.dAddOffset(s,0)),o&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(A,e,i){if("number"==typeof e)if(A<2)this.fromInt(1);else for(this.fromNumber(A,i),this.testBit(A-1)||this.bitwiseTo(t.ONE.shiftLeft(A-1),c,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>A&&this.subTo(t.ONE.shiftLeft(A-1),this);else{var n=new Array,o=7&A;n.length=1+(A>>3),e.nextBytes(n),o>0?n[0]&=(1<>=this.DB;if(A.t>=this.DB;i+=this.s}else{for(i+=this.s;t>=this.DB;i+=A.s}e.s=i<0?-1:0,i>0?e[t++]=i:i<-1&&(e[t++]=this.DV+i),e.t=t,e.clamp()},t.prototype.dMultiply=function(A){this[this.t]=this.am(0,A-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(A,e){if(0!=A){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=A;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(A,e,t){var i,n=Math.min(this.t+A.t,e);for(t.s=0,t.t=n;n>0;)t[--n]=0;for(i=t.t-this.t;n=0;)t[i]=0;for(i=Math.max(e-this.t,0);i0)if(0==e)t=this[0]%A;else for(var i=this.t-1;i>=0;--i)t=(e*t+this[i])%A;return t},t.prototype.millerRabin=function(A){var e=this.subtract(t.ONE),n=e.getLowestSetBit();if(n<=0)return!1;var o=e.shiftRight(n);(A=A+1>>1)>R.length&&(A=R.length);for(var g=i(),s=0;s>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var A=this.t,e=new Array;e[0]=this.s;var t,i=this.DB-A*this.DB%8,n=0;if(A-- >0)for(i>i)!=(this.s&this.DM)>>i&&(e[n++]=t|this.s<=0;)i<8?(t=(this[A]&(1<>(i+=this.DB-8)):(t=this[A]>>(i-=8)&255,i<=0&&(i+=this.DB,--A)),128&t&&(t|=-256),0==n&&(128&this.s)!=(128&t)&&++n,(n>0||t!=this.s)&&(e[n++]=t);return e},t.prototype.equals=function(A){return 0==this.compareTo(A)},t.prototype.min=function(A){return this.compareTo(A)<0?this:A},t.prototype.max=function(A){return this.compareTo(A)>0?this:A},t.prototype.and=function(A){var e=i();return this.bitwiseTo(A,E,e),e},t.prototype.or=function(A){var e=i();return this.bitwiseTo(A,c,e),e},t.prototype.xor=function(A){var e=i();return this.bitwiseTo(A,l,e),e},t.prototype.andNot=function(A){var e=i();return this.bitwiseTo(A,u,e),e},t.prototype.not=function(){for(var A=i(),e=0;e=this.t?0!=this.s:!!(this[e]&1<1){var c=i();for(n.sqrTo(s[1],c);r<=E;)s[r]=i(),n.mulTo(c,s[r-2],s[r]),r+=2}var l,u,d=A.t-1,h=!0,D=i();for(o=C(A[d])-1;d>=0;){for(o>=I?l=A[d]>>o-I&E:(l=(A[d]&(1<0&&(l|=A[d-1]>>this.DB+o-I)),r=t;!(1&l);)l>>=1,--r;if((o-=r)<0&&(o+=this.DB,--d),h)s[l].copyTo(g),h=!1;else{for(;r>1;)n.sqrTo(g,D),n.sqrTo(D,g),r-=2;r>0?n.sqrTo(g,D):(u=g,g=D,D=u),n.mulTo(D,s[l],g)}for(;d>=0&&!(A[d]&1<=0?(i.subTo(n,i),e&&o.subTo(s,o),g.subTo(r,g)):(n.subTo(i,n),e&&s.subTo(o,s),r.subTo(g,r))}return 0!=n.compareTo(t.ONE)?t.ZERO:r.compareTo(A)>=0?r.subtract(A):r.signum()<0?(r.addTo(A,r),r.signum()<0?r.add(A):r):r},t.prototype.pow=function(A){return this.exp(A,new D)},t.prototype.gcd=function(A){var e=this.s<0?this.negate():this.clone(),t=A.s<0?A.negate():A.clone();if(e.compareTo(t)<0){var i=e;e=t,t=i}var n=e.getLowestSetBit(),o=t.getLowestSetBit();if(o<0)return e;for(n0&&(e.rShiftTo(o,e),t.rShiftTo(o,t));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=t.getLowestSetBit())>0&&t.rShiftTo(n,t),e.compareTo(t)>=0?(e.subTo(t,e),e.rShiftTo(1,e)):(t.subTo(e,t),t.rShiftTo(1,t));return o>0&&t.lShiftTo(o,t),t},t.prototype.isProbablePrime=function(A){var e,t=this.abs();if(1==t.t&&t[0]<=R[R.length-1]){for(e=0;e>>8,y[f++]=255&S;f=0,M()}function L(){if(null==m){for(M(),(m=new T).init(y),f=0;fA){let i=e;it&&(i=e+t),[!0,i]}return[!1,0]}},39579(A,e,t){var i=t(13214);const n=t(90092);var o=t(87016).parse,g=t(87016).URL,s=t(24434),r=t(65692),I=t(58611),a=t(39023),C=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","servername","checkServerIdentity"],B=[239,187,191];function Q(A,e){var t=Q.CONNECTING,s=e||{};Object.defineProperty(this,"readyState",{get:function(){return t}}),Object.defineProperty(this,"url",{get:function(){return A}});var a,E=this;E.reconnectInterval=1e3;var c="";s.headers&&s.headers["Last-Event-ID"]&&(c=s.headers["Last-Event-ID"]);var l,h,D,p=!1,w=null,m=new i.RetryDelayStrategy(null!==s.initialRetryDelayMillis&&void 0!==s.initialRetryDelayMillis?s.initialRetryDelayMillis:1e3,s.retryResetIntervalMillis,s.maxBackoffMillis?i.defaultBackoff(s.maxBackoffMillis):null,s.jitterRatio?i.defaultJitter(s.jitterRatio):null),y=new g(A).origin;let f;function R(A){if(A.status){var e=A.status;return 500===e||502===e||503===e||504===e}return!0}function N(e){if(t!==Q.CLOSED){var i=e?new u("error",e):new u("end",{message:"the request completed unexpectedly"});(s.errorFilter||R)(i)?(t=Q.CONNECTING,k(i),function(){if(t===Q.CONNECTING){var e=m.nextRetryDelay((new Date).getTime());w&&(A=w,w=null);var i=new u("retrying");i.delayMillis=e,k(i),clearTimeout(f),f=setTimeout(function(){t===Q.CONNECTING&&S()},e)}}()):(k(i),t=Q.CLOSED,k(new u("closed")))}}function M(){a.destroy&&a.destroy(),a.xhr&&a.xhr.abort&&a.xhr.abort()}function S(){var e=function(){var e=A,t={headers:{}};if(s.skipDefaultHeaders||(t.headers["Cache-Control"]="no-cache",t.headers.Accept="text/event-stream"),c&&(t.headers["Last-Event-ID"]=c),s.headers)for(var i in s.headers)s.headers.hasOwnProperty(i)&&(t.headers[i]=s.headers[i]);if(t.rejectUnauthorized=!!s.rejectUnauthorized,s.proxy){e=null;var n=o(A),g=o(s.proxy);t.protocol="https:"===g.protocol?"https:":"http:",t.path=A,t.headers.Host=n.host,t.hostname=g.hostname,t.host=g.host,t.port=g.port,g.username&&(t.auth=g.username+":"+g.password)}if(s.agent&&(t.agent=s.agent),s.https)for(var r in s.https)if(-1!==C.indexOf(r)){var I=s.https[r];void 0!==I&&(t[r]=I)}return void 0!==s.withCredentials&&(t.withCredentials=s.withCredentials),s.method&&(t.method=s.method),{url:e,options:t}}(),i="https:"===e.options.protocol||e.url&&e.url.startsWith("https:");const g=function(A){let e=!1;return(...t)=>{e||(e=!0,A(...t))}}(N);var E=function(e){if(301===e.statusCode||307===e.statusCode)return e.headers.location?(307===e.statusCode&&(w=A),A=e.headers.location,void process.nextTick(S)):void g({status:e.statusCode,headers:e.headers,message:e.statusMessage});if(200!==e.statusCode)return void g({status:e.statusCode,headers:e.headers,message:e.statusMessage});l="",h="",D=void 0,t=Q.OPEN,e.on("close",function(){e.removeAllListeners("close"),e.removeAllListeners("end"),g()}),e.on("end",function(){e.removeAllListeners("close"),e.removeAllListeners("end"),g()}),k(new u("open",{headers:e.headers}));var i,o=!0,s=0,r=-1;let I=0;e.on("data",function(A){if(i){const[e,t]=n(i.length,A.length+I,1048576);if(e){let A=Buffer.alloc(t);i.copy(A,0,0,I),i=A}A.copy(i,I)}else i=A,o&&function(A){return B.every(function(e,t){return A[t]===e})}(i)&&(i=i.slice(B.length),I-=B.length);I+=A.length,o=!1;let e=0;const t=I;for(;e0&&(i=i.slice(e),I-=e)})},d=i?r:I;a=e.url?d.request(e.url,e.options,E):d.request(e.options,E),s.readTimeoutMillis&&a.setTimeout(s.readTimeoutMillis),s.body&&a.write(s.body),a.on("error",function(A){g({message:A.message})}),a.on("timeout",function(){g({message:"Read timeout, received no data in "+s.readTimeoutMillis+"ms, assuming connection is dead"}),M()}),a.setNoDelay&&a.setNoDelay(!0),a.end()}function k(A){A&&E.emit(A.type,A)}function G(A,e,t,i){if(0===i){if(l.length>0){void 0!==D&&(c=D);var n=new d(h||"message",{data:l.slice(0,-1),lastEventId:c,origin:y});l="",D=void 0,function(A){m.setGoodSince((new Date).getTime()),k(A)}(n)}h=void 0}else{var o,g=t<0,s=A.slice(e,e+(g?i:t)).toString();e+=o=g?i:32!==A[e+t+1]?t+1:t+2;var r=i-o,I=A.slice(e,e+r).toString();if("data"===s)l+=I+"\n";else if("event"===s)h=I;else if("id"===s)I.includes("\0")||(D=I);else if("retry"===s){var a=parseInt(I,10);Number.isNaN(a)||(E.reconnectInterval=a,m.setBaseDelay(a))}}}S(),this._close=function(){clearTimeout(f),t!==Q.CLOSED&&(t=Q.CLOSED,M(),k(new u("closed")))}}A.exports={EventSource:Q},a.inherits(Q,s.EventEmitter),Q.prototype.constructor=Q,["open","end","error","message","retrying","closed"].forEach(function(A){Object.defineProperty(Q.prototype,"on"+A,{get:function(){var e=this.listeners(A)[0];return e?e._listener?e._listener:e:void 0},set:function(e){this.removeAllListeners(A),this.addEventListener(A,e)}})}),Object.defineProperty(Q,"CONNECTING",{enumerable:!0,value:0}),Object.defineProperty(Q,"OPEN",{enumerable:!0,value:1}),Object.defineProperty(Q,"CLOSED",{enumerable:!0,value:2}),Q.prototype.CONNECTING=0,Q.prototype.OPEN=1,Q.prototype.CLOSED=2;var E=["errorFilter","headers","https","initialRetryDelayMillis","jitterRatio","maxBackoffMillis","method","proxy","retryResetIntervalMillis","skipDefaultHeaders","withCredentials"],c={};for(var l in E)Object.defineProperty(c,E[l],{enumerable:!0,value:!0});function u(A,e){if(Object.defineProperty(this,"type",{writable:!1,value:A,enumerable:!0}),e)for(var t in e)e.hasOwnProperty(t)&&Object.defineProperty(this,t,{writable:!1,value:e[t],enumerable:!0})}function d(A,e){for(var t in Object.defineProperty(this,"type",{writable:!1,value:A,enumerable:!0}),e)e.hasOwnProperty(t)&&Object.defineProperty(this,t,{writable:!1,value:e[t],enumerable:!0})}Object.defineProperty(Q,"supportedOptions",{enumerable:!0,value:c}),Q.prototype.close=function(){this._close()},Q.prototype.addEventListener=function(A,e){"function"==typeof e&&(e._listener=e,this.on(A,e))},Q.prototype.dispatchEvent=function(A){if(!A.type)throw new Error("UNSPECIFIED_EVENT_TYPE_ERR");this.emit(A.type,A.detail)},Q.prototype.removeEventListener=function(A,e){"function"==typeof e&&(e._listener=void 0,this.removeListener(A,e))}},13214(A){A.exports={RetryDelayStrategy:function(A,e,t,i){var n,o=A,g=0;return{nextRetryDelay:function(A){n&&e&&A-n>=e&&(g=0),n=null;var s=t?t(o,g):o;return g++,i?i(s):s},setGoodSince:function(A){n=A},setBaseDelay:function(A){o=A,g=0}}},defaultBackoff:function(A){return function(e,t){var i=e*Math.pow(2,t);return i>A?A:i}},defaultJitter:function(A){return function(e){return e-Math.trunc(Math.random()*A*e)}}}},75633(A,e,t){const{Request:i,Response:n}=t(63837),{Minipass:o}=t(29450),g=t(94035),s=t(28812),r=t(87016),I=t(76680),a=t(86911),C=t(92646),B=t(38320),Q=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),E=["accept-charset","accept-encoding","accept-language","accept","cache-control"],c=["cache-control","content-encoding","content-language","content-type","date","etag","expires","last-modified","link","location","pragma","vary"],l=(A,e,t)=>{const i={time:Date.now(),url:A.url,reqHeaders:{},resHeaders:{},options:{compress:null!=t.compress?t.compress:A.compress}};200!==e.status&&304!==e.status&&(i.status=e.status);for(const e of E)A.headers.has(e)&&(i.reqHeaders[e]=A.headers.get(e));const n=A.headers.get("host"),o=new r.URL(A.url);if(n&&o.host!==n&&(i.reqHeaders.host=n),e.headers.has("vary")){const t=e.headers.get("vary");if("*"!==t){const e=t.trim().toLowerCase().split(/\s*,\s*/);for(const t of e)A.headers.has(t)&&(i.reqHeaders[t]=A.headers.get(t))}}for(const A of c)e.headers.has(A)&&(i.resHeaders[A]=e.headers.get(A));for(const A of t.cacheAdditionalHeaders)e.headers.has(A)&&(i.resHeaders[A]=e.headers.get(A));return i},u=Symbol("request"),d=Symbol("response"),h=Symbol("policy");class D{constructor({entry:A,request:e,response:t,options:i}){A?(this.key=A.key,this.entry=A,this.entry.metadata.time=this.entry.metadata.time||this.entry.time):this.key=C(e),this.options=i,this[u]=e,this[d]=t,this[h]=null}static async find(A,e){try{var t=await s.index.compact(e.cachePath,C(A),(A,t)=>{const i=new D({entry:A,options:e}),n=new D({entry:t,options:e});return i.policy.satisfies(n.request)},{validateEntry:A=>!(A.metadata&&A.metadata.resHeaders&&null===A.metadata.resHeaders["content-encoding"]||null===A.integrity&&(!A.metadata||!A.metadata.status))})}catch(A){return}if("reload"===e.cache)return;let i;for(const n of t){const t=new D({entry:n,options:e});if(t.policy.satisfies(A)){i=t;break}}return i}static async invalidate(A,e){const t=C(A);try{await s.rm.entry(e.cachePath,t,{removeFully:!0})}catch(A){}}get request(){return this[u]||(this[u]=new i(this.entry.metadata.url,{method:"GET",headers:this.entry.metadata.reqHeaders,...this.entry.metadata.options})),this[u]}get response(){return this[d]||(this[d]=new n(null,{url:this.entry.metadata.url,counter:this.options.counter,status:this.entry.metadata.status||200,headers:{...this.entry.metadata.resHeaders,"content-length":this.entry.size}})),this[d]}get policy(){return this[h]||(this[h]=new a({entry:this.entry,request:this.request,response:this.response,options:this.options})),this[h]}async store(A){if("GET"!==this.request.method||![200,301,308].includes(this.response.status)||!this.policy.storable())return this.response.headers.set("x-local-cache-status","skip"),this.response;const e=this.response.headers.get("content-length"),t={algorithms:this.options.algorithms,metadata:l(this.request,this.response,this.options),size:e,integrity:this.options.integrity,integrityEmitter:this.response.body.hasIntegrityEmitter&&this.response.body};let i=null;if(200===this.response.status){let A,e;const n=new Promise((t,i)=>{A=t,e=i}).catch(A=>{i.emit("error",A)});i=new I({events:["integrity","size"]},new g({flush:()=>n})),i.hasIntegrityEmitter=!0;const r=()=>{const n=new o,g=s.put.stream(this.options.cachePath,this.key,t);g.on("integrity",A=>i.emit("integrity",A)),g.on("size",A=>i.emit("size",A)),n.pipe(g),g.promise().then(A,e),i.unshift(n),i.unshift(this.response.body)};i.once("resume",r),i.once("end",()=>i.removeListener("resume",r))}else await s.index.insert(this.options.cachePath,this.key,null,t);return this.response.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),this.response.headers.set("x-local-cache-key",encodeURIComponent(this.key)),this.response.headers.set("x-local-cache-mode","stream"),this.response.headers.set("x-local-cache-status",A),this.response.headers.set("x-local-cache-time",(new Date).toISOString()),new n(i,{url:this.response.url,status:this.response.status,headers:this.response.headers,counter:this.options.counter})}async respond(A,e,t){let i;if("HEAD"===A||[301,308].includes(this.response.status))i=this.response;else{const A=new o,t={...this.policy.responseHeaders()},g=()=>{const e=s.get.stream.byDigest(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize});e.on("error",async t=>{e.pause(),"EINTEGRITY"===t.code&&await s.rm.content(this.options.cachePath,this.entry.integrity,{memoize:this.options.memoize}),"ENOENT"!==t.code&&"EINTEGRITY"!==t.code||await D.invalidate(this.request,this.options),A.emit("error",t),e.resume()}),A.emit("integrity",this.entry.integrity),A.emit("size",Number(t["content-length"])),e.pipe(A)};A.once("resume",g),A.once("end",()=>A.removeListener("resume",g)),i=new n(A,{url:this.entry.metadata.url,counter:e.counter,status:200,headers:t})}return i.headers.set("x-local-cache",encodeURIComponent(this.options.cachePath)),i.headers.set("x-local-cache-hash",encodeURIComponent(this.entry.integrity)),i.headers.set("x-local-cache-key",encodeURIComponent(this.key)),i.headers.set("x-local-cache-mode","stream"),i.headers.set("x-local-cache-status",t),i.headers.set("x-local-cache-time",new Date(this.entry.metadata.time).toUTCString()),i}async revalidate(A,e){const t=new i(A,{headers:this.policy.revalidationHeaders(A)});try{var n=await B(t,{...e,headers:void 0})}catch(t){if(!this.policy.mustRevalidate)return this.respond(A.method,e,"stale");throw t}if(this.policy.revalidated(t,n)){const t=l(A,n,e);for(const A of c)!Q(t.resHeaders,A)&&Q(this.entry.metadata.resHeaders,A)&&(t.resHeaders[A]=this.entry.metadata.resHeaders[A]);for(const A of e.cacheAdditionalHeaders){const e=Q(t.resHeaders,A),i=Q(this.entry.metadata.resHeaders,A),n=Q(this.policy.response.headers,A);!e&&i&&(t.resHeaders[A]=this.entry.metadata.resHeaders[A]),!n&&e&&(this.policy.response.headers[A]=t.resHeaders[A])}try{await s.index.insert(e.cachePath,this.key,this.entry.integrity,{size:this.entry.size,metadata:t})}catch(A){}return this.respond(A.method,e,"revalidated")}return new D({request:A,response:n,options:e}).store("updated")}}A.exports=D},64410(A){class e extends Error{constructor(A){super(`request to ${A} failed: cache mode is 'only-if-cached' but no cached response is available.`),this.code="ENOTCACHED"}}A.exports={NotCachedError:e}},90485(A,e,t){const{NotCachedError:i}=t(64410),n=t(75633),o=t(38320),g=async(A,e)=>{const t=await n.find(A,e);if(!t){if("only-if-cached"===e.cache)throw new i(A.url);const t=await o(A,e);return new n({request:A,response:t,options:e}).store("miss")}if("no-cache"===e.cache)return t.revalidate(A,e);const g=t.policy.needsRevalidation(A);return"force-cache"!==e.cache&&"only-if-cached"!==e.cache&&g?t.revalidate(A,e):t.respond(A.method,e,g?"stale":"hit")};g.invalidate=async(A,e)=>{if(e.cachePath)return n.invalidate(A,e)},A.exports=g},92646(A,e,t){const{URL:i,format:n}=t(87016),o={auth:!1,fragment:!1,search:!0,unicode:!1};A.exports=A=>{const e=new i(A.url);return`make-fetch-happen:request-cache:${n(e,o)}`}},86911(A,e,t){const i=t(11785),n=t(78232),o=t(50289),g={shared:!1,ignoreCargoCult:!0},s={status:200,headers:{}},r=A=>{const e={method:A.method,url:A.url,headers:{},compress:A.compress};return A.headers.forEach((A,t)=>{e.headers[t]=A}),e},I=A=>{const e={status:A.status,headers:{}};return A.headers.forEach((A,t)=>{e.headers[t]=A}),e};A.exports=class{constructor({entry:A,request:e,response:t,options:n}){this.entry=A,this.request=r(e),this.response=I(t),this.options=n,this.policy=new i(this.request,this.response,g),this.entry&&(this.policy._responseTime=this.entry.metadata.time)}static storable(A,e){return!!e.cachePath&&("no-store"!==e.cache&&(!!["GET","HEAD"].includes(A.method)&&new i(r(A),s,g).storable()))}satisfies(A){const e=r(A);if(this.request.headers.host!==e.headers.host)return!1;if(this.request.compress!==e.compress)return!1;const t=new n(this.request),i=new n(e);return JSON.stringify(t.mediaTypes())===JSON.stringify(i.mediaTypes())&&JSON.stringify(t.languages())===JSON.stringify(i.languages())&&JSON.stringify(t.encodings())===JSON.stringify(i.encodings())&&(!this.options.integrity||o.parse(this.options.integrity).match(this.entry.integrity))}storable(){return this.policy.storable()}get mustRevalidate(){return!!this.policy._rescc["must-revalidate"]}needsRevalidation(A){const e=r(A);return e.method="GET",!this.policy.satisfiesWithoutRevalidation(e)}responseHeaders(){return this.policy.responseHeaders()}revalidationHeaders(A){const e=r(A);return this.policy.revalidationHeaders(e)}revalidated(A,e){const t=r(A),i=I(e);return!this.policy.revalidatedPolicy(t,i).modified}}},77208(A,e,t){"use strict";const{FetchError:i,Request:n,isRedirect:o}=t(63837),g=t(87016),s=t(86911),r=t(90485),I=t(38320),a=async(A,e)=>{const t=s.storable(A,e)?await r(A,e):await I(A,e);if(!["GET","HEAD"].includes(A.method)&&t.status>=200&&t.status<=399&&await r.invalidate(A,e),!((A,e,t)=>{if(!o(e.status))return!1;if("manual"===t.redirect)return!1;if("error"===t.redirect)throw new i(`redirect mode is set to error: ${A.url}`,"no-redirect",{code:"ENOREDIRECT"});if(!e.headers.has("location"))throw new i(`redirect location header missing for: ${A.url}`,"no-location",{code:"EINVALIDREDIRECT"});if(A.counter>=A.follow)throw new i(`maximum redirect reached at: ${A.url}`,"max-redirect",{code:"EMAXREDIRECT"});return!0})(A,t,e))return t;const C=((A,e,t)=>{const i={...t},o=e.headers.get("location"),s=new g.URL(o,/^https?:/.test(o)?void 0:A.url);return new g.URL(A.url).hostname!==s.hostname&&(A.headers.delete("authorization"),A.headers.delete("cookie")),(303===e.status||"POST"===A.method&&[301,302].includes(e.status))&&(i.method="GET",i.body=null,A.headers.delete("content-length")),i.headers={},A.headers.forEach((A,e)=>{i.headers[e]=A}),i.counter=++A.counter,{request:new n(g.format(s),i),options:i}})(A,t,e);return a(C.request,C.options)};A.exports=a},48912(A,e,t){const{FetchError:i,Headers:n,Request:o,Response:g}=t(63837),s=t(93710),r=t(77208),I=(A,e)=>{const t=s(e),i=new o(A,t);return r(i,t)};I.defaults=(A,e={},t=I)=>{"object"==typeof A&&(e=A,A=null);const i=(i,n={})=>{const o=i||A,g={...e,...n,headers:{...e.headers,...n.headers}};return t(o,g)};return i.defaults=(A,e={})=>I.defaults(A,e,i),i},A.exports=I,A.exports.FetchError=i,A.exports.Headers=n,A.exports.Request=o,A.exports.Response=g},93710(A,e,t){const i=t(72250),n=["if-modified-since","if-none-match","if-unmodified-since","if-match","if-range"];A.exports=A=>{const{strictSSL:e,...t}={...A};if(t.method=t.method?t.method.toUpperCase():"GET",t.rejectUnauthorized=!1!==e,t.retry)if("string"==typeof t.retry){const A=parseInt(t.retry,10);isFinite(A)?t.retry={retries:A}:t.retry={retries:0}}else"number"==typeof t.retry?t.retry={retries:t.retry}:t.retry={retries:0,...t.retry};else t.retry={retries:0};return t.dns={ttl:3e5,lookup:i.lookup,...t.dns},t.cache=t.cache||"default","default"===t.cache&&Object.keys(t.headers||{}).some(A=>n.includes(A.toLowerCase()))&&(t.cache="no-store"),t.cacheAdditionalHeaders=t.cacheAdditionalHeaders||[],t.cacheManager&&!t.cachePath&&(t.cachePath=t.cacheManager),t}},76680(A,e,t){"use strict";const i=t(48805);A.exports=class extends i{#m=[];#y=new Map;constructor(A,...e){super(),this.#m=A.events,e.length&&this.push(...e)}on(A,e){return this.#m.includes(A)&&this.#y.has(A)?e(...this.#y.get(A)):super.on(A,e)}emit(A,...e){return this.#m.includes(A)&&this.#y.set(A,e),super.emit(A,...e)}}},38320(A,e,t){const{Minipass:i}=t(29450),n=t(63837),o=t(604),g=t(50289),{log:s}=t(71241),r=t(76680),{getAgent:I}=t(29873),a=t(53623),C=`${a.name}/${a.version} (+https://npm.im/${a.name})`,B=["ECONNRESET","ECONNREFUSED","EADDRINUSE","ETIMEDOUT","ECONNECTIONTIMEOUT","EIDLETIMEOUT","ERESPONSETIMEOUT","ETRANSFERTIMEOUT"],Q=["request-timeout"];A.exports=(A,e)=>{const t=I(A.url,e);A.headers.has("connection")||A.headers.set("connection",t?"keep-alive":"close"),A.headers.has("user-agent")||A.headers.set("user-agent",C);const a={...e,agent:t,redirect:"manual"};return o(async(t,o)=>{const I=new n.Request(A,a);try{let A=await n(I,a);if(a.integrity&&200===A.status){const e=g.integrityStream({algorithms:a.algorithms,integrity:a.integrity,size:a.size}),t=new r({events:["integrity","size"]},A.body,e);e.on("integrity",A=>t.emit("integrity",A)),e.on("size",A=>t.emit("size",A)),A=new n.Response(t,A),A.body.hasIntegrityEmitter=!0}A.headers.set("x-fetch-attempts",o);const C=i.isStream(I.body);return"POST"!==I.method&&!C&&([408,420,429].includes(A.status)||A.status>=500)?("function"==typeof e.onRetry&&e.onRetry(A),s.http("fetch",`${I.method} ${I.url} attempt ${o} failed with ${A.status}`),t(A)):A}catch(A){const i="EPROMISERETRY"===A.code?A.retried.code:A.code,g=A.retried instanceof n.Response||B.includes(i)&&Q.includes(A.type);if("POST"===I.method||g)throw A;return"function"==typeof e.onRetry&&e.onRetry(A),s.http("fetch",`${I.method} ${I.url} attempt ${o} failed with ${A.code}`),t(A)}},e.retry).catch(A=>{if(A.status>=400&&"system"!==A.type)return A;throw A})}},78232(A,e,t){"use strict";var i=t(308),n=t(60627),o=t(70660),g=t(45252);function s(A){if(!(this instanceof s))return new s(A);this.request=A}A.exports=s,A.exports.Negotiator=s,s.prototype.charset=function(A){var e=this.charsets(A);return e&&e[0]},s.prototype.charsets=function(A){return i(this.request.headers["accept-charset"],A)},s.prototype.encoding=function(A,e){var t=this.encodings(A,e);return t&&t[0]},s.prototype.encodings=function(A,e){return n(this.request.headers["accept-encoding"],A,e)},s.prototype.language=function(A){var e=this.languages(A);return e&&e[0]},s.prototype.languages=function(A){return o(this.request.headers["accept-language"],A)},s.prototype.mediaType=function(A){var e=this.mediaTypes(A);return e&&e[0]},s.prototype.mediaTypes=function(A){return g(this.request.headers.accept,A)},s.prototype.preferredCharset=s.prototype.charset,s.prototype.preferredCharsets=s.prototype.charsets,s.prototype.preferredEncoding=s.prototype.encoding,s.prototype.preferredEncodings=s.prototype.encodings,s.prototype.preferredLanguage=s.prototype.language,s.prototype.preferredLanguages=s.prototype.languages,s.prototype.preferredMediaType=s.prototype.mediaType,s.prototype.preferredMediaTypes=s.prototype.mediaTypes},308(A){"use strict";A.exports=n,A.exports.preferredCharsets=n;var e=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function t(A,t){var i=e.exec(A);if(!i)return null;var n=i[1],o=1;if(i[2])for(var g=i[2].split(";"),s=0;s0}},60627(A){"use strict";A.exports=n,A.exports.preferredEncodings=n;var e=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function t(A,t){var i=e.exec(A);if(!i)return null;var n=i[1],o=1;if(i[2])for(var g=i[2].split(";"),s=0;s0}},70660(A){"use strict";A.exports=n,A.exports.preferredLanguages=n;var e=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function t(A,t){var i=e.exec(A);if(!i)return null;var n=i[1],o=i[2],g=n;o&&(g+="-"+o);var s=1;if(i[3])for(var r=i[3].split(";"),I=0;I0}},45252(A){"use strict";A.exports=n,A.exports.preferredMediaTypes=n;var e=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function t(A,t){var i=e.exec(A);if(!i)return null;var n=Object.create(null),o=1,g=i[2],s=i[1];if(i[3])for(var a=function(A){for(var e=A.split(";"),t=1,i=0;t0){if(!g.every(function(A){return"*"==e.params[A]||(e.params[A]||"").toLowerCase()==(n.params[A]||"").toLowerCase()}))return null;o|=1}return{i,o:e.i,q:e.q,s:o}}function n(A,e){var n=function(A){for(var e=function(A){for(var e=A.split(","),t=1,i=0;t0}function r(A){for(var e=0,t=0;-1!==(t=A.indexOf('"',t));)e++,t++;return e}function I(A){var e,t,i=A.indexOf("=");return-1===i?e=A:(e=A.slice(0,i),t=A.slice(i+1)),[e,t]}},59291(A,e,t){const{Minipass:i}=t(9113),n=Symbol("_data"),o=Symbol("_length");A.exports=class extends i{constructor(A){super(A),this[n]=[],this[o]=0}write(A,e,t){"function"==typeof e&&(t=e,e="utf8"),e||(e="utf8");const i=Buffer.isBuffer(A)?A:Buffer.from(A,e);return this[n].push(i),this[o]+=i.length,t&&t(),!0}end(A,e,t){"function"==typeof A&&(t=A,A=null),"function"==typeof e&&(t=e,e="utf8"),A&&this.write(A,e);const i=Buffer.concat(this[n],this[o]);return super.write(i),super.end(t)}},A.exports.PassThrough=class extends i{constructor(A){super(A),this[n]=[],this[o]=0}write(A,e,t){"function"==typeof e&&(t=e,e="utf8"),e||(e="utf8");const i=Buffer.isBuffer(A)?A:Buffer.from(A,e);return this[n].push(i),this[o]+=i.length,super.write(A,e,t)}end(A,e,t){"function"==typeof A&&(t=A,A=null),"function"==typeof e&&(t=e,e="utf8"),A&&this.write(A,e);const i=Buffer.concat(this[n],this[o]);return this.emit("collect",i),super.end(t)}}},88212(A){"use strict";class e extends Error{constructor(A){super(A),this.code="FETCH_ABORTED",this.type="aborted",Error.captureStackTrace(this,this.constructor)}get name(){return"AbortError"}set name(A){}}A.exports=e},99646(A,e,t){"use strict";const{Minipass:i}=t(97911),n=Symbol("type"),o=Symbol("buffer");class g{constructor(A,e){this[n]="";const t=[];let i=0;if(A){const e=A,n=Number(e.length);for(let A=0;A{const e="AbortError"===A.name?A:new s(`Invalid response while trying to fetch ${this.url}: ${A.message}`,"system",A);this[I].error=e})}get body(){return this[I].body}get bodyUsed(){return this[I].disturbed}arrayBuffer(){return this[a]().then(A=>A.buffer.slice(A.byteOffset,A.byteOffset+A.byteLength))}blob(){const A=this.headers&&this.headers.get("content-type")||"";return this[a]().then(e=>Object.assign(new o([],{type:A.toLowerCase()}),{[g]:e}))}async json(){const A=await this[a]();try{return JSON.parse(A.toString())}catch(A){throw new s(`invalid json response body at ${this.url} reason: ${A.message}`,"invalid-json")}}text(){return this[a]().then(A=>A.toString())}buffer(){return this[a]()}textConverted(){return this[a]().then(A=>E(A,this.headers))}[a](){if(this[I].disturbed)return Promise.reject(new TypeError(`body used already for: ${this.url}`));if(this[I].disturbed=!0,this[I].error)return Promise.reject(this[I].error);if(null===this.body)return Promise.resolve(Buffer.alloc(0));if(Buffer.isBuffer(this.body))return Promise.resolve(this.body);const A=Q(this.body)?this.body.stream():this.body;if(!i.isStream(A))return Promise.resolve(Buffer.alloc(0));const e=this.size&&A instanceof n?A:this.size||!(A instanceof i)||A instanceof n?this.size?new n({size:this.size}):new i:A,t=this.timeout&&e.writable?setTimeout(()=>{e.emit("error",new s(`Response timeout while trying to fetch ${this.url} (over ${this.timeout}ms)`,"body-timeout"))},this.timeout):null;return t&&t.unref&&t.unref(),new Promise(t=>{e!==A&&(A.on("error",A=>e.emit("error",A)),A.pipe(e)),t()}).then(()=>e.concat()).then(A=>(clearTimeout(t),A)).catch(A=>{throw clearTimeout(t),"AbortError"===A.name||"FetchError"===A.name?A:"RangeError"===A.name?new s(`Could not create Buffer from response body for ${this.url}: ${A.message}`,"system",A):new s(`Invalid response body while trying to fetch ${this.url}: ${A.message}`,"system",A)})}static clone(A){if(A.bodyUsed)throw new Error("cannot clone body after it is used");const e=A.body;if(i.isStream(e)&&"function"!=typeof e.getBoundary){const t=new i,n=new i,o=new i;return t.on("error",A=>{n.emit("error",A),o.emit("error",A)}),e.on("error",A=>t.emit("error",A)),t.pipe(n),t.pipe(o),e.pipe(t),A[I].body=n,o}return A.body}static extractContentType(A){return null==A?null:"string"==typeof A?"text/plain;charset=UTF-8":B(A)?"application/x-www-form-urlencoded;charset=UTF-8":Q(A)?A.type||null:Buffer.isBuffer(A)||"[object ArrayBuffer]"===Object.prototype.toString.call(A)||ArrayBuffer.isView(A)?null:"function"==typeof A.getBoundary?`multipart/form-data;boundary=${A.getBoundary()}`:i.isStream(A)?null:"text/plain;charset=UTF-8"}static getTotalBytes(A){const{body:e}=A;return null==e?0:Q(e)?e.size:Buffer.isBuffer(e)?e.length:e&&"function"==typeof e.getLengthSync&&(e._lengthRetrievers&&0===e._lengthRetrievers.length||e.hasKnownLength&&e.hasKnownLength())?e.getLengthSync():null}static writeToStream(A,e){const{body:t}=e;return null==t?A.end():Buffer.isBuffer(t)||"string"==typeof t?A.end(t):(Q(t)?t.stream():t).on("error",e=>A.emit("error",e)).pipe(A),A}}Object.defineProperties(C.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0}});const B=A=>"object"==typeof A&&"function"==typeof A.append&&"function"==typeof A.delete&&"function"==typeof A.get&&"function"==typeof A.getAll&&"function"==typeof A.has&&"function"==typeof A.set&&("URLSearchParams"===A.constructor.name||"[object URLSearchParams]"===Object.prototype.toString.call(A)||"function"==typeof A.sort),Q=A=>"object"==typeof A&&"function"==typeof A.arrayBuffer&&"string"==typeof A.type&&"function"==typeof A.stream&&"function"==typeof A.constructor&&"string"==typeof A.constructor.name&&/^(Blob|File)$/.test(A.constructor.name)&&/^(Blob|File)$/.test(A[Symbol.toStringTag]),E=(A,e)=>{if("function"!=typeof r)throw new Error("The package `encoding` must be installed to use the textConverted() function");const t=e&&e.get("content-type");let i,n="utf-8";t&&(i=/charset=([^;]*)/i.exec(t));const o=A.slice(0,1024).toString();return!i&&o&&(i=/this.expect?"max-size":e,this.message=A,Error.captureStackTrace(this,this.constructor)}get name(){return"FetchError"}set name(A){}get[Symbol.toStringTag](){return"FetchError"}}A.exports=e},93827(A){"use strict";const e=/[^^_`a-zA-Z\-0-9!#$%&'*+.|~]/,t=/[^\t\x20-\x7e\x80-\xff]/,i=A=>{if(A=`${A}`,e.test(A)||""===A)throw new TypeError(`${A} is not a legal HTTP header name`)},n=A=>{if(A=`${A}`,t.test(A))throw new TypeError(`${A} is not a legal HTTP header value`)},o=(A,e)=>{e=e.toLowerCase();for(const t in A)if(t.toLowerCase()===e)return t},g=Symbol("map");class s{constructor(A=void 0){if(this[g]=Object.create(null),A instanceof s){const e=A.raw(),t=Object.keys(e);for(const A of t)for(const t of e[A])this.append(A,t);return}if(null!=A){if("object"!=typeof A)throw new TypeError("Provided initializer must be an object");{const e=A[Symbol.iterator];if(null!=e){if("function"!=typeof e)throw new TypeError("Header pairs must be iterable");const t=[];for(const e of A){if("object"!=typeof e||"function"!=typeof e[Symbol.iterator])throw new TypeError("Each header pair must be iterable");const A=Array.from(e);if(2!==A.length)throw new TypeError("Each header pair must be a name/value tuple");t.push(A)}for(const A of t)this.append(A[0],A[1])}else for(const e of Object.keys(A))this.append(e,A[e])}}}get(A){i(A=`${A}`);const e=o(this[g],A);return void 0===e?null:this[g][e].join(", ")}forEach(A,e=void 0){let t=r(this);for(let i=0;iObject.keys(A[g]).sort().map("key"===e?A=>A.toLowerCase():"value"===e?e=>A[g][e].join(", "):e=>[e.toLowerCase(),A[g][e].join(", ")]),I=Symbol("internal");class a{constructor(A,e){this[I]={target:A,kind:e,index:0}}get[Symbol.toStringTag](){return"HeadersIterator"}next(){if(!this||Object.getPrototypeOf(this)!==a.prototype)throw new TypeError("Value of `this` is not a HeadersIterator");const{target:A,kind:e,index:t}=this[I],i=r(A,e);return t>=i.length?{value:void 0,done:!0}:(this[I].index++,{value:i[t],done:!1})}}Object.setPrototypeOf(a.prototype,Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))),A.exports=s},63837(A,e,t){"use strict";const{URL:i}=t(87016),n=t(58611),o=t(65692),g=t(39432),{Minipass:s}=t(97911),r=t(76045),{writeToStream:I,getTotalBytes:a}=r,C=t(11698),B=t(93827),{createHeadersLenient:Q}=B,E=t(49960),{getNodeRequestOptions:c}=E,l=t(75218),u=t(88212),d=async(A,e)=>{if(/^data:/.test(A)){const t=new E(A,e);return Promise.resolve().then(()=>new Promise((e,n)=>{let o,g;try{const{pathname:e,search:t}=new i(A),n=e.split(",");if(n.length<2)throw new Error("invalid data: URI");const s=n.shift(),r=/;base64$/.test(s);o=r?s.slice(0,-7):s;const I=decodeURIComponent(n.join(",")+t);g=r?Buffer.from(I,"base64"):Buffer.from(I)}catch(A){return n(new l(`[${t.method}] ${t.url} invalid URL, ${A.message}`,"system",A))}const{signal:s}=t;if(s&&s.aborted)return n(new u("The user aborted a request."));const r={"Content-Length":g.length};return o&&(r["Content-Type"]=o),e(new C(g,{headers:r}))}))}return new Promise((t,r)=>{const h=new E(A,e);let D;try{D=c(h)}catch(A){return r(A)}const p=("https:"===D.protocol?o:n).request,{signal:w}=h;let m=null;const y=()=>{const A=new u("The user aborted a request.");r(A),s.isStream(h.body)&&"function"==typeof h.body.destroy&&h.body.destroy(A),m&&m.body&&m.body.emit("error",A)};if(w&&w.aborted)return y();const f=()=>{y(),R()},R=()=>{N.abort(),w&&w.removeEventListener("abort",f),clearTimeout(M)},N=p(D);w&&w.addEventListener("abort",f);let M=null;h.timeout&&N.once("socket",()=>{M=setTimeout(()=>{r(new l(`network timeout at: ${h.url}`,"request-timeout")),R()},h.timeout)}),N.on("error",A=>{N.res&&N.res.emit("error",A),r(new l(`request to ${h.url} failed, reason: ${A.message}`,"system",A)),R()}),N.on("response",A=>{clearTimeout(M);const e=Q(A.headers);if(d.isRedirect(A.statusCode)){const n=e.get("Location");let o=null;try{o=null===n?null:new i(n,h.url).toString()}catch{if("manual"!==h.redirect)return r(new l(`uri requested responds with an invalid redirect URL: ${n}`,"invalid-redirect")),void R()}if("error"===h.redirect)return r(new l(`uri requested responds with a redirect, redirect mode is set to error: ${h.url}`,"no-redirect")),void R();if("manual"===h.redirect){if(null!==o)try{e.set("Location",o)}catch(A){r(A)}}else if("follow"===h.redirect&&null!==o){if(h.counter>=h.follow)return r(new l(`maximum redirect reached at: ${h.url}`,"max-redirect")),void R();if(303!==A.statusCode&&h.body&&null===a(h))return r(new l("Cannot follow redirect with body being a readable stream","unsupported-redirect")),void R();h.headers.set("host",new i(o).host);const e={headers:new B(h.headers),follow:h.follow,counter:h.counter+1,agent:h.agent,compress:h.compress,method:h.method,body:h.body,signal:h.signal,timeout:h.timeout},n=new i(h.url),g=new i(o);return n.hostname!==g.hostname&&(e.headers.delete("authorization"),e.headers.delete("cookie")),303!==A.statusCode&&(301!==A.statusCode&&302!==A.statusCode||"POST"!==h.method)||(e.method="GET",e.body=void 0,e.headers.delete("content-length")),t(d(new E(o,e))),void R()}}A.once("end",()=>w&&w.removeEventListener("abort",f));const n=new s;n.on("error",R),A.on("error",A=>n.emit("error",A)),A.on("data",A=>n.write(A)),A.on("end",()=>n.end());const o={url:h.url,status:A.statusCode,statusText:A.statusMessage,headers:e,size:h.size,timeout:h.timeout,counter:h.counter,trailer:new Promise(e=>A.on("end",()=>e(Q(A.trailers))))},I=e.get("Content-Encoding");if(!h.compress||"HEAD"===h.method||null===I||204===A.statusCode||304===A.statusCode)return m=new C(n,o),void t(m);const c={flush:g.constants.Z_SYNC_FLUSH,finishFlush:g.constants.Z_SYNC_FLUSH};if("gzip"===I||"x-gzip"===I){const A=new g.Gunzip(c);return m=new C(n.on("error",e=>A.emit("error",e)).pipe(A),o),void t(m)}if("deflate"!==I&&"x-deflate"!==I){if("br"===I){try{var u=new g.BrotliDecompress}catch(A){return r(A),void R()}return n.on("error",A=>u.emit("error",A)).pipe(u),m=new C(u,o),void t(m)}m=new C(n,o),t(m)}else A.pipe(new s).once("data",A=>{const e=8==(15&A[0])?new g.Inflate:new g.InflateRaw;n.on("error",A=>e.emit("error",A)).pipe(e),m=new C(e,o),t(m)})}),I(N,h)})};A.exports=d,d.isRedirect=A=>301===A||302===A||303===A||307===A||308===A,d.Headers=B,d.Request=E,d.Response=C,d.FetchError=l,d.AbortError=u},49960(A,e,t){"use strict";const{URL:i}=t(87016),{Minipass:n}=t(97911),o=t(93827),{exportNodeCompatibleHeaders:g}=o,s=t(76045),{clone:r,extractContentType:I,getTotalBytes:a}=s,C=`minipass-fetch/${t(11210).rE} (+https://github.com/isaacs/minipass-fetch)`,B=Symbol("Request internals"),Q=A=>"object"==typeof A&&"object"==typeof A[B];class E extends s{constructor(A,e={}){const t=Q(A)?new i(A.url):A&&A.href?new i(A.href):new i(`${A}`);Q(A)?e={...A[B],...e}:A&&"string"!=typeof A||(A={});const n=(e.method||A.method||"GET").toUpperCase(),g="GET"===n||"HEAD"===n;if((null!==e.body&&void 0!==e.body||Q(A)&&null!==A.body)&&g)throw new TypeError("Request with GET/HEAD method cannot have body");const s=null!==e.body&&void 0!==e.body?e.body:Q(A)&&null!==A.body?r(A):null;super(s,{timeout:e.timeout||A.timeout||0,size:e.size||A.size||0});const a=new o(e.headers||A.headers||{});if(null!=s&&!a.has("Content-Type")){const A=I(s);A&&a.append("Content-Type",A)}const C="signal"in e?e.signal:null;if(null!=C&&!(A=>{const e=A&&"object"==typeof A&&Object.getPrototypeOf(A);return!(!e||"AbortSignal"!==e.constructor.name)})(C))throw new TypeError("Expected signal must be an instanceof AbortSignal");const{ca:E,cert:c,ciphers:l,clientCertEngine:u,crl:d,dhparam:h,ecdhCurve:D,family:p,honorCipherOrder:w,key:m,passphrase:y,pfx:f,rejectUnauthorized:R="0"!==process.env.NODE_TLS_REJECT_UNAUTHORIZED,secureOptions:N,secureProtocol:M,servername:S,sessionIdContext:k}=e;this[B]={method:n,redirect:e.redirect||A.redirect||"follow",headers:a,parsedURL:t,signal:C,ca:E,cert:c,ciphers:l,clientCertEngine:u,crl:d,dhparam:h,ecdhCurve:D,family:p,honorCipherOrder:w,key:m,passphrase:y,pfx:f,rejectUnauthorized:R,secureOptions:N,secureProtocol:M,servername:S,sessionIdContext:k},this.follow=void 0!==e.follow?e.follow:void 0!==A.follow?A.follow:20,this.compress=void 0!==e.compress?e.compress:void 0===A.compress||A.compress,this.counter=e.counter||A.counter||0,this.agent=e.agent||A.agent}get method(){return this[B].method}get url(){return this[B].parsedURL.toString()}get headers(){return this[B].headers}get redirect(){return this[B].redirect}get signal(){return this[B].signal}clone(){return new E(this)}get[Symbol.toStringTag](){return"Request"}static getNodeRequestOptions(A){const e=A[B].parsedURL,t=new o(A[B].headers);if(t.has("Accept")||t.set("Accept","*/*"),!/^https?:$/.test(e.protocol))throw new TypeError("Only HTTP(S) protocols are supported");if(A.signal&&n.isStream(A.body)&&"function"!=typeof A.body.destroy)throw new Error("Cancellation of streamed requests with AbortSignal is not supported");const i=null!==A.body&&void 0!==A.body||!/^(POST|PUT)$/i.test(A.method)?null!==A.body&&void 0!==A.body?a(A):null:"0";i&&t.set("Content-Length",i+""),t.has("User-Agent")||t.set("User-Agent",C),A.compress&&!t.has("Accept-Encoding")&&t.set("Accept-Encoding","gzip,deflate");const s="function"==typeof A.agent?A.agent(e):A.agent;t.has("Connection")||s||t.set("Connection","close");const{ca:r,cert:I,ciphers:Q,clientCertEngine:E,crl:c,dhparam:l,ecdhCurve:u,family:d,honorCipherOrder:h,key:D,passphrase:p,pfx:w,rejectUnauthorized:m,secureOptions:y,secureProtocol:f,servername:R,sessionIdContext:N}=A[B];return{auth:e.username||e.password?`${e.username}:${e.password}`:"",host:e.host,hostname:e.hostname,path:`${e.pathname}${e.search}`,port:e.port,protocol:e.protocol,method:A.method,headers:g(t),agent:s,ca:r,cert:I,ciphers:Q,clientCertEngine:E,crl:c,dhparam:l,ecdhCurve:u,family:d,honorCipherOrder:h,key:D,passphrase:p,pfx:w,rejectUnauthorized:m,secureOptions:y,secureProtocol:f,servername:R,sessionIdContext:N,timeout:A.timeout}}}A.exports=E,Object.defineProperties(E.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0}})},11698(A,e,t){"use strict";const i=t(58611),{STATUS_CODES:n}=i,o=t(93827),g=t(76045),{clone:s,extractContentType:r}=g,I=Symbol("Response internals");class a extends g{constructor(A=null,e={}){super(A,e);const t=e.status||200,i=new o(e.headers);if(null!=A&&!i.has("Content-Type")){const e=r(A);e&&i.append("Content-Type",e)}this[I]={url:e.url,status:t,statusText:e.statusText||n[t],headers:i,counter:e.counter,trailer:Promise.resolve(e.trailer||new o)}}get trailer(){return this[I].trailer}get url(){return this[I].url||""}get status(){return this[I].status}get ok(){return this[I].status>=200&&this[I].status<300}get redirected(){return this[I].counter>0}get statusText(){return this[I].statusText}get headers(){return this[I].headers}clone(){return new a(s(this),{url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,trailer:this.trailer})}get[Symbol.toStringTag](){return"Response"}}A.exports=a,Object.defineProperties(a.prototype,{url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}})},94035(A,e,t){const i=t(25053),n=Symbol("_flush"),o=Symbol("_flushed"),g=Symbol("_flushing");A.exports=class extends i{constructor(A={}){if("function"==typeof A&&(A={flush:A}),super(A),"function"!=typeof A.flush&&"function"!=typeof this.flush)throw new TypeError("must provide flush function in options");this[n]=A.flush||this.flush}emit(A,...e){if("end"!==A&&"finish"!==A||this[o])return super.emit(A,...e);if(this[g])return;this[g]=!0;const t=A=>{this[o]=!0,A?super.emit("error",A):super.emit("end")},i=this[n](t);i&&i.then&&i.then(()=>t(),A=>t(A))}}},25053(A,e,t){"use strict";const i="object"==typeof process&&process?process:{stdout:null,stderr:null},n=t(24434),o=t(2203),g=t(13193).StringDecoder,s=Symbol("EOF"),r=Symbol("maybeEmitEnd"),I=Symbol("emittedEnd"),a=Symbol("emittingEnd"),C=Symbol("emittedError"),B=Symbol("closed"),Q=Symbol("read"),E=Symbol("flush"),c=Symbol("flushChunk"),l=Symbol("encoding"),u=Symbol("decoder"),d=Symbol("flowing"),h=Symbol("paused"),D=Symbol("resume"),p=Symbol("bufferLength"),w=Symbol("bufferPush"),m=Symbol("bufferShift"),y=Symbol("objectMode"),f=Symbol("destroyed"),R=Symbol("emitData"),N=Symbol("emitEnd"),M=Symbol("emitEnd2"),S=Symbol("async"),k=A=>Promise.resolve().then(A),G="1"!==global._MP_NO_ITERATOR_SYMBOLS_,L=G&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),F=G&&Symbol.iterator||Symbol("iterator not implemented");class T{constructor(A,e,t){this.src=A,this.dest=e,this.opts=t,this.ondrain=()=>A[D](),e.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class U extends T{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(A,e,t){super(A,e,t),this.proxyErrors=A=>e.emit("error",A),A.on("error",this.proxyErrors)}}A.exports=class A extends o{constructor(A){super(),this[d]=!1,this[h]=!1,this.pipes=[],this.buffer=[],this[y]=A&&A.objectMode||!1,this[y]?this[l]=null:this[l]=A&&A.encoding||null,"buffer"===this[l]&&(this[l]=null),this[S]=A&&!!A.async||!1,this[u]=this[l]?new g(this[l]):null,this[s]=!1,this[I]=!1,this[a]=!1,this[B]=!1,this[C]=null,this.writable=!0,this.readable=!0,this[p]=0,this[f]=!1}get bufferLength(){return this[p]}get encoding(){return this[l]}set encoding(A){if(this[y])throw new Error("cannot set encoding in objectMode");if(this[l]&&A!==this[l]&&(this[u]&&this[u].lastNeed||this[p]))throw new Error("cannot change encoding");this[l]!==A&&(this[u]=A?new g(A):null,this.buffer.length&&(this.buffer=this.buffer.map(A=>this[u].write(A)))),this[l]=A}setEncoding(A){this.encoding=A}get objectMode(){return this[y]}set objectMode(A){this[y]=this[y]||!!A}get async(){return this[S]}set async(A){this[S]=this[S]||!!A}write(A,e,t){if(this[s])throw new Error("write after end");if(this[f])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;"function"==typeof e&&(t=e,e="utf8"),e||(e="utf8");const i=this[S]?k:A=>A();var n;return this[y]||Buffer.isBuffer(A)||(n=A,!Buffer.isBuffer(n)&&ArrayBuffer.isView(n)?A=Buffer.from(A.buffer,A.byteOffset,A.byteLength):(A=>A instanceof ArrayBuffer||"object"==typeof A&&A.constructor&&"ArrayBuffer"===A.constructor.name&&A.byteLength>=0)(A)?A=Buffer.from(A):"string"!=typeof A&&(this.objectMode=!0)),this[y]?(this.flowing&&0!==this[p]&&this[E](!0),this.flowing?this.emit("data",A):this[w](A),0!==this[p]&&this.emit("readable"),t&&i(t),this.flowing):A.length?("string"!=typeof A||e===this[l]&&!this[u].lastNeed||(A=Buffer.from(A,e)),Buffer.isBuffer(A)&&this[l]&&(A=this[u].write(A)),this.flowing&&0!==this[p]&&this[E](!0),this.flowing?this.emit("data",A):this[w](A),0!==this[p]&&this.emit("readable"),t&&i(t),this.flowing):(0!==this[p]&&this.emit("readable"),t&&i(t),this.flowing)}read(A){if(this[f])return null;if(0===this[p]||0===A||A>this[p])return this[r](),null;this[y]&&(A=null),this.buffer.length>1&&!this[y]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[p])]);const e=this[Q](A||null,this.buffer[0]);return this[r](),e}[Q](A,e){return A===e.length||null===A?this[m]():(this.buffer[0]=e.slice(A),e=e.slice(0,A),this[p]-=A),this.emit("data",e),this.buffer.length||this[s]||this.emit("drain"),e}end(A,e,t){return"function"==typeof A&&(t=A,A=null),"function"==typeof e&&(t=e,e="utf8"),A&&this.write(A,e),t&&this.once("end",t),this[s]=!0,this.writable=!1,!this.flowing&&this[h]||this[r](),this}[D](){this[f]||(this[h]=!1,this[d]=!0,this.emit("resume"),this.buffer.length?this[E]():this[s]?this[r]():this.emit("drain"))}resume(){return this[D]()}pause(){this[d]=!1,this[h]=!0}get destroyed(){return this[f]}get flowing(){return this[d]}get paused(){return this[h]}[w](A){this[y]?this[p]+=1:this[p]+=A.length,this.buffer.push(A)}[m](){return this.buffer.length&&(this[y]?this[p]-=1:this[p]-=this.buffer[0].length),this.buffer.shift()}[E](A){do{}while(this[c](this[m]()));A||this.buffer.length||this[s]||this.emit("drain")}[c](A){return!!A&&(this.emit("data",A),this.flowing)}pipe(A,e){if(this[f])return;const t=this[I];return e=e||{},A===i.stdout||A===i.stderr?e.end=!1:e.end=!1!==e.end,e.proxyErrors=!!e.proxyErrors,t?e.end&&A.end():(this.pipes.push(e.proxyErrors?new U(this,A,e):new T(this,A,e)),this[S]?k(()=>this[D]()):this[D]()),A}unpipe(A){const e=this.pipes.find(e=>e.dest===A);e&&(this.pipes.splice(this.pipes.indexOf(e),1),e.unpipe())}addListener(A,e){return this.on(A,e)}on(A,e){const t=super.on(A,e);return"data"!==A||this.pipes.length||this.flowing?"readable"===A&&0!==this[p]?super.emit("readable"):(A=>"end"===A||"finish"===A||"prefinish"===A)(A)&&this[I]?(super.emit(A),this.removeAllListeners(A)):"error"===A&&this[C]&&(this[S]?k(()=>e.call(this,this[C])):e.call(this,this[C])):this[D](),t}get emittedEnd(){return this[I]}[r](){this[a]||this[I]||this[f]||0!==this.buffer.length||!this[s]||(this[a]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[B]&&this.emit("close"),this[a]=!1)}emit(A,e,...t){if("error"!==A&&"close"!==A&&A!==f&&this[f])return;if("data"===A)return!!e&&(this[S]?k(()=>this[R](e)):this[R](e));if("end"===A)return this[N]();if("close"===A){if(this[B]=!0,!this[I]&&!this[f])return;const A=super.emit("close");return this.removeAllListeners("close"),A}if("error"===A){this[C]=e;const A=super.emit("error",e);return this[r](),A}if("resume"===A){const A=super.emit("resume");return this[r](),A}if("finish"===A||"prefinish"===A){const e=super.emit(A);return this.removeAllListeners(A),e}const i=super.emit(A,e,...t);return this[r](),i}[R](A){for(const e of this.pipes)!1===e.dest.write(A)&&this.pause();const e=super.emit("data",A);return this[r](),e}[N](){this[I]||(this[I]=!0,this.readable=!1,this[S]?k(()=>this[M]()):this[M]())}[M](){if(this[u]){const A=this[u].end();if(A){for(const e of this.pipes)e.dest.write(A);super.emit("data",A)}}for(const A of this.pipes)A.end();const A=super.emit("end");return this.removeAllListeners("end"),A}collect(){const A=[];this[y]||(A.dataLength=0);const e=this.promise();return this.on("data",e=>{A.push(e),this[y]||(A.dataLength+=e.length)}),e.then(()=>A)}concat(){return this[y]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(A=>this[y]?Promise.reject(new Error("cannot concat in objectMode")):this[l]?A.join(""):Buffer.concat(A,A.dataLength))}promise(){return new Promise((A,e)=>{this.on(f,()=>e(new Error("stream destroyed"))),this.on("error",A=>e(A)),this.on("end",()=>A())})}[L](){return{next:()=>{const A=this.read();if(null!==A)return Promise.resolve({done:!1,value:A});if(this[s])return Promise.resolve({done:!0});let e=null,t=null;const i=A=>{this.removeListener("data",n),this.removeListener("end",o),t(A)},n=A=>{this.removeListener("error",i),this.removeListener("end",o),this.pause(),e({value:A,done:!!this[s]})},o=()=>{this.removeListener("error",i),this.removeListener("data",n),e({done:!0})},g=()=>i(new Error("stream destroyed"));return new Promise((A,s)=>{t=s,e=A,this.once(f,g),this.once("error",i),this.once("end",o),this.once("data",n)})}}}[F](){return{next:()=>{const A=this.read();return{value:A,done:null===A}}}}destroy(A){return this[f]?(A?this.emit("error",A):this.emit(f),this):(this[f]=!0,this.buffer.length=0,this[p]=0,"function"!=typeof this.close||this[B]||this.close(),A?this.emit("error",A):this.emit(f),this)}static isStream(e){return!!e&&(e instanceof A||e instanceof o||e instanceof n&&("function"==typeof e.pipe||"function"==typeof e.write&&"function"==typeof e.end))}}},48805(A,e,t){const i=t(37807),n=t(24434),o=Symbol("_head"),g=Symbol("_tail"),s=Symbol("_linkStreams"),r=Symbol("_setHead"),I=Symbol("_setTail"),a=Symbol("_onError"),C=Symbol("_onData"),B=Symbol("_onEnd"),Q=Symbol("_onDrain"),E=Symbol("_streams");A.exports=class extends i{constructor(A,...e){var t;(t=A)&&t instanceof n&&("function"==typeof t.pipe||"function"==typeof t.write&&"function"==typeof t.end)&&(e.unshift(A),A={}),super(A),this[E]=[],e.length&&this.push(...e)}[s](A){return A.reduce((A,e)=>(A.on("error",A=>e.emit("error",A)),A.pipe(e),e))}push(...A){this[E].push(...A),this[g]&&A.unshift(this[g]);const e=this[s](A);this[I](e),this[o]||this[r](A[0])}unshift(...A){this[E].unshift(...A),this[o]&&A.push(this[o]);const e=this[s](A);this[r](A[0]),this[g]||this[I](e)}destroy(A){return this[E].forEach(A=>"function"==typeof A.destroy&&A.destroy()),super.destroy(A)}[I](A){this[g]=A,A.on("error",e=>this[a](A,e)),A.on("data",e=>this[C](A,e)),A.on("end",()=>this[B](A)),A.on("finish",()=>this[B](A))}[a](A,e){A===this[g]&&this.emit("error",e)}[C](A,e){A===this[g]&&super.write(e)}[B](A){A===this[g]&&super.end()}pause(){return super.pause(),this[g]&&this[g].pause&&this[g].pause()}emit(A,...e){return"resume"===A&&this[g]&&this[g].resume&&this[g].resume(),super.emit(A,...e)}[r](A){this[o]=A,A.on("drain",()=>this[Q](A))}[Q](A){A===this[o]&&this.emit("drain")}write(A,e,t){return this[o].write(A,e,t)&&(this.flowing||0===this.buffer.length)}end(A,e,t){return this[o].end(A,e,t),this}}},37807(A,e,t){"use strict";const i="object"==typeof process&&process?process:{stdout:null,stderr:null},n=t(24434),o=t(2203),g=t(13193).StringDecoder,s=Symbol("EOF"),r=Symbol("maybeEmitEnd"),I=Symbol("emittedEnd"),a=Symbol("emittingEnd"),C=Symbol("emittedError"),B=Symbol("closed"),Q=Symbol("read"),E=Symbol("flush"),c=Symbol("flushChunk"),l=Symbol("encoding"),u=Symbol("decoder"),d=Symbol("flowing"),h=Symbol("paused"),D=Symbol("resume"),p=Symbol("bufferLength"),w=Symbol("bufferPush"),m=Symbol("bufferShift"),y=Symbol("objectMode"),f=Symbol("destroyed"),R=Symbol("emitData"),N=Symbol("emitEnd"),M=Symbol("emitEnd2"),S=Symbol("async"),k=A=>Promise.resolve().then(A),G="1"!==global._MP_NO_ITERATOR_SYMBOLS_,L=G&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),F=G&&Symbol.iterator||Symbol("iterator not implemented");class T{constructor(A,e,t){this.src=A,this.dest=e,this.opts=t,this.ondrain=()=>A[D](),e.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class U extends T{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(A,e,t){super(A,e,t),this.proxyErrors=A=>e.emit("error",A),A.on("error",this.proxyErrors)}}A.exports=class A extends o{constructor(A){super(),this[d]=!1,this[h]=!1,this.pipes=[],this.buffer=[],this[y]=A&&A.objectMode||!1,this[y]?this[l]=null:this[l]=A&&A.encoding||null,"buffer"===this[l]&&(this[l]=null),this[S]=A&&!!A.async||!1,this[u]=this[l]?new g(this[l]):null,this[s]=!1,this[I]=!1,this[a]=!1,this[B]=!1,this[C]=null,this.writable=!0,this.readable=!0,this[p]=0,this[f]=!1}get bufferLength(){return this[p]}get encoding(){return this[l]}set encoding(A){if(this[y])throw new Error("cannot set encoding in objectMode");if(this[l]&&A!==this[l]&&(this[u]&&this[u].lastNeed||this[p]))throw new Error("cannot change encoding");this[l]!==A&&(this[u]=A?new g(A):null,this.buffer.length&&(this.buffer=this.buffer.map(A=>this[u].write(A)))),this[l]=A}setEncoding(A){this.encoding=A}get objectMode(){return this[y]}set objectMode(A){this[y]=this[y]||!!A}get async(){return this[S]}set async(A){this[S]=this[S]||!!A}write(A,e,t){if(this[s])throw new Error("write after end");if(this[f])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;"function"==typeof e&&(t=e,e="utf8"),e||(e="utf8");const i=this[S]?k:A=>A();var n;return this[y]||Buffer.isBuffer(A)||(n=A,!Buffer.isBuffer(n)&&ArrayBuffer.isView(n)?A=Buffer.from(A.buffer,A.byteOffset,A.byteLength):(A=>A instanceof ArrayBuffer||"object"==typeof A&&A.constructor&&"ArrayBuffer"===A.constructor.name&&A.byteLength>=0)(A)?A=Buffer.from(A):"string"!=typeof A&&(this.objectMode=!0)),this[y]?(this.flowing&&0!==this[p]&&this[E](!0),this.flowing?this.emit("data",A):this[w](A),0!==this[p]&&this.emit("readable"),t&&i(t),this.flowing):A.length?("string"!=typeof A||e===this[l]&&!this[u].lastNeed||(A=Buffer.from(A,e)),Buffer.isBuffer(A)&&this[l]&&(A=this[u].write(A)),this.flowing&&0!==this[p]&&this[E](!0),this.flowing?this.emit("data",A):this[w](A),0!==this[p]&&this.emit("readable"),t&&i(t),this.flowing):(0!==this[p]&&this.emit("readable"),t&&i(t),this.flowing)}read(A){if(this[f])return null;if(0===this[p]||0===A||A>this[p])return this[r](),null;this[y]&&(A=null),this.buffer.length>1&&!this[y]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[p])]);const e=this[Q](A||null,this.buffer[0]);return this[r](),e}[Q](A,e){return A===e.length||null===A?this[m]():(this.buffer[0]=e.slice(A),e=e.slice(0,A),this[p]-=A),this.emit("data",e),this.buffer.length||this[s]||this.emit("drain"),e}end(A,e,t){return"function"==typeof A&&(t=A,A=null),"function"==typeof e&&(t=e,e="utf8"),A&&this.write(A,e),t&&this.once("end",t),this[s]=!0,this.writable=!1,!this.flowing&&this[h]||this[r](),this}[D](){this[f]||(this[h]=!1,this[d]=!0,this.emit("resume"),this.buffer.length?this[E]():this[s]?this[r]():this.emit("drain"))}resume(){return this[D]()}pause(){this[d]=!1,this[h]=!0}get destroyed(){return this[f]}get flowing(){return this[d]}get paused(){return this[h]}[w](A){this[y]?this[p]+=1:this[p]+=A.length,this.buffer.push(A)}[m](){return this.buffer.length&&(this[y]?this[p]-=1:this[p]-=this.buffer[0].length),this.buffer.shift()}[E](A){do{}while(this[c](this[m]()));A||this.buffer.length||this[s]||this.emit("drain")}[c](A){return!!A&&(this.emit("data",A),this.flowing)}pipe(A,e){if(this[f])return;const t=this[I];return e=e||{},A===i.stdout||A===i.stderr?e.end=!1:e.end=!1!==e.end,e.proxyErrors=!!e.proxyErrors,t?e.end&&A.end():(this.pipes.push(e.proxyErrors?new U(this,A,e):new T(this,A,e)),this[S]?k(()=>this[D]()):this[D]()),A}unpipe(A){const e=this.pipes.find(e=>e.dest===A);e&&(this.pipes.splice(this.pipes.indexOf(e),1),e.unpipe())}addListener(A,e){return this.on(A,e)}on(A,e){const t=super.on(A,e);return"data"!==A||this.pipes.length||this.flowing?"readable"===A&&0!==this[p]?super.emit("readable"):(A=>"end"===A||"finish"===A||"prefinish"===A)(A)&&this[I]?(super.emit(A),this.removeAllListeners(A)):"error"===A&&this[C]&&(this[S]?k(()=>e.call(this,this[C])):e.call(this,this[C])):this[D](),t}get emittedEnd(){return this[I]}[r](){this[a]||this[I]||this[f]||0!==this.buffer.length||!this[s]||(this[a]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[B]&&this.emit("close"),this[a]=!1)}emit(A,e,...t){if("error"!==A&&"close"!==A&&A!==f&&this[f])return;if("data"===A)return!!e&&(this[S]?k(()=>this[R](e)):this[R](e));if("end"===A)return this[N]();if("close"===A){if(this[B]=!0,!this[I]&&!this[f])return;const A=super.emit("close");return this.removeAllListeners("close"),A}if("error"===A){this[C]=e;const A=super.emit("error",e);return this[r](),A}if("resume"===A){const A=super.emit("resume");return this[r](),A}if("finish"===A||"prefinish"===A){const e=super.emit(A);return this.removeAllListeners(A),e}const i=super.emit(A,e,...t);return this[r](),i}[R](A){for(const e of this.pipes)!1===e.dest.write(A)&&this.pause();const e=super.emit("data",A);return this[r](),e}[N](){this[I]||(this[I]=!0,this.readable=!1,this[S]?k(()=>this[M]()):this[M]())}[M](){if(this[u]){const A=this[u].end();if(A){for(const e of this.pipes)e.dest.write(A);super.emit("data",A)}}for(const A of this.pipes)A.end();const A=super.emit("end");return this.removeAllListeners("end"),A}collect(){const A=[];this[y]||(A.dataLength=0);const e=this.promise();return this.on("data",e=>{A.push(e),this[y]||(A.dataLength+=e.length)}),e.then(()=>A)}concat(){return this[y]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(A=>this[y]?Promise.reject(new Error("cannot concat in objectMode")):this[l]?A.join(""):Buffer.concat(A,A.dataLength))}promise(){return new Promise((A,e)=>{this.on(f,()=>e(new Error("stream destroyed"))),this.on("error",A=>e(A)),this.on("end",()=>A())})}[L](){return{next:()=>{const A=this.read();if(null!==A)return Promise.resolve({done:!1,value:A});if(this[s])return Promise.resolve({done:!0});let e=null,t=null;const i=A=>{this.removeListener("data",n),this.removeListener("end",o),t(A)},n=A=>{this.removeListener("error",i),this.removeListener("end",o),this.pause(),e({value:A,done:!!this[s]})},o=()=>{this.removeListener("error",i),this.removeListener("data",n),e({done:!0})},g=()=>i(new Error("stream destroyed"));return new Promise((A,s)=>{t=s,e=A,this.once(f,g),this.once("error",i),this.once("end",o),this.once("data",n)})}}}[F](){return{next:()=>{const A=this.read();return{value:A,done:null===A}}}}destroy(A){return this[f]?(A?this.emit("error",A):this.emit(f),this):(this[f]=!0,this.buffer.length=0,this[p]=0,"function"!=typeof this.close||this[B]||this.close(),A?this.emit("error",A):this.emit(f),this)}static isStream(e){return!!e&&(e instanceof A||e instanceof o||e instanceof n&&("function"==typeof e.pipe||"function"==typeof e.write&&"function"==typeof e.end))}}},71774(A,e,t){const i=t(87040);class n extends Error{constructor(A,e){super(`Bad data size: expected ${e} bytes, but got ${A}`),this.expect=e,this.found=A,this.code="EBADSIZE",Error.captureStackTrace(this,this.constructor)}get name(){return"SizeError"}}class o extends i{constructor(A={}){if(super(A),A.objectMode)throw new TypeError(`${this.constructor.name} streams only work with string and buffer data`);if(this.found=0,this.expect=A.size,"number"!=typeof this.expect||this.expect>Number.MAX_SAFE_INTEGER||isNaN(this.expect)||this.expect<0||!isFinite(this.expect)||this.expect!==Math.floor(this.expect))throw new Error("invalid expected size: "+this.expect)}write(A,e,t){const i=Buffer.isBuffer(A)?A:"string"==typeof A?Buffer.from(A,"string"==typeof e?e:"utf8"):A;return Buffer.isBuffer(i)?(this.found+=i.length,this.found>this.expect&&this.emit("error",new n(this.found,this.expect)),super.write(A,e,t)):(this.emit("error",new TypeError(`${this.constructor.name} streams only work with string and buffer data`)),!1)}emit(A,...e){return"end"===A&&this.found!==this.expect&&this.emit("error",new n(this.found,this.expect)),super.emit(A,...e)}}o.SizeError=n,A.exports=o},87040(A,e,t){"use strict";const i="object"==typeof process&&process?process:{stdout:null,stderr:null},n=t(24434),o=t(2203),g=t(13193).StringDecoder,s=Symbol("EOF"),r=Symbol("maybeEmitEnd"),I=Symbol("emittedEnd"),a=Symbol("emittingEnd"),C=Symbol("emittedError"),B=Symbol("closed"),Q=Symbol("read"),E=Symbol("flush"),c=Symbol("flushChunk"),l=Symbol("encoding"),u=Symbol("decoder"),d=Symbol("flowing"),h=Symbol("paused"),D=Symbol("resume"),p=Symbol("bufferLength"),w=Symbol("bufferPush"),m=Symbol("bufferShift"),y=Symbol("objectMode"),f=Symbol("destroyed"),R=Symbol("emitData"),N=Symbol("emitEnd"),M=Symbol("emitEnd2"),S=Symbol("async"),k=A=>Promise.resolve().then(A),G="1"!==global._MP_NO_ITERATOR_SYMBOLS_,L=G&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),F=G&&Symbol.iterator||Symbol("iterator not implemented");class T{constructor(A,e,t){this.src=A,this.dest=e,this.opts=t,this.ondrain=()=>A[D](),e.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(){}end(){this.unpipe(),this.opts.end&&this.dest.end()}}class U extends T{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(A,e,t){super(A,e,t),this.proxyErrors=A=>e.emit("error",A),A.on("error",this.proxyErrors)}}A.exports=class A extends o{constructor(A){super(),this[d]=!1,this[h]=!1,this.pipes=[],this.buffer=[],this[y]=A&&A.objectMode||!1,this[y]?this[l]=null:this[l]=A&&A.encoding||null,"buffer"===this[l]&&(this[l]=null),this[S]=A&&!!A.async||!1,this[u]=this[l]?new g(this[l]):null,this[s]=!1,this[I]=!1,this[a]=!1,this[B]=!1,this[C]=null,this.writable=!0,this.readable=!0,this[p]=0,this[f]=!1}get bufferLength(){return this[p]}get encoding(){return this[l]}set encoding(A){if(this[y])throw new Error("cannot set encoding in objectMode");if(this[l]&&A!==this[l]&&(this[u]&&this[u].lastNeed||this[p]))throw new Error("cannot change encoding");this[l]!==A&&(this[u]=A?new g(A):null,this.buffer.length&&(this.buffer=this.buffer.map(A=>this[u].write(A)))),this[l]=A}setEncoding(A){this.encoding=A}get objectMode(){return this[y]}set objectMode(A){this[y]=this[y]||!!A}get async(){return this[S]}set async(A){this[S]=this[S]||!!A}write(A,e,t){if(this[s])throw new Error("write after end");if(this[f])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;"function"==typeof e&&(t=e,e="utf8"),e||(e="utf8");const i=this[S]?k:A=>A();var n;return this[y]||Buffer.isBuffer(A)||(n=A,!Buffer.isBuffer(n)&&ArrayBuffer.isView(n)?A=Buffer.from(A.buffer,A.byteOffset,A.byteLength):(A=>A instanceof ArrayBuffer||"object"==typeof A&&A.constructor&&"ArrayBuffer"===A.constructor.name&&A.byteLength>=0)(A)?A=Buffer.from(A):"string"!=typeof A&&(this.objectMode=!0)),this[y]?(this.flowing&&0!==this[p]&&this[E](!0),this.flowing?this.emit("data",A):this[w](A),0!==this[p]&&this.emit("readable"),t&&i(t),this.flowing):A.length?("string"!=typeof A||e===this[l]&&!this[u].lastNeed||(A=Buffer.from(A,e)),Buffer.isBuffer(A)&&this[l]&&(A=this[u].write(A)),this.flowing&&0!==this[p]&&this[E](!0),this.flowing?this.emit("data",A):this[w](A),0!==this[p]&&this.emit("readable"),t&&i(t),this.flowing):(0!==this[p]&&this.emit("readable"),t&&i(t),this.flowing)}read(A){if(this[f])return null;if(0===this[p]||0===A||A>this[p])return this[r](),null;this[y]&&(A=null),this.buffer.length>1&&!this[y]&&(this.encoding?this.buffer=[this.buffer.join("")]:this.buffer=[Buffer.concat(this.buffer,this[p])]);const e=this[Q](A||null,this.buffer[0]);return this[r](),e}[Q](A,e){return A===e.length||null===A?this[m]():(this.buffer[0]=e.slice(A),e=e.slice(0,A),this[p]-=A),this.emit("data",e),this.buffer.length||this[s]||this.emit("drain"),e}end(A,e,t){return"function"==typeof A&&(t=A,A=null),"function"==typeof e&&(t=e,e="utf8"),A&&this.write(A,e),t&&this.once("end",t),this[s]=!0,this.writable=!1,!this.flowing&&this[h]||this[r](),this}[D](){this[f]||(this[h]=!1,this[d]=!0,this.emit("resume"),this.buffer.length?this[E]():this[s]?this[r]():this.emit("drain"))}resume(){return this[D]()}pause(){this[d]=!1,this[h]=!0}get destroyed(){return this[f]}get flowing(){return this[d]}get paused(){return this[h]}[w](A){this[y]?this[p]+=1:this[p]+=A.length,this.buffer.push(A)}[m](){return this.buffer.length&&(this[y]?this[p]-=1:this[p]-=this.buffer[0].length),this.buffer.shift()}[E](A){do{}while(this[c](this[m]()));A||this.buffer.length||this[s]||this.emit("drain")}[c](A){return!!A&&(this.emit("data",A),this.flowing)}pipe(A,e){if(this[f])return;const t=this[I];return e=e||{},A===i.stdout||A===i.stderr?e.end=!1:e.end=!1!==e.end,e.proxyErrors=!!e.proxyErrors,t?e.end&&A.end():(this.pipes.push(e.proxyErrors?new U(this,A,e):new T(this,A,e)),this[S]?k(()=>this[D]()):this[D]()),A}unpipe(A){const e=this.pipes.find(e=>e.dest===A);e&&(this.pipes.splice(this.pipes.indexOf(e),1),e.unpipe())}addListener(A,e){return this.on(A,e)}on(A,e){const t=super.on(A,e);return"data"!==A||this.pipes.length||this.flowing?"readable"===A&&0!==this[p]?super.emit("readable"):(A=>"end"===A||"finish"===A||"prefinish"===A)(A)&&this[I]?(super.emit(A),this.removeAllListeners(A)):"error"===A&&this[C]&&(this[S]?k(()=>e.call(this,this[C])):e.call(this,this[C])):this[D](),t}get emittedEnd(){return this[I]}[r](){this[a]||this[I]||this[f]||0!==this.buffer.length||!this[s]||(this[a]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[B]&&this.emit("close"),this[a]=!1)}emit(A,e,...t){if("error"!==A&&"close"!==A&&A!==f&&this[f])return;if("data"===A)return!!e&&(this[S]?k(()=>this[R](e)):this[R](e));if("end"===A)return this[N]();if("close"===A){if(this[B]=!0,!this[I]&&!this[f])return;const A=super.emit("close");return this.removeAllListeners("close"),A}if("error"===A){this[C]=e;const A=super.emit("error",e);return this[r](),A}if("resume"===A){const A=super.emit("resume");return this[r](),A}if("finish"===A||"prefinish"===A){const e=super.emit(A);return this.removeAllListeners(A),e}const i=super.emit(A,e,...t);return this[r](),i}[R](A){for(const e of this.pipes)!1===e.dest.write(A)&&this.pause();const e=super.emit("data",A);return this[r](),e}[N](){this[I]||(this[I]=!0,this.readable=!1,this[S]?k(()=>this[M]()):this[M]())}[M](){if(this[u]){const A=this[u].end();if(A){for(const e of this.pipes)e.dest.write(A);super.emit("data",A)}}for(const A of this.pipes)A.end();const A=super.emit("end");return this.removeAllListeners("end"),A}collect(){const A=[];this[y]||(A.dataLength=0);const e=this.promise();return this.on("data",e=>{A.push(e),this[y]||(A.dataLength+=e.length)}),e.then(()=>A)}concat(){return this[y]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(A=>this[y]?Promise.reject(new Error("cannot concat in objectMode")):this[l]?A.join(""):Buffer.concat(A,A.dataLength))}promise(){return new Promise((A,e)=>{this.on(f,()=>e(new Error("stream destroyed"))),this.on("error",A=>e(A)),this.on("end",()=>A())})}[L](){return{next:()=>{const A=this.read();if(null!==A)return Promise.resolve({done:!1,value:A});if(this[s])return Promise.resolve({done:!0});let e=null,t=null;const i=A=>{this.removeListener("data",n),this.removeListener("end",o),t(A)},n=A=>{this.removeListener("error",i),this.removeListener("end",o),this.pause(),e({value:A,done:!!this[s]})},o=()=>{this.removeListener("error",i),this.removeListener("data",n),e({done:!0})},g=()=>i(new Error("stream destroyed"));return new Promise((A,s)=>{t=s,e=A,this.once(f,g),this.once("error",i),this.once("end",o),this.once("data",n)})}}}[F](){return{next:()=>{const A=this.read();return{value:A,done:null===A}}}}destroy(A){return this[f]?(A?this.emit("error",A):this.emit(f),this):(this[f]=!0,this.buffer.length=0,this[p]=0,"function"!=typeof this.close||this[B]||this.close(),A?this.emit("error",A):this.emit(f),this)}static isStream(e){return!!e&&(e instanceof A||e instanceof o||e instanceof n&&("function"==typeof e.pipe||"function"==typeof e.write&&"function"==typeof e.end))}}},38461(A,e,t){const i=t(43106).constants||{ZLIB_VERNUM:4736};A.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},i))},39432(A,e,t){"use strict";const i=t(42613),n=t(20181).Buffer,o=t(43106),g=e.constants=t(38461),s=t(93898),r=n.concat,I=Symbol("_superWrite");class a extends Error{constructor(A){super("zlib: "+A.message),this.code=A.code,this.errno=A.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+A.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}}const C=Symbol("opts"),B=Symbol("flushFlag"),Q=Symbol("finishFlushFlag"),E=Symbol("fullFlushFlag"),c=Symbol("handle"),l=Symbol("onError"),u=Symbol("sawError"),d=Symbol("level"),h=Symbol("strategy"),D=Symbol("ended");Symbol("_defaultFullFlush");class p extends s{constructor(A,e){if(!A||"object"!=typeof A)throw new TypeError("invalid options for ZlibBase constructor");super(A),this[u]=!1,this[D]=!1,this[C]=A,this[B]=A.flush,this[Q]=A.finishFlush;try{this[c]=new o[e](A)}catch(A){throw new a(A)}this[l]=A=>{this[u]||(this[u]=!0,this.close(),this.emit("error",A))},this[c].on("error",A=>this[l](new a(A))),this.once("end",()=>this.close)}close(){this[c]&&(this[c].close(),this[c]=null,this.emit("close"))}reset(){if(!this[u])return i(this[c],"zlib binding closed"),this[c].reset()}flush(A){this.ended||("number"!=typeof A&&(A=this[E]),this.write(Object.assign(n.alloc(0),{[B]:A})))}end(A,e,t){return A&&this.write(A,e),this.flush(this[Q]),this[D]=!0,super.end(null,null,t)}get ended(){return this[D]}write(A,e,t){if("function"==typeof e&&(t=e,e="utf8"),"string"==typeof A&&(A=n.from(A,e)),this[u])return;i(this[c],"zlib binding closed");const o=this[c]._handle,g=o.close;o.close=()=>{};const s=this[c].close;let C,Q;this[c].close=()=>{},n.concat=A=>A;try{const e="number"==typeof A[B]?A[B]:this[B];C=this[c]._processChunk(A,e),n.concat=r}catch(A){n.concat=r,this[l](new a(A))}finally{this[c]&&(this[c]._handle=o,o.close=g,this[c].close=s,this[c].removeAllListeners("error"))}if(this[c]&&this[c].on("error",A=>this[l](new a(A))),C)if(Array.isArray(C)&&C.length>0){Q=this[I](n.from(C[0]));for(let A=1;A{this.flush(A),e()};try{this[c].params(A,e)}finally{this[c].flush=t}this[c]&&(this[d]=A,this[h]=e)}}}}const m=Symbol("_portable");class y extends p{constructor(A,e){(A=A||{}).flush=A.flush||g.BROTLI_OPERATION_PROCESS,A.finishFlush=A.finishFlush||g.BROTLI_OPERATION_FINISH,super(A,e),this[E]=g.BROTLI_OPERATION_FLUSH}}e.Deflate=class extends w{constructor(A){super(A,"Deflate")}},e.Inflate=class extends w{constructor(A){super(A,"Inflate")}},e.Gzip=class extends w{constructor(A){super(A,"Gzip"),this[m]=A&&!!A.portable}[I](A){return this[m]?(this[m]=!1,A[9]=255,super[I](A)):super[I](A)}},e.Gunzip=class extends w{constructor(A){super(A,"Gunzip")}},e.DeflateRaw=class extends w{constructor(A){super(A,"DeflateRaw")}},e.InflateRaw=class extends w{constructor(A){super(A,"InflateRaw")}},e.Unzip=class extends w{constructor(A){super(A,"Unzip")}},"function"==typeof o.BrotliCompress?(e.BrotliCompress=class extends y{constructor(A){super(A,"BrotliCompress")}},e.BrotliDecompress=class extends y{constructor(A){super(A,"BrotliDecompress")}}):e.BrotliCompress=e.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}},93898(A,e,t){"use strict";const i=t(24434),n=t(2203),o=t(34680),g=t(13193).StringDecoder,s=Symbol("EOF"),r=Symbol("maybeEmitEnd"),I=Symbol("emittedEnd"),a=Symbol("emittingEnd"),C=Symbol("closed"),B=Symbol("read"),Q=Symbol("flush"),E=Symbol("flushChunk"),c=Symbol("encoding"),l=Symbol("decoder"),u=Symbol("flowing"),d=Symbol("paused"),h=Symbol("resume"),D=Symbol("bufferLength"),p=Symbol("bufferPush"),w=Symbol("bufferShift"),m=Symbol("objectMode"),y=Symbol("destroyed"),f="1"!==global._MP_NO_ITERATOR_SYMBOLS_,R=f&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),N=f&&Symbol.iterator||Symbol("iterator not implemented"),M=A=>"end"===A||"finish"===A||"prefinish"===A;A.exports=class A extends n{constructor(A){super(),this[u]=!1,this[d]=!1,this.pipes=new o,this.buffer=new o,this[m]=A&&A.objectMode||!1,this[m]?this[c]=null:this[c]=A&&A.encoding||null,"buffer"===this[c]&&(this[c]=null),this[l]=this[c]?new g(this[c]):null,this[s]=!1,this[I]=!1,this[a]=!1,this[C]=!1,this.writable=!0,this.readable=!0,this[D]=0,this[y]=!1}get bufferLength(){return this[D]}get encoding(){return this[c]}set encoding(A){if(this[m])throw new Error("cannot set encoding in objectMode");if(this[c]&&A!==this[c]&&(this[l]&&this[l].lastNeed||this[D]))throw new Error("cannot change encoding");this[c]!==A&&(this[l]=A?new g(A):null,this.buffer.length&&(this.buffer=this.buffer.map(A=>this[l].write(A)))),this[c]=A}setEncoding(A){this.encoding=A}get objectMode(){return this[m]}set objectMode(A){this[m]=this[m]||!!A}write(A,e,t){if(this[s])throw new Error("write after end");return this[y]?(this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0):("function"==typeof e&&(t=e,e="utf8"),e||(e="utf8"),this[m]||Buffer.isBuffer(A)||(i=A,!Buffer.isBuffer(i)&&ArrayBuffer.isView(i)?A=Buffer.from(A.buffer,A.byteOffset,A.byteLength):(A=>A instanceof ArrayBuffer||"object"==typeof A&&A.constructor&&"ArrayBuffer"===A.constructor.name&&A.byteLength>=0)(A)?A=Buffer.from(A):"string"!=typeof A&&(this.objectMode=!0)),this.objectMode||A.length?("string"!=typeof A||this[m]||e===this[c]&&!this[l].lastNeed||(A=Buffer.from(A,e)),Buffer.isBuffer(A)&&this[c]&&(A=this[l].write(A)),this.flowing?(0!==this[D]&&this[Q](!0),this.emit("data",A)):this[p](A),0!==this[D]&&this.emit("readable"),t&&t(),this.flowing):(0!==this[D]&&this.emit("readable"),t&&t(),this.flowing));var i}read(A){if(this[y])return null;try{return 0===this[D]||0===A||A>this[D]?null:(this[m]&&(A=null),this.buffer.length>1&&!this[m]&&(this.encoding?this.buffer=new o([Array.from(this.buffer).join("")]):this.buffer=new o([Buffer.concat(Array.from(this.buffer),this[D])])),this[B](A||null,this.buffer.head.value))}finally{this[r]()}}[B](A,e){return A===e.length||null===A?this[w]():(this.buffer.head.value=e.slice(A),e=e.slice(0,A),this[D]-=A),this.emit("data",e),this.buffer.length||this[s]||this.emit("drain"),e}end(A,e,t){return"function"==typeof A&&(t=A,A=null),"function"==typeof e&&(t=e,e="utf8"),A&&this.write(A,e),t&&this.once("end",t),this[s]=!0,this.writable=!1,!this.flowing&&this[d]||this[r](),this}[h](){this[y]||(this[d]=!1,this[u]=!0,this.emit("resume"),this.buffer.length?this[Q]():this[s]?this[r]():this.emit("drain"))}resume(){return this[h]()}pause(){this[u]=!1,this[d]=!0}get destroyed(){return this[y]}get flowing(){return this[u]}get paused(){return this[d]}[p](A){return this[m]?this[D]+=1:this[D]+=A.length,this.buffer.push(A)}[w](){return this.buffer.length&&(this[m]?this[D]-=1:this[D]-=this.buffer.head.value.length),this.buffer.shift()}[Q](A){do{}while(this[E](this[w]()));A||this.buffer.length||this[s]||this.emit("drain")}[E](A){return!!A&&(this.emit("data",A),this.flowing)}pipe(A,e){if(this[y])return;const t=this[I];e=e||{},A===process.stdout||A===process.stderr?e.end=!1:e.end=!1!==e.end;const i={dest:A,opts:e,ondrain:A=>this[h]()};return this.pipes.push(i),A.on("drain",i.ondrain),this[h](),t&&i.opts.end&&i.dest.end(),A}addListener(A,e){return this.on(A,e)}on(A,e){try{return super.on(A,e)}finally{"data"!==A||this.pipes.length||this.flowing?M(A)&&this[I]&&(super.emit(A),this.removeAllListeners(A)):this[h]()}}get emittedEnd(){return this[I]}[r](){this[a]||this[I]||this[y]||0!==this.buffer.length||!this[s]||(this[a]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[C]&&this.emit("close"),this[a]=!1)}emit(A,e){if("error"!==A&&"close"!==A&&A!==y&&this[y])return;if("data"===A){if(!e)return;this.pipes.length&&this.pipes.forEach(A=>!1===A.dest.write(e)&&this.pause())}else if("end"===A){if(!0===this[I])return;this[I]=!0,this.readable=!1,this[l]&&(e=this[l].end())&&(this.pipes.forEach(A=>A.dest.write(e)),super.emit("data",e)),this.pipes.forEach(A=>{A.dest.removeListener("drain",A.ondrain),A.opts.end&&A.dest.end()})}else if("close"===A&&(this[C]=!0,!this[I]&&!this[y]))return;const t=new Array(arguments.length);if(t[0]=A,t[1]=e,arguments.length>2)for(let A=2;A{A.push(e),this[m]||(A.dataLength+=e.length)}),e.then(()=>A)}concat(){return this[m]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(A=>this[m]?Promise.reject(new Error("cannot concat in objectMode")):this[c]?A.join(""):Buffer.concat(A,A.dataLength))}promise(){return new Promise((A,e)=>{this.on(y,()=>e(new Error("stream destroyed"))),this.on("end",()=>A()),this.on("error",A=>e(A))})}[R](){return{next:()=>{const A=this.read();if(null!==A)return Promise.resolve({done:!1,value:A});if(this[s])return Promise.resolve({done:!0});let e=null,t=null;const i=A=>{this.removeListener("data",n),this.removeListener("end",o),t(A)},n=A=>{this.removeListener("error",i),this.removeListener("end",o),this.pause(),e({value:A,done:!!this[s]})},o=()=>{this.removeListener("error",i),this.removeListener("data",n),e({done:!0})},g=()=>i(new Error("stream destroyed"));return new Promise((A,s)=>{t=s,e=A,this.once(y,g),this.once("error",i),this.once("end",o),this.once("data",n)})}}}[N](){return{next:()=>{const A=this.read();return{value:A,done:null===A}}}}destroy(A){return this[y]?(A?this.emit("error",A):this.emit(y),this):(this[y]=!0,this.buffer=new o,this[D]=0,"function"!=typeof this.close||this[C]||this.close(),A?this.emit("error",A):this.emit(y),this)}static isStream(e){return!!e&&(e instanceof A||e instanceof n||e instanceof i&&("function"==typeof e.pipe||"function"==typeof e.write&&"function"==typeof e.end))}}},97706(A){"use strict";A.exports=function(A){A.prototype[Symbol.iterator]=function*(){for(let A=this.head;A;A=A.next)yield A.value}}},34680(A,e,t){"use strict";function i(A){var e=this;if(e instanceof i||(e=new i),e.tail=null,e.head=null,e.length=0,A&&"function"==typeof A.forEach)A.forEach(function(A){e.push(A)});else if(arguments.length>0)for(var t=0,n=arguments.length;t1)t=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,t=this.head.value}for(var n=0;null!==i;n++)t=A(t,i.value,n),i=i.next;return t},i.prototype.reduceReverse=function(A,e){var t,i=this.tail;if(arguments.length>1)t=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,t=this.tail.value}for(var n=this.length-1;null!==i;n--)t=A(t,i.value,n),i=i.prev;return t},i.prototype.toArray=function(){for(var A=new Array(this.length),e=0,t=this.head;null!==t;e++)A[e]=t.value,t=t.next;return A},i.prototype.toArrayReverse=function(){for(var A=new Array(this.length),e=0,t=this.tail;null!==t;e++)A[e]=t.value,t=t.prev;return A},i.prototype.slice=function(A,e){(e=e||this.length)<0&&(e+=this.length),(A=A||0)<0&&(A+=this.length);var t=new i;if(ethis.length&&(e=this.length);for(var n=0,o=this.head;null!==o&&nthis.length&&(e=this.length);for(var n=this.length,o=this.tail;null!==o&&n>e;n--)o=o.prev;for(;null!==o&&n>A;n--,o=o.prev)t.push(o.value);return t},i.prototype.splice=function(A,e,...t){A>this.length&&(A=this.length-1),A<0&&(A=this.length+A);for(var i=0,o=this.head;null!==o&&i=1.5*t;return Math.round(A/t)+" "+i+(n?"s":"")}A.exports=function(A,s){s=s||{};var r,I,a=typeof A;if("string"===a&&A.length>0)return function(A){if(!((A=String(A)).length>100)){var g=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(A);if(g){var s=parseFloat(g[1]);switch((g[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*o;case"days":case"day":case"d":return s*n;case"hours":case"hour":case"hrs":case"hr":case"h":return s*i;case"minutes":case"minute":case"mins":case"min":case"m":return s*t;case"seconds":case"second":case"secs":case"sec":case"s":return s*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(A);if("number"===a&&isFinite(A))return s.long?(r=A,(I=Math.abs(r))>=n?g(r,I,n,"day"):I>=i?g(r,I,i,"hour"):I>=t?g(r,I,t,"minute"):I>=e?g(r,I,e,"second"):r+" ms"):function(A){var o=Math.abs(A);return o>=n?Math.round(A/n)+"d":o>=i?Math.round(A/i)+"h":o>=t?Math.round(A/t)+"m":o>=e?Math.round(A/e)+"s":A+"ms"}(A);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(A))}},70768(A,e,t){A.exports=t(18686)},18686(A,e){!function(){"use strict";var t={version:"3.0.1",x86:{},x64:{}};function i(A,e){return(65535&A)*e+(((A>>>16)*e&65535)<<16)}function n(A,e){return A<>>32-e}function o(A){return A=i(A^=A>>>16,2246822507),(A=i(A^=A>>>13,3266489909))^A>>>16}function g(A,e){A=[A[0]>>>16,65535&A[0],A[1]>>>16,65535&A[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var t=[0,0,0,0];return t[3]+=A[3]+e[3],t[2]+=t[3]>>>16,t[3]&=65535,t[2]+=A[2]+e[2],t[1]+=t[2]>>>16,t[2]&=65535,t[1]+=A[1]+e[1],t[0]+=t[1]>>>16,t[1]&=65535,t[0]+=A[0]+e[0],t[0]&=65535,[t[0]<<16|t[1],t[2]<<16|t[3]]}function s(A,e){A=[A[0]>>>16,65535&A[0],A[1]>>>16,65535&A[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var t=[0,0,0,0];return t[3]+=A[3]*e[3],t[2]+=t[3]>>>16,t[3]&=65535,t[2]+=A[2]*e[3],t[1]+=t[2]>>>16,t[2]&=65535,t[2]+=A[3]*e[2],t[1]+=t[2]>>>16,t[2]&=65535,t[1]+=A[1]*e[3],t[0]+=t[1]>>>16,t[1]&=65535,t[1]+=A[2]*e[2],t[0]+=t[1]>>>16,t[1]&=65535,t[1]+=A[3]*e[1],t[0]+=t[1]>>>16,t[1]&=65535,t[0]+=A[0]*e[3]+A[1]*e[2]+A[2]*e[1]+A[3]*e[0],t[0]&=65535,[t[0]<<16|t[1],t[2]<<16|t[3]]}function r(A,e){return 32==(e%=64)?[A[1],A[0]]:e<32?[A[0]<>>32-e,A[1]<>>32-e]:(e-=32,[A[1]<>>32-e,A[0]<>>32-e])}function I(A,e){return 0==(e%=64)?A:e<32?[A[0]<>>32-e,A[1]<>>1]),A=a(A=s(A,[4283543511,3981806797]),[0,A[0]>>>1]),a(A=s(A,[3301882366,444984403]),[0,A[0]>>>1])}t.x86.hash32=function(A,e){e=e||0;for(var t=(A=A||"").length%4,g=A.length-t,s=e,r=0,I=3432918353,a=461845907,C=0;C>>0},t.x86.hash128=function(A,e){e=e||0;for(var t=(A=A||"").length%16,g=A.length-t,s=e,r=e,I=e,a=e,C=0,B=0,Q=0,E=0,c=597399067,l=2869860233,u=951274213,d=2716044179,h=0;h>>0).toString(16)).slice(-8)+("00000000"+(r>>>0).toString(16)).slice(-8)+("00000000"+(I>>>0).toString(16)).slice(-8)+("00000000"+(a>>>0).toString(16)).slice(-8)},t.x64.hash128=function(A,e){e=e||0;for(var t=(A=A||"").length%16,i=A.length-t,n=[0,e],o=[0,e],B=[0,0],Q=[0,0],E=[2277735313,289559509],c=[1291169091,658871167],l=0;l>>0).toString(16)).slice(-8)+("00000000"+(n[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)},A.exports&&(e=A.exports=t),e.murmurHash3=t}()},71241(A){const e=Symbol("proc-log.meta");A.exports={META:e,output:{LEVELS:["standard","error","buffer","flush"],KEYS:{standard:"standard",error:"error",buffer:"buffer",flush:"flush"},standard:function(...A){return process.emit("output","standard",...A)},error:function(...A){return process.emit("output","error",...A)},buffer:function(...A){return process.emit("output","buffer",...A)},flush:function(...A){return process.emit("output","flush",...A)}},log:{LEVELS:["notice","error","warn","info","verbose","http","silly","timing","pause","resume"],KEYS:{notice:"notice",error:"error",warn:"warn",info:"info",verbose:"verbose",http:"http",silly:"silly",timing:"timing",pause:"pause",resume:"resume"},error:function(...A){return process.emit("log","error",...A)},notice:function(...A){return process.emit("log","notice",...A)},warn:function(...A){return process.emit("log","warn",...A)},info:function(...A){return process.emit("log","info",...A)},verbose:function(...A){return process.emit("log","verbose",...A)},http:function(...A){return process.emit("log","http",...A)},silly:function(...A){return process.emit("log","silly",...A)},timing:function(...A){return process.emit("log","timing",...A)},pause:function(){return process.emit("log","pause")},resume:function(){return process.emit("log","resume")}},time:{LEVELS:["start","end"],KEYS:{start:"start",end:"end"},start:function(A,e){function t(){return process.emit("time","end",A)}if(process.emit("time","start",A),"function"==typeof e){const A=e();return A&&A.finally?A.finally(t):(t(),A)}return t},end:function(A){return process.emit("time","end",A)}},input:{LEVELS:["start","end","read"],KEYS:{start:"start",end:"end",read:"read"},start:function(A){function e(){return process.emit("input","end")}if(process.emit("input","start"),"function"==typeof A){const t=A();return t&&t.finally?t.finally(e):(e(),t)}return e},end:function(){return process.emit("input","end")},read:function(...A){let e,t;const i=new Promise((A,i)=>{e=A,t=i});return process.emit("input","read",e,t,...A),i}}}},604(A,e,t){"use strict";var i=t(72425),n=t(69364),o=Object.prototype.hasOwnProperty;function g(A){return A&&"EPROMISERETRY"===A.code&&o.call(A,"retried")}A.exports=function(A,e){var t,o;return"object"==typeof A&&"function"==typeof e&&(t=e,e=A,A=t),o=n.operation(e),new Promise(function(e,t){o.attempt(function(n){Promise.resolve().then(function(){return A(function(A){throw g(A)&&(A=A.retried),i(new Error("Retrying"),"EPROMISERETRY",{retried:A})},n)}).then(e,function(A){g(A)&&(A=A.retried,o.retry(A||new Error))||t(A)})})})}},88059(A,e,t){"use strict";var i=t(87016).parse,n={ftp:21,gopher:70,http:80,https:443,ws:80,wss:443},o=String.prototype.endsWith||function(A){return A.length<=this.length&&-1!==this.indexOf(A,this.length-A.length)};function g(A){return process.env[A.toLowerCase()]||process.env[A.toUpperCase()]||""}e.getProxyForUrl=function(A){var e="string"==typeof A?i(A):A||{},t=e.protocol,s=e.host,r=e.port;if("string"!=typeof s||!s||"string"!=typeof t)return"";if(t=t.split(":",1)[0],!function(A,e){var t=(g("npm_config_no_proxy")||g("no_proxy")).toLowerCase();return!t||"*"!==t&&t.split(/[,\s]/).every(function(t){if(!t)return!0;var i=t.match(/^(.+):(\d+)$/),n=i?i[1]:t,g=i?parseInt(i[2]):0;return!(!g||g===e)||(/^[.*]/.test(n)?("*"===n.charAt(0)&&(n=n.slice(1)),!o.call(A,n)):A!==n)})}(s=s.replace(/:\d*$/,""),r=parseInt(r)||n[t]||0))return"";var I=g("npm_config_"+t+"_proxy")||g(t+"_proxy")||g("npm_config_proxy")||g("all_proxy");return I&&-1===I.indexOf("://")&&(I=t+"://"+I),I}},69364(A,e,t){A.exports=t(61386)},61386(A,e,t){var i=t(83884);e.operation=function(A){var t=e.timeouts(A);return new i(t,{forever:A&&A.forever,unref:A&&A.unref,maxRetryTime:A&&A.maxRetryTime})},e.timeouts=function(A){if(A instanceof Array)return[].concat(A);var e={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var t in A)e[t]=A[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],n=0;n=this._maxRetryTime)return this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(A);var t=this._timeouts.shift();if(void 0===t){if(!this._cachedTimeouts)return!1;this._errors.splice(this._errors.length-1,this._errors.length),this._timeouts=this._cachedTimeouts.slice(0),t=this._timeouts.shift()}var i=this,n=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},t);return this._options.unref&&n.unref(),!0},e.prototype.attempt=function(A,e){this._fn=A,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},e.prototype.try=function(A){console.log("Using RetryOperation.try() is deprecated"),this.attempt(A)},e.prototype.start=function(A){console.log("Using RetryOperation.start() is deprecated"),this.attempt(A)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(0===this._errors.length)return null;for(var A={},e=null,t=0,i=0;i=t&&(e=n,t=g)}return e}},19845(A,e,t){"use strict";var i,n=t(20181),o=n.Buffer,g={};for(i in n)n.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(g[i]=n[i]);var s=g.Buffer={};for(i in o)o.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(s[i]=o[i]);if(g.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(A,e,t){if("number"==typeof A)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof A);if(A&&void 0===A.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof A);return o(A,e,t)}),s.alloc||(s.alloc=function(A,e,t){if("number"!=typeof A)throw new TypeError('The "size" argument must be of type number. Received type '+typeof A);if(A<0||A>=2*(1<<30))throw new RangeError('The value "'+A+'" is invalid for option "size"');var i=o(A);return e&&0!==e.length?"string"==typeof t?i.fill(e,t):i.fill(e):i.fill(0),i}),!g.kStringMaxLength)try{g.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch(A){}g.constants||(g.constants={MAX_LENGTH:g.kMaxLength},g.kStringMaxLength&&(g.constants.MAX_STRING_LENGTH=g.kStringMaxLength)),A.exports=g},51565(A,e,t){"use strict";const i=Symbol("SemVer ANY");class n{static get ANY(){return i}constructor(A,e){if(e=o(e),A instanceof n){if(A.loose===!!e.loose)return A;A=A.value}A=A.trim().split(/\s+/).join(" "),I("comparator",A,e),this.options=e,this.loose=!!e.loose,this.parse(A),this.semver===i?this.value="":this.value=this.operator+this.semver.version,I("comp",this)}parse(A){const e=this.options.loose?g[s.COMPARATORLOOSE]:g[s.COMPARATOR],t=A.match(e);if(!t)throw new TypeError(`Invalid comparator: ${A}`);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new a(t[2],this.options.loose):this.semver=i}toString(){return this.value}test(A){if(I("Comparator.test",A,this.options.loose),this.semver===i||A===i)return!0;if("string"==typeof A)try{A=new a(A,this.options)}catch(A){return!1}return r(A,this.operator,this.semver,this.options)}intersects(A,e){if(!(A instanceof n))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new C(A.value,e).test(this.value):""===A.operator?""===A.value||new C(this.value,e).test(A.semver):!((e=o(e)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===A.value)||!e.includePrerelease&&(this.value.startsWith("<0.0.0")||A.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!A.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!A.operator.startsWith("<"))&&(this.semver.version!==A.semver.version||!this.operator.includes("=")||!A.operator.includes("="))&&!(r(this.semver,"<",A.semver,e)&&this.operator.startsWith(">")&&A.operator.startsWith("<"))&&!(r(this.semver,">",A.semver,e)&&this.operator.startsWith("<")&&A.operator.startsWith(">")))}}A.exports=n;const o=t(13990),{safeRe:g,t:s}=t(72841),r=t(54004),I=t(41361),a=t(24517),C=t(37476)},37476(A,e,t){"use strict";const i=/\s+/g;class n{constructor(A,e){if(e=g(e),A instanceof n)return A.loose===!!e.loose&&A.includePrerelease===!!e.includePrerelease?A:new n(A.raw,e);if(A instanceof s)return this.raw=A.value,this.set=[[A]],this.formatted=void 0,this;if(this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease,this.raw=A.trim().replace(i," "),this.set=this.raw.split("||").map(A=>this.parseRange(A.trim())).filter(A=>A.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const A=this.set[0];if(this.set=this.set.filter(A=>!u(A[0])),0===this.set.length)this.set=[A];else if(this.set.length>1)for(const A of this.set)if(1===A.length&&d(A[0])){this.set=[A];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let A=0;A0&&(this.formatted+="||");const e=this.set[A];for(let A=0;A0&&(this.formatted+=" "),this.formatted+=e[A].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(A){const e=((this.options.includePrerelease&&c)|(this.options.loose&&l))+":"+A,t=o.get(e);if(t)return t;const i=this.options.loose,n=i?a[C.HYPHENRANGELOOSE]:a[C.HYPHENRANGE];A=A.replace(n,k(this.options.includePrerelease)),r("hyphen replace",A),A=A.replace(a[C.COMPARATORTRIM],B),r("comparator trim",A),A=A.replace(a[C.TILDETRIM],Q),r("tilde trim",A),A=A.replace(a[C.CARETTRIM],E),r("caret trim",A);let g=A.split(" ").map(A=>D(A,this.options)).join(" ").split(/\s+/).map(A=>S(A,this.options));i&&(g=g.filter(A=>(r("loose invalid filter",A,this.options),!!A.match(a[C.COMPARATORLOOSE])))),r("range list",g);const I=new Map,d=g.map(A=>new s(A,this.options));for(const A of d){if(u(A))return[A];I.set(A.value,A)}I.size>1&&I.has("")&&I.delete("");const h=[...I.values()];return o.set(e,h),h}intersects(A,e){if(!(A instanceof n))throw new TypeError("a Range is required");return this.set.some(t=>h(t,e)&&A.set.some(A=>h(A,e)&&t.every(t=>A.every(A=>t.intersects(A,e)))))}test(A){if(!A)return!1;if("string"==typeof A)try{A=new I(A,this.options)}catch(A){return!1}for(let e=0;e"<0.0.0-0"===A.value,d=A=>""===A.value,h=(A,e)=>{let t=!0;const i=A.slice();let n=i.pop();for(;t&&i.length;)t=i.every(A=>n.intersects(A,e)),n=i.pop();return t},D=(A,e)=>(r("comp",A,e),A=y(A,e),r("caret",A),A=w(A,e),r("tildes",A),A=R(A,e),r("xrange",A),A=M(A,e),r("stars",A),A),p=A=>!A||"x"===A.toLowerCase()||"*"===A,w=(A,e)=>A.trim().split(/\s+/).map(A=>m(A,e)).join(" "),m=(A,e)=>{const t=e.loose?a[C.TILDELOOSE]:a[C.TILDE];return A.replace(t,(e,t,i,n,o)=>{let g;return r("tilde",A,e,t,i,n,o),p(t)?g="":p(i)?g=`>=${t}.0.0 <${+t+1}.0.0-0`:p(n)?g=`>=${t}.${i}.0 <${t}.${+i+1}.0-0`:o?(r("replaceTilde pr",o),g=`>=${t}.${i}.${n}-${o} <${t}.${+i+1}.0-0`):g=`>=${t}.${i}.${n} <${t}.${+i+1}.0-0`,r("tilde return",g),g})},y=(A,e)=>A.trim().split(/\s+/).map(A=>f(A,e)).join(" "),f=(A,e)=>{r("caret",A,e);const t=e.loose?a[C.CARETLOOSE]:a[C.CARET],i=e.includePrerelease?"-0":"";return A.replace(t,(e,t,n,o,g)=>{let s;return r("caret",A,e,t,n,o,g),p(t)?s="":p(n)?s=`>=${t}.0.0${i} <${+t+1}.0.0-0`:p(o)?s="0"===t?`>=${t}.${n}.0${i} <${t}.${+n+1}.0-0`:`>=${t}.${n}.0${i} <${+t+1}.0.0-0`:g?(r("replaceCaret pr",g),s="0"===t?"0"===n?`>=${t}.${n}.${o}-${g} <${t}.${n}.${+o+1}-0`:`>=${t}.${n}.${o}-${g} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${o}-${g} <${+t+1}.0.0-0`):(r("no pr"),s="0"===t?"0"===n?`>=${t}.${n}.${o}${i} <${t}.${n}.${+o+1}-0`:`>=${t}.${n}.${o}${i} <${t}.${+n+1}.0-0`:`>=${t}.${n}.${o} <${+t+1}.0.0-0`),r("caret return",s),s})},R=(A,e)=>(r("replaceXRanges",A,e),A.split(/\s+/).map(A=>N(A,e)).join(" ")),N=(A,e)=>{A=A.trim();const t=e.loose?a[C.XRANGELOOSE]:a[C.XRANGE];return A.replace(t,(t,i,n,o,g,s)=>{r("xRange",A,t,i,n,o,g,s);const I=p(n),a=I||p(o),C=a||p(g),B=C;return"="===i&&B&&(i=""),s=e.includePrerelease?"-0":"",I?t=">"===i||"<"===i?"<0.0.0-0":"*":i&&B?(a&&(o=0),g=0,">"===i?(i=">=",a?(n=+n+1,o=0,g=0):(o=+o+1,g=0)):"<="===i&&(i="<",a?n=+n+1:o=+o+1),"<"===i&&(s="-0"),t=`${i+n}.${o}.${g}${s}`):a?t=`>=${n}.0.0${s} <${+n+1}.0.0-0`:C&&(t=`>=${n}.${o}.0${s} <${n}.${+o+1}.0-0`),r("xRange return",t),t})},M=(A,e)=>(r("replaceStars",A,e),A.trim().replace(a[C.STAR],"")),S=(A,e)=>(r("replaceGTE0",A,e),A.trim().replace(a[e.includePrerelease?C.GTE0PRE:C.GTE0],"")),k=A=>(e,t,i,n,o,g,s,r,I,a,C,B)=>`${t=p(i)?"":p(n)?`>=${i}.0.0${A?"-0":""}`:p(o)?`>=${i}.${n}.0${A?"-0":""}`:g?`>=${t}`:`>=${t}${A?"-0":""}`} ${r=p(I)?"":p(a)?`<${+I+1}.0.0-0`:p(C)?`<${I}.${+a+1}.0-0`:B?`<=${I}.${a}.${C}-${B}`:A?`<${I}.${a}.${+C+1}-0`:`<=${r}`}`.trim(),G=(A,e,t)=>{for(let t=0;t0){const i=A[t].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}},24517(A,e,t){"use strict";const i=t(41361),{MAX_LENGTH:n,MAX_SAFE_INTEGER:o}=t(79543),{safeRe:g,t:s}=t(72841),r=t(13990),{compareIdentifiers:I}=t(93806);class a{constructor(A,e){if(e=r(e),A instanceof a){if(A.loose===!!e.loose&&A.includePrerelease===!!e.includePrerelease)return A;A=A.version}else if("string"!=typeof A)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof A}".`);if(A.length>n)throw new TypeError(`version is longer than ${n} characters`);i("SemVer",A,e),this.options=e,this.loose=!!e.loose,this.includePrerelease=!!e.includePrerelease;const t=A.trim().match(e.loose?g[s.LOOSE]:g[s.FULL]);if(!t)throw new TypeError(`Invalid Version: ${A}`);if(this.raw=A,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map(A=>{if(/^[0-9]+$/.test(A)){const e=+A;if(e>=0&&e=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(e===this.prerelease.join(".")&&!1===t)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(A)}}if(e){let i=[e,A];!1===t&&(i=[e]),0===I(this.prerelease[0],e)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${A}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}A.exports=a},92281(A,e,t){"use strict";const i=t(93955);A.exports=(A,e)=>{const t=i(A.trim().replace(/^[=v]+/,""),e);return t?t.version:null}},54004(A,e,t){"use strict";const i=t(28848),n=t(28220),o=t(89761),g=t(72386),s=t(51262),r=t(89639);A.exports=(A,e,t,I)=>{switch(e){case"===":return"object"==typeof A&&(A=A.version),"object"==typeof t&&(t=t.version),A===t;case"!==":return"object"==typeof A&&(A=A.version),"object"==typeof t&&(t=t.version),A!==t;case"":case"=":case"==":return i(A,t,I);case"!=":return n(A,t,I);case">":return o(A,t,I);case">=":return g(A,t,I);case"<":return s(A,t,I);case"<=":return r(A,t,I);default:throw new TypeError(`Invalid operator: ${e}`)}}},56783(A,e,t){"use strict";const i=t(24517),n=t(93955),{safeRe:o,t:g}=t(72841);A.exports=(A,e)=>{if(A instanceof i)return A;if("number"==typeof A&&(A=String(A)),"string"!=typeof A)return null;let t=null;if((e=e||{}).rtl){const i=e.includePrerelease?o[g.COERCERTLFULL]:o[g.COERCERTL];let n;for(;(n=i.exec(A))&&(!t||t.index+t[0].length!==A.length);)t&&n.index+n[0].length===t.index+t[0].length||(t=n),i.lastIndex=n.index+n[1].length+n[2].length;i.lastIndex=-1}else t=A.match(e.includePrerelease?o[g.COERCEFULL]:o[g.COERCE]);if(null===t)return null;const s=t[2],r=t[3]||"0",I=t[4]||"0",a=e.includePrerelease&&t[5]?`-${t[5]}`:"",C=e.includePrerelease&&t[6]?`+${t[6]}`:"";return n(`${s}.${r}.${I}${a}${C}`,e)}},6106(A,e,t){"use strict";const i=t(24517);A.exports=(A,e,t)=>{const n=new i(A,t),o=new i(e,t);return n.compare(o)||n.compareBuild(o)}},52132(A,e,t){"use strict";const i=t(87851);A.exports=(A,e)=>i(A,e,!0)},87851(A,e,t){"use strict";const i=t(24517);A.exports=(A,e,t)=>new i(A,t).compare(new i(e,t))},73269(A,e,t){"use strict";const i=t(93955);A.exports=(A,e)=>{const t=i(A,null,!0),n=i(e,null,!0),o=t.compare(n);if(0===o)return null;const g=o>0,s=g?t:n,r=g?n:t,I=!!s.prerelease.length;if(r.prerelease.length&&!I){if(!r.patch&&!r.minor)return"major";if(0===r.compareMain(s))return r.minor&&!r.patch?"minor":"patch"}const a=I?"pre":"";return t.major!==n.major?a+"major":t.minor!==n.minor?a+"minor":t.patch!==n.patch?a+"patch":"prerelease"}},28848(A,e,t){"use strict";const i=t(87851);A.exports=(A,e,t)=>0===i(A,e,t)},89761(A,e,t){"use strict";const i=t(87851);A.exports=(A,e,t)=>i(A,e,t)>0},72386(A,e,t){"use strict";const i=t(87851);A.exports=(A,e,t)=>i(A,e,t)>=0},38868(A,e,t){"use strict";const i=t(24517);A.exports=(A,e,t,n,o)=>{"string"==typeof t&&(o=n,n=t,t=void 0);try{return new i(A instanceof i?A.version:A,t).inc(e,n,o).version}catch(A){return null}}},51262(A,e,t){"use strict";const i=t(87851);A.exports=(A,e,t)=>i(A,e,t)<0},89639(A,e,t){"use strict";const i=t(87851);A.exports=(A,e,t)=>i(A,e,t)<=0},26381(A,e,t){"use strict";const i=t(24517);A.exports=(A,e)=>new i(A,e).major},31353(A,e,t){"use strict";const i=t(24517);A.exports=(A,e)=>new i(A,e).minor},28220(A,e,t){"use strict";const i=t(87851);A.exports=(A,e,t)=>0!==i(A,e,t)},93955(A,e,t){"use strict";const i=t(24517);A.exports=(A,e,t=!1)=>{if(A instanceof i)return A;try{return new i(A,e)}catch(A){if(!t)return null;throw A}}},96082(A,e,t){"use strict";const i=t(24517);A.exports=(A,e)=>new i(A,e).patch},69428(A,e,t){"use strict";const i=t(93955);A.exports=(A,e)=>{const t=i(A,e);return t&&t.prerelease.length?t.prerelease:null}},87555(A,e,t){"use strict";const i=t(87851);A.exports=(A,e,t)=>i(e,A,t)},93810(A,e,t){"use strict";const i=t(6106);A.exports=(A,e)=>A.sort((A,t)=>i(t,A,e))},27229(A,e,t){"use strict";const i=t(37476);A.exports=(A,e,t)=>{try{e=new i(e,t)}catch(A){return!1}return e.test(A)}},34042(A,e,t){"use strict";const i=t(6106);A.exports=(A,e)=>A.sort((A,t)=>i(A,t,e))},28474(A,e,t){"use strict";const i=t(93955);A.exports=(A,e)=>{const t=i(A,e);return t?t.version:null}},2722(A,e,t){"use strict";const i=t(72841),n=t(79543),o=t(24517),g=t(93806),s=t(93955),r=t(28474),I=t(92281),a=t(38868),C=t(73269),B=t(26381),Q=t(31353),E=t(96082),c=t(69428),l=t(87851),u=t(87555),d=t(52132),h=t(6106),D=t(34042),p=t(93810),w=t(89761),m=t(51262),y=t(28848),f=t(28220),R=t(72386),N=t(89639),M=t(54004),S=t(56783),k=t(51565),G=t(37476),L=t(27229),F=t(26364),T=t(55039),U=t(77738),J=t(71280),_=t(37403),Y=t(58854),b=t(27226),H=t(37183),x=t(18623),K=t(76486),O=t(40583);A.exports={parse:s,valid:r,clean:I,inc:a,diff:C,major:B,minor:Q,patch:E,prerelease:c,compare:l,rcompare:u,compareLoose:d,compareBuild:h,sort:D,rsort:p,gt:w,lt:m,eq:y,neq:f,gte:R,lte:N,cmp:M,coerce:S,Comparator:k,Range:G,satisfies:L,toComparators:F,maxSatisfying:T,minSatisfying:U,minVersion:J,validRange:_,outside:Y,gtr:b,ltr:H,intersects:x,simplifyRange:K,subset:O,SemVer:o,re:i.re,src:i.src,tokens:i.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:g.compareIdentifiers,rcompareIdentifiers:g.rcompareIdentifiers}},79543(A){"use strict";const e=Number.MAX_SAFE_INTEGER||9007199254740991;A.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},41361(A){"use strict";const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...A)=>console.error("SEMVER",...A):()=>{};A.exports=e},93806(A){"use strict";const e=/^[0-9]+$/,t=(A,t)=>{const i=e.test(A),n=e.test(t);return i&&n&&(A=+A,t=+t),A===t?0:i&&!n?-1:n&&!i?1:At(e,A)}},58953(A){"use strict";A.exports=class{constructor(){this.max=1e3,this.map=new Map}get(A){const e=this.map.get(A);return void 0===e?void 0:(this.map.delete(A),this.map.set(A,e),e)}delete(A){return this.map.delete(A)}set(A,e){if(!this.delete(A)&&void 0!==e){if(this.map.size>=this.max){const A=this.map.keys().next().value;this.delete(A)}this.map.set(A,e)}return this}}},13990(A){"use strict";const e=Object.freeze({loose:!0}),t=Object.freeze({});A.exports=A=>A?"object"!=typeof A?e:A:t},72841(A,e,t){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=t(79543),g=t(41361),s=(e=A.exports={}).re=[],r=e.safeRe=[],I=e.src=[],a=e.safeSrc=[],C=e.t={};let B=0;const Q="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",o],[Q,n]],c=(A,e,t)=>{const i=(A=>{for(const[e,t]of E)A=A.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return A})(e),n=B++;g(A,n,e),C[A]=n,I[n]=e,a[n]=i,s[n]=new RegExp(e,t?"g":void 0),r[n]=new RegExp(i,t?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","\\d+"),c("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Q}*`),c("MAINVERSION",`(${I[C.NUMERICIDENTIFIER]})\\.(${I[C.NUMERICIDENTIFIER]})\\.(${I[C.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${I[C.NUMERICIDENTIFIERLOOSE]})\\.(${I[C.NUMERICIDENTIFIERLOOSE]})\\.(${I[C.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${I[C.NONNUMERICIDENTIFIER]}|${I[C.NUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${I[C.NONNUMERICIDENTIFIER]}|${I[C.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASE",`(?:-(${I[C.PRERELEASEIDENTIFIER]}(?:\\.${I[C.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${I[C.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${I[C.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER",`${Q}+`),c("BUILD",`(?:\\+(${I[C.BUILDIDENTIFIER]}(?:\\.${I[C.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${I[C.MAINVERSION]}${I[C.PRERELEASE]}?${I[C.BUILD]}?`),c("FULL",`^${I[C.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${I[C.MAINVERSIONLOOSE]}${I[C.PRERELEASELOOSE]}?${I[C.BUILD]}?`),c("LOOSE",`^${I[C.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${I[C.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${I[C.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${I[C.XRANGEIDENTIFIER]})(?:\\.(${I[C.XRANGEIDENTIFIER]})(?:\\.(${I[C.XRANGEIDENTIFIER]})(?:${I[C.PRERELEASE]})?${I[C.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${I[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[C.XRANGEIDENTIFIERLOOSE]})(?:\\.(${I[C.XRANGEIDENTIFIERLOOSE]})(?:${I[C.PRERELEASELOOSE]})?${I[C.BUILD]}?)?)?`),c("XRANGE",`^${I[C.GTLT]}\\s*${I[C.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${I[C.GTLT]}\\s*${I[C.XRANGEPLAINLOOSE]}$`),c("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),c("COERCE",`${I[C.COERCEPLAIN]}(?:$|[^\\d])`),c("COERCEFULL",I[C.COERCEPLAIN]+`(?:${I[C.PRERELEASE]})?`+`(?:${I[C.BUILD]})?(?:$|[^\\d])`),c("COERCERTL",I[C.COERCE],!0),c("COERCERTLFULL",I[C.COERCEFULL],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${I[C.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",c("TILDE",`^${I[C.LONETILDE]}${I[C.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${I[C.LONETILDE]}${I[C.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${I[C.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",c("CARET",`^${I[C.LONECARET]}${I[C.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${I[C.LONECARET]}${I[C.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${I[C.GTLT]}\\s*(${I[C.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${I[C.GTLT]}\\s*(${I[C.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${I[C.GTLT]}\\s*(${I[C.LOOSEPLAIN]}|${I[C.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${I[C.XRANGEPLAIN]})\\s+-\\s+(${I[C.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${I[C.XRANGEPLAINLOOSE]})\\s+-\\s+(${I[C.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},27226(A,e,t){"use strict";const i=t(58854);A.exports=(A,e,t)=>i(A,e,">",t)},18623(A,e,t){"use strict";const i=t(37476);A.exports=(A,e,t)=>(A=new i(A,t),e=new i(e,t),A.intersects(e,t))},37183(A,e,t){"use strict";const i=t(58854);A.exports=(A,e,t)=>i(A,e,"<",t)},55039(A,e,t){"use strict";const i=t(24517),n=t(37476);A.exports=(A,e,t)=>{let o=null,g=null,s=null;try{s=new n(e,t)}catch(A){return null}return A.forEach(A=>{s.test(A)&&(o&&-1!==g.compare(A)||(o=A,g=new i(o,t)))}),o}},77738(A,e,t){"use strict";const i=t(24517),n=t(37476);A.exports=(A,e,t)=>{let o=null,g=null,s=null;try{s=new n(e,t)}catch(A){return null}return A.forEach(A=>{s.test(A)&&(o&&1!==g.compare(A)||(o=A,g=new i(o,t)))}),o}},71280(A,e,t){"use strict";const i=t(24517),n=t(37476),o=t(89761);A.exports=(A,e)=>{A=new n(A,e);let t=new i("0.0.0");if(A.test(t))return t;if(t=new i("0.0.0-0"),A.test(t))return t;t=null;for(let e=0;e{const e=new i(A.semver.version);switch(A.operator){case">":0===e.prerelease.length?e.patch++:e.prerelease.push(0),e.raw=e.format();case"":case">=":g&&!o(e,g)||(g=e);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${A.operator}`)}}),!g||t&&!o(t,g)||(t=g)}return t&&A.test(t)?t:null}},58854(A,e,t){"use strict";const i=t(24517),n=t(51565),{ANY:o}=n,g=t(37476),s=t(27229),r=t(89761),I=t(51262),a=t(89639),C=t(72386);A.exports=(A,e,t,B)=>{let Q,E,c,l,u;switch(A=new i(A,B),e=new g(e,B),t){case">":Q=r,E=a,c=I,l=">",u=">=";break;case"<":Q=I,E=C,c=r,l="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(A,e,B))return!1;for(let t=0;t{A.semver===o&&(A=new n(">=0.0.0")),g=g||A,s=s||A,Q(A.semver,g.semver,B)?g=A:c(A.semver,s.semver,B)&&(s=A)}),g.operator===l||g.operator===u)return!1;if((!s.operator||s.operator===l)&&E(A,s.semver))return!1;if(s.operator===u&&c(A,s.semver))return!1}return!0}},76486(A,e,t){"use strict";const i=t(27229),n=t(87851);A.exports=(A,e,t)=>{const o=[];let g=null,s=null;const r=A.sort((A,e)=>n(A,e,t));for(const A of r)i(A,e,t)?(s=A,g||(g=A)):(s&&o.push([g,s]),s=null,g=null);g&&o.push([g,null]);const I=[];for(const[A,e]of o)A===e?I.push(A):e||A!==r[0]?e?A===r[0]?I.push(`<=${e}`):I.push(`${A} - ${e}`):I.push(`>=${A}`):I.push("*");const a=I.join(" || "),C="string"==typeof e.raw?e.raw:String(e);return a.length=0.0.0-0")],I=[new n(">=0.0.0")],a=(A,e,t)=>{if(A===e)return!0;if(1===A.length&&A[0].semver===o){if(1===e.length&&e[0].semver===o)return!0;A=t.includePrerelease?r:I}if(1===e.length&&e[0].semver===o){if(t.includePrerelease)return!0;e=I}const i=new Set;let n,a,Q,E,c,l,u;for(const e of A)">"===e.operator||">="===e.operator?n=C(n,e,t):"<"===e.operator||"<="===e.operator?a=B(a,e,t):i.add(e.semver);if(i.size>1)return null;if(n&&a){if(Q=s(n.semver,a.semver,t),Q>0)return null;if(0===Q&&(">="!==n.operator||"<="!==a.operator))return null}for(const A of i){if(n&&!g(A,String(n),t))return null;if(a&&!g(A,String(a),t))return null;for(const i of e)if(!g(A,String(i),t))return!1;return!0}let d=!(!a||t.includePrerelease||!a.semver.prerelease.length)&&a.semver,h=!(!n||t.includePrerelease||!n.semver.prerelease.length)&&n.semver;d&&1===d.prerelease.length&&"<"===a.operator&&0===d.prerelease[0]&&(d=!1);for(const A of e){if(u=u||">"===A.operator||">="===A.operator,l=l||"<"===A.operator||"<="===A.operator,n)if(h&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===h.major&&A.semver.minor===h.minor&&A.semver.patch===h.patch&&(h=!1),">"===A.operator||">="===A.operator){if(E=C(n,A,t),E===A&&E!==n)return!1}else if(">="===n.operator&&!g(n.semver,String(A),t))return!1;if(a)if(d&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===d.major&&A.semver.minor===d.minor&&A.semver.patch===d.patch&&(d=!1),"<"===A.operator||"<="===A.operator){if(c=B(a,A,t),c===A&&c!==a)return!1}else if("<="===a.operator&&!g(a.semver,String(A),t))return!1;if(!A.operator&&(a||n)&&0!==Q)return!1}return!(n&&l&&!a&&0!==Q||a&&u&&!n&&0!==Q||h||d)},C=(A,e,t)=>{if(!A)return e;const i=s(A.semver,e.semver,t);return i>0?A:i<0||">"===e.operator&&">="===A.operator?e:A},B=(A,e,t)=>{if(!A)return e;const i=s(A.semver,e.semver,t);return i<0?A:i>0||"<"===e.operator&&"<="===A.operator?e:A};A.exports=(A,e,t={})=>{if(A===e)return!0;A=new i(A,t),e=new i(e,t);let n=!1;A:for(const i of A.set){for(const A of e.set){const e=a(i,A,t);if(n=n||null!==e,e)continue A}if(n)return!1}return!0}},26364(A,e,t){"use strict";const i=t(37476);A.exports=(A,e)=>new i(A,e).set.map(A=>A.map(A=>A.value).join(" ").trim().split(" "))},37403(A,e,t){"use strict";const i=t(37476);A.exports=(A,e)=>{try{return new i(A,e).range||"*"}catch(A){return null}}},5092(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=t(46742);class n{constructor(A){if(this.length=0,this._encoding="utf8",this._writeOffset=0,this._readOffset=0,n.isSmartBufferOptions(A))if(A.encoding&&(i.checkEncoding(A.encoding),this._encoding=A.encoding),A.size){if(!(i.isFiniteInteger(A.size)&&A.size>0))throw new Error(i.ERRORS.INVALID_SMARTBUFFER_SIZE);this._buff=Buffer.allocUnsafe(A.size)}else if(A.buff){if(!Buffer.isBuffer(A.buff))throw new Error(i.ERRORS.INVALID_SMARTBUFFER_BUFFER);this._buff=A.buff,this.length=A.buff.length}else this._buff=Buffer.allocUnsafe(4096);else{if(void 0!==A)throw new Error(i.ERRORS.INVALID_SMARTBUFFER_OBJECT);this._buff=Buffer.allocUnsafe(4096)}}static fromSize(A,e){return new this({size:A,encoding:e})}static fromBuffer(A,e){return new this({buff:A,encoding:e})}static fromOptions(A){return new this(A)}static isSmartBufferOptions(A){const e=A;return e&&(void 0!==e.encoding||void 0!==e.size||void 0!==e.buff)}readInt8(A){return this._readNumberValue(Buffer.prototype.readInt8,1,A)}readInt16BE(A){return this._readNumberValue(Buffer.prototype.readInt16BE,2,A)}readInt16LE(A){return this._readNumberValue(Buffer.prototype.readInt16LE,2,A)}readInt32BE(A){return this._readNumberValue(Buffer.prototype.readInt32BE,4,A)}readInt32LE(A){return this._readNumberValue(Buffer.prototype.readInt32LE,4,A)}readBigInt64BE(A){return i.bigIntAndBufferInt64Check("readBigInt64BE"),this._readNumberValue(Buffer.prototype.readBigInt64BE,8,A)}readBigInt64LE(A){return i.bigIntAndBufferInt64Check("readBigInt64LE"),this._readNumberValue(Buffer.prototype.readBigInt64LE,8,A)}writeInt8(A,e){return this._writeNumberValue(Buffer.prototype.writeInt8,1,A,e),this}insertInt8(A,e){return this._insertNumberValue(Buffer.prototype.writeInt8,1,A,e)}writeInt16BE(A,e){return this._writeNumberValue(Buffer.prototype.writeInt16BE,2,A,e)}insertInt16BE(A,e){return this._insertNumberValue(Buffer.prototype.writeInt16BE,2,A,e)}writeInt16LE(A,e){return this._writeNumberValue(Buffer.prototype.writeInt16LE,2,A,e)}insertInt16LE(A,e){return this._insertNumberValue(Buffer.prototype.writeInt16LE,2,A,e)}writeInt32BE(A,e){return this._writeNumberValue(Buffer.prototype.writeInt32BE,4,A,e)}insertInt32BE(A,e){return this._insertNumberValue(Buffer.prototype.writeInt32BE,4,A,e)}writeInt32LE(A,e){return this._writeNumberValue(Buffer.prototype.writeInt32LE,4,A,e)}insertInt32LE(A,e){return this._insertNumberValue(Buffer.prototype.writeInt32LE,4,A,e)}writeBigInt64BE(A,e){return i.bigIntAndBufferInt64Check("writeBigInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigInt64BE,8,A,e)}insertBigInt64BE(A,e){return i.bigIntAndBufferInt64Check("writeBigInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigInt64BE,8,A,e)}writeBigInt64LE(A,e){return i.bigIntAndBufferInt64Check("writeBigInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigInt64LE,8,A,e)}insertBigInt64LE(A,e){return i.bigIntAndBufferInt64Check("writeBigInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigInt64LE,8,A,e)}readUInt8(A){return this._readNumberValue(Buffer.prototype.readUInt8,1,A)}readUInt16BE(A){return this._readNumberValue(Buffer.prototype.readUInt16BE,2,A)}readUInt16LE(A){return this._readNumberValue(Buffer.prototype.readUInt16LE,2,A)}readUInt32BE(A){return this._readNumberValue(Buffer.prototype.readUInt32BE,4,A)}readUInt32LE(A){return this._readNumberValue(Buffer.prototype.readUInt32LE,4,A)}readBigUInt64BE(A){return i.bigIntAndBufferInt64Check("readBigUInt64BE"),this._readNumberValue(Buffer.prototype.readBigUInt64BE,8,A)}readBigUInt64LE(A){return i.bigIntAndBufferInt64Check("readBigUInt64LE"),this._readNumberValue(Buffer.prototype.readBigUInt64LE,8,A)}writeUInt8(A,e){return this._writeNumberValue(Buffer.prototype.writeUInt8,1,A,e)}insertUInt8(A,e){return this._insertNumberValue(Buffer.prototype.writeUInt8,1,A,e)}writeUInt16BE(A,e){return this._writeNumberValue(Buffer.prototype.writeUInt16BE,2,A,e)}insertUInt16BE(A,e){return this._insertNumberValue(Buffer.prototype.writeUInt16BE,2,A,e)}writeUInt16LE(A,e){return this._writeNumberValue(Buffer.prototype.writeUInt16LE,2,A,e)}insertUInt16LE(A,e){return this._insertNumberValue(Buffer.prototype.writeUInt16LE,2,A,e)}writeUInt32BE(A,e){return this._writeNumberValue(Buffer.prototype.writeUInt32BE,4,A,e)}insertUInt32BE(A,e){return this._insertNumberValue(Buffer.prototype.writeUInt32BE,4,A,e)}writeUInt32LE(A,e){return this._writeNumberValue(Buffer.prototype.writeUInt32LE,4,A,e)}insertUInt32LE(A,e){return this._insertNumberValue(Buffer.prototype.writeUInt32LE,4,A,e)}writeBigUInt64BE(A,e){return i.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64BE,8,A,e)}insertBigUInt64BE(A,e){return i.bigIntAndBufferInt64Check("writeBigUInt64BE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64BE,8,A,e)}writeBigUInt64LE(A,e){return i.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._writeNumberValue(Buffer.prototype.writeBigUInt64LE,8,A,e)}insertBigUInt64LE(A,e){return i.bigIntAndBufferInt64Check("writeBigUInt64LE"),this._insertNumberValue(Buffer.prototype.writeBigUInt64LE,8,A,e)}readFloatBE(A){return this._readNumberValue(Buffer.prototype.readFloatBE,4,A)}readFloatLE(A){return this._readNumberValue(Buffer.prototype.readFloatLE,4,A)}writeFloatBE(A,e){return this._writeNumberValue(Buffer.prototype.writeFloatBE,4,A,e)}insertFloatBE(A,e){return this._insertNumberValue(Buffer.prototype.writeFloatBE,4,A,e)}writeFloatLE(A,e){return this._writeNumberValue(Buffer.prototype.writeFloatLE,4,A,e)}insertFloatLE(A,e){return this._insertNumberValue(Buffer.prototype.writeFloatLE,4,A,e)}readDoubleBE(A){return this._readNumberValue(Buffer.prototype.readDoubleBE,8,A)}readDoubleLE(A){return this._readNumberValue(Buffer.prototype.readDoubleLE,8,A)}writeDoubleBE(A,e){return this._writeNumberValue(Buffer.prototype.writeDoubleBE,8,A,e)}insertDoubleBE(A,e){return this._insertNumberValue(Buffer.prototype.writeDoubleBE,8,A,e)}writeDoubleLE(A,e){return this._writeNumberValue(Buffer.prototype.writeDoubleLE,8,A,e)}insertDoubleLE(A,e){return this._insertNumberValue(Buffer.prototype.writeDoubleLE,8,A,e)}readString(A,e){let t;"number"==typeof A?(i.checkLengthValue(A),t=Math.min(A,this.length-this._readOffset)):(e=A,t=this.length-this._readOffset),void 0!==e&&i.checkEncoding(e);const n=this._buff.slice(this._readOffset,this._readOffset+t).toString(e||this._encoding);return this._readOffset+=t,n}insertString(A,e,t){return i.checkOffsetValue(e),this._handleString(A,!0,e,t)}writeString(A,e,t){return this._handleString(A,!1,e,t)}readStringNT(A){void 0!==A&&i.checkEncoding(A);let e=this.length;for(let A=this._readOffset;Athis.length)throw new Error(i.ERRORS.INVALID_READ_BEYOND_BOUNDS)}ensureInsertable(A,e){i.checkOffsetValue(e),this._ensureCapacity(this.length+A),ethis.length?this.length=e+A:this.length+=A}_ensureWriteable(A,e){const t="number"==typeof e?e:this._writeOffset;this._ensureCapacity(t+A),t+A>this.length&&(this.length=t+A)}_ensureCapacity(A){const e=this._buff.length;if(A>e){let t=this._buff,i=3*e/2+1;ie.length)throw new Error(n.INVALID_TARGET_OFFSET)},e.bigIntAndBufferInt64Check=function(A){if("undefined"==typeof BigInt)throw new Error("Platform does not support JS BigInt type.");if(void 0===i.Buffer.prototype[A])throw new Error(`Platform does not support Buffer.prototype.${A}.`)}},54439(A,e,t){"use strict";var i=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),n=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),o=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t in A)"default"!==t&&Object.prototype.hasOwnProperty.call(A,t)&&i(e,A,t);return n(e,A),e},g=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocksProxyAgent=void 0;const s=t(296),r=t(64112),I=g(t(3680)),a=o(t(72250)),C=o(t(64756)),B=t(87016),Q=(0,I.default)("socks-proxy-agent");class E extends r.Agent{constructor(A,e){super(e);const t="string"==typeof A?new B.URL(A):A,{proxy:i,lookup:n}=function(A){let e=!1,t=5;const i=A.hostname,n=parseInt(A.port,10)||1080;switch(A.protocol.replace(":","")){case"socks4":e=!0,t=4;break;case"socks4a":t=4;break;case"socks5":e=!0,t=5;break;case"socks":case"socks5h":t=5;break;default:throw new TypeError(`A "socks" protocol must be specified! Got: ${String(A.protocol)}`)}const o={host:i,port:n,type:t};return A.username&&Object.defineProperty(o,"userId",{value:decodeURIComponent(A.username),enumerable:!1}),null!=A.password&&Object.defineProperty(o,"password",{value:decodeURIComponent(A.password),enumerable:!1}),{lookup:e,proxy:o}}(t);this.shouldLookup=n,this.proxy=i,this.timeout=e?.timeout??null,this.socketOptions=e?.socketOptions??null}async connect(A,e){const{shouldLookup:t,proxy:i,timeout:n}=this;if(!e.host)throw new Error("No `host` defined!");let{host:o}=e;const{port:g,lookup:r=a.lookup}=e;t&&(o=await new Promise((A,e)=>{r(o,{},(t,i)=>{t?e(t):A(i)})}));const I={proxy:i,destination:{host:o,port:"number"==typeof g?g:parseInt(g,10)},command:"connect",timeout:n??void 0,socket_options:this.socketOptions??void 0},B=e=>{A.destroy(),E.destroy(),e&&e.destroy()};Q("Creating socks proxy connection: %o",I);const{socket:E}=await s.SocksClient.createConnection(I);if(Q("Successfully created socks proxy connection"),null!==n&&(E.setTimeout(n),E.on("timeout",()=>B())),e.secureEndpoint){Q("Upgrading socket connection to TLS");const A=e.servername||e.host,t=C.connect({...c(e,"host","path","port"),socket:E,servername:A});return t.once("error",A=>{Q("Socket TLS error",A.message),B(t)}),t}return E}}function c(A,...e){const t={};let i;for(i in A)e.includes(i)||(t[i]=A[i]);return t}E.protocols=["socks","socks4","socks4a","socks5","socks5h"],e.SocksProxyAgent=E},28148(A,e,t){"use strict";var i=this&&this.__awaiter||function(A,e,t,i){return new(t||(t=Promise))(function(n,o){function g(A){try{r(i.next(A))}catch(A){o(A)}}function s(A){try{r(i.throw(A))}catch(A){o(A)}}function r(A){var e;A.done?n(A.value):(e=A.value,e instanceof t?e:new t(function(A){A(e)})).then(g,s)}r((i=i.apply(A,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.SocksClientError=e.SocksClient=void 0;const n=t(24434),o=t(69278),g=t(5092),s=t(11737),r=t(81761),I=t(16871),a=t(67606);Object.defineProperty(e,"SocksClientError",{enumerable:!0,get:function(){return a.SocksClientError}});const C=t(11039);class B extends n.EventEmitter{constructor(A){super(),this.options=Object.assign({},A),(0,r.validateSocksClientOptions)(A),this.setState(s.SocksClientState.Created)}static createConnection(A,e){return new Promise((t,i)=>{try{(0,r.validateSocksClientOptions)(A,["connect"])}catch(A){return"function"==typeof e?(e(A),t(A)):i(A)}const n=new B(A);n.connect(A.existing_socket),n.once("established",A=>{n.removeAllListeners(),"function"==typeof e?(e(null,A),t(A)):t(A)}),n.once("error",A=>{n.removeAllListeners(),"function"==typeof e?(e(A),t(A)):i(A)})})}static createConnectionChain(A,e){return new Promise((t,n)=>i(this,void 0,void 0,function*(){try{(0,r.validateSocksClientChainOptions)(A)}catch(A){return"function"==typeof e?(e(A),t(A)):n(A)}A.randomizeChain&&(0,a.shuffleArray)(A.proxies);try{let i;for(let e=0;ethis.onDataReceivedHandler(A),this.onClose=()=>this.onCloseHandler(),this.onError=A=>this.onErrorHandler(A),this.onConnect=()=>this.onConnectHandler();const e=setTimeout(()=>this.onEstablishedTimeout(),this.options.timeout||s.DEFAULT_TIMEOUT);e.unref&&"function"==typeof e.unref&&e.unref(),this.socket=A||new o.Socket,this.socket.once("close",this.onClose),this.socket.once("error",this.onError),this.socket.once("connect",this.onConnect),this.socket.on("data",this.onDataReceived),this.setState(s.SocksClientState.Connecting),this.receiveBuffer=new I.ReceiveBuffer,A?this.socket.emit("connect"):(this.socket.connect(this.getSocketOptions()),void 0!==this.options.set_tcp_nodelay&&null!==this.options.set_tcp_nodelay&&this.socket.setNoDelay(!!this.options.set_tcp_nodelay)),this.prependOnceListener("established",A=>{setImmediate(()=>{if(this.receiveBuffer.length>0){const e=this.receiveBuffer.get(this.receiveBuffer.length);A.socket.emit("data",e)}A.socket.resume()})})}getSocketOptions(){return Object.assign(Object.assign({},this.options.socket_options),{host:this.options.proxy.host||this.options.proxy.ipaddress,port:this.options.proxy.port})}onEstablishedTimeout(){this.state!==s.SocksClientState.Established&&this.state!==s.SocksClientState.BoundWaitingForConnection&&this.closeSocket(s.ERRORS.ProxyConnectionTimedOut)}onConnectHandler(){this.setState(s.SocksClientState.Connected),4===this.options.proxy.type?this.sendSocks4InitialHandshake():this.sendSocks5InitialHandshake(),this.setState(s.SocksClientState.SentInitialHandshake)}onDataReceivedHandler(A){this.receiveBuffer.append(A),this.processData()}processData(){for(;this.state!==s.SocksClientState.Established&&this.state!==s.SocksClientState.Error&&this.receiveBuffer.length>=this.nextRequiredPacketBufferSize;)if(this.state===s.SocksClientState.SentInitialHandshake)4===this.options.proxy.type?this.handleSocks4FinalHandshakeResponse():this.handleInitialSocks5HandshakeResponse();else if(this.state===s.SocksClientState.SentAuthentication)this.handleInitialSocks5AuthenticationHandshakeResponse();else if(this.state===s.SocksClientState.SentFinalHandshake)this.handleSocks5FinalHandshakeResponse();else{if(this.state!==s.SocksClientState.BoundWaitingForConnection){this.closeSocket(s.ERRORS.InternalError);break}4===this.options.proxy.type?this.handleSocks4IncomingConnectionResponse():this.handleSocks5IncomingConnectionResponse()}}onCloseHandler(){this.closeSocket(s.ERRORS.SocketClosed)}onErrorHandler(A){this.closeSocket(A.message)}removeInternalSocketHandlers(){this.socket.pause(),this.socket.removeListener("data",this.onDataReceived),this.socket.removeListener("close",this.onClose),this.socket.removeListener("error",this.onError),this.socket.removeListener("connect",this.onConnect)}closeSocket(A){this.state!==s.SocksClientState.Error&&(this.setState(s.SocksClientState.Error),this.socket.destroy(),this.removeInternalSocketHandlers(),this.emit("error",new a.SocksClientError(A,this.options)))}sendSocks4InitialHandshake(){const A=this.options.proxy.userId||"",e=new g.SmartBuffer;e.writeUInt8(4),e.writeUInt8(s.SocksCommand[this.options.command]),e.writeUInt16BE(this.options.destination.port),o.isIPv4(this.options.destination.host)?(e.writeBuffer((0,r.ipToBuffer)(this.options.destination.host)),e.writeStringNT(A)):(e.writeUInt8(0),e.writeUInt8(0),e.writeUInt8(0),e.writeUInt8(1),e.writeStringNT(A),e.writeStringNT(this.options.destination.host)),this.nextRequiredPacketBufferSize=s.SOCKS_INCOMING_PACKET_SIZES.Socks4Response,this.socket.write(e.toBuffer())}handleSocks4FinalHandshakeResponse(){const A=this.receiveBuffer.get(8);if(A[1]!==s.Socks4Response.Granted)this.closeSocket(`${s.ERRORS.Socks4ProxyRejectedConnection} - (${s.Socks4Response[A[1]]})`);else if(s.SocksCommand[this.options.command]===s.SocksCommand.bind){const e=g.SmartBuffer.fromBuffer(A);e.readOffset=2;const t={port:e.readUInt16BE(),host:(0,r.int32ToIpv4)(e.readUInt32BE())};"0.0.0.0"===t.host&&(t.host=this.options.proxy.ipaddress),this.setState(s.SocksClientState.BoundWaitingForConnection),this.emit("bound",{remoteHost:t,socket:this.socket})}else this.setState(s.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{socket:this.socket})}handleSocks4IncomingConnectionResponse(){const A=this.receiveBuffer.get(8);if(A[1]!==s.Socks4Response.Granted)this.closeSocket(`${s.ERRORS.Socks4ProxyRejectedIncomingBoundConnection} - (${s.Socks4Response[A[1]]})`);else{const e=g.SmartBuffer.fromBuffer(A);e.readOffset=2;const t={port:e.readUInt16BE(),host:(0,r.int32ToIpv4)(e.readUInt32BE())};this.setState(s.SocksClientState.Established),this.removeInternalSocketHandlers(),this.emit("established",{remoteHost:t,socket:this.socket})}}sendSocks5InitialHandshake(){const A=new g.SmartBuffer,e=[s.Socks5Auth.NoAuth];(this.options.proxy.userId||this.options.proxy.password)&&e.push(s.Socks5Auth.UserPass),void 0!==this.options.proxy.custom_auth_method&&e.push(this.options.proxy.custom_auth_method),A.writeUInt8(5),A.writeUInt8(e.length);for(const t of e)A.writeUInt8(t);this.nextRequiredPacketBufferSize=s.SOCKS_INCOMING_PACKET_SIZES.Socks5InitialHandshakeResponse,this.socket.write(A.toBuffer()),this.setState(s.SocksClientState.SentInitialHandshake)}handleInitialSocks5HandshakeResponse(){const A=this.receiveBuffer.get(2);5!==A[0]?this.closeSocket(s.ERRORS.InvalidSocks5IntiailHandshakeSocksVersion):A[1]===s.SOCKS5_NO_ACCEPTABLE_AUTH?this.closeSocket(s.ERRORS.InvalidSocks5InitialHandshakeNoAcceptedAuthType):A[1]===s.Socks5Auth.NoAuth?(this.socks5ChosenAuthType=s.Socks5Auth.NoAuth,this.sendSocks5CommandRequest()):A[1]===s.Socks5Auth.UserPass?(this.socks5ChosenAuthType=s.Socks5Auth.UserPass,this.sendSocks5UserPassAuthentication()):A[1]===this.options.proxy.custom_auth_method?(this.socks5ChosenAuthType=this.options.proxy.custom_auth_method,this.sendSocks5CustomAuthentication()):this.closeSocket(s.ERRORS.InvalidSocks5InitialHandshakeUnknownAuthType)}sendSocks5UserPassAuthentication(){const A=this.options.proxy.userId||"",e=this.options.proxy.password||"",t=new g.SmartBuffer;t.writeUInt8(1),t.writeUInt8(Buffer.byteLength(A)),t.writeString(A),t.writeUInt8(Buffer.byteLength(e)),t.writeString(e),this.nextRequiredPacketBufferSize=s.SOCKS_INCOMING_PACKET_SIZES.Socks5UserPassAuthenticationResponse,this.socket.write(t.toBuffer()),this.setState(s.SocksClientState.SentAuthentication)}sendSocks5CustomAuthentication(){return i(this,void 0,void 0,function*(){this.nextRequiredPacketBufferSize=this.options.proxy.custom_auth_response_size,this.socket.write(yield this.options.proxy.custom_auth_request_handler()),this.setState(s.SocksClientState.SentAuthentication)})}handleSocks5CustomAuthHandshakeResponse(A){return i(this,void 0,void 0,function*(){return yield this.options.proxy.custom_auth_response_handler(A)})}handleSocks5AuthenticationNoAuthHandshakeResponse(A){return i(this,void 0,void 0,function*(){return 0===A[1]})}handleSocks5AuthenticationUserPassHandshakeResponse(A){return i(this,void 0,void 0,function*(){return 0===A[1]})}handleInitialSocks5AuthenticationHandshakeResponse(){return i(this,void 0,void 0,function*(){this.setState(s.SocksClientState.ReceivedAuthenticationResponse);let A=!1;this.socks5ChosenAuthType===s.Socks5Auth.NoAuth?A=yield this.handleSocks5AuthenticationNoAuthHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===s.Socks5Auth.UserPass?A=yield this.handleSocks5AuthenticationUserPassHandshakeResponse(this.receiveBuffer.get(2)):this.socks5ChosenAuthType===this.options.proxy.custom_auth_method&&(A=yield this.handleSocks5CustomAuthHandshakeResponse(this.receiveBuffer.get(this.options.proxy.custom_auth_response_size))),A?this.sendSocks5CommandRequest():this.closeSocket(s.ERRORS.Socks5AuthenticationFailed)})}sendSocks5CommandRequest(){const A=new g.SmartBuffer;A.writeUInt8(5),A.writeUInt8(s.SocksCommand[this.options.command]),A.writeUInt8(0),o.isIPv4(this.options.destination.host)?(A.writeUInt8(s.Socks5HostType.IPv4),A.writeBuffer((0,r.ipToBuffer)(this.options.destination.host))):o.isIPv6(this.options.destination.host)?(A.writeUInt8(s.Socks5HostType.IPv6),A.writeBuffer((0,r.ipToBuffer)(this.options.destination.host))):(A.writeUInt8(s.Socks5HostType.Hostname),A.writeUInt8(this.options.destination.host.length),A.writeString(this.options.destination.host)),A.writeUInt16BE(this.options.destination.port),this.nextRequiredPacketBufferSize=s.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseHeader,this.socket.write(A.toBuffer()),this.setState(s.SocksClientState.SentFinalHandshake)}handleSocks5FinalHandshakeResponse(){const A=this.receiveBuffer.peek(5);if(5!==A[0]||A[1]!==s.Socks5Response.Granted)this.closeSocket(`${s.ERRORS.InvalidSocks5FinalHandshakeRejected} - ${s.Socks5Response[A[1]]}`);else{const e=A[3];let t,i;if(e===s.Socks5HostType.IPv4){const A=s.SOCKS_INCOMING_PACKET_SIZES.Socks5ResponseIPv4;if(this.receiveBuffer.lengthA+7,Socks4Response:8},function(A){A[A.connect=1]="connect",A[A.bind=2]="bind",A[A.associate=3]="associate"}(t||(e.SocksCommand=t={})),function(A){A[A.Granted=90]="Granted",A[A.Failed=91]="Failed",A[A.Rejected=92]="Rejected",A[A.RejectedIdent=93]="RejectedIdent"}(i||(e.Socks4Response=i={})),function(A){A[A.NoAuth=0]="NoAuth",A[A.GSSApi=1]="GSSApi",A[A.UserPass=2]="UserPass"}(n||(e.Socks5Auth=n={})),e.SOCKS5_CUSTOM_AUTH_START=128,e.SOCKS5_CUSTOM_AUTH_END=254,e.SOCKS5_NO_ACCEPTABLE_AUTH=255,function(A){A[A.Granted=0]="Granted",A[A.Failure=1]="Failure",A[A.NotAllowed=2]="NotAllowed",A[A.NetworkUnreachable=3]="NetworkUnreachable",A[A.HostUnreachable=4]="HostUnreachable",A[A.ConnectionRefused=5]="ConnectionRefused",A[A.TTLExpired=6]="TTLExpired",A[A.CommandNotSupported=7]="CommandNotSupported",A[A.AddressNotSupported=8]="AddressNotSupported"}(o||(e.Socks5Response=o={})),function(A){A[A.IPv4=1]="IPv4",A[A.Hostname=3]="Hostname",A[A.IPv6=4]="IPv6"}(g||(e.Socks5HostType=g={})),function(A){A[A.Created=0]="Created",A[A.Connecting=1]="Connecting",A[A.Connected=2]="Connected",A[A.SentInitialHandshake=3]="SentInitialHandshake",A[A.ReceivedInitialHandshakeResponse=4]="ReceivedInitialHandshakeResponse",A[A.SentAuthentication=5]="SentAuthentication",A[A.ReceivedAuthenticationResponse=6]="ReceivedAuthenticationResponse",A[A.SentFinalHandshake=7]="SentFinalHandshake",A[A.ReceivedFinalResponse=8]="ReceivedFinalResponse",A[A.BoundWaitingForConnection=9]="BoundWaitingForConnection",A[A.Established=10]="Established",A[A.Disconnected=11]="Disconnected",A[A.Error=99]="Error"}(s||(e.SocksClientState=s={}))},81761(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ipToBuffer=e.int32ToIpv4=e.ipv4ToInt32=e.validateSocksClientChainOptions=e.validateSocksClientOptions=void 0;const i=t(67606),n=t(11737),o=t(2203),g=t(11039),s=t(69278);function r(A,e){if(void 0!==A.custom_auth_method){if(A.custom_auth_methodn.SOCKS5_CUSTOM_AUTH_END)throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsCustomAuthRange,e);if(void 0===A.custom_auth_request_handler||"function"!=typeof A.custom_auth_request_handler)throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(void 0===A.custom_auth_response_size)throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e);if(void 0===A.custom_auth_response_handler||"function"!=typeof A.custom_auth_response_handler)throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsCustomAuthOptions,e)}}function I(A){return A&&"string"==typeof A.host&&"number"==typeof A.port&&A.port>=0&&A.port<=65535}function a(A){return A&&("string"==typeof A.host||"string"==typeof A.ipaddress)&&"number"==typeof A.port&&A.port>=0&&A.port<=65535&&(4===A.type||5===A.type)}function C(A){return"number"==typeof A&&A>0}e.validateSocksClientOptions=function(A,e=["connect","bind","associate"]){if(!n.SocksCommand[A.command])throw new i.SocksClientError(n.ERRORS.InvalidSocksCommand,A);if(-1===e.indexOf(A.command))throw new i.SocksClientError(n.ERRORS.InvalidSocksCommandForOperation,A);if(!I(A.destination))throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsDestination,A);if(!a(A.proxy))throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsProxy,A);if(r(A.proxy,A),A.timeout&&!C(A.timeout))throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsTimeout,A);if(A.existing_socket&&!(A.existing_socket instanceof o.Duplex))throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsExistingSocket,A)},e.validateSocksClientChainOptions=function(A){if("connect"!==A.command)throw new i.SocksClientError(n.ERRORS.InvalidSocksCommandChain,A);if(!I(A.destination))throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsDestination,A);if(!(A.proxies&&Array.isArray(A.proxies)&&A.proxies.length>=2))throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsProxiesLength,A);if(A.proxies.forEach(e=>{if(!a(e))throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsProxy,A);r(e,A)}),A.timeout&&!C(A.timeout))throw new i.SocksClientError(n.ERRORS.InvalidSocksClientOptionsTimeout,A)},e.ipv4ToInt32=function(A){return new g.Address4(A).toArray().reduce((A,e)=>(A<<8)+e,0)},e.int32ToIpv4=function(A){return[A>>>24&255,A>>>16&255,A>>>8&255,255&A].join(".")},e.ipToBuffer=function(A){if(s.isIPv4(A)){const e=new g.Address4(A);return Buffer.from(e.toArray())}if(s.isIPv6(A)){const e=new g.Address6(A);return Buffer.from(e.canonicalForm().split(":").map(A=>A.padStart(4,"0")).join(""),"hex")}throw new Error("Invalid IP address format")}},16871(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ReceiveBuffer=void 0,e.ReceiveBuffer=class{constructor(A=4096){this.buffer=Buffer.allocUnsafe(A),this.offset=0,this.originalSize=A}get length(){return this.offset}append(A){if(!Buffer.isBuffer(A))throw new Error("Attempted to append a non-buffer instance to ReceiveBuffer.");if(this.offset+A.length>=this.buffer.length){const e=this.buffer;this.buffer=Buffer.allocUnsafe(Math.max(this.buffer.length+this.originalSize,this.buffer.length+A.length)),e.copy(this.buffer)}return A.copy(this.buffer,this.offset),this.offset+=A.length}peek(A){if(A>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");return this.buffer.slice(0,A)}get(A){if(A>this.offset)throw new Error("Attempted to read beyond the bounds of the managed internal data.");const e=Buffer.allocUnsafe(A);return this.buffer.slice(0,A).copy(e),this.buffer.copyWithin(0,A,A+this.offset-A),this.offset-=A,e}}},67606(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shuffleArray=e.SocksClientError=void 0;class t extends Error{constructor(A,e){super(A),this.options=e}}e.SocksClientError=t,e.shuffleArray=function(A){for(let e=A.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[A[e],A[t]]=[A[t],A[e]]}}},296(A,e,t){"use strict";var i=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),n=this&&this.__exportStar||function(A,e){for(var t in A)"default"===t||Object.prototype.hasOwnProperty.call(e,t)||i(e,A,t)};Object.defineProperty(e,"__esModule",{value:!0}),n(t(28148),e)},69471(A,e,t){var i;!function(){"use strict";var n={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 o(A){return function(A,e){var t,i,g,s,r,I,a,C,B,Q=1,E=A.length,c="";for(i=0;i=0),s.type){case"b":t=parseInt(t,10).toString(2);break;case"c":t=String.fromCharCode(parseInt(t,10));break;case"d":case"i":t=parseInt(t,10);break;case"j":t=JSON.stringify(t,null,s.width?parseInt(s.width):0);break;case"e":t=s.precision?parseFloat(t).toExponential(s.precision):parseFloat(t).toExponential();break;case"f":t=s.precision?parseFloat(t).toFixed(s.precision):parseFloat(t);break;case"g":t=s.precision?String(Number(t.toPrecision(s.precision))):parseFloat(t);break;case"o":t=(parseInt(t,10)>>>0).toString(8);break;case"s":t=String(t),t=s.precision?t.substring(0,s.precision):t;break;case"t":t=String(!!t),t=s.precision?t.substring(0,s.precision):t;break;case"T":t=Object.prototype.toString.call(t).slice(8,-1).toLowerCase(),t=s.precision?t.substring(0,s.precision):t;break;case"u":t=parseInt(t,10)>>>0;break;case"v":t=t.valueOf(),t=s.precision?t.substring(0,s.precision):t;break;case"x":t=(parseInt(t,10)>>>0).toString(16);break;case"X":t=(parseInt(t,10)>>>0).toString(16).toUpperCase()}n.json.test(s.type)?c+=t:(!n.number.test(s.type)||C&&!s.sign?B="":(B=C?"+":"-",t=t.toString().replace(n.sign,"")),I=s.pad_char?"0"===s.pad_char?"0":s.pad_char.charAt(1):" ",a=s.width-(B+t).length,r=s.width&&a>0?I.repeat(a):"",c+=s.align?B+t+r:"0"===I?B+r+t:r+B+t)}return c}(function(A){if(s[A])return s[A];for(var e,t=A,i=[],o=0;t;){if(null!==(e=n.text.exec(t)))i.push(e[0]);else if(null!==(e=n.modulo.exec(t)))i.push("%");else{if(null===(e=n.placeholder.exec(t)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var g=[],r=e[2],I=[];if(null===(I=n.key.exec(r)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(g.push(I[1]);""!==(r=r.substring(I[0].length));)if(null!==(I=n.key_access.exec(r)))g.push(I[1]);else{if(null===(I=n.index_access.exec(r)))throw new SyntaxError("[sprintf] failed to parse named argument key");g.push(I[1])}e[2]=g}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push({placeholder:e[0],param_no:e[1],keys:e[2],sign:e[3],pad_char:e[4],align:e[5],width:e[6],precision:e[7],type:e[8]})}t=t.substring(e[0].length)}return s[A]=i}(A),arguments)}function g(A,e){return o.apply(null,[A].concat(e||[]))}var s=Object.create(null);e.sprintf=o,e.vsprintf=g,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=g,void 0===(i=function(){return{sprintf:o,vsprintf:g}}.call(e,t,e,A))||(A.exports=i))}()},50289(A,e,t){"use strict";const i=t(76982),{Minipass:n}=t(30407),o=["sha512","sha384","sha256"],g=["sha512"],s=/^[a-z0-9+/]+(?:=?=?)$/i,r=/^([a-z0-9]+)-([^?]+)([?\S*]*)$/,I=/^([a-z0-9]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)?$/,a=/^[\x21-\x7E]+$/,C=A=>A?.length?`?${A.join("?")}`:"";class B extends n{#f;#R;#N;constructor(A){super(),this.size=0,this.opts=A,this.#M(),this.algorithms=A?.algorithms?[...A.algorithms]:[...g],null===this.algorithm||this.algorithms.includes(this.algorithm)||this.algorithms.push(this.algorithm),this.hashes=this.algorithms.map(i.createHash)}#M(){this.sri=this.opts?.integrity?l(this.opts?.integrity,this.opts):null,this.expectedSize=this.opts?.size,this.sri?this.sri.isHash?(this.goodSri=!0,this.algorithm=this.sri.algorithm):(this.goodSri=!this.sri.isEmpty(),this.algorithm=this.sri.pickAlgorithm(this.opts)):this.algorithm=null,this.digests=this.goodSri?this.sri[this.algorithm]:null,this.optString=C(this.opts?.options)}on(A,e){return"size"===A&&this.#R?e(this.#R):"integrity"===A&&this.#f?e(this.#f):"verified"===A&&this.#N?e(this.#N):super.on(A,e)}emit(A,e){return"end"===A&&this.#S(),super.emit(A,e)}write(A){return this.size+=A.length,this.hashes.forEach(e=>e.update(A)),super.write(A)}#S(){this.goodSri||this.#M();const A=l(this.hashes.map((A,e)=>`${this.algorithms[e]}-${A.digest("base64")}${this.optString}`).join(" "),this.opts),e=this.goodSri&&A.match(this.sri,this.opts);if("number"==typeof this.expectedSize&&this.size!==this.expectedSize){const A=new Error(`stream size mismatch when checking ${this.sri}.\n Wanted: ${this.expectedSize}\n Found: ${this.size}`);A.code="EBADSIZE",A.found=this.size,A.expected=this.expectedSize,A.sri=this.sri,this.emit("error",A)}else if(this.sri&&!e){const e=new Error(`${this.sri} integrity checksum failed when using ${this.algorithm}: wanted ${this.digests} but got ${A}. (${this.size} bytes)`);e.code="EINTEGRITY",e.found=A,e.expected=this.digests,e.algorithm=this.algorithm,e.sri=this.sri,this.emit("error",e)}else this.#R=this.size,this.emit("size",this.size),this.#f=A,this.emit("integrity",A),e&&(this.#N=e,this.emit("verified",e))}}class Q{get isHash(){return!0}constructor(A,e){const t=e?.strict;this.source=A.trim(),this.digest="",this.algorithm="",this.options=[];const i=this.source.match(t?I:r);if(!i)return;if(t&&!o.includes(i[1]))return;this.algorithm=i[1],this.digest=i[2];const n=i[3];n&&(this.options=n.slice(1).split("?"))}hexDigest(){return this.digest&&Buffer.from(this.digest,"base64").toString("hex")}toJSON(){return this.toString()}match(A,e){const t=l(A,e);if(!t)return!1;if(t.isIntegrity){const A=t.pickAlgorithm(e,[this.algorithm]);if(!A)return!1;return t[A].find(A=>A.digest===this.digest)||!1}return t.digest===this.digest&&t}toString(A){return!A?.strict||o.includes(this.algorithm)&&this.digest.match(s)&&this.options.every(A=>A.match(a))?`${this.algorithm}-${this.digest}${C(this.options)}`:""}}function E(A,e,t,i){const n=""!==A;let o=!1,g="";const s=i.length-1;for(let A=0;At[A].find(A=>e.digest===A.digest)))throw new Error("hashes do not match, cannot update integrity")}else this[A]=t[A]}match(A,e){const t=l(A,e);if(!t)return!1;const i=t.pickAlgorithm(e,Object.keys(this));return!!i&&this[i]&&t[i]&&this[i].find(A=>t[i].find(e=>A.digest===e.digest))||!1}pickAlgorithm(A,e){const t=A?.pickAlgorithm||w,i=Object.keys(this).filter(A=>!e?.length||e.includes(A));return i.length?i.reduce((A,e)=>t(A,e)||A):null}}function l(A,e){if(!A)return null;if("string"==typeof A)return u(A,e);if(A.algorithm&&A.digest){const t=new c;return t[A.algorithm]=[A],u(d(t,e),e)}return u(d(A,e),e)}function u(A,e){if(e?.single)return new Q(A,e);const t=A.trim().split(/\s+/).reduce((A,t)=>{const i=new Q(t,e);if(i.algorithm&&i.digest){const e=i.algorithm;A[e]||(A[e]=[]),A[e].push(i)}return A},new c);return t.isEmpty()?null:t}function d(A,e){return A.algorithm&&A.digest?Q.prototype.toString.call(A,e):"string"==typeof A?d(l(A,e),e):c.prototype.toString.call(A,e)}function h(A=Object.create(null)){return new B(A)}A.exports.parse=l,A.exports.stringify=d,A.exports.fromHex=function(A,e,t){const i=C(t?.options);return l(`${e}-${Buffer.from(A,"hex").toString("base64")}${i}`,t)},A.exports.fromData=function(A,e){const t=e?.algorithms||[...g],n=C(e?.options);return t.reduce((t,o)=>{const g=i.createHash(o).update(A).digest("base64"),s=new Q(`${o}-${g}${n}`,e);if(s.algorithm&&s.digest){const A=s.algorithm;t[A]||(t[A]=[]),t[A].push(s)}return t},new c)},A.exports.fromStream=function(A,e){const t=h(e);return new Promise((e,i)=>{let n;A.pipe(t),A.on("error",i),t.on("error",i),t.on("integrity",A=>{n=A}),t.on("end",()=>e(n)),t.resume()})},A.exports.checkData=function(A,e,t){if(!(e=l(e,t))||!Object.keys(e).length){if(t?.error)throw Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"});return!1}const n=e.pickAlgorithm(t),o=l({algorithm:n,digest:i.createHash(n).update(A).digest("base64")}),g=o.match(e,t);if(t=t||{},g||!t.error)return g;if("number"==typeof t.size&&A.length!==t.size){const i=new Error(`data size mismatch when checking ${e}.\n Wanted: ${t.size}\n Found: ${A.length}`);throw i.code="EBADSIZE",i.found=A.length,i.expected=t.size,i.sri=e,i}{const t=new Error(`Integrity checksum failed when using ${n}: Wanted ${e}, but got ${o}. (${A.length} bytes)`);throw t.code="EINTEGRITY",t.found=o,t.expected=e,t.algorithm=n,t.sri=e,t}},A.exports.checkStream=function(A,e,t){if((t=t||Object.create(null)).integrity=e,!(e=l(e,t))||!Object.keys(e).length)return Promise.reject(Object.assign(new Error("No valid integrity hashes to check against"),{code:"EINTEGRITY"}));const i=h(t);return new Promise((e,t)=>{let n;A.pipe(i),A.on("error",t),i.on("error",t),i.on("verified",A=>{n=A}),i.on("end",()=>e(n)),i.resume()})},A.exports.integrityStream=h,A.exports.create=function(A){const e=A?.algorithms||[...g],t=C(A?.options),n=e.map(i.createHash);return{update:function(A,e){return n.forEach(t=>t.update(A,e)),this},digest:function(){return e.reduce((e,i)=>{const o=n.shift().digest("base64"),g=new Q(`${i}-${o}${t}`,A);if(g.algorithm&&g.digest){const A=g.algorithm;e[A]||(e[A]=[]),e[A].push(g)}return e},new c)}}};const D=i.getHashes(),p=["md5","whirlpool","sha1","sha224","sha256","sha384","sha512","sha3","sha3-256","sha3-384","sha3-512","sha3_256","sha3_384","sha3_512"].filter(A=>D.includes(A));function w(A,e){return p.indexOf(A.toLowerCase())>=p.indexOf(e.toLowerCase())?A:e}},86116(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{const e=I.UnleashProvider.getInstance().isEnabled(Q);C.acpOutputChannel.info(`re-evaluated acpEnabled after context update: ${e}`),e&&(t.dispose(),s.commands.executeCommand("setContext","windsurf:acpEnabled",!0),h(A))});A.subscriptions.push(t)};const s=g(t(91398)),r=t(53024),I=t(11788),a=t(29176),C=t(14953),B=t(51650),Q="ACP_ENABLED";let E,c,l=!1;function u(){E?.dispose(),E=void 0,c?.dispose(),c=void 0}async function d(){u(),E=new B.AcpRegistry;const A=[E.load()];((0,a.isDevelopment)()||(0,r.isWindsurfInsiders)())&&(c=new B.LocalRegistry,A.push(c.load())),await Promise.all(A)}function h(A){const e=s.workspace.getConfiguration("windsurf.acp");!1!==(s.workspace.isTrusted?e.get("enabled"):e.inspect("enabled")?.globalValue)?(l=!0,d()):C.acpOutputChannel.info("ACP disabled via windsurf.acp.enabled setting"),A.subscriptions.push(s.commands.registerCommand("windsurf.reloadAcpConnections",()=>{l?(C.acpOutputChannel.info("Reloading ACP connections..."),d(),C.acpOutputChannel.info("ACP connections reload initiated")):C.acpOutputChannel.info("ACP is disabled; ignoring reload command")})),A.subscriptions.push(s.workspace.onDidChangeConfiguration(A=>{if(A.affectsConfiguration("windsurf.acp.enabledAgents")&&(E?.handleEnabledAgentsChanged(),c?.handleEnabledAgentsChanged()),A.affectsConfiguration("windsurf.acp.enabled")){const A=s.workspace.getConfiguration("windsurf.acp"),e=!1!==(s.workspace.isTrusted?A.get("enabled"):A.inspect("enabled")?.globalValue);!e&&l?(C.acpOutputChannel.info("ACP disabled; disposing all registries"),l=!1,u()):e&&!l&&(C.acpOutputChannel.info("ACP enabled; loading registries"),l=!0,d())}})),A.subscriptions.push({dispose:u})}},14953(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{t.abort()},5e3),n=()=>{t.abort()};e?.addEventListener("abort",n);try{const e=await fetch(A,{signal:t.signal});if(!e.ok)return;const i=e.headers.get("content-type")??"";if(""===i||!i.includes("svg"))return;const n=e.headers.get("content-length");if(null!==n&&parseInt(n,10)>l)return;const o=await e.arrayBuffer();if(o.byteLength>l)return;return`data:image/svg+xml;base64,${Buffer.from(o).toString("base64")}`}finally{clearTimeout(i),e?.removeEventListener("abort",n)}}catch{return}}(A.icon??"",n.signal).then(e=>{if(void 0!==e&&this._connectors.has(A.id)){const t=this._connectors.get(A.id);void 0!==t&&t.iconFetchAbort===n&&(t.disposable.dispose(),t.disposable=s.windsurfAcp.registerAvailableConnector(this.buildConnectorInfo(A,e)))}})}handleEnabledAgentsChanged(){const A=s.workspace.getConfiguration("windsurf.acp.enabledAgents");for(const e of this._connectors.values()){const t=s.workspace.isTrusted?A.get(e.agent.id):A.inspect(e.agent.id)?.globalValue;!0!==t||e.connector?!0!==t&&e.connector&&(Q.acpOutputChannel.info(`Agent "${e.agent.id}" disabled; disposing connector`),e.connector.dispose(),e.connector=void 0):(Q.acpOutputChannel.info(`Agent "${e.agent.id}" enabled; instantiating connector`),e.connector=this._createConnector(e.agent))}}unregister(A){const e=this._connectors.get(A);e&&(Q.acpOutputChannel.info(`Unregistering agent "${A}"`),e.iconFetchAbort?.abort(),e.connector?.dispose(),e.disposable.dispose(),this._connectors.delete(A))}getRegisteredAgent(A){return this._connectors.get(A)?.agent}getRegisteredAgentIds(){return[...this._connectors.keys()]}_createConnector(A){return A.distribution.websocket?c.RemoteAcpConnector.tryCreate(s.windsurfAcp,A,!0):E.RegistryAcpConnector.tryCreate(s.windsurfAcp,A,!0)}dispose(){for(const A of this._connectors.values())A.iconFetchAbort?.abort(),A.connector?.dispose(),A.disposable.dispose();this._connectors.clear()}}e.AcpRegistry=class extends u{async fetch(){try{const A=a.LanguageServerClient.getInstance();await A.waitForReady();const e=A.client,t=C.MetadataProvider.getInstance().getMetadata(),i=await e.getAllAcpRegistries({metadata:t});return JSON.parse(i.registryJson||"{}")}catch(A){Q.acpOutputChannel.appendLine(`Error fetching registry from server: ${String(A)}`)}return{version:"1.0.0",agents:[]}}},e.LocalRegistry=class extends u{filePath;constructor(){super(),this.filePath=r.join((0,B.getWindsurfConfigDirectory)(),"acp","registry.json")}async fetch(){try{const A=await s.workspace.fs.readFile(s.Uri.file(this.filePath)),e=(new TextDecoder).decode(A);return JSON.parse(e)}catch(A){return Q.acpOutputChannel.appendLine(`Error loading local registry: ${String(A)}`),{version:"1.0.0",agents:[]}}}}},89601(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{this.outputChannel.error(`Initialization failed: ${String(A)}`)})}static tryCreate(A,e,t){if((0,r.resolveAgentCommand)(e,t,process.platform,process.arch))try{return new C(A,e,t)}catch(A){return void I.acpOutputChannel.appendLine(`Failed to create connector for "${e.id}": ${String(A)}`)}else I.acpOutputChannel.appendLine(`Skipping agent "${e.id}": no supported distribution for this platform`)}}e.RegistryAcpConnector=C},21508(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g"}}class l extends Q.WindsurfAcpConnector{id;transport="websocket";command="";args=[];_url;_displayName;_ws=null;_buildAuthenticatedUrl(){if(this.id!==E)return this._url;const A=C.MetadataProvider.getInstance(),e=A.planInfo?.devinInfo;if(void 0===e||""===e.webappHost)return this._url;const t=new URL(this._url);this.outputChannel.info(`[devin-connect] _buildAuthenticatedUrl: before rewrite: hostname="${t.hostname}" webappHost="${e.webappHost}" fullUrl="${c(t.toString())}"`),t.host=e.webappHost,"localhost"===t.hostname||"127.0.0.1"===t.hostname?t.protocol="ws:":t.protocol="wss:",this.outputChannel.info(`[devin-connect] _buildAuthenticatedUrl: after rewrite: hostname="${t.hostname}" protocol="${t.protocol}" port="${t.port}" fullUrl="${c(t.toString())}"`);let i=A.getMetadata().apiKey;return i.startsWith("devin-session-token$")&&(i=i.slice(20)),""!==i&&t.searchParams.set("token",i),t.toString()}_reconnectTimer=null;_reconnectAttempts=0;_disposed=!1;_hasShownDisconnectNotification=!1;_deferredConnectCleanups=[];constructor(A,e,t,i){super(A),this.id=e,this._url=t,this._displayName=i}static tryCreate(A,e,t){const i=e.distribution.websocket;if(void 0===i)return void B.acpOutputChannel.appendLine(`Skipping agent "${e.id}": no websocket distribution`);const n=new l(A,e.id,i.url,e.name);return e.id===E?n._waitForDevinInfoThenConnect():n.connect().catch(A=>{B.acpOutputChannel.error(`Failed to connect remote agent "${e.id}": ${String(A)}`)}),n}connect(){if(this._disposed)return Promise.resolve();const A=this._buildAuthenticatedUrl();return this.outputChannel.info(`Connecting to remote ACP: ${c(A)}`),new Promise((e,t)=>{const i=new I.default(A);this._ws=i;let n=!1;i.once("open",()=>{this.outputChannel.info("WebSocket connected"),this.createConnection((0,a.webSocketStream)(i)),this.initialize().then(()=>{this._reconnectAttempts=0,this._hasShownDisconnectNotification=!1,n||(n=!0,e())},A=>{this.outputChannel.error(`ACP initialize failed: ${A instanceof Error?A.message:String(A)}`),n||(n=!0,t(A instanceof Error?A:new Error(String(A)))),i.close(1011,"ACP initialize failed")})}),i.once("error",A=>{this.outputChannel.error(`WebSocket error: ${A.message}`),n||(n=!0,t(A))}),i.on("close",(A,e)=>{const o=e.toString();this.outputChannel.info(`WebSocket closed: code=${A} reason=${o}`),this._ws===i&&(this.connection=null,this._ws=null,this.setConnected(!1),this._hasShownDisconnectNotification||this._disposed||(this._hasShownDisconnectNotification=!0)),n||(n=!0,t(new Error(`WebSocket closed before initialize completed (code=${A})`))),this._scheduleReconnect()})})}getConnection(){if(null===this.connection)throw new Error("Remote ACP is disconnected.");return this.connection}async sendRequest(A,e){try{return await super.sendRequest(A,e)}catch(e){if(e instanceof a.AcpConnectionClosedError)throw this.outputChannel.info(`Request "${A.method}" failed due to closed connection`),new Error("Remote ACP is disconnected.");throw e}}_scheduleReconnect(){if(this._disposed)return;if(null!==this._reconnectTimer)return;if(this._reconnectAttempts>=5)return this.outputChannel.error("Max reconnection attempts (5) reached. Giving up."),void r.window.showErrorMessage(`${this._displayName} reconnection failed after 5 attempts.`,{modal:!1},"Retry").then(A=>{"Retry"===A&&(this._reconnectAttempts=0,this._hasShownDisconnectNotification=!1,this.connect().catch(A=>{this.outputChannel.error(`Manual reconnection failed: ${String(A)}`)}))});const A=Math.min(1e3*Math.pow(2,this._reconnectAttempts),3e4);this._reconnectAttempts++,this.outputChannel.info(`Scheduling reconnection attempt ${this._reconnectAttempts} in ${A}ms`),this._reconnectTimer=setTimeout(()=>{if(this._reconnectTimer=null,this.id===E&&""===(C.MetadataProvider.getInstance().planInfo?.devinInfo?.webappHost??""))return this.outputChannel.info(`Skipping reconnect for "${this.id}": webappHost not available, will retry`),void this._scheduleReconnect();this.connect().catch(A=>{this.outputChannel.error(`Reconnection failed: ${String(A)}`)})},A)}_handleDevinCloudUnavailable(){this.outputChannel.info(`[devin-connect] User is logged in but devinInfo is unavailable; disabling "${this.id}"`),r.window.showErrorMessage("Devin Cloud is available only if you log in to Windsurf with Devin.");const A=r.workspace.getConfiguration("windsurf.acp"),e=A.get("enabledAgents")??{};A.update("enabledAgents",{...e,[E]:!1},r.ConfigurationTarget.Global)}_waitForDevinInfoThenConnect(){const A=C.MetadataProvider.getInstance();if(""!==(A.planInfo?.devinInfo?.webappHost??""))return this.outputChannel.info("[devin-connect] webappHost already available, connecting immediately"),void this.connect().catch(A=>{this.outputChannel.error(`Failed to connect remote agent "${this.id}": ${String(A)}`)});if(A.isUserLoggedIn()&&void 0!==A.planInfo&&void 0===A.planInfo.devinInfo)return void this._handleDevinCloudUnavailable();this.outputChannel.info(`[devin-connect] Deferring connection for "${this.id}" until devinInfo.webappHost is available`);let e=!1;const t=A.onDidUpdateAuthState(()=>{if(!e&&!this._disposed)return""!==(C.MetadataProvider.getInstance().planInfo?.devinInfo?.webappHost??"")?(e=!0,this._cleanupDeferredConnect(),this.outputChannel.info("[devin-connect] webappHost now available, calling connect()"),void this.connect().catch(A=>{this.outputChannel.error(`Failed to connect remote agent "${this.id}": ${String(A)}`)})):void(A.isUserLoggedIn()&&void 0!==A.planInfo&&void 0===A.planInfo.devinInfo&&this._handleDevinCloudUnavailable())});this._deferredConnectCleanups.push(t)}_cleanupDeferredConnect(){for(const A of this._deferredConnectCleanups)A.dispose();this._deferredConnectCleanups=[]}dispose(){this._disposed=!0,this._cleanupDeferredConnect(),null!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._ws&&(this._ws.close(1e3,"Connector disposed"),this._ws=null),super.dispose()}}e.RemoteAcpConnector=l},3036(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{this.outputChannel.info("Initialization complete")}).finally(()=>{A.dispose()})}_capabilities;get capabilities(){return this._capabilities}spawn(){if(this.process)return void this.outputChannel.debug("Process already running, skipping spawn");this.outputChannel.info(`Spawning process: ${this.command} ${this.args.join(" ")}`);const A=this.env;this.process=r.spawn(this.command,this.args,{stdio:["pipe","pipe","pipe"],shell:!0,detached:!0,...A?{env:{...process.env,...A}}:{}}),this.outputChannel.debug(`Process spawned with PID: ${this.process.pid}${A?` with env ${JSON.stringify(A)}`:""}`),this.process.stderr?.on("data",A=>{const e=A.toString().trim();this.outputChannel.warn(`[stderr] ${e}`)}),this.process.on("error",A=>{this.outputChannel.error(`[error] ${A.message}`)}),this.process.on("exit",(A,e)=>{this.outputChannel.info(`Process exited with code=${A??"null"}, signal=${e??"null"}`),this.process=null,this.connection=null});const e=this.process.stdout,t=this.process.stdin;if(!e||!t)throw new Error("Failed to get process stdio");const i=(0,I.ndJsonStream)(new WritableStream({write:A=>{t.write(A)}}),new ReadableStream({start:A=>{e.on("data",e=>{A.enqueue(e)}),e.on("end",()=>{A.close()})}}));this.createConnection(i)}createConnection(A){this.connection=new I.WindsurfAcpConnection({onClientRequest:A=>(this.outputChannel.trace(`Client request: ${A.method}`),this._host.handleClientRequest(this.id,A))},A),this.outputChannel.debug("Connection established")}async sendRequest(A,e){this.outputChannel.trace(`Sending request: ${A.method}`);const t=this.getConnection(),i=await t.sendRequest(A);return this.outputChannel.trace(`Received response for: ${A.method}`),"initialize"===A.method&&this.onInitialize(i),i}onInitialize(A){this.outputChannel.debug(`Initialized with capabilities: ${JSON.stringify(A.agentCapabilities)}`),this._capabilities=A.agentCapabilities??void 0,this._isRegistered||(this.outputChannel.info("Registering provider with host"),this._registration=this._host.registerConnection(this),this._isRegistered=!0),this._host.updateConnectionStatus(this.id,!0)}setConnected(A){this._host.updateConnectionStatus(this.id,A)}getConnection(){if(this.connection||this.spawn(),!this.connection)throw new Error("Failed to create connection");return this.connection}dispose(){if(this.outputChannel.debug("Disposing provider"),this._registration&&(this.outputChannel.debug("Unregistering provider"),this._registration.dispose(),this._registration=null,this._isRegistered=!1),this.process&&(this.outputChannel.debug(`Killing process PID: ${this.process.pid}`),void 0!==this.process.pid))try{process.kill(-this.process.pid)}catch{}this.process=null,this.connection=null}}},92486(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{this.requestUpdateEmitter.fire()})}getState(){return I.MetadataProvider.getInstance().isUserLoggedIn()?null:this.loggedOut}}},96163(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.UriEventHandler=void 0;const i=t(91398);class n extends i.EventEmitter{handleUri(A){this.fire(A)}}e.UriEventHandler=n},89884(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WindsurfAuthProvider=e.LoginScope=void 0;const i=t(91398),n=t(99),o=t(89271),g=t(52107),s=t(9673),r=t(83720),I=t(32266),a=t(46390),C=t(67894),B=t(70393),Q=t(96163),E=t(9525),c=t(20479);var l;!function(A){A.LOGIN="login",A.SIGNUP="signup",A.ONBOARDING="onboarding"}(l||(e.LoginScope=l={}));class u{context;_sessionChangeEmitter=new i.EventEmitter;_disposable;_uriHandler=new Q.UriEventHandler;static BASE_SESSIONS_SECRET_KEY="windsurf_auth.sessions";static BASE_API_SERVER_URL_SECRET_KEY="windsurf_auth.apiServerUrl";static getSessionsSecretKey(){return(0,B.isStaging)((0,a.getConfig)(a.Config.API_SERVER_URL))?`${u.BASE_SESSIONS_SECRET_KEY}.staging`:u.BASE_SESSIONS_SECRET_KEY}static getApiServerUrlSecretKey(){return(0,B.isStaging)((0,a.getConfig)(a.Config.API_SERVER_URL))?`${u.BASE_API_SERVER_URL_SECRET_KEY}.staging`:u.BASE_API_SERVER_URL_SECRET_KEY}_cachedSessions;_cancellationEmitter=new n.Emitter;_cancellationPromise=(0,C.promiseFromEvent)(this._cancellationEmitter.event).promise;forceCancellation(){this._cancellationEmitter.fire(),this._cancellationPromise=(0,C.promiseFromEvent)(this._cancellationEmitter.event).promise}static instance;constructor(A){this.context=A,this._disposable=i.Disposable.from(i.authentication.registerAuthenticationProvider(r.WindsurfExtensionMetadata.getInstance().authProviderId,"Windsurf Auth",this,{supportsMultipleAccounts:!1}),i.window.registerUriHandler(this._uriHandler),this._uriHandler.event(A=>{"/refresh-authentication-session"===A.path&&(0,c.refreshAuthenticationSession)()}),A.secrets.onDidChange(A=>this.handleSecretChange(A))),this.initializeCachedSessions()}async initializeCachedSessions(){this._cachedSessions=await this.getSecret()}async restartLanguageServerIfNeeded(A){(0,o.isString)(A)&&!(0,o.isEmpty)(A)&&A!==I.LanguageServerClient.getInstance().apiServerUrl&&await I.LanguageServerClient.getInstance().restart(A)}async handleSecretChange(A){if(A.key!==u.BASE_SESSIONS_SECRET_KEY&&A.key!==`${u.BASE_SESSIONS_SECRET_KEY}.staging`)return;if(A.key!==u.getSessionsSecretKey())return;if(void 0===this._cachedSessions)return;const e=await this.getSecret(),t=this._cachedSessions,i=new Set(e.map(A=>A.id)),n=new Set(t.map(A=>A.id)),o=e.filter(A=>!n.has(A.id)),g=t.filter(A=>!i.has(A.id)),s=o.length>0||g.length>0;if(this._cachedSessions=e,s){if(o.length>0){const A=await this.context.secrets.get(u.getApiServerUrlSecretKey());await this.restartLanguageServerIfNeeded(A)}this._sessionChangeEmitter.fire({added:o,removed:g,changed:[]})}}static initialize(A){u.instance||(u.instance=new u(A))}static getInstance(){if(!u.instance)throw new Error("WindsurfAuthProvider must be initialized first!");return u.instance}getContext(){return this.context}dispose(){this._disposable.dispose()}get onDidChangeSessions(){return this._sessionChangeEmitter.event}async getSecret(){try{const A=await this.context.secrets.get(u.getSessionsSecretKey());return void 0!==A&&""!==A?JSON.parse(A):[]}catch(A){console.error(A)}return[]}async getSessions(){return await this.getSecret()}async storeSessions(A){this._cachedSessions=A,await this.context.secrets.store(u.getSessionsSecretKey(),JSON.stringify(A))}get redirectUri(){const A=this.context.extension.packageJSON,e=A.publisher,t=A.name;return`${i.env.uriScheme}://${e}.${t}`}static handleUri(A){const e=new URLSearchParams(A.fragment).get("access_token");if(null===e)throw new Error("No token");return e}getLoginUrl(A){const{forceShowAuthToken:e=!1}=A||{},t=(0,g.v4)(),n=(0,a.isMultiTenantMode)(),o=new URLSearchParams([["response_type","token"],["client_id","3GUryQ7ldAeKEuD2obYnppsnmj58eP5u"],["redirect_uri",e?"show-auth-token":this.redirectUri],["state",t],["prompt","login"],["redirect_parameters_type",e?"query":"fragment"],["workflow",!0===A?.fromOnboarding?"onboarding":""]]),s=(0,B.isStaging)((0,a.getConfig)(a.Config.API_SERVER_URL))?"lastLoginEmail.staging":"lastLoginEmail",r=this.context.globalState.get(s);void 0!==r&&""!==r&&o.append("login_hint",r);let I="",C="";return n?(o.append("scope","openid profile email"),C="profile"):C=!0===A?.shouldRegisterNewUser?"windsurf/signup":"windsurf/signin",I=`${(0,a.getWebsite)()}/${C}?${o.toString()}`,i.Uri.parse(I,!0)}async login(A){return await i.window.withProgress({location:i.ProgressLocation.Notification,title:"Waiting for Windsurf authentication",cancellable:!0},async(e,t)=>{const n=this.getLoginUrl(A);(0,a.hasDevExtension)()&&console.log(`[Windsurf] Opening auth redirect URL: ${n.toString()}`),await i.env.openExternal(n);const o=(0,C.promiseFromEvent)(this._uriHandler.event);try{return await Promise.race([o.promise.then(A=>u.handleUri(A)),(0,C.promiseFromEvent)(t.onCancellationRequested).promise.then(()=>{throw new D}),this._cancellationPromise.then(()=>{throw new h})])}finally{o.cancel.fire()}})}async provideAuthToken(){const A=this.getLoginUrl({forceShowAuthToken:!0});(0,a.hasDevExtension)()&&console.log(`[Windsurf] Opening auth token URL: ${A.toString()}`),await i.env.openExternal(A);const e=await i.window.showInputBox({title:"Enter your Windsurf authentication token",placeHolder:"Paste your authentication token here",ignoreFocusOut:!0});if(void 0===e||""===e)throw new Error("Invalid authentication token");return await this.handleAuthToken(e)}async copyAuthTokenUrl(A=!1){const e=this.getLoginUrl({forceShowAuthToken:!0,fromOnboarding:A});await i.env.clipboard.writeText(decodeURIComponent(e.toString()))}async handleAuthToken(A){const e=await(0,E.registerUser)(A),{apiKey:t,name:i}=e,n=(0,B.getApiServerUrl)(e.apiServerUrl);if(!t)throw new s.AuthMalformedLanguageServerResponseError("Auth login failure: empty api_key");if(!i)throw new s.AuthMalformedLanguageServerResponseError("Auth login failure: empty name");const r={id:(0,g.v4)(),accessToken:t,account:{label:i,id:i},scopes:[]},I=(0,B.isStaging)((0,a.getConfig)(a.Config.API_SERVER_URL))?"apiServerUrl.staging":"apiServerUrl";return await this.context.globalState.update(I,n),(0,o.isString)(n)&&!(0,o.isEmpty)(n)&&await this.context.secrets.store(u.getApiServerUrlSecretKey(),n),this._cachedSessions=[r],await this.context.secrets.store(u.getSessionsSecretKey(),JSON.stringify([r])),await this.restartLanguageServerIfNeeded(n),this._sessionChangeEmitter.fire({added:[r],removed:[],changed:[]}),r}async createSession(A,e){const t=function(A){const e=A.join(";");return{shouldRegisterNewUser:e.includes(l.SIGNUP),fromOnboarding:e.includes(l.ONBOARDING)}}(A);try{const A=await this.login(t);return await this.handleAuthToken(A)}catch(A){if(!0===t.fromOnboarding||A instanceof h)throw A;let e=`Sign in failed: ${A}`;return A instanceof d?e="Sign in timed out. Having trouble? Provide your auth token manually.":A instanceof D&&(e="Sign in cancelled. Having trouble? Provide your auth token manually."),await Promise.race([(async()=>{if("Provide Auth Token"===await i.window.showErrorMessage(e,"Provide Auth Token"))try{return await this.provideAuthToken()}catch(A){throw console.error("Failed to provide auth token:",A),A}throw A})(),this._cancellationPromise.then(()=>{throw new h})])}}async removeSession(A){const e=await this.getSecret();if(e.length>0){const t=e.findIndex(e=>e.id===A);if(-1===t)return;const i=e[t];e.splice(t,1),this._cachedSessions=e,await this.context.secrets.store(u.getSessionsSecretKey(),JSON.stringify(e)),this._sessionChangeEmitter.fire({added:[],removed:[i],changed:[]})}}}e.WindsurfAuthProvider=u;class d extends Error{constructor(){super("Authentication timed out"),this.name="AuthenticationTimeoutError"}}class h extends Error{constructor(){super("Authentication cancelled programmatically"),this.name="AuthenticationCancelledError"}}class D extends Error{constructor(){super("Authentication cancelled by user"),this.name="AuthenticationUserCancelledError"}}},9525(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.registerUser=async function(A){const e=(0,I.getRegisterApiServerUrl)(),t=(0,n.createConnectTransport)({baseUrl:e,useBinaryFormat:!0,httpVersion:"1.1"}),a=(0,i.createPromiseClient)(g.SeatManagementService,t);try{return await a.registerUser({firebaseIdToken:A})}catch(A){if((0,s.sentryCaptureException)(A),(0,r.hasDevExtension)()&&console.error(A),A instanceof i.ConnectError&&A.code===i.Code.Unauthenticated){const e=new o.InvalidAuthTokenError("invalid auth token");throw e.cause=A,e}throw new Error("Problem with login service, please try again or check your connection.",{cause:A})}};const i=t(62573),n=t(58690),o=t(9673),g=t(18860),s=t(4103),r=t(46390),I=t(70393)},48595(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getAuthSession=void 0;const i=t(91398),n=t(83720),o=t(89884);e.getAuthSession=async A=>{const e={silent:void 0===A?.promptLoginIfNone};return!0===A?.promptLoginIfNone&&(e.createIfNone=!0),await i.authentication.getSession(n.WindsurfExtensionMetadata.getInstance().authProviderId,[!0===A?.shouldRegisterNewUser?o.LoginScope.SIGNUP:o.LoginScope.LOGIN,!0===A?.fromOnboarding?o.LoginScope.ONBOARDING:""],e)}},20479(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{A&&s.windsurfAuth.setProfileUrl(A)}).catch(A=>{(0,u.sentryCaptureException)(A)})}catch(A){(0,u.sentryCaptureException)(A)}e===N.AuthSessionChangeType.AuthenticationEvent&&(0,M.showWelcomeMessageForLogin)(A)},e.onUserStatusUnavailable=async function(A){const e=c.MetadataProvider.getInstance(),t=e.getMetadata().apiKey;return A instanceof r.ConnectError&&(A.code===r.Code.Unavailable||A.code===r.Code.DeadlineExceeded)?((0,p.fireSelfDismissingNotification)({location:s.ProgressLocation.Notification,title:"Unable to connect Windsurf. Some AI features may not work.",durationMilliseconds:5e3}),!0):((async()=>{"Copy API Key"===await s.window.showErrorMessage(`Failed to log in: ${A.message}`,"Copy API Key")&&s.env.clipboard.writeText(t)})(),(0,u.sentryCaptureException)(A),console.error("Error during login process:",A),(await(0,f.getAuthSession)())?.accessToken===t||e.clearAuthentication(),!1)},e.registerAuthHandlers=function(A){const e=y.WindsurfAuthProvider.getInstance(),t=C.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS;A.subscriptions.push(s.commands.registerCommand(t.PROVIDE_AUTH_TOKEN_TO_AUTH_PROVIDER,async A=>{try{return{session:await e.handleAuthToken(A),error:void 0}}catch(A){return A instanceof a.WindsurfError?{error:A.errorMetadata}:{error:C.WindsurfExtensionMetadata.getInstance().errorCodes.GENERIC_ERROR}}}),s.commands.registerCommand(t.LOGIN_WITH_REDIRECT,async(A,e)=>{(k||G)&&await F(),k=void 0;const t=(0,f.getAuthSession)({promptLoginIfNone:!0,shouldRegisterNewUser:A,fromOnboarding:e}).catch(A=>{if(!L(A))throw(0,u.sentryCaptureException)(A),console.error("Error during login with redirect:",A),A});k=t;try{return await t}finally{k===t&&(k=void 0)}}),s.commands.registerCommand(t.LOGIN_WITH_AUTH_TOKEN,()=>{e.provideAuthToken()}),s.commands.registerCommand(t.CANCEL_LOGIN,()=>F()),s.commands.registerCommand(t.LOGOUT,async()=>{const A=y.WindsurfAuthProvider.getInstance(),e=await A.getSessions();e.length>0&&await A.removeSession(e[0].id)})),e.onDidChangeSessions(()=>S(N.AuthSessionChangeType.AuthenticationEvent))},e.refreshAuthenticationSession=async function(){await S(N.AuthSessionChangeType.AuthenticationRefreshEvent)},e.initializeAuthSession=async function(){await S(N.AuthSessionChangeType.ExtensionStartup)};const s=g(t(91398)),r=t(62573),I=t(7540),a=t(9673),C=t(83720),B=t(98224),Q=t(29076),E=t(32266),c=t(94168),l=t(81871),u=t(4103),d=t(82492),h=t(6405),D=t(46390),p=t(20590),w=t(79106),m=t(70393),y=t(89884),f=t(48595),R=t(21772),N=t(91548),M=t(71478);async function S(A){await s.onboardedInCurrentAppSession();const e=c.MetadataProvider.getInstance(),t=l.ChatPanelProvider.getInstance(),i=E.LanguageServerClient.getInstance(),n=await(0,f.getAuthSession)(),o=n?.accessToken;if(void 0===o||""===o)return e.clearAuthentication(),t.setApiKey(void 0),h.StatusBar.getInstance().setAuthStatus(!1),s.windsurfAuth.setAuthStatus(null),s.windsurfAuth.setProfileUrl(null),void await w.ExtensionStorage.getInstance().setStoredValue(I.STATE_IDS.PENDING_API_KEY_MIGRATION,void 0);const g=w.ExtensionStorage.getInstance().getStoredValue(I.STATE_IDS.PENDING_API_KEY_MIGRATION)??o;if(!i.started)return;e.updateApiKey(g);const r=e.getMetadata();try{await i.client.initializeCascadePanelState({metadata:r,workspaceTrusted:s.workspace.isTrusted}),await i.checkOrWaitForUserStatusAuth(r,A)}catch(A){(0,u.sentryCaptureException)(A),console.error("Unexpected error during authentication:",A)}}let k,G;function L(A){return A instanceof Error&&("AuthenticationCancelledError"===A.name||"AuthenticationUserCancelledError"===A.name)}async function F(){if(G)return G;const A=(async()=>{const A=k;if(A){y.WindsurfAuthProvider.getInstance().forceCancellation();try{await A}catch(A){L(A)||((0,u.sentryCaptureException)(A),console.error("Error while waiting for in-flight login to cancel:",A))}finally{k===A&&(k=void 0)}}})();G=A;try{await A}finally{G===A&&(G=void 0)}}},21772(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.prepareProfilePictureBase64=async function(A){try{const e=await i.Jimp.read(A);return`data:image/png;base64,${(await e.resize({w:100,h:100}).getBuffer("image/png")).toString("base64")}`}catch(A){throw console.error("Error processing image:",A),A}};const i=t(82604)},91548(A,e){"use strict";var t;Object.defineProperty(e,"__esModule",{value:!0}),e.AuthSessionChangeType=void 0,function(A){A.ExtensionStartup="extensionStartup",A.AuthenticationEvent="authenticationEvent",A.AuthenticationRefreshEvent="authenticationRefreshEvent"}(t||(e.AuthSessionChangeType=t={}))},71478(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{const A=s.window.activeTerminal;if(!A)return;let e=this.popups.get(A);e?e.focus():(e=A.createCommandPopup(),this.popups.set(A,e),e.focus(),e.onDidClose(()=>{this.cleanupPopup(A,e)}),e.onDidSubmitInstruction(t=>{this.handleSubmitInstruction(A,e,t)}),e.onDidAccept(()=>{this.handleAccept(A,e)}),e.onDidReject(()=>{this.handleReject(A,e)}),e.onDidRun(()=>{this.handleRun(A,e)}))}),s.commands.registerCommand(e.TERMINAL_COMMAND_RUN,()=>{const A=s.window.activeTerminal;if(!A)return;const e=this.popups.get(A);e&&this.handleRun(A,e)}),s.commands.registerCommand(e.TERMINAL_COMMAND_ACCEPT,()=>{const A=s.window.activeTerminal;if(!A)return;const e=this.popups.get(A);e&&this.handleAccept(A,e)}),s.commands.registerCommand(e.TERMINAL_COMMAND_REJECT,()=>{const A=s.window.activeTerminal;if(!A)return;const e=this.popups.get(A);e&&this.handleReject(A,e)}))}cleanupPopup(A,e){e.dispose(),s.commands.executeCommand("setContext",r.WindsurfExtensionMetadata.getInstance().EXTENSION_CONTEXT_KEYS.CAN_TRIGGER_TERMINAL_COMMAND_ACTION,!1),this.popups.delete(A),this.prevPendingCompletionIds.delete(A)}async handleSubmitInstruction(A,e,t){let i;e.setLoadingState(!0),void 0!==A.shellIntegration?.cwd&&(i=A.shellIntegration.cwd.fsPath);const n=this.getTerminalCommandStream(A,t,i);let o="",g="";try{for await(const e of n)this.prevPendingCompletionIds.set(A,e.completionId),e.command&&(o=e.command),e.explanation&&(g=e.explanation);o=o.trim(),o.includes("\n")&&(o=o.replace(/\n/g," "));const e=await(0,E.getTerminalId)(A),i=this.conversationHistory.get(e)||[];i.push({userPrompt:t.instruction,generatedCommand:o,explanation:g||void 0}),i.length>5&&i.splice(0,i.length-5),this.conversationHistory.set(e,i),(0,E.clearTerminalLine)(A),A.sendText(o,!1),s.commands.executeCommand("setContext",r.WindsurfExtensionMetadata.getInstance().EXTENSION_CONTEXT_KEYS.CAN_TRIGGER_TERMINAL_COMMAND_ACTION,!0)}catch(A){e.showNotification(A instanceof Error?A.message:String(A),s.CommandPopupNotificationType.ERROR)}finally{e.setLoadingState(!1)}}handleRun(A,e){A.sendText(""),this.cleanupPopup(A,e)}handleAccept(A,e){this.cleanupPopup(A,e)}handleReject(A,e){(0,E.clearTerminalLine)(A),this.cleanupPopup(A,e)}async*getTerminalCommandStream(A,e,t){const i=(0,E.getShellName)(A),n=C.LanguageServerClient.getInstance(),o=B.MetadataProvider.getInstance().getMetadata(),g=(0,c.getPlatformArch)(),s=await(0,E.getTerminalId)(A),r={terminalId:s,platform:g===c.PlatformArch.UNSUPPORTED?"":g,cwd:t??"",shellName:i},I=l(e),a=this.conversationHistory.get(s)||[];try{yield*n.client.handleStreamingTerminalCommand({metadata:o,commandText:e.instruction,terminalCommandData:r,model:I,conversationHistory:a})}catch(A){throw new Error(`Failed to handle streaming terminal command: ${A instanceof Error?A.message:String(A)}`)}}async*getCommandStream(A,e,t){const i=(0,E.getShellName)(A),n=new I.Document({absoluteUri:`codeium-terminal://${A.name}`,workspaceUri:`codeium-terminal://${A.name}`,text:"",editorLanguage:i,language:void 0,cursorOffset:BigInt(0),lineEnding:"\n"}),o=C.LanguageServerClient.getInstance(),g={tabSize:BigInt(4),insertSpaces:!0,disableAutocompleteInComments:!0},s=B.MetadataProvider.getInstance().getMetadata(),r=l(e),Q=(0,c.getPlatformArch)(),u={terminalId:await(0,E.getTerminalId)(A),platform:Q===c.PlatformArch.UNSUPPORTED?"":Q,cwd:t,shellName:i};try{yield*o.client.handleStreamingCommand({metadata:s,document:n,editorOptions:g,diffType:a.DiffType.UNIFIED,requestSource:I.CommandRequestSource.TERMINAL,selectionStartLine:BigInt(0),selectionEndLine:BigInt(0),commandText:e.instruction,requestedModelId:r,terminalCommandData:u,parentCompletionId:this.prevPendingCompletionIds.get(A)??""})}catch(A){throw new Error(`Failed to handle streaming command: ${A instanceof Error?A.message:String(A)}`)}}}},2872(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{try{(0,B.initializeCommitTelemetry)()}catch(A){(0,I.sentryCaptureException)(A),console.error("Failed to initialize commit telemetry",A)}const e=new C.GenerateCommitMessageController;A.subscriptions.push(s.commands.registerCommand(r.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.GENERATE_COMMIT_MESSAGE,async A=>{if(void 0===A){const e=(0,a.maybeGitApi)();e?.repositories.forEach(e=>{void 0===A&&(A=e.rootUri.path)})}void 0!==A?(s.commands.executeCommand("workbench.view.scm"),await e.generateCommitMessage(A)):s.window.showErrorMessage("It looks like you do not have a git repository opened.")})),A.subscriptions.push(s.commands.registerCommand(r.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.CANCEL_GENERATE_COMMIT_MESSAGE,()=>{e.cancelGeneration()}))}},41281(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{const e=A instanceof Error?A.message:"Unknown error",t=`Error generating commit message: ${e}`;s.window.showErrorMessage(t),l.ProductAnalyticsLogger.getInstance().logEvent(a.ProductEventType.WS_GENERATE_COMMIT_MESSAGE_ERRORED,void 0,void 0,{message:e})},t=new AbortController,i=t.signal;if(!B.MetadataProvider.getInstance().planInfo?.canGenerateCommitMessages)return s.window.showErrorMessage("AI commit message generation is only available for users on a paid plan.","Upgrade Plan").then(A=>{"Upgrade Plan"===A&&s.commands.executeCommand(I.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.OPEN_PRICING_PAGE)}),{promise:Promise.resolve(),abort:t};const n=(0,E.getGitRepository)(s.Uri.file(A));if(null===n)return e(new Error("No git repository found")),{promise:Promise.resolve(),abort:t};const o=n.generateCommitMessageButton;return o.isGenerating=!0,{promise:(async()=>{try{const A=await C.LanguageServerClient.getInstance().client.generateCommitMessage({metadata:B.MetadataProvider.getInstance().getMetadata(),planInfo:B.MetadataProvider.getInstance().planInfo},{signal:i});if(0===A.commitMessages.length)throw new Error("No commit message generated");let e;if(A.commitMessages.forEach(A=>{s.Uri.file(A.repoRoot).toString()===n.rootUri.toString()&&(e=A.commitMessageSummary)}),void 0===e)e=A.commitMessages[0].commitMessageSummary,c.logger.info("[Generate Commit Message] No repository matched, using first one as fallback"),l.ProductAnalyticsLogger.getInstance().logEvent(a.ProductEventType.WS_GENERATE_COMMIT_MESSAGE_ERRORED,void 0,void 0,{message:"No repository matched",isSilent:"true"});else if(""===e)throw new Error("Generated message is empty");n.inputBox.value=e}catch(A){A instanceof r.ConnectError&&A.code===r.Code.Canceled?l.ProductAnalyticsLogger.getInstance().logEvent(a.ProductEventType.WS_CANCELED_GENERATE_COMMIT_MESSAGE):((0,Q.sentryCaptureException)(A),e(A))}finally{o.isGenerating=!1}})(),abort:t}}}},47926(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.initializeCommitTelemetry=void 0;const i=t(48271),n=t(98224),o=t(29076),g=t(32266),s=t(94168),r=t(4103),I=t(52300),a=t(87503);e.initializeCommitTelemetry=()=>{(0,I.forEachRepository)(A=>{A.onDidCommit(()=>(async A=>{const e=A.rootUri.fsPath;try{const t=A.state.HEAD;if(void 0===t)return void console.warn(`[Windsurf Commit] No commit found for ${e}`);const r=t.commit;if(void 0===r)return void console.warn(`[Windsurf Commit] No commit found for ${e}`);const I=await A.getCommit(r);let C;I.parents.length>0&&(I.parents.length>1&&console.warn(`Multiple parents found for commit ${r} in ${e}. Using first parent: ${I.parents[0]}`),C=I.parents[0]),g.LanguageServerClient.getInstance().client.recordCommitMessageSave(new o.RecordCommitMessageSaveRequest({metadata:s.MetadataProvider.getInstance().getMetadata(),repoRoot:e,branchName:t.name,commitHash:r,commitMessage:I.message,commitTimestamp:I.authorDate?i.Timestamp.fromDate(I.authorDate):i.Timestamp.now(),parentCommitHash:C,authorName:I.authorName,authorEmail:I.authorEmail})),a.ProductAnalyticsLogger.getInstance().logEvent(n.ProductEventType.WS_CLICKED_COMMIT_FROM_SCM_PANEL)}catch(A){(0,r.sentryCaptureException)(A),console.error(`[Windsurf Commit] Failed to get commit for '${e}'`,A)}})(A))})}},12767(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AnnoyanceManager=e.AnnoyanceManagerRestriction=void 0;const i=t(11788);var n;!function(A){A.ALLOW_ALL="allowAll",A.BLOCK_INLINE_RENDERS="blockInlineRenders",A.BLOCK_DUE_TO_INACTIVITY="blockDueToInactivity"}(n||(e.AnnoyanceManagerRestriction=n={})),e.AnnoyanceManager=class{intentionalRejectionTimestamps=[];autoRejectionTimestamps=[];lastEditTimestamp=Date.now();inlinePreventionThresholdMs=2e4;inlinePreventionMaxIntentionalRejections=2;inlinePreventionMaxAutoRejections=4;inactivityThresholdMs=15e3;constructor(){this.inlinePreventionThresholdMs=i.UnleashProvider.getInstance().getNumberVariant("ANNOYANCE_MANAGER_INLINE_PREVENTION_THRESHOLD_MS")??this.inlinePreventionThresholdMs,this.inlinePreventionMaxIntentionalRejections=i.UnleashProvider.getInstance().getNumberVariant("ANNOYANCE_MANAGER_INLINE_PREVENTION_MAX_INTENTIONAL_REJECTIONS")??this.inlinePreventionMaxIntentionalRejections,this.inlinePreventionMaxAutoRejections=i.UnleashProvider.getInstance().getNumberVariant("ANNOYANCE_MANAGER_INLINE_PREVENTION_MAX_AUTO_REJECTIONS")??this.inlinePreventionMaxAutoRejections,this.inactivityThresholdMs=i.UnleashProvider.getInstance().getNumberVariant("ANNOYANCE_MANAGER_INACTIVITY_THRESHOLD_MS")??this.inactivityThresholdMs}markIntentionalRejection(){this.intentionalRejectionTimestamps.push(Date.now())}markAutoRejection(){this.autoRejectionTimestamps.push(Date.now())}getRecentRejections(A){const e=Date.now()-this.inlinePreventionThresholdMs;return A.filter(A=>A>e)}markAccept(){this.autoRejectionTimestamps=[],this.intentionalRejectionTimestamps=[]}markEdit(){this.lastEditTimestamp=Date.now()}checkRestriction(){if(Date.now()-this.lastEditTimestamp>this.inactivityThresholdMs)return n.BLOCK_DUE_TO_INACTIVITY;const A=this.getRecentRejections(this.intentionalRejectionTimestamps),e=this.getRecentRejections(this.autoRejectionTimestamps);return this.intentionalRejectionTimestamps=A,this.autoRejectionTimestamps=e,A.length>=this.inlinePreventionMaxIntentionalRejections||e.length>=this.inlinePreventionMaxAutoRejections?n.BLOCK_INLINE_RENDERS:n.ALLOW_ALL}}},49299(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g1e3||(0,I.isProbablyPassword)(A)||this.lastEntry&&this.lastEntry.content===A||(this.lastEntry={content:A,timestamp:Date.now()}))}getRecentClipboardEntry(A=5e3){return r.UserSettingBroadcaster.getInstance().userSettings.useClipboardForCompletions&&this.lastEntry&&Date.now()-this.lastEntry.timestamp<=A&&""!==this.lastEntry.content?this.lastEntry.content:null}}e.ClipboardReader=a},35575(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.comment=function(A,e){const i=t.get(e);if(i){const e=""===i.end?"":" "+i.end;return`${i.start} ${A}${e}`}return A};const t=new Map([["abap",{start:'"',end:""}],["bat",{start:"REM",end:""}],["bazel",{start:"#",end:""}],["bibtex",{start:"%",end:""}],["blade",{start:"#",end:""}],["c",{start:"//",end:""}],["clojure",{start:";",end:""}],["coffeescript",{start:"//",end:""}],["cpp",{start:"//",end:""}],["csharp",{start:"//",end:""}],["css",{start:"/*",end:"*/"}],["dart",{start:"//",end:""}],["dockerfile",{start:"#",end:""}],["elixir",{start:"#",end:""}],["erb",{start:"<%#",end:"%>"}],["erlang",{start:"%",end:""}],["fsharp",{start:"//",end:""}],["go",{start:"//",end:""}],["groovy",{start:"//",end:""}],["haml",{start:"-#",end:""}],["handlebars",{start:"{{!",end:"}}"}],["html",{start:"\x3c!--",end:"--\x3e"}],["ini",{start:";",end:""}],["java",{start:"//",end:""}],["javascript",{start:"//",end:""}],["javascriptreact",{start:"//",end:""}],["jsonc",{start:"//",end:""}],["jsx",{start:"//",end:""}],["julia",{start:"#",end:""}],["kotlin",{start:"//",end:""}],["latex",{start:"%",end:""}],["less",{start:"//",end:""}],["lua",{start:"--",end:""}],["makefile",{start:"#",end:""}],["markdown",{start:"[]: #",end:""}],["objective-c",{start:"//",end:""}],["objective-cpp",{start:"//",end:""}],["perl",{start:"#",end:""}],["php",{start:"//",end:""}],["ql",{start:"//",end:""}],["powershell",{start:"#",end:""}],["pug",{start:"//",end:""}],["python",{start:"#",end:""}],["r",{start:"#",end:""}],["razor",{start:"\x3c!--",end:"--\x3e"}],["ruby",{start:"#",end:""}],["rust",{start:"//",end:""}],["sass",{start:"//",end:""}],["scala",{start:"//",end:""}],["scss",{start:"//",end:""}],["shellscript",{start:"#",end:""}],["slim",{start:"/",end:""}],["solidity",{start:"//",end:""}],["sql",{start:"--",end:""}],["stylus",{start:"//",end:""}],["svelte",{start:"\x3c!--",end:"--\x3e"}],["swift",{start:"//",end:""}],["terraform",{start:"#",end:""}],["tex",{start:"%",end:""}],["typescript",{start:"//",end:""}],["typescriptreact",{start:"//",end:""}],["vb",{start:"'",end:""}],["vue-html",{start:"\x3c!--",end:"--\x3e"}],["vue",{start:"//",end:""}],["xml",{start:"\x3c!--",end:"--\x3e"}],["xsl",{start:"\x3c!--",end:"--\x3e"}],["yaml",{start:"#",end:""}]])},41782(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g=10;)this.filteredCompletions.shift();this.filteredCompletions.push(A)}sendFilteredCompletionsDetailedView(){const A=this.filteredCompletions.map(A=>this.comment(A));(0,a.hasDevExtension)()&&s.commands.executeCommand(r.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.DEV_UPDATE_TAB_DETAILED_VIEW,A.join("\n"))}clearFilteredCompletions(){this.filteredCompletions=[]}getDetailedViewData(){return this.lastDetailedView}generateDetailedView(){if(!(0,a.hasDevExtension)())return;const A=[],e=e=>{A.push(this.horizontalRule("=")),A.push(this.comment(e)),A.push(this.horizontalRule("=")),A.push("")},t=this.completionInfo?.completion;if(!t)return A.push(this.comment("No completion data available")),this.lastDetailedView={content:A.join("\n"),type:B.CompletionType.NONE},void((0,a.hasDevExtension)()&&s.commands.executeCommand(r.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.DEV_UPDATE_TAB_DETAILED_VIEW,this.lastDetailedView.content));A.push(this.comment(`Windsurf Tab Detailed View: ${t.type}`)),t.type===B.CompletionType.SUPERCOMPLETE&&A.push(this.comment(Q("Request UID",t.result.completion.response.requestUid))),A.push(this.horizontalRule("="));const i=this.documentInfo?.uri.path??"N/A",n=this.documentInfo?.languageId??"N/A";if(A.push(this.comment(Q("Document",i))),A.push(this.comment(Q("Language",n))),t.type===B.CompletionType.QUICK_ACTION)return A.push(this.comment(Q("Line",t.result.line))),A.push(this.comment(Q("Title",t.result.title))),A.push(this.comment(Q("Diagnostic Name",t.result.diagnosticName))),A.push(this.horizontalRule("=")),this.lastDetailedView={content:A.join("\n"),type:B.CompletionType.QUICK_ACTION},void((0,a.hasDevExtension)()&&s.commands.executeCommand(r.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.DEV_UPDATE_TAB_DETAILED_VIEW,this.lastDetailedView.content));let o;if(t.type===B.CompletionType.SUPERCOMPLETE)o=t.result.completion.response,A.push(this.comment(Q("Retool Link: ",`https://exafunction.retool.com/apps/b9412a18-63c8-11ef-8e93-573ca9cceee4/Supercomplete%20Inspect?completion_id=${o.completionId}`)));else{if(t.type!==B.CompletionType.TAB_JUMP)return A.push(this.comment("Completion type not supported")),this.lastDetailedView={content:A.join("\n"),type:B.CompletionType.NONE},void((0,a.hasDevExtension)()&&s.commands.executeCommand(r.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.DEV_UPDATE_TAB_DETAILED_VIEW,this.lastDetailedView.content));o=t.result.response}if(e("Request Information"),t.type===B.CompletionType.SUPERCOMPLETE){const e=t.result.completion.range;A.push(this.comment(Q("Range",`${e.start.line}:${e.start.character} - ${e.end.line}:${e.end.character}`)))}else{const e=t.result.jumpPosition;A.push(this.comment(Q("Jump Position",`${e.line}:${e.character}`)))}if(e("Response Information"),A.push(this.comment(Q("Completion ID",o.completionId))),"diff"===o.suggestion.case&&(A.push(this.comment(Q("Selection Range",`${o.suggestion.value.selectionStartLine} - ${o.suggestion.value.selectionEndLine}`))),o.suggestion.value.characterDiff?.changes)){e("Diff Information");for(const e of o.suggestion.value.characterDiff.changes){const t=e.type===I.DiffChangeType.INSERT?"+":e.type===I.DiffChangeType.DELETE?"-":" ";A.push(`${t} ${JSON.stringify(e.text)}`)}}o.filterReason&&(e("Filter Information"),A.push(this.comment(Q("Filter Reason",JSON.stringify(o.filterReason)))));const g=this.completionInfo?.midstreamAutocomplete??!1,C=this.completionInfo?.midstreamAutocompleteInsertText??"";this.completionType===B.CompletionType.AUTOCOMPLETE&&(e("Autocomplete Information"),g?(A.push(this.comment("Midstream autocomplete")),A.push(this.comment(Q("Insert Text",C)))):A.push(this.comment("Converted autocomplete"))),this.lastDetailedView={content:A.join("\n"),type:this.completionType},this.completionType===B.CompletionType.AUTOCOMPLETE&&g&&(this.lastDetailedView.midstreamAutocompleteInsertText=C),(0,a.hasDevExtension)()&&s.commands.executeCommand(r.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.DEV_UPDATE_TAB_DETAILED_VIEW,this.lastDetailedView.content)}comment(A){return(0,C.comment)(A,this.documentInfo?.languageId??"")}horizontalRule(A){return this.comment(A.repeat(100))}}e.CompletionDetailedViewProvider=E},14655(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{s.commands.executeCommand("editor.action.inlineSuggest.trigger")}),s.window.onDidChangeActiveTextEditor(()=>{for(const A of s.window.visibleTextEditors)this.resetAllAndProvideFeedback(A);s.commands.executeCommand("editor.action.inlineSuggest.trigger")}),s.workspace.onDidFinishSearch(A=>{(0,R.searchEventToLS)(A)}),I.LintManager.getInstance().onDidLintsChange(()=>{(0,y.lintsToLs)()})}handleDidShowCompletionItem(A){A.command&&""!==A.command.title&&(this.activeAutocompleteCompletion={id:A.command.title,renderTimestamp:Date.now()})}async provideInlineCompletionItems(A,e,t){return await(0,c.sentryStartSpan)(void 0,"provideInlineCompletionItems",async i=>{if(b.testingState===Y.DISABLE_ALL)return;const n=performance.now(),o=await this.provideInlineCompletionItemsInternal(i,A,e,t),g=performance.now();return(0,u.hasDevExtension)()&&console.debug(`provideInlineCompletionItems took ${g-n}ms`),o})}async provideInlineCompletionItemsInternal(A,e,t,i){if("scminput"===e.languageId)return;this.activeAutocompleteCompletion&&i.activeCompletionId!==this.activeAutocompleteCompletion.id&&(Q.LanguageServerClient.getInstance().client.provideCompletionFeedback({metadata:E.MetadataProvider.getInstance().getMetadata(),completionId:this.activeAutocompleteCompletion.id,isAccepted:!1,source:a.ProviderSource.AUTOCOMPLETE,document:(0,D.getDocumentInfo)({document:e,position:t}),feedbackDelayMs:BigInt(Date.now()-this.activeAutocompleteCompletion.renderTimestamp),...(0,G.additionalDataForFeedback)()}),void 0!==i.activeCompletionId&&""!==i.activeCompletionId?this.activeAutocompleteCompletion={id:i.activeCompletionId,renderTimestamp:Date.now()}:this.activeAutocompleteCompletion=void 0);const n=s.window.activeTextEditor;if(!n)return;if(r.ActiveCommandState.getInstance().hasActiveCommandPopupForUri(n.document.uri.toString()))return(0,u.hasDevExtension)()&&console.log("[CompletionProvider] Command popup is active in this editor, not providing completions"),void this.resetAllAndProvideFeedback(n);const o=n.selections[0].start,g=n.selections[0].end;if(o.line!==g.line||o.character!==g.character)return(0,u.hasDevExtension)()&&console.log("[CompletionProvider] returning because of non-point selection"),void this.resetAllAndProvideFeedback(n,!1);let I=await this.triggerManager.checkAndUpdate(n,t);if(!I.textChanged&&!I.cursorMovedChar&&!I.cursorMovedLine){if(I.acceptedCompletion!==_.AUTOCOMPLETE||!this.prevDocUpdateState)return(0,u.hasDevExtension)()&&console.log("[CompletionProvider] returning because no notable changes"),this.lastResultPromise;I={...this.prevDocUpdateState,acceptedCompletion:I.acceptedCompletion},(0,u.hasDevExtension)()&&console.log("[CompletionProvider] Overriding docUpdateState with old state",I)}return this.prevDocUpdateState=I,this.lastResultPromise=this._provideInlineCompletionItems(A,n,e,t,i,I),this.lastResultPromise}isCompletionAllowed(A){if(b.testingState===Y.ENABLE_ALL)return!0;const e=(0,u.getConfig)(u.Config.COMPLETION_MODE),t=l.UserSettingBroadcaster.getInstance().userSettings.tabToJump===a.TabToJump.DISABLED;return A===_.SUPERCOMPLETE||A===_.AUTOCOMPLETE?"off"!==e:A!==_.TAB_JUMP||!t}async _provideInlineCompletionItems(A,e,t,i,n,o){return await(0,c.sentryStartSpan)(A,"_provideInlineCompletionItems",async A=>{this.triggerDeepWikiContextUpdate(t,i),await M.ClipboardReader.getInstance().readClipboard();const g=(0,p.getIntellisenseSuggestionsAsProto)(n.selectedCompletionInfo,n.intellisenseSuggestions,t);if(this.shownCustomCompletion?.type===_.SUPERCOMPLETE&&this.supercompleteProvider.checkRetention(this.shownCustomCompletion.result.completion,i,o))return;if(this.shownCustomCompletion?.type===_.QUICK_ACTION&&this.quickActionProvider.checkRetention(this.shownCustomCompletion.result,i,o))return;U.TabStatusProvider.getInstance().isIdle(),S.CompletionDetailedViewProvider.getInstance().clearFilteredCompletions(),o.textChanged&&this.annoyanceManager.markEdit();const r=this.annoyanceManager.checkRestriction();if(r===N.AnnoyanceManagerRestriction.BLOCK_DUE_TO_INACTIVITY)return(0,u.hasDevExtension)()&&console.log("[CompletionProvider] returning due to user inactivity"),S.CompletionDetailedViewProvider.getInstance().addFilteredCompletion("[CompletionProvider] User has not recently edited the file. Temporarily pausing completions."),void S.CompletionDetailedViewProvider.getInstance().sendFilteredCompletionsDetailedView();const I=crypto.randomUUID();this.mostRecentTriggerId=I,this.cachedResponseTimeout&&clearTimeout(this.cachedResponseTimeout),this.cachedResponseTimeout=setTimeout(()=>{this.resetAllAndProvideFeedback(e,!1)},this.supercompleteCachedResponseMs);let a=await this.getCompletion(A,t,i,o,I,g);if(this.mostRecentTriggerId===I){if(clearTimeout(this.cachedResponseTimeout),this.cachedResponseTimeout=void 0,(0,u.hasDevExtension)()&&console.log("[CompletionProvider] completion:",a),S.CompletionDetailedViewProvider.getInstance().documentInfo={uri:t.uri,languageId:t.languageId},!a)return this.resetAllAndProvideFeedback(e,!1),(0,u.hasDevExtension)()&&console.debug("[Completions] No completion found."),U.TabStatusProvider.getInstance().noCompletion(),void S.CompletionDetailedViewProvider.getInstance().sendFilteredCompletionsDetailedView();if(!this.isCompletionAllowed(a.type))return this.resetAllAndProvideFeedback(e,!1),void((0,u.hasDevExtension)()&&console.log("[CompletionProvider] returning because completion not allowed",a.type));if(S.CompletionDetailedViewProvider.getInstance().completionInfo={completion:a,midstreamAutocomplete:!1,midstreamAutocompleteInsertText:""},S.CompletionDetailedViewProvider.getInstance().completionType=a.type,S.CompletionDetailedViewProvider.getInstance().clearFilteredCompletions(),U.TabStatusProvider.getInstance().renderingCompletion(a.type),S.CompletionDetailedViewProvider.getInstance().triggerId=a.triggerId,S.CompletionDetailedViewProvider.getInstance().completionInfo?.completion.triggerId===a.triggerId&&S.CompletionDetailedViewProvider.getInstance().generateDetailedView(),a.type===_.SUPERCOMPLETE){let A=!1;try{A=await s.commands.executeCommand("_isEditorPeeked")}catch(A){console.error("[CompletionProvider] Error checking peeked editor:",A)}if(!A){const A=a.result.completion,e=async()=>{await F.SupercompleteProvider.provideFeedback(A,!0)},n=(0,k.convertSupercompleteToAutocomplete)(t,i,A.finalText,A.response.completionId,A.triggerId,e);(0,u.hasDevExtension)()&&console.log("[CompletionProvider] convertedSupercomplete",{convertedSupercomplete:n}),a=n?{type:_.AUTOCOMPLETE,triggerId:I,result:n}:a}}if((0,u.hasDevExtension)()&&console.debug("[Completions] Using completion:",a),a.type===_.AUTOCOMPLETE)return this.shownCustomCompletion=a,this.resetAllAndProvideFeedback(e,!1),[a.result];try{if((e!==s.window.activeTextEditor||a.type===_.SUPERCOMPLETE&&a.result.completion.editor!==e)&&(0,u.hasDevExtension)()&&console.warn("[CompletionProvider] Attempted render on inactive text editor"),a.type===_.SUPERCOMPLETE){const A=this.supercompleteProvider.computeRenderData(a.result.completion.editor,(0,h.charDiffWithSemanticCleanup)(e.document.getText(),a.result.completion.finalText),(0,h.wordDiff)(e.document.getText(),a.result.completion.finalText),r===N.AnnoyanceManagerRestriction.BLOCK_INLINE_RENDERS);if("supercomplete"!==(0,u.getConfig)(u.Config.COMPLETION_MODE)&&"sideHint"===A?.type)return(0,u.hasDevExtension)()&&console.log("[CompletionProvider] Rejecting sideHint in non-SUPERCOMPLETE mode"),F.SupercompleteProvider.provideFeedback(a.result.completion,!1,!1,!1,!0),void this.resetAllAndProvideFeedback(e,!1);this.tabJumpProvider.resetRender(e),await this.supercompleteProvider.render(a.result.completion.editor,A)}else a.type===_.TAB_JUMP?(await this.supercompleteProvider.resetRender(e),this.tabJumpProvider.render(e,a.result)):(await this.supercompleteProvider.resetRender(e),this.quickActionProvider.render(e,a.result));this.shownCustomCompletion=a}catch(A){(0,u.hasDevExtension)()&&console.warn("[Completions] Error rendering completion:",A),this.resetAllAndProvideFeedback(e,!1)}}})}async getCompletion(A,e,t,i,n,o){const g=i.textChanged?a.SupercompleteTriggerCondition.TYPING:a.SupercompleteTriggerCondition.CURSOR_LINE_NAVIGATION;U.TabStatusProvider.getInstance().gettingCompletion();const s=[],r="off"===(0,u.getConfig)(u.Config.COMPLETION_MODE),I=l.UserSettingBroadcaster.getInstance().userSettings.tabToJump===a.TabToJump.DISABLED,C=this.getCachedDeepWikiContext(e,t),B=new Promise((i,s)=>{r&&I?i(void 0):this.supercompleteProvider.getSupercompleteItems(A,e,t,g,void 0,n,o,C,r,I).then(A=>{void 0!==A?A.type===_.SUPERCOMPLETE?i({type:_.SUPERCOMPLETE,triggerId:n,result:A.result}):i({type:_.TAB_JUMP,triggerId:n,result:A.result}):i(void 0)}).catch(A=>{s(A)})});s.push(B);const Q=new AbortController,E=f.UnleashProvider.getInstance().getNumberVariant("QUICKACTION_THROTTLE_MS")??1e3;let c=Promise.resolve(void 0);this.quickActionProvider.enabled&&(c=(async()=>{const A=performance.now(),i=await this.quickActionProvider.getQuickActions(e,t),o=async e=>{const t=performance.now()-A;return tsetTimeout(A,E-t)),{type:_.QUICK_ACTION,triggerId:n,result:e}};if(i)return o(i);const g=performance.now()-A;if(g<500){const A=500-g;await new Promise(e=>setTimeout(e,A))}if(Q.signal.aborted)return;const s=await this.quickActionProvider.getQuickActions(e,t);return s?o(s):void 0})(),s.push(c));const d=await Promise.any(s.map(A=>A.then(A=>A??Promise.reject(new Error("No completion found"))))).catch(()=>{});if(Q.abort(),d)return d;(0,u.hasDevExtension)()&&console.debug("[Completions] No valid completion found")}async acceptCustomCompletion(){this.annoyanceManager.markAccept();const A=s.window.activeTextEditor;if(!A)return;const e=this.shownCustomCompletion;this.resetAllAndProvideFeedback(A,!0),s.commands.executeCommand("editor.action.inlineSuggest.commit"),e?.type===_.SUPERCOMPLETE&&(this.triggerManager.markCompletionAccepted(_.SUPERCOMPLETE,e.triggerId),await this.supercompleteProvider.accept(A,e.result.completion.finalText)),e?.type===_.TAB_JUMP&&(this.triggerManager.markCompletionAccepted(_.TAB_JUMP,e.triggerId,e.originalTriggerId),this.tabJumpProvider.accept(A,e.result)),e?.type===_.QUICK_ACTION&&(this.triggerManager.markCompletionAccepted(_.QUICK_ACTION,e.triggerId),await this.quickActionProvider.accept(e.result)),this.shownCustomCompletion=void 0}intentionalReset(A){if(this.activeAutocompleteCompletion&&(Q.LanguageServerClient.getInstance().client.provideCompletionFeedback({metadata:E.MetadataProvider.getInstance().getMetadata(),completionId:this.activeAutocompleteCompletion.id,isAccepted:!1,source:a.ProviderSource.AUTOCOMPLETE,document:(0,D.getDocumentInfo)({document:A.document}),feedbackDelayMs:BigInt(Date.now()-this.activeAutocompleteCompletion.renderTimestamp),isIntentionalReject:!0,...(0,G.additionalDataForFeedback)()}),this.activeAutocompleteCompletion=void 0),this.shownCustomCompletion){this.annoyanceManager.markIntentionalRejection(),this.shownCustomCompletion.type===_.AUTOCOMPLETE&&(console.log("[CompletionProvider] intentional reject autocomplete (converted from supercomplete)"),this.supercompleteProvider.intentionalReject(A)),this.shownCustomCompletion.type===_.SUPERCOMPLETE&&this.supercompleteProvider.intentionalReject(A),this.shownCustomCompletion.type===_.TAB_JUMP&&this.tabJumpProvider.intentionalReject(A),this.shownCustomCompletion.type===_.QUICK_ACTION&&this.quickActionProvider.intentionalReject(this.shownCustomCompletion.result);for(const A of s.window.visibleTextEditors)this.resetAllAndProvideFeedback(A,!1,!0)}U.TabStatusProvider.getInstance().isIdle(),s.commands.executeCommand("editor.action.inlineSuggest.hide")}async acceptedLastCompletion(A,e,t){this.activeAutocompleteCompletion=void 0,this.triggerManager.markCompletionAccepted(_.AUTOCOMPLETE,e),await async function(A,e=!1){try{Q.LanguageServerClient.getInstance()}catch(A){return void w.logger.error("Language server not initialized",A)}try{e||await Q.LanguageServerClient.getInstance().client.acceptCompletion({metadata:E.MetadataProvider.getInstance().getMetadata(),completionId:A})}catch(A){w.logger.error("Error accepting completion",A)}m.ProductAnalyticsLogger.getInstance().logEvent(C.ProductEventType.AUTOCOMPLETE_ACCEPTED),B.GuestAccessManager.getInstance().incrementAcceptedCompletions()}(A,t)}resetAllAndProvideFeedback(A,e=!1,t=!1){this.supercompleteProvider.resetRender(A),this.tabJumpProvider.resetRender(A),this.quickActionProvider.resetRender(A),this.shownCustomCompletion?.type===_.SUPERCOMPLETE?(this.annoyanceManager.markAutoRejection(),F.SupercompleteProvider.provideFeedback(this.shownCustomCompletion.result.completion,e,t)):this.shownCustomCompletion?.type===_.TAB_JUMP&&this.tabJumpProvider.provideFeedback(this.shownCustomCompletion.result,e,t),this.shownCustomCompletion=void 0}triggerDeepWikiContextUpdate(A,e){const t=A.uri.toString();if(this.deepWikiUpdateInFlight){if(this.isDeepWikiContextValid(this.deepWikiUpdateInFlight.documentUri,this.deepWikiUpdateInFlight.position,t,e))return;this.deepWikiUpdateInFlight.abortController.abort(),this.deepWikiUpdateInFlight=void 0}const i=new AbortController;this.deepWikiUpdateInFlight={documentUri:t,position:e,abortController:i};const n=(0,d.getDeepWikiContext)(A,e),o=setTimeout(()=>{i.signal.aborted||(i.abort(),this.deepWikiUpdateInFlight=void 0)},50);n.then(A=>{clearTimeout(o),i.signal.aborted||(this.cachedDeepWikiContext={documentUri:t,position:e,context:A,timestamp:Date.now()},this.deepWikiUpdateInFlight=void 0)})}getCachedDeepWikiContext(A,e){if(this.cachedDeepWikiContext){if(this.isDeepWikiContextValid(this.cachedDeepWikiContext.documentUri,this.cachedDeepWikiContext.position,A.uri.toString(),e,this.cachedDeepWikiContext.timestamp))return(0,u.hasDevExtension)()&&console.log("[Supercomplete] Returning cached deep wiki context"+JSON.stringify(this.cachedDeepWikiContext.context)),this.cachedDeepWikiContext.context;(0,u.hasDevExtension)()&&console.log("[Supercomplete] Cached deep wiki context invalid or expired")}}isDeepWikiContextValid(A,e,t,i,n,o=5e3){return!(A!==t||Math.abs(e.line-i.line)>5||void 0!==n&&Date.now()-n>o)}}e.VscodeCompletionProvider=b},60601(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{const g=e.translate(0,-e.character),I=A.lineAt(g),a=I.text.length,C=g.translate(0,a),B=A.getText().slice(0,A.offsetAt(e)),Q=A.getText().slice(A.offsetAt(e)),E=A.getText().slice(0,A.offsetAt(g)),c=A.getText().slice(A.offsetAt(C)),l=I.text.slice(e.character),u=t.startsWith(B)&&t.endsWith(c)&&t.length>B.length+Q.length,d=t.slice(E.length,t.length-c.length),h=function(A,e){let t=0,i=0;for(;t0)for(const t of A.fixes){const i=A.diagnostic.range.start.line;if(g.test(t.title.toLowerCase())&&!(Math.abs(i-e.line)>3||((0,a.hasDevExtension)()&&console.debug("[QuickAction] Considering quick action:",t.title),this.intentionalRejections.includes(u.getKey(t.title,A.diagnostic.message)))))return(0,a.hasDevExtension)()&&console.debug("[QuickAction] Returning quick action:",t.title),new l(A.diagnostic.range.start.line,t.title,A.diagnostic.message,async()=>{await s.languages.applyCodeAction(t.id)})}Q.CompletionDetailedViewProvider.getInstance().addFilteredCompletion("[QuickAction] No quick action found")}intentionalReject(A){for(this.lastIntentionalRejectionTime=performance.now(),this.consecutiveRejections++,this.intentionalRejections.push(u.getKey(A.title,A.diagnosticName));this.intentionalRejections.length>10;)this.intentionalRejections.shift()}async accept(A){this.consecutiveRejections=0,await A.execute()}checkRetention(A,e,t){return!t.textChanged&&(t.cursorMovedChar&&(this.numValidActionsSinceRender+=1,this.numValidActionsSinceRender>=4)?(this.intentionalReject(A),!1):Math.abs(A.line-e.line)<=1)}render(A,e){A.showTabToJumpWidget(e.line,e.title)}resetRender(A){A.hideTabToJumpWidget(),this.numValidActionsSinceRender=0}}e.QuickActionProvider=u},14163(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{this._getSupercompleteItems(A,e,t,i,n,o,g,s,r,I,async A=>{a(A)}).finally(()=>{a(void 0)})})}async _getSupercompleteItems(A,e,t,i,n=void 0,o,g=[],C=void 0,Q=!1,D=!1,m){const y=void 0!==n,f=s.window.activeTextEditor;if(!f)return;const R=f.selections[0].start,G=f.selections[0].end;if(R.line!==G.line||R.character!==G.character)return;if(!N.UnleashProvider.getInstance().isEnabled("ENABLE_SUPERCOMPLETE"))return;const L=await Promise.race([(0,h.getVsCodeDiagnosticsWithFixesAsProto)(f.document.uri,t.line),new Promise(A=>{setTimeout(()=>{A((0,h.getVscodeDiagnosticsAsProto)(f.document.uri,t.line))},10)})]),U=(0,p.getDocumentInfo)({document:e,position:t,predictiveText:n}),J=f.options.tabSize??4,_=f.options.insertSpaces??!1,Y={tabSize:BigInt(J),insertSpaces:_,disableAutocompleteInComments:!1},b=M.ClipboardReader.getInstance().getRecentClipboardEntry()??void 0,H=new B.HandleStreamingTabV2Request({metadata:c.MetadataProvider.getInstance().getMetadata(o),document:U,editorOptions:Y,diagnostics:L,supercompleteTriggerCondition:i,clipboardEntry:b,intellisenseSuggestions:g,otherDocuments:(0,p.getOtherDocumentInfos)(),deepWikiContextV2:C,disableSupercomplete:Q,disableTabJump:D,supercompleteAggression:u.UserSettingBroadcaster.getInstance().userSettings.supercompleteAggression});(0,d.hasDevExtension)()&&!y&&(s.commands.executeCommand(I.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.DEV_UPDATE_DOC_AND_EDITOR,f.document,f),s.commands.executeCommand(I.WindsurfExtensionMetadata.getInstance().EXTENSION_COMMAND_IDS.DEV_UPDATE_SUPERCOMPLETE_DETAILED_VIEW,H,void 0,void 0));const x=new AbortController;y?(this.predictiveAbortController.abort(),this.predictiveAbortController=x):(this.abortControllers.length>=this.maxConcurrentRequests&&(this.abortControllers[0].abort(),this.abortControllers.shift()),this.abortControllers.push(x));const K=(0,l.sentryStartSpan)(A,"handleStreamingTabV2",async A=>await E.LanguageServerClient.getInstance().client.handleStreamingTabV2(H,{signal:x.signal,headers:(0,l.sentryTraceHeaders)(A)}));let O;try{O=await K}catch(A){if(S.CompletionDetailedViewProvider.getInstance().addFilteredCompletion(`[SupercompleteProvider] Error getting supercomplete response ${A}`),A.code!==r.Code.Canceled){const e=s.workspace.getConfiguration("codeium"),t=e.get("apiServerUrl"),i=e.get("inferenceApiServerUrl");w.ProductAnalyticsLogger.getInstance().logFrequentEvent(a.ProductEventType.SUPERCOMPLETE_ERROR_GETTING_RESPONSE,void 0,void 0,{error:String(A),apiServerUrl:t??"",inferenceApiServerUrl:i??""})}return}w.ProductAnalyticsLogger.getInstance().logFrequentEvent(a.ProductEventType.SUPERCOMPLETE_REQUEST_SUCCEEDED);const v=this.createSupercompleteCompletionFromResponse({response:O,request:H,document:e,position:t,editor:f,activeLine:f.selection.active.line,documentText:U.text,triggerId:o});v&&m(v instanceof F?{type:k.CompletionType.SUPERCOMPLETE,result:new T(v)}:{type:k.CompletionType.TAB_JUMP,result:v,triggerId:o})}createSupercompleteCompletionFromResponse(A){const{response:e,request:t,document:i,editor:n,activeLine:o,documentText:g,triggerId:r}=A;if(S.CompletionDetailedViewProvider.getInstance().addFilteredCompletion(`[Supercomplete] Link: https://exafunction.retool.com/apps/b9412a18-63c8-11ef-8e93-573ca9cceee4/Supercomplete%20Inspect?completion_id=${e.completionId}`),"diff"===e.suggestion.case){const A=e.suggestion.value,I=Number(A.selectionStartLine),B=Number(A.selectionEndLine),Q=I===B?new s.Range(I,0,B,Number.MAX_SAFE_INTEGER):new s.Range(I,0,B-1,Number.MAX_SAFE_INTEGER);if(e.filterReason)return S.CompletionDetailedViewProvider.getInstance().addFilteredCompletion(`[Supercomplete] Response filtered by: ${e.filterReason.reason} (${e.completionId})`),void w.ProductAnalyticsLogger.getInstance().logFrequentEvent(a.ProductEventType.SUPERCOMPLETE_FILTERED,void 0,void 0,{reason:e.filterReason.reason});const E=(0,y.computeFinalDocumentState)(I,B,A.characterDiff??new C.CharacterDiff,g,i.eol);return new F(t,e,e.suggestion.value,Q,Date.now(),n,o,g,E,r)}if("tabJump"===e.suggestion.case){const i=e.suggestion.value,n=new s.Position(Number(i.jumpPosition?.row),Number(i.jumpPosition?.col));return new L.TabJumpCompletion(t,e,e.suggestion.value,Date.now(),n,t.document?.text??"",A.position,r)}}async resetRender(A){await Promise.all([A.hideSideHint(),A.clearInlineEdits()]),this.numValidActionsSinceRender=0}static async provideFeedback(A,e=!1,t=!1,i=!1,n=!1){const o=s.window.activeTextEditor?.document;o?await E.LanguageServerClient.getInstance().client.provideCompletionFeedback({metadata:c.MetadataProvider.getInstance().getMetadata(),completionId:A.response.completionId,isAccepted:e,promptId:A.response.promptId,latencyInfo:void 0,source:a.ProviderSource.SUPERCOMPLETE,document:(0,p.getDocumentInfo)({document:o}),feedbackDelayMs:BigInt(Date.now()-A.renderTimestamp),isIntentionalReject:t,isPartial:i,completionText:A.finalText,isClientFilterReject:n,...(0,G.additionalDataForFeedback)()}):console.warn("No active document for supercomplete feedback")}async render(A,e){void 0!==e?"inline"===e.type?await(0,m.inlineRenderWithRichGhostText)(A,e.inlineData.range,e.inlineData.charDiff):await(0,R.renderSideHintData)(A,e.sideHintData):await this.resetRender(A)}computeRenderData(A,e,t,i=!1){const n=e?.charDiff,o=t?.charDiff;if(!n||!o)return void console.warn("[Supercomplete] rendered supercomplete with no character diff");const g=new s.Range(new s.Position(e.startLine,0),new s.Position(e.endLine,Number.MAX_SAFE_INTEGER)),r=(0,m.useInlineCharacterDiff)(A.document,g.start.line,n);if(!i&&(0,m.isInlineRenderValidWithRichGhostText)(A.document,g.start.line,o))return{type:"inline",inlineData:{range:g,charDiff:o}};if(r)return{type:"inline",inlineData:{range:g,charDiff:n}};{const{characterDiff:A,newRange:e}=(0,f.pruneUnchangedLines)(g,o);return{type:"sideHint",sideHintData:{range:e,charDiff:A}}}}async accept(A,e){const t=A.document.getText(),i=(0,D.findMatchingPrefixLength)(t,e),n=(0,D.findMatchingSuffixLength)(t,e),o=t.length-i-n,g=e.length-i-n,r=o<0||g<0?Math.max(0,n-Math.abs(Math.min(o,g))):n,I=A.document.positionAt(i),a=A.document.positionAt(t.length-r);await A.edit(t=>{this.resetRender(A);const n=new s.Range(I,a),o=e.slice(i,e.length-r);t.replace(n,o)}),Q.GuestAccessManager.getInstance().incrementAcceptedSupercompletes()}intentionalReject(A){this.resetRender(A)}checkRetention(A,t,i){if(i.textChanged)return!1;if(i.cursorMovedChar)if(t.line>=Math.min(A.range.start.line,A.originalLine)-e.MAX_LINE_RANGE_DISTANCE&&t.line<=Math.max(A.range.end.line,A.originalLine)+e.MAX_LINE_RANGE_DISTANCE&&this.numValidActionsSinceRender<10)this.numValidActionsSinceRender+=1;else{if(this.numValidActionsSinceRender>=10)return this.intentionalReject(A.editor),!1;if(i.cursorMovedLine)return!1}return!0}}},20028(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g({label:`${e+1} ago`,description:A,link:A}))],t=await s.window.showQuickPick(e,{placeHolder:"Recent Tab Completions"});t&&("Most recent"===t.label?s.env.openExternal(s.Uri.parse(A[0])):"Open last 10"===t.label?Promise.all(A.slice(0,10).map(A=>s.env.openExternal(s.Uri.parse(A)))):"link"in t&&s.env.openExternal(s.Uri.parse(t.link)))}}e.TabStatusProvider=I},34866(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CompletionTriggerStateManager=void 0;const i=t(14655);e.CompletionTriggerStateManager=class{lastStr;lastPos;lastFileUri;acceptedCompletion=i.CompletionType.NONE;lastAcceptedTriggerId="";lastAcceptedOriginalTriggerId="";update(A,e){this.lastStr=A.document.getText(),this.lastPos=e,this.lastFileUri=A.document.uri.toString(),this.acceptedCompletion=i.CompletionType.NONE,this.lastAcceptedTriggerId=""}markCompletionAccepted(A,e,t){this.acceptedCompletion=A,this.lastAcceptedTriggerId=e,this.lastAcceptedOriginalTriggerId=t??""}async checkAndUpdate(A,e){await new Promise(A=>setTimeout(A,10));const t=A.document.getText(),i=A.document.uri.toString(),n={textChanged:!(this.lastFileUri!==i)&&this.lastStr!==t,cursorMovedLine:this.lastPos?.line!==e.line,cursorMovedChar:this.lastPos?.line!==e.line||this.lastPos.character!==e.character,acceptedCompletion:this.acceptedCompletion,lastAcceptedTriggerId:this.lastAcceptedTriggerId,lastAcceptedOriginalTriggerId:this.lastAcceptedOriginalTriggerId};return this.update(A,e),n}}},7540(A,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STATE_IDS=void 0,e.STATE_IDS={SNOOZE_END_TIME:"codeium.snoozeEndTimeKey",METADATA_INSTALLATION_ID:"codeium.installationId",HAS_ONE_TIME_UPDATED_UNSPECIFIED_MODE:"codeium.hasOneTimeUpdatedUnspecifiedMode",WORKSPACE_CASCADE_MAP:"windsurf.workspaceCascadeMap",PENDING_API_KEY_MIGRATION:"windsurf.pendingApiKeyMigration"}},9673(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AuthMalformedLanguageServerResponseError=e.InvalidAuthTokenError=e.GenericLanguageServerError=e.WindsurfError=void 0;const i=t(83720);class n extends Error{constructor(A,e){super(A,e),this.name=this.constructor.name}toString(){const A=`${this.name}: ${this.message}`;return void 0!==this.cause?`${A} [cause: ${this.cause instanceof Error?this.cause.toString():String(this.cause)}]`:A}}e.WindsurfError=n,e.GenericLanguageServerError=class extends n{errorMetadata=i.WindsurfExtensionMetadata.getInstance().errorCodes.GENERIC_LS_FAILURE},e.InvalidAuthTokenError=class extends n{errorMetadata=i.WindsurfExtensionMetadata.getInstance().errorCodes.AUTH_INVALID_AUTH_TOKEN},e.AuthMalformedLanguageServerResponseError=class extends n{errorMetadata=i.WindsurfExtensionMetadata.getInstance().errorCodes.AUTH_MALFORMED_LS_RESPONSE}},83720(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;gA.id)}get customEditorDecorations(){return this.metadata.customEditorDecorations}get blacklistedExtensionIds(){return this.metadata.blacklistedExtensionIds}get blacklistedPublishers(){return this.metadata.blacklistedPublishers}get errorCodes(){return this.metadata.errorCodes}get windsurfAnalyticEvents(){return this.metadata.windsurfAnalyticEvents}get authProviderId(){return this.metadata.authProviderId}get userSettingsFilePathSegments(){return this.metadata.userSettingsFilePathSegments}get userSettingsFileUri(){const A=[...this.codeiumDirPathSegments,...this.metadata.userSettingsFilePathSegments],e=s.Uri.file(I.homedir());return s.Uri.joinPath(e,...A)}get mcpConfigFileUri(){const A=[...this.codeiumDirPathSegments,...this.metadata.mcpConfigFilePathSegments],e=s.Uri.file(I.homedir());return s.Uri.joinPath(e,...A)}get codeiumDirPathSegments(){return[".codeium",(0,a.isWindsurfInsiders)()?"windsurf-insiders":(0,a.isWindsurfNext)()?"windsurf-next":"windsurf"]}get codeiumDirUri(){return s.Uri.joinPath(s.Uri.file(I.homedir()),...this.codeiumDirPathSegments)}get cascadePlanDirUri(){return s.Uri.joinPath(this.codeiumDirUri,...this.metadata.cascadePlanDirPathSegments)}}e.WindsurfExtensionMetadata=C},42915(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createRefreshContextRequestFromOpenPaths=function(A){return new n.RefreshContextForIdeActionRequest({otherDocuments:(0,o.getOtherDocumentInfos)(),recentlyOpenedUris:i.DocumentAccessTimeTracker.getInstance().getRecentlyOpenedUris(),...A})};const i=t(12187),n=t(29076),o=t(28531)},21206(A,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.refreshContextForIdeAction=function(A,e,t){a(A,e,t)};const i=t(89271),n=t(32266),o=t(94168),g=t(4103),s=t(28531),r=t(96885),I=t(42915),a=(0,i.debounce)(async(A,e,t)=>{if(!(0,r.getRecognizedSchemes)().has(e.uri.scheme))return;const i=n.LanguageServerClient.getInstance();await i.waitForReady();const a=(0,s.getDocumentInfo)({document:e,position:A?.selection.active,docVisibleRange:A?.visibleRanges[0]});i.client.refreshContextForIdeAction((0,I.createRefreshContextRequestFromOpenPaths)({activeDocument:a,metadata:o.MetadataProvider.getInstance().getMetadata(),ideAction:t})).catch(A=>{(0,g.sentryCaptureException)(A),console.log(A)})},500,{leading:!0})},14499(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g{"update"!==e.type||this.writeToDocument(A,e.content)}),await Promise.resolve()}async writeToDocument(A,e){const t=new s.WorkspaceEdit,i=this.createMarkdownContent(e);return t.replace(A.uri,new s.Range(0,0,A.lineCount,0),i),await s.workspace.applyEdit(t)}}},61983(A,e,t){"use strict";var i,n=this&&this.__createBinding||(Object.create?function(A,e,t,i){void 0===i&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);n&&!("get"in n?!e.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(A,i,n)}:function(A,e,t,i){void 0===i&&(i=t),A[i]=e[t]}),o=this&&this.__setModuleDefault||(Object.create?function(A,e){Object.defineProperty(A,"default",{enumerable:!0,value:e})}:function(A,e){A.default=e}),g=this&&this.__importStar||(i=function(A){return i=Object.getOwnPropertyNames||function(A){var e=[];for(var t in A)Object.prototype.hasOwnProperty.call(A,t)&&(e[e.length]=t);return e},i(A)},function(A){if(A&&A.__esModule)return A;var e={};if(null!=A)for(var t=i(A),g=0;g\n\t\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tWorkflow Editor\n\t\n\t\n\t\t
\n\t\t

Create Workflow

\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t
\n
\n \n
\n
\n\t\t
\n\t\t
\n\t\t\t\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t\t
\n\n\t\t