PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.0-beta2
Elementor Website Builder – more than just a page builder v4.1.0-beta2
4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 All 457 releases
← All changes | assets/js/packages/editor-mcp/editor-mcp.js +8 -31054 4.2.0-dev2 → 4.1.0-beta2 View file →
@@ -1,31055 +1,9 @@
1 -/******/ (function() { // webpackBootstrap
2 -/******/ "use strict";
3 -/******/ var __webpack_modules__ = ({
4 -
5 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js":
6 -/*!***************************************************************************************!*\
7 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js ***!
8 - \***************************************************************************************/
9 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
10 -
11 -__webpack_require__.r(__webpack_exports__);
12 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13 -/* harmony export */ assertClientRequestTaskCapability: function() { return /* binding */ assertClientRequestTaskCapability; },
14 -/* harmony export */ assertToolsCallTaskCapability: function() { return /* binding */ assertToolsCallTaskCapability; }
15 -/* harmony export */ });
16 -/**
17 - * Experimental task capability assertion helpers.
18 - * WARNING: These APIs are experimental and may change without notice.
19 - *
20 - * @experimental
21 - */
22 -/**
23 - * Asserts that task creation is supported for tools/call.
24 - * Used by Client.assertTaskCapability and Server.assertTaskHandlerCapability.
25 - *
26 - * @param requests - The task requests capability object
27 - * @param method - The method being checked
28 - * @param entityName - 'Server' or 'Client' for error messages
29 - * @throws Error if the capability is not supported
30 - *
31 - * @experimental
32 - */
33 -function assertToolsCallTaskCapability(requests, method, entityName) {
34 - if (!requests) {
35 - throw new Error(`${entityName} does not support task creation (required for ${method})`);
36 - }
37 - switch (method) {
38 - case 'tools/call':
39 - if (!requests.tools?.call) {
40 - throw new Error(`${entityName} does not support task creation for tools/call (required for ${method})`);
41 - }
42 - break;
43 - default:
44 - // Method doesn't support tasks, which is fine - no error
45 - break;
46 - }
47 -}
48 -/**
49 - * Asserts that task creation is supported for sampling/createMessage or elicitation/create.
50 - * Used by Server.assertTaskCapability and Client.assertTaskHandlerCapability.
51 - *
52 - * @param requests - The task requests capability object
53 - * @param method - The method being checked
54 - * @param entityName - 'Server' or 'Client' for error messages
55 - * @throws Error if the capability is not supported
56 - *
57 - * @experimental
58 - */
59 -function assertClientRequestTaskCapability(requests, method, entityName) {
60 - if (!requests) {
61 - throw new Error(`${entityName} does not support task creation (required for ${method})`);
62 - }
63 - switch (method) {
64 - case 'sampling/createMessage':
65 - if (!requests.sampling?.createMessage) {
66 - throw new Error(`${entityName} does not support task creation for sampling/createMessage (required for ${method})`);
67 - }
68 - break;
69 - case 'elicitation/create':
70 - if (!requests.elicitation?.create) {
71 - throw new Error(`${entityName} does not support task creation for elicitation/create (required for ${method})`);
72 - }
73 - break;
74 - default:
75 - // Method doesn't support tasks, which is fine - no error
76 - break;
77 - }
78 -}
79 -//# sourceMappingURL=helpers.js.map
80 -
81 -/***/ }),
82 -
83 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js":
84 -/*!******************************************************************************************!*\
85 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js ***!
86 - \******************************************************************************************/
87 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
88 -
89 -__webpack_require__.r(__webpack_exports__);
90 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
91 -/* harmony export */ isTerminal: function() { return /* binding */ isTerminal; }
92 -/* harmony export */ });
93 -/**
94 - * Experimental task interfaces for MCP SDK.
95 - * WARNING: These APIs are experimental and may change without notice.
96 - */
97 -/**
98 - * Checks if a task status represents a terminal state.
99 - * Terminal states are those where the task has finished and will not change.
100 - *
101 - * @param status - The task status to check
102 - * @returns True if the status is terminal (completed, failed, or cancelled)
103 - * @experimental
104 - */
105 -function isTerminal(status) {
106 - return status === 'completed' || status === 'failed' || status === 'cancelled';
107 -}
108 -//# sourceMappingURL=interfaces.js.map
109 -
110 -/***/ }),
111 -
112 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js":
113 -/*!******************************************************************************************!*\
114 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js ***!
115 - \******************************************************************************************/
116 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
117 -
118 -__webpack_require__.r(__webpack_exports__);
119 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
120 -/* harmony export */ ExperimentalMcpServerTasks: function() { return /* binding */ ExperimentalMcpServerTasks; }
121 -/* harmony export */ });
122 -/**
123 - * Experimental McpServer task features for MCP SDK.
124 - * WARNING: These APIs are experimental and may change without notice.
125 - *
126 - * @experimental
127 - */
128 -/**
129 - * Experimental task features for McpServer.
130 - *
131 - * Access via `server.experimental.tasks`:
132 - * ```typescript
133 - * server.experimental.tasks.registerToolTask('long-running', config, handler);
134 - * ```
135 - *
136 - * @experimental
137 - */
138 -class ExperimentalMcpServerTasks {
139 - constructor(_mcpServer) {
140 - this._mcpServer = _mcpServer;
141 - }
142 - registerToolTask(name, config, handler) {
143 - // Validate that taskSupport is not 'forbidden' for task-based tools
144 - const execution = { taskSupport: 'required', ...config.execution };
145 - if (execution.taskSupport === 'forbidden') {
146 - throw new Error(`Cannot register task-based tool '${name}' with taskSupport 'forbidden'. Use registerTool() instead.`);
147 - }
148 - // Access McpServer's internal _createRegisteredTool method
149 - const mcpServerInternal = this._mcpServer;
150 - return mcpServerInternal._createRegisteredTool(name, config.title, config.description, config.inputSchema, config.outputSchema, config.annotations, execution, config._meta, handler);
151 - }
152 -}
153 -//# sourceMappingURL=mcp-server.js.map
154 -
155 -/***/ }),
156 -
157 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js":
158 -/*!**************************************************************************************!*\
159 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js ***!
160 - \**************************************************************************************/
161 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
162 -
163 -__webpack_require__.r(__webpack_exports__);
164 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
165 -/* harmony export */ ExperimentalServerTasks: function() { return /* binding */ ExperimentalServerTasks; }
166 -/* harmony export */ });
167 -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../types.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");
168 -/**
169 - * Experimental server task features for MCP SDK.
170 - * WARNING: These APIs are experimental and may change without notice.
171 - *
172 - * @experimental
173 - */
174 -
175 -/**
176 - * Experimental task features for low-level MCP servers.
177 - *
178 - * Access via `server.experimental.tasks`:
179 - * ```typescript
180 - * const stream = server.experimental.tasks.requestStream(request, schema, options);
181 - * ```
182 - *
183 - * For high-level server usage with task-based tools, use `McpServer.experimental.tasks` instead.
184 - *
185 - * @experimental
186 - */
187 -class ExperimentalServerTasks {
188 - constructor(_server) {
189 - this._server = _server;
190 - }
191 - /**
192 - * Sends a request and returns an AsyncGenerator that yields response messages.
193 - * The generator is guaranteed to end with either a 'result' or 'error' message.
194 - *
195 - * This method provides streaming access to request processing, allowing you to
196 - * observe intermediate task status updates for task-augmented requests.
197 - *
198 - * @param request - The request to send
199 - * @param resultSchema - Zod schema for validating the result
200 - * @param options - Optional request options (timeout, signal, task creation params, etc.)
201 - * @returns AsyncGenerator that yields ResponseMessage objects
202 - *
203 - * @experimental
204 - */
205 - requestStream(request, resultSchema, options) {
206 - return this._server.requestStream(request, resultSchema, options);
207 - }
208 - /**
209 - * Sends a sampling request and returns an AsyncGenerator that yields response messages.
210 - * The generator is guaranteed to end with either a 'result' or 'error' message.
211 - *
212 - * For task-augmented requests, yields 'taskCreated' and 'taskStatus' messages
213 - * before the final result.
214 - *
215 - * @example
216 - * ```typescript
217 - * const stream = server.experimental.tasks.createMessageStream({
218 - * messages: [{ role: 'user', content: { type: 'text', text: 'Hello' } }],
219 - * maxTokens: 100
220 - * }, {
221 - * onprogress: (progress) => {
222 - * // Handle streaming tokens via progress notifications
223 - * console.log('Progress:', progress.message);
224 - * }
225 - * });
226 - *
227 - * for await (const message of stream) {
228 - * switch (message.type) {
229 - * case 'taskCreated':
230 - * console.log('Task created:', message.task.taskId);
231 - * break;
232 - * case 'taskStatus':
233 - * console.log('Task status:', message.task.status);
234 - * break;
235 - * case 'result':
236 - * console.log('Final result:', message.result);
237 - * break;
238 - * case 'error':
239 - * console.error('Error:', message.error);
240 - * break;
241 - * }
242 - * }
243 - * ```
244 - *
245 - * @param params - The sampling request parameters
246 - * @param options - Optional request options (timeout, signal, task creation params, onprogress, etc.)
247 - * @returns AsyncGenerator that yields ResponseMessage objects
248 - *
249 - * @experimental
250 - */
251 - createMessageStream(params, options) {
252 - // Access client capabilities via the server
253 - const clientCapabilities = this._server.getClientCapabilities();
254 - // Capability check - only required when tools/toolChoice are provided
255 - if ((params.tools || params.toolChoice) && !clientCapabilities?.sampling?.tools) {
256 - throw new Error('Client does not support sampling tools capability.');
257 - }
258 - // Message structure validation - always validate tool_use/tool_result pairs.
259 - // These may appear even without tools/toolChoice in the current request when
260 - // a previous sampling request returned tool_use and this is a follow-up with results.
261 - if (params.messages.length > 0) {
262 - const lastMessage = params.messages[params.messages.length - 1];
263 - const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
264 - const hasToolResults = lastContent.some(c => c.type === 'tool_result');
265 - const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined;
266 - const previousContent = previousMessage
267 - ? Array.isArray(previousMessage.content)
268 - ? previousMessage.content
269 - : [previousMessage.content]
270 - : [];
271 - const hasPreviousToolUse = previousContent.some(c => c.type === 'tool_use');
272 - if (hasToolResults) {
273 - if (lastContent.some(c => c.type !== 'tool_result')) {
274 - throw new Error('The last message must contain only tool_result content if any is present');
275 - }
276 - if (!hasPreviousToolUse) {
277 - throw new Error('tool_result blocks are not matching any tool_use from the previous message');
278 - }
279 - }
280 - if (hasPreviousToolUse) {
281 - // Extract tool_use IDs from previous message and tool_result IDs from current message
282 - const toolUseIds = new Set(previousContent.filter(c => c.type === 'tool_use').map(c => c.id));
283 - const toolResultIds = new Set(lastContent.filter(c => c.type === 'tool_result').map(c => c.toolUseId));
284 - if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every(id => toolResultIds.has(id))) {
285 - throw new Error('ids of tool_result blocks and tool_use blocks from previous message do not match');
286 - }
287 - }
288 - }
289 - return this.requestStream({
290 - method: 'sampling/createMessage',
291 - params
292 - }, _types_js__WEBPACK_IMPORTED_MODULE_0__.CreateMessageResultSchema, options);
293 - }
294 - /**
295 - * Sends an elicitation request and returns an AsyncGenerator that yields response messages.
296 - * The generator is guaranteed to end with either a 'result' or 'error' message.
297 - *
298 - * For task-augmented requests (especially URL-based elicitation), yields 'taskCreated'
299 - * and 'taskStatus' messages before the final result.
300 - *
301 - * @example
302 - * ```typescript
303 - * const stream = server.experimental.tasks.elicitInputStream({
304 - * mode: 'url',
305 - * message: 'Please authenticate',
306 - * elicitationId: 'auth-123',
307 - * url: 'https://example.com/auth'
308 - * }, {
309 - * task: { ttl: 300000 } // Task-augmented for long-running auth flow
310 - * });
311 - *
312 - * for await (const message of stream) {
313 - * switch (message.type) {
314 - * case 'taskCreated':
315 - * console.log('Task created:', message.task.taskId);
316 - * break;
317 - * case 'taskStatus':
318 - * console.log('Task status:', message.task.status);
319 - * break;
320 - * case 'result':
321 - * console.log('User action:', message.result.action);
322 - * break;
323 - * case 'error':
324 - * console.error('Error:', message.error);
325 - * break;
326 - * }
327 - * }
328 - * ```
329 - *
330 - * @param params - The elicitation request parameters
331 - * @param options - Optional request options (timeout, signal, task creation params, etc.)
332 - * @returns AsyncGenerator that yields ResponseMessage objects
333 - *
334 - * @experimental
335 - */
336 - elicitInputStream(params, options) {
337 - // Access client capabilities via the server
338 - const clientCapabilities = this._server.getClientCapabilities();
339 - const mode = params.mode ?? 'form';
340 - // Capability check based on mode
341 - switch (mode) {
342 - case 'url': {
343 - if (!clientCapabilities?.elicitation?.url) {
344 - throw new Error('Client does not support url elicitation.');
345 - }
346 - break;
347 - }
348 - case 'form': {
349 - if (!clientCapabilities?.elicitation?.form) {
350 - throw new Error('Client does not support form elicitation.');
351 - }
352 - break;
353 - }
354 - }
355 - // Normalize params to ensure mode is set for form mode (defaults to 'form' per spec)
356 - const normalizedParams = mode === 'form' && params.mode === undefined ? { ...params, mode: 'form' } : params;
357 - // Cast to ServerRequest needed because TypeScript can't narrow the union type
358 - // based on the discriminated 'method' field when constructing the object literal
359 - return this.requestStream({
360 - method: 'elicitation/create',
361 - params: normalizedParams
362 - }, _types_js__WEBPACK_IMPORTED_MODULE_0__.ElicitResultSchema, options);
363 - }
364 - /**
365 - * Gets the current status of a task.
366 - *
367 - * @param taskId - The task identifier
368 - * @param options - Optional request options
369 - * @returns The task status
370 - *
371 - * @experimental
372 - */
373 - async getTask(taskId, options) {
374 - return this._server.getTask({ taskId }, options);
375 - }
376 - /**
377 - * Retrieves the result of a completed task.
378 - *
379 - * @param taskId - The task identifier
380 - * @param resultSchema - Zod schema for validating the result
381 - * @param options - Optional request options
382 - * @returns The task result
383 - *
384 - * @experimental
385 - */
386 - async getTaskResult(taskId, resultSchema, options) {
387 - return this._server.getTaskResult({ taskId }, resultSchema, options);
388 - }
389 - /**
390 - * Lists tasks with optional pagination.
391 - *
392 - * @param cursor - Optional pagination cursor
393 - * @param options - Optional request options
394 - * @returns List of tasks with optional next cursor
395 - *
396 - * @experimental
397 - */
398 - async listTasks(cursor, options) {
399 - return this._server.listTasks(cursor ? { cursor } : undefined, options);
400 - }
401 - /**
402 - * Cancels a running task.
403 - *
404 - * @param taskId - The task identifier
405 - * @param options - Optional request options
406 - *
407 - * @experimental
408 - */
409 - async cancelTask(taskId, options) {
410 - return this._server.cancelTask({ taskId }, options);
411 - }
412 -}
413 -//# sourceMappingURL=server.js.map
414 -
415 -/***/ }),
416 -
417 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js":
418 -/*!*******************************************************************************!*\
419 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js ***!
420 - \*******************************************************************************/
421 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
422 -
423 -__webpack_require__.r(__webpack_exports__);
424 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
425 -/* harmony export */ COMPLETABLE_SYMBOL: function() { return /* binding */ COMPLETABLE_SYMBOL; },
426 -/* harmony export */ McpZodTypeKind: function() { return /* binding */ McpZodTypeKind; },
427 -/* harmony export */ completable: function() { return /* binding */ completable; },
428 -/* harmony export */ getCompleter: function() { return /* binding */ getCompleter; },
429 -/* harmony export */ isCompletable: function() { return /* binding */ isCompletable; },
430 -/* harmony export */ unwrapCompletable: function() { return /* binding */ unwrapCompletable; }
431 -/* harmony export */ });
432 -const COMPLETABLE_SYMBOL = Symbol.for('mcp.completable');
433 -/**
434 - * Wraps a Zod type to provide autocompletion capabilities. Useful for, e.g., prompt arguments in MCP.
435 - * Works with both Zod v3 and v4 schemas.
436 - */
437 -function completable(schema, complete) {
438 - Object.defineProperty(schema, COMPLETABLE_SYMBOL, {
439 - value: { complete },
440 - enumerable: false,
441 - writable: false,
442 - configurable: false
443 - });
444 - return schema;
445 -}
446 -/**
447 - * Checks if a schema is completable (has completion metadata).
448 - */
449 -function isCompletable(schema) {
450 - return !!schema && typeof schema === 'object' && COMPLETABLE_SYMBOL in schema;
451 -}
452 -/**
453 - * Gets the completer callback from a completable schema, if it exists.
454 - */
455 -function getCompleter(schema) {
456 - const meta = schema[COMPLETABLE_SYMBOL];
457 - return meta?.complete;
458 -}
459 -/**
460 - * Unwraps a completable schema to get the underlying schema.
461 - * For backward compatibility with code that called `.unwrap()`.
462 - */
463 -function unwrapCompletable(schema) {
464 - return schema;
465 -}
466 -// Legacy exports for backward compatibility
467 -// These types are deprecated but kept for existing code
468 -var McpZodTypeKind;
469 -(function (McpZodTypeKind) {
470 - McpZodTypeKind["Completable"] = "McpCompletable";
471 -})(McpZodTypeKind || (McpZodTypeKind = {}));
472 -//# sourceMappingURL=completable.js.map
473 -
474 -/***/ }),
475 -
476 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js":
477 -/*!*************************************************************************!*\
478 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js ***!
479 - \*************************************************************************/
480 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
481 -
482 -__webpack_require__.r(__webpack_exports__);
483 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
484 -/* harmony export */ Server: function() { return /* binding */ Server; }
485 -/* harmony export */ });
486 -/* harmony import */ var _shared_protocol_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/protocol.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js");
487 -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");
488 -/* harmony import */ var _validation_ajv_provider_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../validation/ajv-provider.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js");
489 -/* harmony import */ var _zod_compat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./zod-compat.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js");
490 -/* harmony import */ var _experimental_tasks_server_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../experimental/tasks/server.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js");
491 -/* harmony import */ var _experimental_tasks_helpers_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../experimental/tasks/helpers.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js");
492 -
493 -
494 -
495 -
496 -
497 -
498 -/**
499 - * An MCP server on top of a pluggable transport.
500 - *
501 - * This server will automatically respond to the initialization flow as initiated from the client.
502 - *
503 - * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters:
504 - *
505 - * ```typescript
506 - * // Custom schemas
507 - * const CustomRequestSchema = RequestSchema.extend({...})
508 - * const CustomNotificationSchema = NotificationSchema.extend({...})
509 - * const CustomResultSchema = ResultSchema.extend({...})
510 - *
511 - * // Type aliases
512 - * type CustomRequest = z.infer<typeof CustomRequestSchema>
513 - * type CustomNotification = z.infer<typeof CustomNotificationSchema>
514 - * type CustomResult = z.infer<typeof CustomResultSchema>
515 - *
516 - * // Create typed server
517 - * const server = new Server<CustomRequest, CustomNotification, CustomResult>({
518 - * name: "CustomServer",
519 - * version: "1.0.0"
520 - * })
521 - * ```
522 - * @deprecated Use `McpServer` instead for the high-level API. Only use `Server` for advanced use cases.
523 - */
524 -class Server extends _shared_protocol_js__WEBPACK_IMPORTED_MODULE_0__.Protocol {
525 - /**
526 - * Initializes this server with the given name and version information.
527 - */
528 - constructor(_serverInfo, options) {
529 - super(options);
530 - this._serverInfo = _serverInfo;
531 - // Map log levels by session id
532 - this._loggingLevels = new Map();
533 - // Map LogLevelSchema to severity index
534 - this.LOG_LEVEL_SEVERITY = new Map(_types_js__WEBPACK_IMPORTED_MODULE_1__.LoggingLevelSchema.options.map((level, index) => [level, index]));
535 - // Is a message with the given level ignored in the log level set for the given session id?
536 - this.isMessageIgnored = (level, sessionId) => {
537 - const currentLevel = this._loggingLevels.get(sessionId);
538 - return currentLevel ? this.LOG_LEVEL_SEVERITY.get(level) < this.LOG_LEVEL_SEVERITY.get(currentLevel) : false;
539 - };
540 - this._capabilities = options?.capabilities ?? {};
541 - this._instructions = options?.instructions;
542 - this._jsonSchemaValidator = options?.jsonSchemaValidator ?? new _validation_ajv_provider_js__WEBPACK_IMPORTED_MODULE_2__.AjvJsonSchemaValidator();
543 - this.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.InitializeRequestSchema, request => this._oninitialize(request));
544 - this.setNotificationHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.InitializedNotificationSchema, () => this.oninitialized?.());
545 - if (this._capabilities.logging) {
546 - this.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.SetLevelRequestSchema, async (request, extra) => {
547 - const transportSessionId = extra.sessionId || extra.requestInfo?.headers['mcp-session-id'] || undefined;
548 - const { level } = request.params;
549 - const parseResult = _types_js__WEBPACK_IMPORTED_MODULE_1__.LoggingLevelSchema.safeParse(level);
550 - if (parseResult.success) {
551 - this._loggingLevels.set(transportSessionId, parseResult.data);
552 - }
553 - return {};
554 - });
555 - }
556 - }
557 - /**
558 - * Access experimental features.
559 - *
560 - * WARNING: These APIs are experimental and may change without notice.
561 - *
562 - * @experimental
563 - */
564 - get experimental() {
565 - if (!this._experimental) {
566 - this._experimental = {
567 - tasks: new _experimental_tasks_server_js__WEBPACK_IMPORTED_MODULE_4__.ExperimentalServerTasks(this)
568 - };
569 - }
570 - return this._experimental;
571 - }
572 - /**
573 - * Registers new capabilities. This can only be called before connecting to a transport.
574 - *
575 - * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization).
576 - */
577 - registerCapabilities(capabilities) {
578 - if (this.transport) {
579 - throw new Error('Cannot register capabilities after connecting to transport');
580 - }
581 - this._capabilities = (0,_shared_protocol_js__WEBPACK_IMPORTED_MODULE_0__.mergeCapabilities)(this._capabilities, capabilities);
582 - }
583 - /**
584 - * Override request handler registration to enforce server-side validation for tools/call.
585 - */
586 - setRequestHandler(requestSchema, handler) {
587 - const shape = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_3__.getObjectShape)(requestSchema);
588 - const methodSchema = shape?.method;
589 - if (!methodSchema) {
590 - throw new Error('Schema is missing a method literal');
591 - }
592 - // Extract literal value using type-safe property access
593 - let methodValue;
594 - if ((0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_3__.isZ4Schema)(methodSchema)) {
595 - const v4Schema = methodSchema;
596 - const v4Def = v4Schema._zod?.def;
597 - methodValue = v4Def?.value ?? v4Schema.value;
598 - }
599 - else {
600 - const v3Schema = methodSchema;
601 - const legacyDef = v3Schema._def;
602 - methodValue = legacyDef?.value ?? v3Schema.value;
603 - }
604 - if (typeof methodValue !== 'string') {
605 - throw new Error('Schema method literal must be a string');
606 - }
607 - const method = methodValue;
608 - if (method === 'tools/call') {
609 - const wrappedHandler = async (request, extra) => {
610 - const validatedRequest = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_3__.safeParse)(_types_js__WEBPACK_IMPORTED_MODULE_1__.CallToolRequestSchema, request);
611 - if (!validatedRequest.success) {
612 - const errorMessage = validatedRequest.error instanceof Error ? validatedRequest.error.message : String(validatedRequest.error);
613 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Invalid tools/call request: ${errorMessage}`);
614 - }
615 - const { params } = validatedRequest.data;
616 - const result = await Promise.resolve(handler(request, extra));
617 - // When task creation is requested, validate and return CreateTaskResult
618 - if (params.task) {
619 - const taskValidationResult = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_3__.safeParse)(_types_js__WEBPACK_IMPORTED_MODULE_1__.CreateTaskResultSchema, result);
620 - if (!taskValidationResult.success) {
621 - const errorMessage = taskValidationResult.error instanceof Error
622 - ? taskValidationResult.error.message
623 - : String(taskValidationResult.error);
624 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Invalid task creation result: ${errorMessage}`);
625 - }
626 - return taskValidationResult.data;
627 - }
628 - // For non-task requests, validate against CallToolResultSchema
629 - const validationResult = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_3__.safeParse)(_types_js__WEBPACK_IMPORTED_MODULE_1__.CallToolResultSchema, result);
630 - if (!validationResult.success) {
631 - const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
632 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Invalid tools/call result: ${errorMessage}`);
633 - }
634 - return validationResult.data;
635 - };
636 - // Install the wrapped handler
637 - return super.setRequestHandler(requestSchema, wrappedHandler);
638 - }
639 - // Other handlers use default behavior
640 - return super.setRequestHandler(requestSchema, handler);
641 - }
642 - assertCapabilityForMethod(method) {
643 - switch (method) {
644 - case 'sampling/createMessage':
645 - if (!this._clientCapabilities?.sampling) {
646 - throw new Error(`Client does not support sampling (required for ${method})`);
647 - }
648 - break;
649 - case 'elicitation/create':
650 - if (!this._clientCapabilities?.elicitation) {
651 - throw new Error(`Client does not support elicitation (required for ${method})`);
652 - }
653 - break;
654 - case 'roots/list':
655 - if (!this._clientCapabilities?.roots) {
656 - throw new Error(`Client does not support listing roots (required for ${method})`);
657 - }
658 - break;
659 - case 'ping':
660 - // No specific capability required for ping
661 - break;
662 - }
663 - }
664 - assertNotificationCapability(method) {
665 - switch (method) {
666 - case 'notifications/message':
667 - if (!this._capabilities.logging) {
668 - throw new Error(`Server does not support logging (required for ${method})`);
669 - }
670 - break;
671 - case 'notifications/resources/updated':
672 - case 'notifications/resources/list_changed':
673 - if (!this._capabilities.resources) {
674 - throw new Error(`Server does not support notifying about resources (required for ${method})`);
675 - }
676 - break;
677 - case 'notifications/tools/list_changed':
678 - if (!this._capabilities.tools) {
679 - throw new Error(`Server does not support notifying of tool list changes (required for ${method})`);
680 - }
681 - break;
682 - case 'notifications/prompts/list_changed':
683 - if (!this._capabilities.prompts) {
684 - throw new Error(`Server does not support notifying of prompt list changes (required for ${method})`);
685 - }
686 - break;
687 - case 'notifications/elicitation/complete':
688 - if (!this._clientCapabilities?.elicitation?.url) {
689 - throw new Error(`Client does not support URL elicitation (required for ${method})`);
690 - }
691 - break;
692 - case 'notifications/cancelled':
693 - // Cancellation notifications are always allowed
694 - break;
695 - case 'notifications/progress':
696 - // Progress notifications are always allowed
697 - break;
698 - }
699 - }
700 - assertRequestHandlerCapability(method) {
701 - // Task handlers are registered in Protocol constructor before _capabilities is initialized
702 - // Skip capability check for task methods during initialization
703 - if (!this._capabilities) {
704 - return;
705 - }
706 - switch (method) {
707 - case 'completion/complete':
708 - if (!this._capabilities.completions) {
709 - throw new Error(`Server does not support completions (required for ${method})`);
710 - }
711 - break;
712 - case 'logging/setLevel':
713 - if (!this._capabilities.logging) {
714 - throw new Error(`Server does not support logging (required for ${method})`);
715 - }
716 - break;
717 - case 'prompts/get':
718 - case 'prompts/list':
719 - if (!this._capabilities.prompts) {
720 - throw new Error(`Server does not support prompts (required for ${method})`);
721 - }
722 - break;
723 - case 'resources/list':
724 - case 'resources/templates/list':
725 - case 'resources/read':
726 - if (!this._capabilities.resources) {
727 - throw new Error(`Server does not support resources (required for ${method})`);
728 - }
729 - break;
730 - case 'tools/call':
731 - case 'tools/list':
732 - if (!this._capabilities.tools) {
733 - throw new Error(`Server does not support tools (required for ${method})`);
734 - }
735 - break;
736 - case 'tasks/get':
737 - case 'tasks/list':
738 - case 'tasks/result':
739 - case 'tasks/cancel':
740 - if (!this._capabilities.tasks) {
741 - throw new Error(`Server does not support tasks capability (required for ${method})`);
742 - }
743 - break;
744 - case 'ping':
745 - case 'initialize':
746 - // No specific capability required for these methods
747 - break;
748 - }
749 - }
750 - assertTaskCapability(method) {
751 - (0,_experimental_tasks_helpers_js__WEBPACK_IMPORTED_MODULE_5__.assertClientRequestTaskCapability)(this._clientCapabilities?.tasks?.requests, method, 'Client');
752 - }
753 - assertTaskHandlerCapability(method) {
754 - // Task handlers are registered in Protocol constructor before _capabilities is initialized
755 - // Skip capability check for task methods during initialization
756 - if (!this._capabilities) {
757 - return;
758 - }
759 - (0,_experimental_tasks_helpers_js__WEBPACK_IMPORTED_MODULE_5__.assertToolsCallTaskCapability)(this._capabilities.tasks?.requests, method, 'Server');
760 - }
761 - async _oninitialize(request) {
762 - const requestedVersion = request.params.protocolVersion;
763 - this._clientCapabilities = request.params.capabilities;
764 - this._clientVersion = request.params.clientInfo;
765 - const protocolVersion = _types_js__WEBPACK_IMPORTED_MODULE_1__.SUPPORTED_PROTOCOL_VERSIONS.includes(requestedVersion) ? requestedVersion : _types_js__WEBPACK_IMPORTED_MODULE_1__.LATEST_PROTOCOL_VERSION;
766 - return {
767 - protocolVersion,
768 - capabilities: this.getCapabilities(),
769 - serverInfo: this._serverInfo,
770 - ...(this._instructions && { instructions: this._instructions })
771 - };
772 - }
773 - /**
774 - * After initialization has completed, this will be populated with the client's reported capabilities.
775 - */
776 - getClientCapabilities() {
777 - return this._clientCapabilities;
778 - }
779 - /**
780 - * After initialization has completed, this will be populated with information about the client's name and version.
781 - */
782 - getClientVersion() {
783 - return this._clientVersion;
784 - }
785 - getCapabilities() {
786 - return this._capabilities;
787 - }
788 - async ping() {
789 - return this.request({ method: 'ping' }, _types_js__WEBPACK_IMPORTED_MODULE_1__.EmptyResultSchema);
790 - }
791 - // Implementation
792 - async createMessage(params, options) {
793 - // Capability check - only required when tools/toolChoice are provided
794 - if (params.tools || params.toolChoice) {
795 - if (!this._clientCapabilities?.sampling?.tools) {
796 - throw new Error('Client does not support sampling tools capability.');
797 - }
798 - }
799 - // Message structure validation - always validate tool_use/tool_result pairs.
800 - // These may appear even without tools/toolChoice in the current request when
801 - // a previous sampling request returned tool_use and this is a follow-up with results.
802 - if (params.messages.length > 0) {
803 - const lastMessage = params.messages[params.messages.length - 1];
804 - const lastContent = Array.isArray(lastMessage.content) ? lastMessage.content : [lastMessage.content];
805 - const hasToolResults = lastContent.some(c => c.type === 'tool_result');
806 - const previousMessage = params.messages.length > 1 ? params.messages[params.messages.length - 2] : undefined;
807 - const previousContent = previousMessage
808 - ? Array.isArray(previousMessage.content)
809 - ? previousMessage.content
810 - : [previousMessage.content]
811 - : [];
812 - const hasPreviousToolUse = previousContent.some(c => c.type === 'tool_use');
813 - if (hasToolResults) {
814 - if (lastContent.some(c => c.type !== 'tool_result')) {
815 - throw new Error('The last message must contain only tool_result content if any is present');
816 - }
817 - if (!hasPreviousToolUse) {
818 - throw new Error('tool_result blocks are not matching any tool_use from the previous message');
819 - }
820 - }
821 - if (hasPreviousToolUse) {
822 - const toolUseIds = new Set(previousContent.filter(c => c.type === 'tool_use').map(c => c.id));
823 - const toolResultIds = new Set(lastContent.filter(c => c.type === 'tool_result').map(c => c.toolUseId));
824 - if (toolUseIds.size !== toolResultIds.size || ![...toolUseIds].every(id => toolResultIds.has(id))) {
825 - throw new Error('ids of tool_result blocks and tool_use blocks from previous message do not match');
826 - }
827 - }
828 - }
829 - // Use different schemas based on whether tools are provided
830 - if (params.tools) {
831 - return this.request({ method: 'sampling/createMessage', params }, _types_js__WEBPACK_IMPORTED_MODULE_1__.CreateMessageResultWithToolsSchema, options);
832 - }
833 - return this.request({ method: 'sampling/createMessage', params }, _types_js__WEBPACK_IMPORTED_MODULE_1__.CreateMessageResultSchema, options);
834 - }
835 - /**
836 - * Creates an elicitation request for the given parameters.
837 - * For backwards compatibility, `mode` may be omitted for form requests and will default to `'form'`.
838 - * @param params The parameters for the elicitation request.
839 - * @param options Optional request options.
840 - * @returns The result of the elicitation request.
841 - */
842 - async elicitInput(params, options) {
843 - const mode = (params.mode ?? 'form');
844 - switch (mode) {
845 - case 'url': {
846 - if (!this._clientCapabilities?.elicitation?.url) {
847 - throw new Error('Client does not support url elicitation.');
848 - }
849 - const urlParams = params;
850 - return this.request({ method: 'elicitation/create', params: urlParams }, _types_js__WEBPACK_IMPORTED_MODULE_1__.ElicitResultSchema, options);
851 - }
852 - case 'form': {
853 - if (!this._clientCapabilities?.elicitation?.form) {
854 - throw new Error('Client does not support form elicitation.');
855 - }
856 - const formParams = params.mode === 'form' ? params : { ...params, mode: 'form' };
857 - const result = await this.request({ method: 'elicitation/create', params: formParams }, _types_js__WEBPACK_IMPORTED_MODULE_1__.ElicitResultSchema, options);
858 - if (result.action === 'accept' && result.content && formParams.requestedSchema) {
859 - try {
860 - const validator = this._jsonSchemaValidator.getValidator(formParams.requestedSchema);
861 - const validationResult = validator(result.content);
862 - if (!validationResult.valid) {
863 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Elicitation response content does not match requested schema: ${validationResult.errorMessage}`);
864 - }
865 - }
866 - catch (error) {
867 - if (error instanceof _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError) {
868 - throw error;
869 - }
870 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InternalError, `Error validating elicitation response: ${error instanceof Error ? error.message : String(error)}`);
871 - }
872 - }
873 - return result;
874 - }
875 - }
876 - }
877 - /**
878 - * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete`
879 - * notification for the specified elicitation ID.
880 - *
881 - * @param elicitationId The ID of the elicitation to mark as complete.
882 - * @param options Optional notification options. Useful when the completion notification should be related to a prior request.
883 - * @returns A function that emits the completion notification when awaited.
884 - */
885 - createElicitationCompletionNotifier(elicitationId, options) {
886 - if (!this._clientCapabilities?.elicitation?.url) {
887 - throw new Error('Client does not support URL elicitation (required for notifications/elicitation/complete)');
888 - }
889 - return () => this.notification({
890 - method: 'notifications/elicitation/complete',
891 - params: {
892 - elicitationId
893 - }
894 - }, options);
895 - }
896 - async listRoots(params, options) {
897 - return this.request({ method: 'roots/list', params }, _types_js__WEBPACK_IMPORTED_MODULE_1__.ListRootsResultSchema, options);
898 - }
899 - /**
900 - * Sends a logging message to the client, if connected.
901 - * Note: You only need to send the parameters object, not the entire JSON RPC message
902 - * @see LoggingMessageNotification
903 - * @param params
904 - * @param sessionId optional for stateless and backward compatibility
905 - */
906 - async sendLoggingMessage(params, sessionId) {
907 - if (this._capabilities.logging) {
908 - if (!this.isMessageIgnored(params.level, sessionId)) {
909 - return this.notification({ method: 'notifications/message', params });
910 - }
911 - }
912 - }
913 - async sendResourceUpdated(params) {
914 - return this.notification({
915 - method: 'notifications/resources/updated',
916 - params
917 - });
918 - }
919 - async sendResourceListChanged() {
920 - return this.notification({
921 - method: 'notifications/resources/list_changed'
922 - });
923 - }
924 - async sendToolListChanged() {
925 - return this.notification({ method: 'notifications/tools/list_changed' });
926 - }
927 - async sendPromptListChanged() {
928 - return this.notification({ method: 'notifications/prompts/list_changed' });
929 - }
930 -}
931 -//# sourceMappingURL=index.js.map
932 -
933 -/***/ }),
934 -
935 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js":
936 -/*!***********************************************************************!*\
937 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js ***!
938 - \***********************************************************************/
939 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
940 -
941 -__webpack_require__.r(__webpack_exports__);
942 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
943 -/* harmony export */ McpServer: function() { return /* binding */ McpServer; },
944 -/* harmony export */ ResourceTemplate: function() { return /* binding */ ResourceTemplate; }
945 -/* harmony export */ });
946 -/* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js");
947 -/* harmony import */ var _zod_compat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./zod-compat.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js");
948 -/* harmony import */ var _zod_json_schema_compat_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./zod-json-schema-compat.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js");
949 -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../types.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");
950 -/* harmony import */ var _completable_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./completable.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js");
951 -/* harmony import */ var _shared_uriTemplate_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../shared/uriTemplate.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js");
952 -/* harmony import */ var _shared_toolNameValidation_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../shared/toolNameValidation.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js");
953 -/* harmony import */ var _experimental_tasks_mcp_server_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../experimental/tasks/mcp-server.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js");
954 -/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! zod */ "./node_modules/zod/v3/types.js");
955 -
956 -
957 -
958 -
959 -
960 -
961 -
962 -
963 -
964 -/**
965 - * High-level MCP server that provides a simpler API for working with resources, tools, and prompts.
966 - * For advanced usage (like sending notifications or setting custom request handlers), use the underlying
967 - * Server instance available via the `server` property.
968 - */
969 -class McpServer {
970 - constructor(serverInfo, options) {
971 - this._registeredResources = {};
972 - this._registeredResourceTemplates = {};
973 - this._registeredTools = {};
974 - this._registeredPrompts = {};
975 - this._toolHandlersInitialized = false;
976 - this._completionHandlerInitialized = false;
977 - this._resourceHandlersInitialized = false;
978 - this._promptHandlersInitialized = false;
979 - this.server = new _index_js__WEBPACK_IMPORTED_MODULE_0__.Server(serverInfo, options);
980 - }
981 - /**
982 - * Access experimental features.
983 - *
984 - * WARNING: These APIs are experimental and may change without notice.
985 - *
986 - * @experimental
987 - */
988 - get experimental() {
989 - if (!this._experimental) {
990 - this._experimental = {
991 - tasks: new _experimental_tasks_mcp_server_js__WEBPACK_IMPORTED_MODULE_7__.ExperimentalMcpServerTasks(this)
992 - };
993 - }
994 - return this._experimental;
995 - }
996 - /**
997 - * Attaches to the given transport, starts it, and starts listening for messages.
998 - *
999 - * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
1000 - */
1001 - async connect(transport) {
1002 - return await this.server.connect(transport);
1003 - }
1004 - /**
1005 - * Closes the connection.
1006 - */
1007 - async close() {
1008 - await this.server.close();
1009 - }
1010 - setToolRequestHandlers() {
1011 - if (this._toolHandlersInitialized) {
1012 - return;
1013 - }
1014 - this.server.assertCanSetRequestHandler(getMethodValue(_types_js__WEBPACK_IMPORTED_MODULE_3__.ListToolsRequestSchema));
1015 - this.server.assertCanSetRequestHandler(getMethodValue(_types_js__WEBPACK_IMPORTED_MODULE_3__.CallToolRequestSchema));
1016 - this.server.registerCapabilities({
1017 - tools: {
1018 - listChanged: true
1019 - }
1020 - });
1021 - this.server.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_3__.ListToolsRequestSchema, () => ({
1022 - tools: Object.entries(this._registeredTools)
1023 - .filter(([, tool]) => tool.enabled)
1024 - .map(([name, tool]) => {
1025 - const toolDefinition = {
1026 - name,
1027 - title: tool.title,
1028 - description: tool.description,
1029 - inputSchema: (() => {
1030 - const obj = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.normalizeObjectSchema)(tool.inputSchema);
1031 - return obj
1032 - ? (0,_zod_json_schema_compat_js__WEBPACK_IMPORTED_MODULE_2__.toJsonSchemaCompat)(obj, {
1033 - strictUnions: true,
1034 - pipeStrategy: 'input'
1035 - })
1036 - : EMPTY_OBJECT_JSON_SCHEMA;
1037 - })(),
1038 - annotations: tool.annotations,
1039 - execution: tool.execution,
1040 - _meta: tool._meta
1041 - };
1042 - if (tool.outputSchema) {
1043 - const obj = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.normalizeObjectSchema)(tool.outputSchema);
1044 - if (obj) {
1045 - toolDefinition.outputSchema = (0,_zod_json_schema_compat_js__WEBPACK_IMPORTED_MODULE_2__.toJsonSchemaCompat)(obj, {
1046 - strictUnions: true,
1047 - pipeStrategy: 'output'
1048 - });
1049 - }
1050 - }
1051 - return toolDefinition;
1052 - })
1053 - }));
1054 - this.server.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_3__.CallToolRequestSchema, async (request, extra) => {
1055 - try {
1056 - const tool = this._registeredTools[request.params.name];
1057 - if (!tool) {
1058 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Tool ${request.params.name} not found`);
1059 - }
1060 - if (!tool.enabled) {
1061 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Tool ${request.params.name} disabled`);
1062 - }
1063 - const isTaskRequest = !!request.params.task;
1064 - const taskSupport = tool.execution?.taskSupport;
1065 - const isTaskHandler = 'createTask' in tool.handler;
1066 - // Validate task hint configuration
1067 - if ((taskSupport === 'required' || taskSupport === 'optional') && !isTaskHandler) {
1068 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InternalError, `Tool ${request.params.name} has taskSupport '${taskSupport}' but was not registered with registerToolTask`);
1069 - }
1070 - // Handle taskSupport 'required' without task augmentation
1071 - if (taskSupport === 'required' && !isTaskRequest) {
1072 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.MethodNotFound, `Tool ${request.params.name} requires task augmentation (taskSupport: 'required')`);
1073 - }
1074 - // Handle taskSupport 'optional' without task augmentation - automatic polling
1075 - if (taskSupport === 'optional' && !isTaskRequest && isTaskHandler) {
1076 - return await this.handleAutomaticTaskPolling(tool, request, extra);
1077 - }
1078 - // Normal execution path
1079 - const args = await this.validateToolInput(tool, request.params.arguments, request.params.name);
1080 - const result = await this.executeToolHandler(tool, args, extra);
1081 - // Return CreateTaskResult immediately for task requests
1082 - if (isTaskRequest) {
1083 - return result;
1084 - }
1085 - // Validate output schema for non-task requests
1086 - await this.validateToolOutput(tool, result, request.params.name);
1087 - return result;
1088 - }
1089 - catch (error) {
1090 - if (error instanceof _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError) {
1091 - if (error.code === _types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.UrlElicitationRequired) {
1092 - throw error; // Return the error to the caller without wrapping in CallToolResult
1093 - }
1094 - }
1095 - return this.createToolError(error instanceof Error ? error.message : String(error));
1096 - }
1097 - });
1098 - this._toolHandlersInitialized = true;
1099 - }
1100 - /**
1101 - * Creates a tool error result.
1102 - *
1103 - * @param errorMessage - The error message.
1104 - * @returns The tool error result.
1105 - */
1106 - createToolError(errorMessage) {
1107 - return {
1108 - content: [
1109 - {
1110 - type: 'text',
1111 - text: errorMessage
1112 - }
1113 - ],
1114 - isError: true
1115 - };
1116 - }
1117 - /**
1118 - * Validates tool input arguments against the tool's input schema.
1119 - */
1120 - async validateToolInput(tool, args, toolName) {
1121 - if (!tool.inputSchema) {
1122 - return undefined;
1123 - }
1124 - // Try to normalize to object schema first (for raw shapes and object schemas)
1125 - // If that fails, use the schema directly (for union/intersection/etc)
1126 - const inputObj = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.normalizeObjectSchema)(tool.inputSchema);
1127 - const schemaToParse = inputObj ?? tool.inputSchema;
1128 - const parseResult = await (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.safeParseAsync)(schemaToParse, args);
1129 - if (!parseResult.success) {
1130 - const error = 'error' in parseResult ? parseResult.error : 'Unknown error';
1131 - const errorMessage = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getParseErrorMessage)(error);
1132 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Input validation error: Invalid arguments for tool ${toolName}: ${errorMessage}`);
1133 - }
1134 - return parseResult.data;
1135 - }
1136 - /**
1137 - * Validates tool output against the tool's output schema.
1138 - */
1139 - async validateToolOutput(tool, result, toolName) {
1140 - if (!tool.outputSchema) {
1141 - return;
1142 - }
1143 - // Only validate CallToolResult, not CreateTaskResult
1144 - if (!('content' in result)) {
1145 - return;
1146 - }
1147 - if (result.isError) {
1148 - return;
1149 - }
1150 - if (!result.structuredContent) {
1151 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Output validation error: Tool ${toolName} has an output schema but no structured content was provided`);
1152 - }
1153 - // if the tool has an output schema, validate structured content
1154 - const outputObj = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.normalizeObjectSchema)(tool.outputSchema);
1155 - const parseResult = await (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.safeParseAsync)(outputObj, result.structuredContent);
1156 - if (!parseResult.success) {
1157 - const error = 'error' in parseResult ? parseResult.error : 'Unknown error';
1158 - const errorMessage = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getParseErrorMessage)(error);
1159 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Output validation error: Invalid structured content for tool ${toolName}: ${errorMessage}`);
1160 - }
1161 - }
1162 - /**
1163 - * Executes a tool handler (either regular or task-based).
1164 - */
1165 - async executeToolHandler(tool, args, extra) {
1166 - const handler = tool.handler;
1167 - const isTaskHandler = 'createTask' in handler;
1168 - if (isTaskHandler) {
1169 - if (!extra.taskStore) {
1170 - throw new Error('No task store provided.');
1171 - }
1172 - const taskExtra = { ...extra, taskStore: extra.taskStore };
1173 - if (tool.inputSchema) {
1174 - const typedHandler = handler;
1175 - // eslint-disable-next-line @typescript-eslint/no-explicit-any
1176 - return await Promise.resolve(typedHandler.createTask(args, taskExtra));
1177 - }
1178 - else {
1179 - const typedHandler = handler;
1180 - // eslint-disable-next-line @typescript-eslint/no-explicit-any
1181 - return await Promise.resolve(typedHandler.createTask(taskExtra));
1182 - }
1183 - }
1184 - if (tool.inputSchema) {
1185 - const typedHandler = handler;
1186 - // eslint-disable-next-line @typescript-eslint/no-explicit-any
1187 - return await Promise.resolve(typedHandler(args, extra));
1188 - }
1189 - else {
1190 - const typedHandler = handler;
1191 - // eslint-disable-next-line @typescript-eslint/no-explicit-any
1192 - return await Promise.resolve(typedHandler(extra));
1193 - }
1194 - }
1195 - /**
1196 - * Handles automatic task polling for tools with taskSupport 'optional'.
1197 - */
1198 - async handleAutomaticTaskPolling(tool, request, extra) {
1199 - if (!extra.taskStore) {
1200 - throw new Error('No task store provided for task-capable tool.');
1201 - }
1202 - // Validate input and create task
1203 - const args = await this.validateToolInput(tool, request.params.arguments, request.params.name);
1204 - const handler = tool.handler;
1205 - const taskExtra = { ...extra, taskStore: extra.taskStore };
1206 - const createTaskResult = args // undefined only if tool.inputSchema is undefined
1207 - ? await Promise.resolve(handler.createTask(args, taskExtra))
1208 - : // eslint-disable-next-line @typescript-eslint/no-explicit-any
1209 - await Promise.resolve(handler.createTask(taskExtra));
1210 - // Poll until completion
1211 - const taskId = createTaskResult.task.taskId;
1212 - let task = createTaskResult.task;
1213 - const pollInterval = task.pollInterval ?? 5000;
1214 - while (task.status !== 'completed' && task.status !== 'failed' && task.status !== 'cancelled') {
1215 - await new Promise(resolve => setTimeout(resolve, pollInterval));
1216 - const updatedTask = await extra.taskStore.getTask(taskId);
1217 - if (!updatedTask) {
1218 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InternalError, `Task ${taskId} not found during polling`);
1219 - }
1220 - task = updatedTask;
1221 - }
1222 - // Return the final result
1223 - return (await extra.taskStore.getTaskResult(taskId));
1224 - }
1225 - setCompletionRequestHandler() {
1226 - if (this._completionHandlerInitialized) {
1227 - return;
1228 - }
1229 - this.server.assertCanSetRequestHandler(getMethodValue(_types_js__WEBPACK_IMPORTED_MODULE_3__.CompleteRequestSchema));
1230 - this.server.registerCapabilities({
1231 - completions: {}
1232 - });
1233 - this.server.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_3__.CompleteRequestSchema, async (request) => {
1234 - switch (request.params.ref.type) {
1235 - case 'ref/prompt':
1236 - (0,_types_js__WEBPACK_IMPORTED_MODULE_3__.assertCompleteRequestPrompt)(request);
1237 - return this.handlePromptCompletion(request, request.params.ref);
1238 - case 'ref/resource':
1239 - (0,_types_js__WEBPACK_IMPORTED_MODULE_3__.assertCompleteRequestResourceTemplate)(request);
1240 - return this.handleResourceCompletion(request, request.params.ref);
1241 - default:
1242 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Invalid completion reference: ${request.params.ref}`);
1243 - }
1244 - });
1245 - this._completionHandlerInitialized = true;
1246 - }
1247 - async handlePromptCompletion(request, ref) {
1248 - const prompt = this._registeredPrompts[ref.name];
1249 - if (!prompt) {
1250 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Prompt ${ref.name} not found`);
1251 - }
1252 - if (!prompt.enabled) {
1253 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Prompt ${ref.name} disabled`);
1254 - }
1255 - if (!prompt.argsSchema) {
1256 - return EMPTY_COMPLETION_RESULT;
1257 - }
1258 - const promptShape = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getObjectShape)(prompt.argsSchema);
1259 - const field = promptShape?.[request.params.argument.name];
1260 - if (!(0,_completable_js__WEBPACK_IMPORTED_MODULE_4__.isCompletable)(field)) {
1261 - return EMPTY_COMPLETION_RESULT;
1262 - }
1263 - const completer = (0,_completable_js__WEBPACK_IMPORTED_MODULE_4__.getCompleter)(field);
1264 - if (!completer) {
1265 - return EMPTY_COMPLETION_RESULT;
1266 - }
1267 - const suggestions = await completer(request.params.argument.value, request.params.context);
1268 - return createCompletionResult(suggestions);
1269 - }
1270 - async handleResourceCompletion(request, ref) {
1271 - const template = Object.values(this._registeredResourceTemplates).find(t => t.resourceTemplate.uriTemplate.toString() === ref.uri);
1272 - if (!template) {
1273 - if (this._registeredResources[ref.uri]) {
1274 - // Attempting to autocomplete a fixed resource URI is not an error in the spec (but probably should be).
1275 - return EMPTY_COMPLETION_RESULT;
1276 - }
1277 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Resource template ${request.params.ref.uri} not found`);
1278 - }
1279 - const completer = template.resourceTemplate.completeCallback(request.params.argument.name);
1280 - if (!completer) {
1281 - return EMPTY_COMPLETION_RESULT;
1282 - }
1283 - const suggestions = await completer(request.params.argument.value, request.params.context);
1284 - return createCompletionResult(suggestions);
1285 - }
1286 - setResourceRequestHandlers() {
1287 - if (this._resourceHandlersInitialized) {
1288 - return;
1289 - }
1290 - this.server.assertCanSetRequestHandler(getMethodValue(_types_js__WEBPACK_IMPORTED_MODULE_3__.ListResourcesRequestSchema));
1291 - this.server.assertCanSetRequestHandler(getMethodValue(_types_js__WEBPACK_IMPORTED_MODULE_3__.ListResourceTemplatesRequestSchema));
1292 - this.server.assertCanSetRequestHandler(getMethodValue(_types_js__WEBPACK_IMPORTED_MODULE_3__.ReadResourceRequestSchema));
1293 - this.server.registerCapabilities({
1294 - resources: {
1295 - listChanged: true
1296 - }
1297 - });
1298 - this.server.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_3__.ListResourcesRequestSchema, async (request, extra) => {
1299 - const resources = Object.entries(this._registeredResources)
1300 - .filter(([_, resource]) => resource.enabled)
1301 - .map(([uri, resource]) => ({
1302 - uri,
1303 - name: resource.name,
1304 - ...resource.metadata
1305 - }));
1306 - const templateResources = [];
1307 - for (const template of Object.values(this._registeredResourceTemplates)) {
1308 - if (!template.resourceTemplate.listCallback) {
1309 - continue;
1310 - }
1311 - const result = await template.resourceTemplate.listCallback(extra);
1312 - for (const resource of result.resources) {
1313 - templateResources.push({
1314 - ...template.metadata,
1315 - // the defined resource metadata should override the template metadata if present
1316 - ...resource
1317 - });
1318 - }
1319 - }
1320 - return { resources: [...resources, ...templateResources] };
1321 - });
1322 - this.server.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_3__.ListResourceTemplatesRequestSchema, async () => {
1323 - const resourceTemplates = Object.entries(this._registeredResourceTemplates).map(([name, template]) => ({
1324 - name,
1325 - uriTemplate: template.resourceTemplate.uriTemplate.toString(),
1326 - ...template.metadata
1327 - }));
1328 - return { resourceTemplates };
1329 - });
1330 - this.server.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_3__.ReadResourceRequestSchema, async (request, extra) => {
1331 - const uri = new URL(request.params.uri);
1332 - // First check for exact resource match
1333 - const resource = this._registeredResources[uri.toString()];
1334 - if (resource) {
1335 - if (!resource.enabled) {
1336 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Resource ${uri} disabled`);
1337 - }
1338 - return resource.readCallback(uri, extra);
1339 - }
1340 - // Then check templates
1341 - for (const template of Object.values(this._registeredResourceTemplates)) {
1342 - const variables = template.resourceTemplate.uriTemplate.match(uri.toString());
1343 - if (variables) {
1344 - return template.readCallback(uri, variables, extra);
1345 - }
1346 - }
1347 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Resource ${uri} not found`);
1348 - });
1349 - this._resourceHandlersInitialized = true;
1350 - }
1351 - setPromptRequestHandlers() {
1352 - if (this._promptHandlersInitialized) {
1353 - return;
1354 - }
1355 - this.server.assertCanSetRequestHandler(getMethodValue(_types_js__WEBPACK_IMPORTED_MODULE_3__.ListPromptsRequestSchema));
1356 - this.server.assertCanSetRequestHandler(getMethodValue(_types_js__WEBPACK_IMPORTED_MODULE_3__.GetPromptRequestSchema));
1357 - this.server.registerCapabilities({
1358 - prompts: {
1359 - listChanged: true
1360 - }
1361 - });
1362 - this.server.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_3__.ListPromptsRequestSchema, () => ({
1363 - prompts: Object.entries(this._registeredPrompts)
1364 - .filter(([, prompt]) => prompt.enabled)
1365 - .map(([name, prompt]) => {
1366 - return {
1367 - name,
1368 - title: prompt.title,
1369 - description: prompt.description,
1370 - arguments: prompt.argsSchema ? promptArgumentsFromSchema(prompt.argsSchema) : undefined
1371 - };
1372 - })
1373 - }));
1374 - this.server.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_3__.GetPromptRequestSchema, async (request, extra) => {
1375 - const prompt = this._registeredPrompts[request.params.name];
1376 - if (!prompt) {
1377 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Prompt ${request.params.name} not found`);
1378 - }
1379 - if (!prompt.enabled) {
1380 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Prompt ${request.params.name} disabled`);
1381 - }
1382 - if (prompt.argsSchema) {
1383 - const argsObj = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.normalizeObjectSchema)(prompt.argsSchema);
1384 - const parseResult = await (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.safeParseAsync)(argsObj, request.params.arguments);
1385 - if (!parseResult.success) {
1386 - const error = 'error' in parseResult ? parseResult.error : 'Unknown error';
1387 - const errorMessage = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getParseErrorMessage)(error);
1388 - throw new _types_js__WEBPACK_IMPORTED_MODULE_3__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_3__.ErrorCode.InvalidParams, `Invalid arguments for prompt ${request.params.name}: ${errorMessage}`);
1389 - }
1390 - const args = parseResult.data;
1391 - const cb = prompt.callback;
1392 - return await Promise.resolve(cb(args, extra));
1393 - }
1394 - else {
1395 - const cb = prompt.callback;
1396 - // eslint-disable-next-line @typescript-eslint/no-explicit-any
1397 - return await Promise.resolve(cb(extra));
1398 - }
1399 - });
1400 - this._promptHandlersInitialized = true;
1401 - }
1402 - resource(name, uriOrTemplate, ...rest) {
1403 - let metadata;
1404 - if (typeof rest[0] === 'object') {
1405 - metadata = rest.shift();
1406 - }
1407 - const readCallback = rest[0];
1408 - if (typeof uriOrTemplate === 'string') {
1409 - if (this._registeredResources[uriOrTemplate]) {
1410 - throw new Error(`Resource ${uriOrTemplate} is already registered`);
1411 - }
1412 - const registeredResource = this._createRegisteredResource(name, undefined, uriOrTemplate, metadata, readCallback);
1413 - this.setResourceRequestHandlers();
1414 - this.sendResourceListChanged();
1415 - return registeredResource;
1416 - }
1417 - else {
1418 - if (this._registeredResourceTemplates[name]) {
1419 - throw new Error(`Resource template ${name} is already registered`);
1420 - }
1421 - const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, undefined, uriOrTemplate, metadata, readCallback);
1422 - this.setResourceRequestHandlers();
1423 - this.sendResourceListChanged();
1424 - return registeredResourceTemplate;
1425 - }
1426 - }
1427 - registerResource(name, uriOrTemplate, config, readCallback) {
1428 - if (typeof uriOrTemplate === 'string') {
1429 - if (this._registeredResources[uriOrTemplate]) {
1430 - throw new Error(`Resource ${uriOrTemplate} is already registered`);
1431 - }
1432 - const registeredResource = this._createRegisteredResource(name, config.title, uriOrTemplate, config, readCallback);
1433 - this.setResourceRequestHandlers();
1434 - this.sendResourceListChanged();
1435 - return registeredResource;
1436 - }
1437 - else {
1438 - if (this._registeredResourceTemplates[name]) {
1439 - throw new Error(`Resource template ${name} is already registered`);
1440 - }
1441 - const registeredResourceTemplate = this._createRegisteredResourceTemplate(name, config.title, uriOrTemplate, config, readCallback);
1442 - this.setResourceRequestHandlers();
1443 - this.sendResourceListChanged();
1444 - return registeredResourceTemplate;
1445 - }
1446 - }
1447 - _createRegisteredResource(name, title, uri, metadata, readCallback) {
1448 - const registeredResource = {
1449 - name,
1450 - title,
1451 - metadata,
1452 - readCallback,
1453 - enabled: true,
1454 - disable: () => registeredResource.update({ enabled: false }),
1455 - enable: () => registeredResource.update({ enabled: true }),
1456 - remove: () => registeredResource.update({ uri: null }),
1457 - update: updates => {
1458 - if (typeof updates.uri !== 'undefined' && updates.uri !== uri) {
1459 - delete this._registeredResources[uri];
1460 - if (updates.uri)
1461 - this._registeredResources[updates.uri] = registeredResource;
1462 - }
1463 - if (typeof updates.name !== 'undefined')
1464 - registeredResource.name = updates.name;
1465 - if (typeof updates.title !== 'undefined')
1466 - registeredResource.title = updates.title;
1467 - if (typeof updates.metadata !== 'undefined')
1468 - registeredResource.metadata = updates.metadata;
1469 - if (typeof updates.callback !== 'undefined')
1470 - registeredResource.readCallback = updates.callback;
1471 - if (typeof updates.enabled !== 'undefined')
1472 - registeredResource.enabled = updates.enabled;
1473 - this.sendResourceListChanged();
1474 - }
1475 - };
1476 - this._registeredResources[uri] = registeredResource;
1477 - return registeredResource;
1478 - }
1479 - _createRegisteredResourceTemplate(name, title, template, metadata, readCallback) {
1480 - const registeredResourceTemplate = {
1481 - resourceTemplate: template,
1482 - title,
1483 - metadata,
1484 - readCallback,
1485 - enabled: true,
1486 - disable: () => registeredResourceTemplate.update({ enabled: false }),
1487 - enable: () => registeredResourceTemplate.update({ enabled: true }),
1488 - remove: () => registeredResourceTemplate.update({ name: null }),
1489 - update: updates => {
1490 - if (typeof updates.name !== 'undefined' && updates.name !== name) {
1491 - delete this._registeredResourceTemplates[name];
1492 - if (updates.name)
1493 - this._registeredResourceTemplates[updates.name] = registeredResourceTemplate;
1494 - }
1495 - if (typeof updates.title !== 'undefined')
1496 - registeredResourceTemplate.title = updates.title;
1497 - if (typeof updates.template !== 'undefined')
1498 - registeredResourceTemplate.resourceTemplate = updates.template;
1499 - if (typeof updates.metadata !== 'undefined')
1500 - registeredResourceTemplate.metadata = updates.metadata;
1501 - if (typeof updates.callback !== 'undefined')
1502 - registeredResourceTemplate.readCallback = updates.callback;
1503 - if (typeof updates.enabled !== 'undefined')
1504 - registeredResourceTemplate.enabled = updates.enabled;
1505 - this.sendResourceListChanged();
1506 - }
1507 - };
1508 - this._registeredResourceTemplates[name] = registeredResourceTemplate;
1509 - // If the resource template has any completion callbacks, enable completions capability
1510 - const variableNames = template.uriTemplate.variableNames;
1511 - const hasCompleter = Array.isArray(variableNames) && variableNames.some(v => !!template.completeCallback(v));
1512 - if (hasCompleter) {
1513 - this.setCompletionRequestHandler();
1514 - }
1515 - return registeredResourceTemplate;
1516 - }
1517 - _createRegisteredPrompt(name, title, description, argsSchema, callback) {
1518 - const registeredPrompt = {
1519 - title,
1520 - description,
1521 - argsSchema: argsSchema === undefined ? undefined : (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.objectFromShape)(argsSchema),
1522 - callback,
1523 - enabled: true,
1524 - disable: () => registeredPrompt.update({ enabled: false }),
1525 - enable: () => registeredPrompt.update({ enabled: true }),
1526 - remove: () => registeredPrompt.update({ name: null }),
1527 - update: updates => {
1528 - if (typeof updates.name !== 'undefined' && updates.name !== name) {
1529 - delete this._registeredPrompts[name];
1530 - if (updates.name)
1531 - this._registeredPrompts[updates.name] = registeredPrompt;
1532 - }
1533 - if (typeof updates.title !== 'undefined')
1534 - registeredPrompt.title = updates.title;
1535 - if (typeof updates.description !== 'undefined')
1536 - registeredPrompt.description = updates.description;
1537 - if (typeof updates.argsSchema !== 'undefined')
1538 - registeredPrompt.argsSchema = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.objectFromShape)(updates.argsSchema);
1539 - if (typeof updates.callback !== 'undefined')
1540 - registeredPrompt.callback = updates.callback;
1541 - if (typeof updates.enabled !== 'undefined')
1542 - registeredPrompt.enabled = updates.enabled;
1543 - this.sendPromptListChanged();
1544 - }
1545 - };
1546 - this._registeredPrompts[name] = registeredPrompt;
1547 - // If any argument uses a Completable schema, enable completions capability
1548 - if (argsSchema) {
1549 - const hasCompletable = Object.values(argsSchema).some(field => {
1550 - const inner = field instanceof zod__WEBPACK_IMPORTED_MODULE_8__.ZodOptional ? field._def?.innerType : field;
1551 - return (0,_completable_js__WEBPACK_IMPORTED_MODULE_4__.isCompletable)(inner);
1552 - });
1553 - if (hasCompletable) {
1554 - this.setCompletionRequestHandler();
1555 - }
1556 - }
1557 - return registeredPrompt;
1558 - }
1559 - _createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, execution, _meta, handler) {
1560 - // Validate tool name according to SEP specification
1561 - (0,_shared_toolNameValidation_js__WEBPACK_IMPORTED_MODULE_6__.validateAndWarnToolName)(name);
1562 - const registeredTool = {
1563 - title,
1564 - description,
1565 - inputSchema: getZodSchemaObject(inputSchema),
1566 - outputSchema: getZodSchemaObject(outputSchema),
1567 - annotations,
1568 - execution,
1569 - _meta,
1570 - handler: handler,
1571 - enabled: true,
1572 - disable: () => registeredTool.update({ enabled: false }),
1573 - enable: () => registeredTool.update({ enabled: true }),
1574 - remove: () => registeredTool.update({ name: null }),
1575 - update: updates => {
1576 - if (typeof updates.name !== 'undefined' && updates.name !== name) {
1577 - if (typeof updates.name === 'string') {
1578 - (0,_shared_toolNameValidation_js__WEBPACK_IMPORTED_MODULE_6__.validateAndWarnToolName)(updates.name);
1579 - }
1580 - delete this._registeredTools[name];
1581 - if (updates.name)
1582 - this._registeredTools[updates.name] = registeredTool;
1583 - }
1584 - if (typeof updates.title !== 'undefined')
1585 - registeredTool.title = updates.title;
1586 - if (typeof updates.description !== 'undefined')
1587 - registeredTool.description = updates.description;
1588 - if (typeof updates.paramsSchema !== 'undefined')
1589 - registeredTool.inputSchema = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.objectFromShape)(updates.paramsSchema);
1590 - if (typeof updates.outputSchema !== 'undefined')
1591 - registeredTool.outputSchema = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.objectFromShape)(updates.outputSchema);
1592 - if (typeof updates.callback !== 'undefined')
1593 - registeredTool.handler = updates.callback;
1594 - if (typeof updates.annotations !== 'undefined')
1595 - registeredTool.annotations = updates.annotations;
1596 - if (typeof updates._meta !== 'undefined')
1597 - registeredTool._meta = updates._meta;
1598 - if (typeof updates.enabled !== 'undefined')
1599 - registeredTool.enabled = updates.enabled;
1600 - this.sendToolListChanged();
1601 - }
1602 - };
1603 - this._registeredTools[name] = registeredTool;
1604 - this.setToolRequestHandlers();
1605 - this.sendToolListChanged();
1606 - return registeredTool;
1607 - }
1608 - /**
1609 - * tool() implementation. Parses arguments passed to overrides defined above.
1610 - */
1611 - tool(name, ...rest) {
1612 - if (this._registeredTools[name]) {
1613 - throw new Error(`Tool ${name} is already registered`);
1614 - }
1615 - let description;
1616 - let inputSchema;
1617 - let outputSchema;
1618 - let annotations;
1619 - // Tool properties are passed as separate arguments, with omissions allowed.
1620 - // Support for this style is frozen as of protocol version 2025-03-26. Future additions
1621 - // to tool definition should *NOT* be added.
1622 - if (typeof rest[0] === 'string') {
1623 - description = rest.shift();
1624 - }
1625 - // Handle the different overload combinations
1626 - if (rest.length > 1) {
1627 - // We have at least one more arg before the callback
1628 - const firstArg = rest[0];
1629 - if (isZodRawShapeCompat(firstArg)) {
1630 - // We have a params schema as the first arg
1631 - inputSchema = rest.shift();
1632 - // Check if the next arg is potentially annotations
1633 - if (rest.length > 1 && typeof rest[0] === 'object' && rest[0] !== null && !isZodRawShapeCompat(rest[0])) {
1634 - // Case: tool(name, paramsSchema, annotations, cb)
1635 - // Or: tool(name, description, paramsSchema, annotations, cb)
1636 - annotations = rest.shift();
1637 - }
1638 - }
1639 - else if (typeof firstArg === 'object' && firstArg !== null) {
1640 - // Not a ZodRawShapeCompat, so must be annotations in this position
1641 - // Case: tool(name, annotations, cb)
1642 - // Or: tool(name, description, annotations, cb)
1643 - annotations = rest.shift();
1644 - }
1645 - }
1646 - const callback = rest[0];
1647 - return this._createRegisteredTool(name, undefined, description, inputSchema, outputSchema, annotations, { taskSupport: 'forbidden' }, undefined, callback);
1648 - }
1649 - /**
1650 - * Registers a tool with a config object and callback.
1651 - */
1652 - registerTool(name, config, cb) {
1653 - if (this._registeredTools[name]) {
1654 - throw new Error(`Tool ${name} is already registered`);
1655 - }
1656 - const { title, description, inputSchema, outputSchema, annotations, _meta } = config;
1657 - return this._createRegisteredTool(name, title, description, inputSchema, outputSchema, annotations, { taskSupport: 'forbidden' }, _meta, cb);
1658 - }
1659 - prompt(name, ...rest) {
1660 - if (this._registeredPrompts[name]) {
1661 - throw new Error(`Prompt ${name} is already registered`);
1662 - }
1663 - let description;
1664 - if (typeof rest[0] === 'string') {
1665 - description = rest.shift();
1666 - }
1667 - let argsSchema;
1668 - if (rest.length > 1) {
1669 - argsSchema = rest.shift();
1670 - }
1671 - const cb = rest[0];
1672 - const registeredPrompt = this._createRegisteredPrompt(name, undefined, description, argsSchema, cb);
1673 - this.setPromptRequestHandlers();
1674 - this.sendPromptListChanged();
1675 - return registeredPrompt;
1676 - }
1677 - /**
1678 - * Registers a prompt with a config object and callback.
1679 - */
1680 - registerPrompt(name, config, cb) {
1681 - if (this._registeredPrompts[name]) {
1682 - throw new Error(`Prompt ${name} is already registered`);
1683 - }
1684 - const { title, description, argsSchema } = config;
1685 - const registeredPrompt = this._createRegisteredPrompt(name, title, description, argsSchema, cb);
1686 - this.setPromptRequestHandlers();
1687 - this.sendPromptListChanged();
1688 - return registeredPrompt;
1689 - }
1690 - /**
1691 - * Checks if the server is connected to a transport.
1692 - * @returns True if the server is connected
1693 - */
1694 - isConnected() {
1695 - return this.server.transport !== undefined;
1696 - }
1697 - /**
1698 - * Sends a logging message to the client, if connected.
1699 - * Note: You only need to send the parameters object, not the entire JSON RPC message
1700 - * @see LoggingMessageNotification
1701 - * @param params
1702 - * @param sessionId optional for stateless and backward compatibility
1703 - */
1704 - async sendLoggingMessage(params, sessionId) {
1705 - return this.server.sendLoggingMessage(params, sessionId);
1706 - }
1707 - /**
1708 - * Sends a resource list changed event to the client, if connected.
1709 - */
1710 - sendResourceListChanged() {
1711 - if (this.isConnected()) {
1712 - this.server.sendResourceListChanged();
1713 - }
1714 - }
1715 - /**
1716 - * Sends a tool list changed event to the client, if connected.
1717 - */
1718 - sendToolListChanged() {
1719 - if (this.isConnected()) {
1720 - this.server.sendToolListChanged();
1721 - }
1722 - }
1723 - /**
1724 - * Sends a prompt list changed event to the client, if connected.
1725 - */
1726 - sendPromptListChanged() {
1727 - if (this.isConnected()) {
1728 - this.server.sendPromptListChanged();
1729 - }
1730 - }
1731 -}
1732 -/**
1733 - * A resource template combines a URI pattern with optional functionality to enumerate
1734 - * all resources matching that pattern.
1735 - */
1736 -class ResourceTemplate {
1737 - constructor(uriTemplate, _callbacks) {
1738 - this._callbacks = _callbacks;
1739 - this._uriTemplate = typeof uriTemplate === 'string' ? new _shared_uriTemplate_js__WEBPACK_IMPORTED_MODULE_5__.UriTemplate(uriTemplate) : uriTemplate;
1740 - }
1741 - /**
1742 - * Gets the URI template pattern.
1743 - */
1744 - get uriTemplate() {
1745 - return this._uriTemplate;
1746 - }
1747 - /**
1748 - * Gets the list callback, if one was provided.
1749 - */
1750 - get listCallback() {
1751 - return this._callbacks.list;
1752 - }
1753 - /**
1754 - * Gets the callback for completing a specific URI template variable, if one was provided.
1755 - */
1756 - completeCallback(variable) {
1757 - return this._callbacks.complete?.[variable];
1758 - }
1759 -}
1760 -const EMPTY_OBJECT_JSON_SCHEMA = {
1761 - type: 'object',
1762 - properties: {}
1763 -};
1764 -/**
1765 - * Checks if a value looks like a Zod schema by checking for parse/safeParse methods.
1766 - */
1767 -function isZodTypeLike(value) {
1768 - return (value !== null &&
1769 - typeof value === 'object' &&
1770 - 'parse' in value &&
1771 - typeof value.parse === 'function' &&
1772 - 'safeParse' in value &&
1773 - typeof value.safeParse === 'function');
1774 -}
1775 -/**
1776 - * Checks if an object is a Zod schema instance (v3 or v4).
1777 - *
1778 - * Zod schemas have internal markers:
1779 - * - v3: `_def` property
1780 - * - v4: `_zod` property
1781 - *
1782 - * This includes transformed schemas like z.preprocess(), z.transform(), z.pipe().
1783 - */
1784 -function isZodSchemaInstance(obj) {
1785 - return '_def' in obj || '_zod' in obj || isZodTypeLike(obj);
1786 -}
1787 -/**
1788 - * Checks if an object is a "raw shape" - a plain object where values are Zod schemas.
1789 - *
1790 - * Raw shapes are used as shorthand: `{ name: z.string() }` instead of `z.object({ name: z.string() })`.
1791 - *
1792 - * IMPORTANT: This must NOT match actual Zod schema instances (like z.preprocess, z.pipe),
1793 - * which have internal properties that could be mistaken for schema values.
1794 - */
1795 -function isZodRawShapeCompat(obj) {
1796 - if (typeof obj !== 'object' || obj === null) {
1797 - return false;
1798 - }
1799 - // If it's already a Zod schema instance, it's NOT a raw shape
1800 - if (isZodSchemaInstance(obj)) {
1801 - return false;
1802 - }
1803 - // Empty objects are valid raw shapes (tools with no parameters)
1804 - if (Object.keys(obj).length === 0) {
1805 - return true;
1806 - }
1807 - // A raw shape has at least one property that is a Zod schema
1808 - return Object.values(obj).some(isZodTypeLike);
1809 -}
1810 -/**
1811 - * Converts a provided Zod schema to a Zod object if it is a ZodRawShapeCompat,
1812 - * otherwise returns the schema as is.
1813 - */
1814 -function getZodSchemaObject(schema) {
1815 - if (!schema) {
1816 - return undefined;
1817 - }
1818 - if (isZodRawShapeCompat(schema)) {
1819 - return (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.objectFromShape)(schema);
1820 - }
1821 - return schema;
1822 -}
1823 -function promptArgumentsFromSchema(schema) {
1824 - const shape = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getObjectShape)(schema);
1825 - if (!shape)
1826 - return [];
1827 - return Object.entries(shape).map(([name, field]) => {
1828 - // Get description - works for both v3 and v4
1829 - const description = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaDescription)(field);
1830 - // Check if optional - works for both v3 and v4
1831 - const isOptional = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.isSchemaOptional)(field);
1832 - return {
1833 - name,
1834 - description,
1835 - required: !isOptional
1836 - };
1837 - });
1838 -}
1839 -function getMethodValue(schema) {
1840 - const shape = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getObjectShape)(schema);
1841 - const methodSchema = shape?.method;
1842 - if (!methodSchema) {
1843 - throw new Error('Schema is missing a method literal');
1844 - }
1845 - // Extract literal value - works for both v3 and v4
1846 - const value = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getLiteralValue)(methodSchema);
1847 - if (typeof value === 'string') {
1848 - return value;
1849 - }
1850 - throw new Error('Schema method literal must be a string');
1851 -}
1852 -function createCompletionResult(suggestions) {
1853 - return {
1854 - completion: {
1855 - values: suggestions.slice(0, 100),
1856 - total: suggestions.length,
1857 - hasMore: suggestions.length > 100
1858 - }
1859 - };
1860 -}
1861 -const EMPTY_COMPLETION_RESULT = {
1862 - completion: {
1863 - values: [],
1864 - hasMore: false
1865 - }
1866 -};
1867 -//# sourceMappingURL=mcp.js.map
1868 -
1869 -/***/ }),
1870 -
1871 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js":
1872 -/*!******************************************************************************!*\
1873 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js ***!
1874 - \******************************************************************************/
1875 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
1876 -
1877 -__webpack_require__.r(__webpack_exports__);
1878 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
1879 -/* harmony export */ getLiteralValue: function() { return /* binding */ getLiteralValue; },
1880 -/* harmony export */ getObjectShape: function() { return /* binding */ getObjectShape; },
1881 -/* harmony export */ getParseErrorMessage: function() { return /* binding */ getParseErrorMessage; },
1882 -/* harmony export */ getSchemaDescription: function() { return /* binding */ getSchemaDescription; },
1883 -/* harmony export */ isSchemaOptional: function() { return /* binding */ isSchemaOptional; },
1884 -/* harmony export */ isZ4Schema: function() { return /* binding */ isZ4Schema; },
1885 -/* harmony export */ normalizeObjectSchema: function() { return /* binding */ normalizeObjectSchema; },
1886 -/* harmony export */ objectFromShape: function() { return /* binding */ objectFromShape; },
1887 -/* harmony export */ safeParse: function() { return /* binding */ safeParse; },
1888 -/* harmony export */ safeParseAsync: function() { return /* binding */ safeParseAsync; }
1889 -/* harmony export */ });
1890 -/* harmony import */ var zod_v3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod/v3 */ "./node_modules/zod/v3/types.js");
1891 -/* harmony import */ var zod_v4_mini__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! zod/v4-mini */ "./node_modules/zod/v4/core/parse.js");
1892 -/* harmony import */ var zod_v4_mini__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! zod/v4-mini */ "./node_modules/zod/v4/mini/schemas.js");
1893 -// zod-compat.ts
1894 -// ----------------------------------------------------
1895 -// Unified types + helpers to accept Zod v3 and v4 (Mini)
1896 -// ----------------------------------------------------
1897 -
1898 -
1899 -// --- Runtime detection ---
1900 -function isZ4Schema(s) {
1901 - // Present on Zod 4 (Classic & Mini) schemas; absent on Zod 3
1902 - const schema = s;
1903 - return !!schema._zod;
1904 -}
1905 -// --- Schema construction ---
1906 -function objectFromShape(shape) {
1907 - const values = Object.values(shape);
1908 - if (values.length === 0)
1909 - return zod_v4_mini__WEBPACK_IMPORTED_MODULE_2__.object({}); // default to v4 Mini
1910 - const allV4 = values.every(isZ4Schema);
1911 - const allV3 = values.every(s => !isZ4Schema(s));
1912 - if (allV4)
1913 - return zod_v4_mini__WEBPACK_IMPORTED_MODULE_2__.object(shape);
1914 - if (allV3)
1915 - return zod_v3__WEBPACK_IMPORTED_MODULE_0__.object(shape);
1916 - throw new Error('Mixed Zod versions detected in object shape.');
1917 -}
1918 -// --- Unified parsing ---
1919 -function safeParse(schema, data) {
1920 - if (isZ4Schema(schema)) {
1921 - // Mini exposes top-level safeParse
1922 - const result = zod_v4_mini__WEBPACK_IMPORTED_MODULE_1__.safeParse(schema, data);
1923 - return result;
1924 - }
1925 - const v3Schema = schema;
1926 - const result = v3Schema.safeParse(data);
1927 - return result;
1928 -}
1929 -async function safeParseAsync(schema, data) {
1930 - if (isZ4Schema(schema)) {
1931 - // Mini exposes top-level safeParseAsync
1932 - const result = await zod_v4_mini__WEBPACK_IMPORTED_MODULE_1__.safeParseAsync(schema, data);
1933 - return result;
1934 - }
1935 - const v3Schema = schema;
1936 - const result = await v3Schema.safeParseAsync(data);
1937 - return result;
1938 -}
1939 -// --- Shape extraction ---
1940 -function getObjectShape(schema) {
1941 - if (!schema)
1942 - return undefined;
1943 - // Zod v3 exposes `.shape`; Zod v4 keeps the shape on `_zod.def.shape`
1944 - let rawShape;
1945 - if (isZ4Schema(schema)) {
1946 - const v4Schema = schema;
1947 - rawShape = v4Schema._zod?.def?.shape;
1948 - }
1949 - else {
1950 - const v3Schema = schema;
1951 - rawShape = v3Schema.shape;
1952 - }
1953 - if (!rawShape)
1954 - return undefined;
1955 - if (typeof rawShape === 'function') {
1956 - try {
1957 - return rawShape();
1958 - }
1959 - catch {
1960 - return undefined;
1961 - }
1962 - }
1963 - return rawShape;
1964 -}
1965 -// --- Schema normalization ---
1966 -/**
1967 - * Normalizes a schema to an object schema. Handles both:
1968 - * - Already-constructed object schemas (v3 or v4)
1969 - * - Raw shapes that need to be wrapped into object schemas
1970 - */
1971 -function normalizeObjectSchema(schema) {
1972 - if (!schema)
1973 - return undefined;
1974 - // First check if it's a raw shape (Record<string, AnySchema>)
1975 - // Raw shapes don't have _def or _zod properties and aren't schemas themselves
1976 - if (typeof schema === 'object') {
1977 - // Check if it's actually a ZodRawShapeCompat (not a schema instance)
1978 - // by checking if it lacks schema-like internal properties
1979 - const asV3 = schema;
1980 - const asV4 = schema;
1981 - // If it's not a schema instance (no _def or _zod), it might be a raw shape
1982 - if (!asV3._def && !asV4._zod) {
1983 - // Check if all values are schemas (heuristic to confirm it's a raw shape)
1984 - const values = Object.values(schema);
1985 - if (values.length > 0 &&
1986 - values.every(v => typeof v === 'object' &&
1987 - v !== null &&
1988 - (v._def !== undefined ||
1989 - v._zod !== undefined ||
1990 - typeof v.parse === 'function'))) {
1991 - return objectFromShape(schema);
1992 - }
1993 - }
1994 - }
1995 - // If we get here, it should be an AnySchema (not a raw shape)
1996 - // Check if it's already an object schema
1997 - if (isZ4Schema(schema)) {
1998 - // Check if it's a v4 object
1999 - const v4Schema = schema;
2000 - const def = v4Schema._zod?.def;
2001 - if (def && (def.type === 'object' || def.shape !== undefined)) {
2002 - return schema;
2003 - }
2004 - }
2005 - else {
2006 - // Check if it's a v3 object
2007 - const v3Schema = schema;
2008 - if (v3Schema.shape !== undefined) {
2009 - return schema;
2010 - }
2011 - }
2012 - return undefined;
2013 -}
2014 -// --- Error message extraction ---
2015 -/**
2016 - * Safely extracts an error message from a parse result error.
2017 - * Zod errors can have different structures, so we handle various cases.
2018 - */
2019 -function getParseErrorMessage(error) {
2020 - if (error && typeof error === 'object') {
2021 - // Try common error structures
2022 - if ('message' in error && typeof error.message === 'string') {
2023 - return error.message;
2024 - }
2025 - if ('issues' in error && Array.isArray(error.issues) && error.issues.length > 0) {
2026 - const firstIssue = error.issues[0];
2027 - if (firstIssue && typeof firstIssue === 'object' && 'message' in firstIssue) {
2028 - return String(firstIssue.message);
2029 - }
2030 - }
2031 - // Fallback: try to stringify the error
2032 - try {
2033 - return JSON.stringify(error);
2034 - }
2035 - catch {
2036 - return String(error);
2037 - }
2038 - }
2039 - return String(error);
2040 -}
2041 -// --- Schema metadata access ---
2042 -/**
2043 - * Gets the description from a schema, if available.
2044 - * Works with both Zod v3 and v4.
2045 - *
2046 - * Both versions expose a `.description` getter that returns the description
2047 - * from their respective internal storage (v3: _def, v4: globalRegistry).
2048 - */
2049 -function getSchemaDescription(schema) {
2050 - return schema.description;
2051 -}
2052 -/**
2053 - * Checks if a schema is optional.
2054 - * Works with both Zod v3 and v4.
2055 - */
2056 -function isSchemaOptional(schema) {
2057 - if (isZ4Schema(schema)) {
2058 - const v4Schema = schema;
2059 - return v4Schema._zod?.def?.type === 'optional';
2060 - }
2061 - const v3Schema = schema;
2062 - // v3 has isOptional() method
2063 - if (typeof schema.isOptional === 'function') {
2064 - return schema.isOptional();
2065 - }
2066 - return v3Schema._def?.typeName === 'ZodOptional';
2067 -}
2068 -/**
2069 - * Gets the literal value from a schema, if it's a literal schema.
2070 - * Works with both Zod v3 and v4.
2071 - * Returns undefined if the schema is not a literal or the value cannot be determined.
2072 - */
2073 -function getLiteralValue(schema) {
2074 - if (isZ4Schema(schema)) {
2075 - const v4Schema = schema;
2076 - const def = v4Schema._zod?.def;
2077 - if (def) {
2078 - // Try various ways to get the literal value
2079 - if (def.value !== undefined)
2080 - return def.value;
2081 - if (Array.isArray(def.values) && def.values.length > 0) {
2082 - return def.values[0];
2083 - }
2084 - }
2085 - }
2086 - const v3Schema = schema;
2087 - const def = v3Schema._def;
2088 - if (def) {
2089 - if (def.value !== undefined)
2090 - return def.value;
2091 - if (Array.isArray(def.values) && def.values.length > 0) {
2092 - return def.values[0];
2093 - }
2094 - }
2095 - // Fallback: check for direct value property (some Zod versions)
2096 - const directValue = schema.value;
2097 - if (directValue !== undefined)
2098 - return directValue;
2099 - return undefined;
2100 -}
2101 -//# sourceMappingURL=zod-compat.js.map
2102 -
2103 -/***/ }),
2104 -
2105 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js":
2106 -/*!******************************************************************************************!*\
2107 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js ***!
2108 - \******************************************************************************************/
2109 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2110 -
2111 -__webpack_require__.r(__webpack_exports__);
2112 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2113 -/* harmony export */ getMethodLiteral: function() { return /* binding */ getMethodLiteral; },
2114 -/* harmony export */ parseWithCompat: function() { return /* binding */ parseWithCompat; },
2115 -/* harmony export */ toJsonSchemaCompat: function() { return /* binding */ toJsonSchemaCompat; }
2116 -/* harmony export */ });
2117 -/* harmony import */ var zod_v4_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod/v4-mini */ "./node_modules/zod/v4/core/to-json-schema.js");
2118 -/* harmony import */ var _zod_compat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./zod-compat.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js");
2119 -/* harmony import */ var zod_to_json_schema__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! zod-to-json-schema */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/index.js");
2120 -// zod-json-schema-compat.ts
2121 -// ----------------------------------------------------
2122 -// JSON Schema conversion for both Zod v3 and Zod v4 (Mini)
2123 -// v3 uses your vendored converter; v4 uses Mini's toJSONSchema
2124 -// ----------------------------------------------------
2125 -
2126 -
2127 -
2128 -function mapMiniTarget(t) {
2129 - if (!t)
2130 - return 'draft-7';
2131 - if (t === 'jsonSchema7' || t === 'draft-7')
2132 - return 'draft-7';
2133 - if (t === 'jsonSchema2019-09' || t === 'draft-2020-12')
2134 - return 'draft-2020-12';
2135 - return 'draft-7'; // fallback
2136 -}
2137 -function toJsonSchemaCompat(schema, opts) {
2138 - if ((0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.isZ4Schema)(schema)) {
2139 - // v4 branch — use Mini's built-in toJSONSchema
2140 - return zod_v4_mini__WEBPACK_IMPORTED_MODULE_0__.toJSONSchema(schema, {
2141 - target: mapMiniTarget(opts?.target),
2142 - io: opts?.pipeStrategy ?? 'input'
2143 - });
2144 - }
2145 - // v3 branch — use vendored converter
2146 - return (0,zod_to_json_schema__WEBPACK_IMPORTED_MODULE_2__.zodToJsonSchema)(schema, {
2147 - strictUnions: opts?.strictUnions ?? true,
2148 - pipeStrategy: opts?.pipeStrategy ?? 'input'
2149 - });
2150 -}
2151 -function getMethodLiteral(schema) {
2152 - const shape = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getObjectShape)(schema);
2153 - const methodSchema = shape?.method;
2154 - if (!methodSchema) {
2155 - throw new Error('Schema is missing a method literal');
2156 - }
2157 - const value = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.getLiteralValue)(methodSchema);
2158 - if (typeof value !== 'string') {
2159 - throw new Error('Schema method literal must be a string');
2160 - }
2161 - return value;
2162 -}
2163 -function parseWithCompat(schema, data) {
2164 - const result = (0,_zod_compat_js__WEBPACK_IMPORTED_MODULE_1__.safeParse)(schema, data);
2165 - if (!result.success) {
2166 - throw result.error;
2167 - }
2168 - return result.data;
2169 -}
2170 -//# sourceMappingURL=zod-json-schema-compat.js.map
2171 -
2172 -/***/ }),
2173 -
2174 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js":
2175 -/*!****************************************************************************!*\
2176 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js ***!
2177 - \****************************************************************************/
2178 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
2179 -
2180 -__webpack_require__.r(__webpack_exports__);
2181 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2182 -/* harmony export */ DEFAULT_REQUEST_TIMEOUT_MSEC: function() { return /* binding */ DEFAULT_REQUEST_TIMEOUT_MSEC; },
2183 -/* harmony export */ Protocol: function() { return /* binding */ Protocol; },
2184 -/* harmony export */ mergeCapabilities: function() { return /* binding */ mergeCapabilities; }
2185 -/* harmony export */ });
2186 -/* harmony import */ var _server_zod_compat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../server/zod-compat.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js");
2187 -/* harmony import */ var _types_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");
2188 -/* harmony import */ var _experimental_tasks_interfaces_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../experimental/tasks/interfaces.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js");
2189 -/* harmony import */ var _server_zod_json_schema_compat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../server/zod-json-schema-compat.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js");
2190 -
2191 -
2192 -
2193 -
2194 -/**
2195 - * The default request timeout, in miliseconds.
2196 - */
2197 -const DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
2198 -/**
2199 - * Implements MCP protocol framing on top of a pluggable transport, including
2200 - * features like request/response linking, notifications, and progress.
2201 - */
2202 -class Protocol {
2203 - constructor(_options) {
2204 - this._options = _options;
2205 - this._requestMessageId = 0;
2206 - this._requestHandlers = new Map();
2207 - this._requestHandlerAbortControllers = new Map();
2208 - this._notificationHandlers = new Map();
2209 - this._responseHandlers = new Map();
2210 - this._progressHandlers = new Map();
2211 - this._timeoutInfo = new Map();
2212 - this._pendingDebouncedNotifications = new Set();
2213 - // Maps task IDs to progress tokens to keep handlers alive after CreateTaskResult
2214 - this._taskProgressTokens = new Map();
2215 - this._requestResolvers = new Map();
2216 - this.setNotificationHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.CancelledNotificationSchema, notification => {
2217 - this._oncancel(notification);
2218 - });
2219 - this.setNotificationHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.ProgressNotificationSchema, notification => {
2220 - this._onprogress(notification);
2221 - });
2222 - this.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.PingRequestSchema,
2223 - // Automatic pong by default.
2224 - _request => ({}));
2225 - // Install task handlers if TaskStore is provided
2226 - this._taskStore = _options?.taskStore;
2227 - this._taskMessageQueue = _options?.taskMessageQueue;
2228 - if (this._taskStore) {
2229 - this.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.GetTaskRequestSchema, async (request, extra) => {
2230 - const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
2231 - if (!task) {
2232 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, 'Failed to retrieve task: Task not found');
2233 - }
2234 - // Per spec: tasks/get responses SHALL NOT include related-task metadata
2235 - // as the taskId parameter is the source of truth
2236 - // @ts-expect-error SendResultT cannot contain GetTaskResult, but we include it in our derived types everywhere else
2237 - return {
2238 - ...task
2239 - };
2240 - });
2241 - this.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.GetTaskPayloadRequestSchema, async (request, extra) => {
2242 - const handleTaskResult = async () => {
2243 - const taskId = request.params.taskId;
2244 - // Deliver queued messages
2245 - if (this._taskMessageQueue) {
2246 - let queuedMessage;
2247 - while ((queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId))) {
2248 - // Handle response and error messages by routing them to the appropriate resolver
2249 - if (queuedMessage.type === 'response' || queuedMessage.type === 'error') {
2250 - const message = queuedMessage.message;
2251 - const requestId = message.id;
2252 - // Lookup resolver in _requestResolvers map
2253 - const resolver = this._requestResolvers.get(requestId);
2254 - if (resolver) {
2255 - // Remove resolver from map after invocation
2256 - this._requestResolvers.delete(requestId);
2257 - // Invoke resolver with response or error
2258 - if (queuedMessage.type === 'response') {
2259 - resolver(message);
2260 - }
2261 - else {
2262 - // Convert JSONRPCError to McpError
2263 - const errorMessage = message;
2264 - const error = new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(errorMessage.error.code, errorMessage.error.message, errorMessage.error.data);
2265 - resolver(error);
2266 - }
2267 - }
2268 - else {
2269 - // Handle missing resolver gracefully with error logging
2270 - const messageType = queuedMessage.type === 'response' ? 'Response' : 'Error';
2271 - this._onerror(new Error(`${messageType} handler missing for request ${requestId}`));
2272 - }
2273 - // Continue to next message
2274 - continue;
2275 - }
2276 - // Send the message on the response stream by passing the relatedRequestId
2277 - // This tells the transport to write the message to the tasks/result response stream
2278 - await this._transport?.send(queuedMessage.message, { relatedRequestId: extra.requestId });
2279 - }
2280 - }
2281 - // Now check task status
2282 - const task = await this._taskStore.getTask(taskId, extra.sessionId);
2283 - if (!task) {
2284 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Task not found: ${taskId}`);
2285 - }
2286 - // Block if task is not terminal (we've already delivered all queued messages above)
2287 - if (!(0,_experimental_tasks_interfaces_js__WEBPACK_IMPORTED_MODULE_2__.isTerminal)(task.status)) {
2288 - // Wait for status change or new messages
2289 - await this._waitForTaskUpdate(taskId, extra.signal);
2290 - // After waking up, recursively call to deliver any new messages or result
2291 - return await handleTaskResult();
2292 - }
2293 - // If task is terminal, return the result
2294 - if ((0,_experimental_tasks_interfaces_js__WEBPACK_IMPORTED_MODULE_2__.isTerminal)(task.status)) {
2295 - const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
2296 - this._clearTaskQueue(taskId);
2297 - return {
2298 - ...result,
2299 - _meta: {
2300 - ...result._meta,
2301 - [_types_js__WEBPACK_IMPORTED_MODULE_1__.RELATED_TASK_META_KEY]: {
2302 - taskId: taskId
2303 - }
2304 - }
2305 - };
2306 - }
2307 - return await handleTaskResult();
2308 - };
2309 - return await handleTaskResult();
2310 - });
2311 - this.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.ListTasksRequestSchema, async (request, extra) => {
2312 - try {
2313 - const { tasks, nextCursor } = await this._taskStore.listTasks(request.params?.cursor, extra.sessionId);
2314 - // @ts-expect-error SendResultT cannot contain ListTasksResult, but we include it in our derived types everywhere else
2315 - return {
2316 - tasks,
2317 - nextCursor,
2318 - _meta: {}
2319 - };
2320 - }
2321 - catch (error) {
2322 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Failed to list tasks: ${error instanceof Error ? error.message : String(error)}`);
2323 - }
2324 - });
2325 - this.setRequestHandler(_types_js__WEBPACK_IMPORTED_MODULE_1__.CancelTaskRequestSchema, async (request, extra) => {
2326 - try {
2327 - // Get the current task to check if it's in a terminal state, in case the implementation is not atomic
2328 - const task = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
2329 - if (!task) {
2330 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Task not found: ${request.params.taskId}`);
2331 - }
2332 - // Reject cancellation of terminal tasks
2333 - if ((0,_experimental_tasks_interfaces_js__WEBPACK_IMPORTED_MODULE_2__.isTerminal)(task.status)) {
2334 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
2335 - }
2336 - await this._taskStore.updateTaskStatus(request.params.taskId, 'cancelled', 'Client cancelled task execution.', extra.sessionId);
2337 - this._clearTaskQueue(request.params.taskId);
2338 - const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
2339 - if (!cancelledTask) {
2340 - // Task was deleted during cancellation (e.g., cleanup happened)
2341 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
2342 - }
2343 - return {
2344 - _meta: {},
2345 - ...cancelledTask
2346 - };
2347 - }
2348 - catch (error) {
2349 - // Re-throw McpError as-is
2350 - if (error instanceof _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError) {
2351 - throw error;
2352 - }
2353 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidRequest, `Failed to cancel task: ${error instanceof Error ? error.message : String(error)}`);
2354 - }
2355 - });
2356 - }
2357 - }
2358 - async _oncancel(notification) {
2359 - if (!notification.params.requestId) {
2360 - return;
2361 - }
2362 - // Handle request cancellation
2363 - const controller = this._requestHandlerAbortControllers.get(notification.params.requestId);
2364 - controller?.abort(notification.params.reason);
2365 - }
2366 - _setupTimeout(messageId, timeout, maxTotalTimeout, onTimeout, resetTimeoutOnProgress = false) {
2367 - this._timeoutInfo.set(messageId, {
2368 - timeoutId: setTimeout(onTimeout, timeout),
2369 - startTime: Date.now(),
2370 - timeout,
2371 - maxTotalTimeout,
2372 - resetTimeoutOnProgress,
2373 - onTimeout
2374 - });
2375 - }
2376 - _resetTimeout(messageId) {
2377 - const info = this._timeoutInfo.get(messageId);
2378 - if (!info)
2379 - return false;
2380 - const totalElapsed = Date.now() - info.startTime;
2381 - if (info.maxTotalTimeout && totalElapsed >= info.maxTotalTimeout) {
2382 - this._timeoutInfo.delete(messageId);
2383 - throw _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError.fromError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.RequestTimeout, 'Maximum total timeout exceeded', {
2384 - maxTotalTimeout: info.maxTotalTimeout,
2385 - totalElapsed
2386 - });
2387 - }
2388 - clearTimeout(info.timeoutId);
2389 - info.timeoutId = setTimeout(info.onTimeout, info.timeout);
2390 - return true;
2391 - }
2392 - _cleanupTimeout(messageId) {
2393 - const info = this._timeoutInfo.get(messageId);
2394 - if (info) {
2395 - clearTimeout(info.timeoutId);
2396 - this._timeoutInfo.delete(messageId);
2397 - }
2398 - }
2399 - /**
2400 - * Attaches to the given transport, starts it, and starts listening for messages.
2401 - *
2402 - * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward.
2403 - */
2404 - async connect(transport) {
2405 - if (this._transport) {
2406 - throw new Error('Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.');
2407 - }
2408 - this._transport = transport;
2409 - const _onclose = this.transport?.onclose;
2410 - this._transport.onclose = () => {
2411 - _onclose?.();
2412 - this._onclose();
2413 - };
2414 - const _onerror = this.transport?.onerror;
2415 - this._transport.onerror = (error) => {
2416 - _onerror?.(error);
2417 - this._onerror(error);
2418 - };
2419 - const _onmessage = this._transport?.onmessage;
2420 - this._transport.onmessage = (message, extra) => {
2421 - _onmessage?.(message, extra);
2422 - if ((0,_types_js__WEBPACK_IMPORTED_MODULE_1__.isJSONRPCResultResponse)(message) || (0,_types_js__WEBPACK_IMPORTED_MODULE_1__.isJSONRPCErrorResponse)(message)) {
2423 - this._onresponse(message);
2424 - }
2425 - else if ((0,_types_js__WEBPACK_IMPORTED_MODULE_1__.isJSONRPCRequest)(message)) {
2426 - this._onrequest(message, extra);
2427 - }
2428 - else if ((0,_types_js__WEBPACK_IMPORTED_MODULE_1__.isJSONRPCNotification)(message)) {
2429 - this._onnotification(message);
2430 - }
2431 - else {
2432 - this._onerror(new Error(`Unknown message type: ${JSON.stringify(message)}`));
2433 - }
2434 - };
2435 - await this._transport.start();
2436 - }
2437 - _onclose() {
2438 - const responseHandlers = this._responseHandlers;
2439 - this._responseHandlers = new Map();
2440 - this._progressHandlers.clear();
2441 - this._taskProgressTokens.clear();
2442 - this._pendingDebouncedNotifications.clear();
2443 - // Abort all in-flight request handlers so they stop sending messages
2444 - for (const controller of this._requestHandlerAbortControllers.values()) {
2445 - controller.abort();
2446 - }
2447 - this._requestHandlerAbortControllers.clear();
2448 - const error = _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError.fromError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.ConnectionClosed, 'Connection closed');
2449 - this._transport = undefined;
2450 - this.onclose?.();
2451 - for (const handler of responseHandlers.values()) {
2452 - handler(error);
2453 - }
2454 - }
2455 - _onerror(error) {
2456 - this.onerror?.(error);
2457 - }
2458 - _onnotification(notification) {
2459 - const handler = this._notificationHandlers.get(notification.method) ?? this.fallbackNotificationHandler;
2460 - // Ignore notifications not being subscribed to.
2461 - if (handler === undefined) {
2462 - return;
2463 - }
2464 - // Starting with Promise.resolve() puts any synchronous errors into the monad as well.
2465 - Promise.resolve()
2466 - .then(() => handler(notification))
2467 - .catch(error => this._onerror(new Error(`Uncaught error in notification handler: ${error}`)));
2468 - }
2469 - _onrequest(request, extra) {
2470 - const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
2471 - // Capture the current transport at request time to ensure responses go to the correct client
2472 - const capturedTransport = this._transport;
2473 - // Extract taskId from request metadata if present (needed early for method not found case)
2474 - const relatedTaskId = request.params?._meta?.[_types_js__WEBPACK_IMPORTED_MODULE_1__.RELATED_TASK_META_KEY]?.taskId;
2475 - if (handler === undefined) {
2476 - const errorResponse = {
2477 - jsonrpc: '2.0',
2478 - id: request.id,
2479 - error: {
2480 - code: _types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.MethodNotFound,
2481 - message: 'Method not found'
2482 - }
2483 - };
2484 - // Queue or send the error response based on whether this is a task-related request
2485 - if (relatedTaskId && this._taskMessageQueue) {
2486 - this._enqueueTaskMessage(relatedTaskId, {
2487 - type: 'error',
2488 - message: errorResponse,
2489 - timestamp: Date.now()
2490 - }, capturedTransport?.sessionId).catch(error => this._onerror(new Error(`Failed to enqueue error response: ${error}`)));
2491 - }
2492 - else {
2493 - capturedTransport
2494 - ?.send(errorResponse)
2495 - .catch(error => this._onerror(new Error(`Failed to send an error response: ${error}`)));
2496 - }
2497 - return;
2498 - }
2499 - const abortController = new AbortController();
2500 - this._requestHandlerAbortControllers.set(request.id, abortController);
2501 - const taskCreationParams = (0,_types_js__WEBPACK_IMPORTED_MODULE_1__.isTaskAugmentedRequestParams)(request.params) ? request.params.task : undefined;
2502 - const taskStore = this._taskStore ? this.requestTaskStore(request, capturedTransport?.sessionId) : undefined;
2503 - const fullExtra = {
2504 - signal: abortController.signal,
2505 - sessionId: capturedTransport?.sessionId,
2506 - _meta: request.params?._meta,
2507 - sendNotification: async (notification) => {
2508 - if (abortController.signal.aborted)
2509 - return;
2510 - // Include related-task metadata if this request is part of a task
2511 - const notificationOptions = { relatedRequestId: request.id };
2512 - if (relatedTaskId) {
2513 - notificationOptions.relatedTask = { taskId: relatedTaskId };
2514 - }
2515 - await this.notification(notification, notificationOptions);
2516 - },
2517 - sendRequest: async (r, resultSchema, options) => {
2518 - if (abortController.signal.aborted) {
2519 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.ConnectionClosed, 'Request was cancelled');
2520 - }
2521 - // Include related-task metadata if this request is part of a task
2522 - const requestOptions = { ...options, relatedRequestId: request.id };
2523 - if (relatedTaskId && !requestOptions.relatedTask) {
2524 - requestOptions.relatedTask = { taskId: relatedTaskId };
2525 - }
2526 - // Set task status to input_required when sending a request within a task context
2527 - // Use the taskId from options (explicit) or fall back to relatedTaskId (inherited)
2528 - const effectiveTaskId = requestOptions.relatedTask?.taskId ?? relatedTaskId;
2529 - if (effectiveTaskId && taskStore) {
2530 - await taskStore.updateTaskStatus(effectiveTaskId, 'input_required');
2531 - }
2532 - return await this.request(r, resultSchema, requestOptions);
2533 - },
2534 - authInfo: extra?.authInfo,
2535 - requestId: request.id,
2536 - requestInfo: extra?.requestInfo,
2537 - taskId: relatedTaskId,
2538 - taskStore: taskStore,
2539 - taskRequestedTtl: taskCreationParams?.ttl,
2540 - closeSSEStream: extra?.closeSSEStream,
2541 - closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
2542 - };
2543 - // Starting with Promise.resolve() puts any synchronous errors into the monad as well.
2544 - Promise.resolve()
2545 - .then(() => {
2546 - // If this request asked for task creation, check capability first
2547 - if (taskCreationParams) {
2548 - // Check if the request method supports task creation
2549 - this.assertTaskHandlerCapability(request.method);
2550 - }
2551 - })
2552 - .then(() => handler(request, fullExtra))
2553 - .then(async (result) => {
2554 - if (abortController.signal.aborted) {
2555 - // Request was cancelled
2556 - return;
2557 - }
2558 - const response = {
2559 - result,
2560 - jsonrpc: '2.0',
2561 - id: request.id
2562 - };
2563 - // Queue or send the response based on whether this is a task-related request
2564 - if (relatedTaskId && this._taskMessageQueue) {
2565 - await this._enqueueTaskMessage(relatedTaskId, {
2566 - type: 'response',
2567 - message: response,
2568 - timestamp: Date.now()
2569 - }, capturedTransport?.sessionId);
2570 - }
2571 - else {
2572 - await capturedTransport?.send(response);
2573 - }
2574 - }, async (error) => {
2575 - if (abortController.signal.aborted) {
2576 - // Request was cancelled
2577 - return;
2578 - }
2579 - const errorResponse = {
2580 - jsonrpc: '2.0',
2581 - id: request.id,
2582 - error: {
2583 - code: Number.isSafeInteger(error['code']) ? error['code'] : _types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InternalError,
2584 - message: error.message ?? 'Internal error',
2585 - ...(error['data'] !== undefined && { data: error['data'] })
2586 - }
2587 - };
2588 - // Queue or send the error response based on whether this is a task-related request
2589 - if (relatedTaskId && this._taskMessageQueue) {
2590 - await this._enqueueTaskMessage(relatedTaskId, {
2591 - type: 'error',
2592 - message: errorResponse,
2593 - timestamp: Date.now()
2594 - }, capturedTransport?.sessionId);
2595 - }
2596 - else {
2597 - await capturedTransport?.send(errorResponse);
2598 - }
2599 - })
2600 - .catch(error => this._onerror(new Error(`Failed to send response: ${error}`)))
2601 - .finally(() => {
2602 - this._requestHandlerAbortControllers.delete(request.id);
2603 - });
2604 - }
2605 - _onprogress(notification) {
2606 - const { progressToken, ...params } = notification.params;
2607 - const messageId = Number(progressToken);
2608 - const handler = this._progressHandlers.get(messageId);
2609 - if (!handler) {
2610 - this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(notification)}`));
2611 - return;
2612 - }
2613 - const responseHandler = this._responseHandlers.get(messageId);
2614 - const timeoutInfo = this._timeoutInfo.get(messageId);
2615 - if (timeoutInfo && responseHandler && timeoutInfo.resetTimeoutOnProgress) {
2616 - try {
2617 - this._resetTimeout(messageId);
2618 - }
2619 - catch (error) {
2620 - // Clean up if maxTotalTimeout was exceeded
2621 - this._responseHandlers.delete(messageId);
2622 - this._progressHandlers.delete(messageId);
2623 - this._cleanupTimeout(messageId);
2624 - responseHandler(error);
2625 - return;
2626 - }
2627 - }
2628 - handler(params);
2629 - }
2630 - _onresponse(response) {
2631 - const messageId = Number(response.id);
2632 - // Check if this is a response to a queued request
2633 - const resolver = this._requestResolvers.get(messageId);
2634 - if (resolver) {
2635 - this._requestResolvers.delete(messageId);
2636 - if ((0,_types_js__WEBPACK_IMPORTED_MODULE_1__.isJSONRPCResultResponse)(response)) {
2637 - resolver(response);
2638 - }
2639 - else {
2640 - const error = new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(response.error.code, response.error.message, response.error.data);
2641 - resolver(error);
2642 - }
2643 - return;
2644 - }
2645 - const handler = this._responseHandlers.get(messageId);
2646 - if (handler === undefined) {
2647 - this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(response)}`));
2648 - return;
2649 - }
2650 - this._responseHandlers.delete(messageId);
2651 - this._cleanupTimeout(messageId);
2652 - // Keep progress handler alive for CreateTaskResult responses
2653 - let isTaskResponse = false;
2654 - if ((0,_types_js__WEBPACK_IMPORTED_MODULE_1__.isJSONRPCResultResponse)(response) && response.result && typeof response.result === 'object') {
2655 - const result = response.result;
2656 - if (result.task && typeof result.task === 'object') {
2657 - const task = result.task;
2658 - if (typeof task.taskId === 'string') {
2659 - isTaskResponse = true;
2660 - this._taskProgressTokens.set(task.taskId, messageId);
2661 - }
2662 - }
2663 - }
2664 - if (!isTaskResponse) {
2665 - this._progressHandlers.delete(messageId);
2666 - }
2667 - if ((0,_types_js__WEBPACK_IMPORTED_MODULE_1__.isJSONRPCResultResponse)(response)) {
2668 - handler(response);
2669 - }
2670 - else {
2671 - const error = _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError.fromError(response.error.code, response.error.message, response.error.data);
2672 - handler(error);
2673 - }
2674 - }
2675 - get transport() {
2676 - return this._transport;
2677 - }
2678 - /**
2679 - * Closes the connection.
2680 - */
2681 - async close() {
2682 - await this._transport?.close();
2683 - }
2684 - /**
2685 - * Sends a request and returns an AsyncGenerator that yields response messages.
2686 - * The generator is guaranteed to end with either a 'result' or 'error' message.
2687 - *
2688 - * @example
2689 - * ```typescript
2690 - * const stream = protocol.requestStream(request, resultSchema, options);
2691 - * for await (const message of stream) {
2692 - * switch (message.type) {
2693 - * case 'taskCreated':
2694 - * console.log('Task created:', message.task.taskId);
2695 - * break;
2696 - * case 'taskStatus':
2697 - * console.log('Task status:', message.task.status);
2698 - * break;
2699 - * case 'result':
2700 - * console.log('Final result:', message.result);
2701 - * break;
2702 - * case 'error':
2703 - * console.error('Error:', message.error);
2704 - * break;
2705 - * }
2706 - * }
2707 - * ```
2708 - *
2709 - * @experimental Use `client.experimental.tasks.requestStream()` to access this method.
2710 - */
2711 - async *requestStream(request, resultSchema, options) {
2712 - const { task } = options ?? {};
2713 - // For non-task requests, just yield the result
2714 - if (!task) {
2715 - try {
2716 - const result = await this.request(request, resultSchema, options);
2717 - yield { type: 'result', result };
2718 - }
2719 - catch (error) {
2720 - yield {
2721 - type: 'error',
2722 - error: error instanceof _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError ? error : new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InternalError, String(error))
2723 - };
2724 - }
2725 - return;
2726 - }
2727 - // For task-augmented requests, we need to poll for status
2728 - // First, make the request to create the task
2729 - let taskId;
2730 - try {
2731 - // Send the request and get the CreateTaskResult
2732 - const createResult = await this.request(request, _types_js__WEBPACK_IMPORTED_MODULE_1__.CreateTaskResultSchema, options);
2733 - // Extract taskId from the result
2734 - if (createResult.task) {
2735 - taskId = createResult.task.taskId;
2736 - yield { type: 'taskCreated', task: createResult.task };
2737 - }
2738 - else {
2739 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InternalError, 'Task creation did not return a task');
2740 - }
2741 - // Poll for task completion
2742 - while (true) {
2743 - // Get current task status
2744 - const task = await this.getTask({ taskId }, options);
2745 - yield { type: 'taskStatus', task };
2746 - // Check if task is terminal
2747 - if ((0,_experimental_tasks_interfaces_js__WEBPACK_IMPORTED_MODULE_2__.isTerminal)(task.status)) {
2748 - if (task.status === 'completed') {
2749 - // Get the final result
2750 - const result = await this.getTaskResult({ taskId }, resultSchema, options);
2751 - yield { type: 'result', result };
2752 - }
2753 - else if (task.status === 'failed') {
2754 - yield {
2755 - type: 'error',
2756 - error: new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InternalError, `Task ${taskId} failed`)
2757 - };
2758 - }
2759 - else if (task.status === 'cancelled') {
2760 - yield {
2761 - type: 'error',
2762 - error: new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InternalError, `Task ${taskId} was cancelled`)
2763 - };
2764 - }
2765 - return;
2766 - }
2767 - // When input_required, call tasks/result to deliver queued messages
2768 - // (elicitation, sampling) via SSE and block until terminal
2769 - if (task.status === 'input_required') {
2770 - const result = await this.getTaskResult({ taskId }, resultSchema, options);
2771 - yield { type: 'result', result };
2772 - return;
2773 - }
2774 - // Wait before polling again
2775 - const pollInterval = task.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1000;
2776 - await new Promise(resolve => setTimeout(resolve, pollInterval));
2777 - // Check if cancelled
2778 - options?.signal?.throwIfAborted();
2779 - }
2780 - }
2781 - catch (error) {
2782 - yield {
2783 - type: 'error',
2784 - error: error instanceof _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError ? error : new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InternalError, String(error))
2785 - };
2786 - }
2787 - }
2788 - /**
2789 - * Sends a request and waits for a response.
2790 - *
2791 - * Do not use this method to emit notifications! Use notification() instead.
2792 - */
2793 - request(request, resultSchema, options) {
2794 - const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
2795 - // Send the request
2796 - return new Promise((resolve, reject) => {
2797 - const earlyReject = (error) => {
2798 - reject(error);
2799 - };
2800 - if (!this._transport) {
2801 - earlyReject(new Error('Not connected'));
2802 - return;
2803 - }
2804 - if (this._options?.enforceStrictCapabilities === true) {
2805 - try {
2806 - this.assertCapabilityForMethod(request.method);
2807 - // If task creation is requested, also check task capabilities
2808 - if (task) {
2809 - this.assertTaskCapability(request.method);
2810 - }
2811 - }
2812 - catch (e) {
2813 - earlyReject(e);
2814 - return;
2815 - }
2816 - }
2817 - options?.signal?.throwIfAborted();
2818 - const messageId = this._requestMessageId++;
2819 - const jsonrpcRequest = {
2820 - ...request,
2821 - jsonrpc: '2.0',
2822 - id: messageId
2823 - };
2824 - if (options?.onprogress) {
2825 - this._progressHandlers.set(messageId, options.onprogress);
2826 - jsonrpcRequest.params = {
2827 - ...request.params,
2828 - _meta: {
2829 - ...(request.params?._meta || {}),
2830 - progressToken: messageId
2831 - }
2832 - };
2833 - }
2834 - // Augment with task creation parameters if provided
2835 - if (task) {
2836 - jsonrpcRequest.params = {
2837 - ...jsonrpcRequest.params,
2838 - task: task
2839 - };
2840 - }
2841 - // Augment with related task metadata if relatedTask is provided
2842 - if (relatedTask) {
2843 - jsonrpcRequest.params = {
2844 - ...jsonrpcRequest.params,
2845 - _meta: {
2846 - ...(jsonrpcRequest.params?._meta || {}),
2847 - [_types_js__WEBPACK_IMPORTED_MODULE_1__.RELATED_TASK_META_KEY]: relatedTask
2848 - }
2849 - };
2850 - }
2851 - const cancel = (reason) => {
2852 - this._responseHandlers.delete(messageId);
2853 - this._progressHandlers.delete(messageId);
2854 - this._cleanupTimeout(messageId);
2855 - this._transport
2856 - ?.send({
2857 - jsonrpc: '2.0',
2858 - method: 'notifications/cancelled',
2859 - params: {
2860 - requestId: messageId,
2861 - reason: String(reason)
2862 - }
2863 - }, { relatedRequestId, resumptionToken, onresumptiontoken })
2864 - .catch(error => this._onerror(new Error(`Failed to send cancellation: ${error}`)));
2865 - // Wrap the reason in an McpError if it isn't already
2866 - const error = reason instanceof _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError ? reason : new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.RequestTimeout, String(reason));
2867 - reject(error);
2868 - };
2869 - this._responseHandlers.set(messageId, response => {
2870 - if (options?.signal?.aborted) {
2871 - return;
2872 - }
2873 - if (response instanceof Error) {
2874 - return reject(response);
2875 - }
2876 - try {
2877 - const parseResult = (0,_server_zod_compat_js__WEBPACK_IMPORTED_MODULE_0__.safeParse)(resultSchema, response.result);
2878 - if (!parseResult.success) {
2879 - // Type guard: if success is false, error is guaranteed to exist
2880 - reject(parseResult.error);
2881 - }
2882 - else {
2883 - resolve(parseResult.data);
2884 - }
2885 - }
2886 - catch (error) {
2887 - reject(error);
2888 - }
2889 - });
2890 - options?.signal?.addEventListener('abort', () => {
2891 - cancel(options?.signal?.reason);
2892 - });
2893 - const timeout = options?.timeout ?? DEFAULT_REQUEST_TIMEOUT_MSEC;
2894 - const timeoutHandler = () => cancel(_types_js__WEBPACK_IMPORTED_MODULE_1__.McpError.fromError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.RequestTimeout, 'Request timed out', { timeout }));
2895 - this._setupTimeout(messageId, timeout, options?.maxTotalTimeout, timeoutHandler, options?.resetTimeoutOnProgress ?? false);
2896 - // Queue request if related to a task
2897 - const relatedTaskId = relatedTask?.taskId;
2898 - if (relatedTaskId) {
2899 - // Store the response resolver for this request so responses can be routed back
2900 - const responseResolver = (response) => {
2901 - const handler = this._responseHandlers.get(messageId);
2902 - if (handler) {
2903 - handler(response);
2904 - }
2905 - else {
2906 - // Log error when resolver is missing, but don't fail
2907 - this._onerror(new Error(`Response handler missing for side-channeled request ${messageId}`));
2908 - }
2909 - };
2910 - this._requestResolvers.set(messageId, responseResolver);
2911 - this._enqueueTaskMessage(relatedTaskId, {
2912 - type: 'request',
2913 - message: jsonrpcRequest,
2914 - timestamp: Date.now()
2915 - }).catch(error => {
2916 - this._cleanupTimeout(messageId);
2917 - reject(error);
2918 - });
2919 - // Don't send through transport - queued messages are delivered via tasks/result only
2920 - // This prevents duplicate delivery for bidirectional transports
2921 - }
2922 - else {
2923 - // No related task - send through transport normally
2924 - this._transport.send(jsonrpcRequest, { relatedRequestId, resumptionToken, onresumptiontoken }).catch(error => {
2925 - this._cleanupTimeout(messageId);
2926 - reject(error);
2927 - });
2928 - }
2929 - });
2930 - }
2931 - /**
2932 - * Gets the current status of a task.
2933 - *
2934 - * @experimental Use `client.experimental.tasks.getTask()` to access this method.
2935 - */
2936 - async getTask(params, options) {
2937 - // @ts-expect-error SendRequestT cannot directly contain GetTaskRequest, but we ensure all type instantiations contain it anyways
2938 - return this.request({ method: 'tasks/get', params }, _types_js__WEBPACK_IMPORTED_MODULE_1__.GetTaskResultSchema, options);
2939 - }
2940 - /**
2941 - * Retrieves the result of a completed task.
2942 - *
2943 - * @experimental Use `client.experimental.tasks.getTaskResult()` to access this method.
2944 - */
2945 - async getTaskResult(params, resultSchema, options) {
2946 - // @ts-expect-error SendRequestT cannot directly contain GetTaskPayloadRequest, but we ensure all type instantiations contain it anyways
2947 - return this.request({ method: 'tasks/result', params }, resultSchema, options);
2948 - }
2949 - /**
2950 - * Lists tasks, optionally starting from a pagination cursor.
2951 - *
2952 - * @experimental Use `client.experimental.tasks.listTasks()` to access this method.
2953 - */
2954 - async listTasks(params, options) {
2955 - // @ts-expect-error SendRequestT cannot directly contain ListTasksRequest, but we ensure all type instantiations contain it anyways
2956 - return this.request({ method: 'tasks/list', params }, _types_js__WEBPACK_IMPORTED_MODULE_1__.ListTasksResultSchema, options);
2957 - }
2958 - /**
2959 - * Cancels a specific task.
2960 - *
2961 - * @experimental Use `client.experimental.tasks.cancelTask()` to access this method.
2962 - */
2963 - async cancelTask(params, options) {
2964 - // @ts-expect-error SendRequestT cannot directly contain CancelTaskRequest, but we ensure all type instantiations contain it anyways
2965 - return this.request({ method: 'tasks/cancel', params }, _types_js__WEBPACK_IMPORTED_MODULE_1__.CancelTaskResultSchema, options);
2966 - }
2967 - /**
2968 - * Emits a notification, which is a one-way message that does not expect a response.
2969 - */
2970 - async notification(notification, options) {
2971 - if (!this._transport) {
2972 - throw new Error('Not connected');
2973 - }
2974 - this.assertNotificationCapability(notification.method);
2975 - // Queue notification if related to a task
2976 - const relatedTaskId = options?.relatedTask?.taskId;
2977 - if (relatedTaskId) {
2978 - // Build the JSONRPC notification with metadata
2979 - const jsonrpcNotification = {
2980 - ...notification,
2981 - jsonrpc: '2.0',
2982 - params: {
2983 - ...notification.params,
2984 - _meta: {
2985 - ...(notification.params?._meta || {}),
2986 - [_types_js__WEBPACK_IMPORTED_MODULE_1__.RELATED_TASK_META_KEY]: options.relatedTask
2987 - }
2988 - }
2989 - };
2990 - await this._enqueueTaskMessage(relatedTaskId, {
2991 - type: 'notification',
2992 - message: jsonrpcNotification,
2993 - timestamp: Date.now()
2994 - });
2995 - // Don't send through transport - queued messages are delivered via tasks/result only
2996 - // This prevents duplicate delivery for bidirectional transports
2997 - return;
2998 - }
2999 - const debouncedMethods = this._options?.debouncedNotificationMethods ?? [];
3000 - // A notification can only be debounced if it's in the list AND it's "simple"
3001 - // (i.e., has no parameters and no related request ID or related task that could be lost).
3002 - const canDebounce = debouncedMethods.includes(notification.method) && !notification.params && !options?.relatedRequestId && !options?.relatedTask;
3003 - if (canDebounce) {
3004 - // If a notification of this type is already scheduled, do nothing.
3005 - if (this._pendingDebouncedNotifications.has(notification.method)) {
3006 - return;
3007 - }
3008 - // Mark this notification type as pending.
3009 - this._pendingDebouncedNotifications.add(notification.method);
3010 - // Schedule the actual send to happen in the next microtask.
3011 - // This allows all synchronous calls in the current event loop tick to be coalesced.
3012 - Promise.resolve().then(() => {
3013 - // Un-mark the notification so the next one can be scheduled.
3014 - this._pendingDebouncedNotifications.delete(notification.method);
3015 - // SAFETY CHECK: If the connection was closed while this was pending, abort.
3016 - if (!this._transport) {
3017 - return;
3018 - }
3019 - let jsonrpcNotification = {
3020 - ...notification,
3021 - jsonrpc: '2.0'
3022 - };
3023 - // Augment with related task metadata if relatedTask is provided
3024 - if (options?.relatedTask) {
3025 - jsonrpcNotification = {
3026 - ...jsonrpcNotification,
3027 - params: {
3028 - ...jsonrpcNotification.params,
3029 - _meta: {
3030 - ...(jsonrpcNotification.params?._meta || {}),
3031 - [_types_js__WEBPACK_IMPORTED_MODULE_1__.RELATED_TASK_META_KEY]: options.relatedTask
3032 - }
3033 - }
3034 - };
3035 - }
3036 - // Send the notification, but don't await it here to avoid blocking.
3037 - // Handle potential errors with a .catch().
3038 - this._transport?.send(jsonrpcNotification, options).catch(error => this._onerror(error));
3039 - });
3040 - // Return immediately.
3041 - return;
3042 - }
3043 - let jsonrpcNotification = {
3044 - ...notification,
3045 - jsonrpc: '2.0'
3046 - };
3047 - // Augment with related task metadata if relatedTask is provided
3048 - if (options?.relatedTask) {
3049 - jsonrpcNotification = {
3050 - ...jsonrpcNotification,
3051 - params: {
3052 - ...jsonrpcNotification.params,
3053 - _meta: {
3054 - ...(jsonrpcNotification.params?._meta || {}),
3055 - [_types_js__WEBPACK_IMPORTED_MODULE_1__.RELATED_TASK_META_KEY]: options.relatedTask
3056 - }
3057 - }
3058 - };
3059 - }
3060 - await this._transport.send(jsonrpcNotification, options);
3061 - }
3062 - /**
3063 - * Registers a handler to invoke when this protocol object receives a request with the given method.
3064 - *
3065 - * Note that this will replace any previous request handler for the same method.
3066 - */
3067 - setRequestHandler(requestSchema, handler) {
3068 - const method = (0,_server_zod_json_schema_compat_js__WEBPACK_IMPORTED_MODULE_3__.getMethodLiteral)(requestSchema);
3069 - this.assertRequestHandlerCapability(method);
3070 - this._requestHandlers.set(method, (request, extra) => {
3071 - const parsed = (0,_server_zod_json_schema_compat_js__WEBPACK_IMPORTED_MODULE_3__.parseWithCompat)(requestSchema, request);
3072 - return Promise.resolve(handler(parsed, extra));
3073 - });
3074 - }
3075 - /**
3076 - * Removes the request handler for the given method.
3077 - */
3078 - removeRequestHandler(method) {
3079 - this._requestHandlers.delete(method);
3080 - }
3081 - /**
3082 - * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed.
3083 - */
3084 - assertCanSetRequestHandler(method) {
3085 - if (this._requestHandlers.has(method)) {
3086 - throw new Error(`A request handler for ${method} already exists, which would be overridden`);
3087 - }
3088 - }
3089 - /**
3090 - * Registers a handler to invoke when this protocol object receives a notification with the given method.
3091 - *
3092 - * Note that this will replace any previous notification handler for the same method.
3093 - */
3094 - setNotificationHandler(notificationSchema, handler) {
3095 - const method = (0,_server_zod_json_schema_compat_js__WEBPACK_IMPORTED_MODULE_3__.getMethodLiteral)(notificationSchema);
3096 - this._notificationHandlers.set(method, notification => {
3097 - const parsed = (0,_server_zod_json_schema_compat_js__WEBPACK_IMPORTED_MODULE_3__.parseWithCompat)(notificationSchema, notification);
3098 - return Promise.resolve(handler(parsed));
3099 - });
3100 - }
3101 - /**
3102 - * Removes the notification handler for the given method.
3103 - */
3104 - removeNotificationHandler(method) {
3105 - this._notificationHandlers.delete(method);
3106 - }
3107 - /**
3108 - * Cleans up the progress handler associated with a task.
3109 - * This should be called when a task reaches a terminal status.
3110 - */
3111 - _cleanupTaskProgressHandler(taskId) {
3112 - const progressToken = this._taskProgressTokens.get(taskId);
3113 - if (progressToken !== undefined) {
3114 - this._progressHandlers.delete(progressToken);
3115 - this._taskProgressTokens.delete(taskId);
3116 - }
3117 - }
3118 - /**
3119 - * Enqueues a task-related message for side-channel delivery via tasks/result.
3120 - * @param taskId The task ID to associate the message with
3121 - * @param message The message to enqueue
3122 - * @param sessionId Optional session ID for binding the operation to a specific session
3123 - * @throws Error if taskStore is not configured or if enqueue fails (e.g., queue overflow)
3124 - *
3125 - * Note: If enqueue fails, it's the TaskMessageQueue implementation's responsibility to handle
3126 - * the error appropriately (e.g., by failing the task, logging, etc.). The Protocol layer
3127 - * simply propagates the error.
3128 - */
3129 - async _enqueueTaskMessage(taskId, message, sessionId) {
3130 - // Task message queues are only used when taskStore is configured
3131 - if (!this._taskStore || !this._taskMessageQueue) {
3132 - throw new Error('Cannot enqueue task message: taskStore and taskMessageQueue are not configured');
3133 - }
3134 - const maxQueueSize = this._options?.maxTaskQueueSize;
3135 - await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
3136 - }
3137 - /**
3138 - * Clears the message queue for a task and rejects any pending request resolvers.
3139 - * @param taskId The task ID whose queue should be cleared
3140 - * @param sessionId Optional session ID for binding the operation to a specific session
3141 - */
3142 - async _clearTaskQueue(taskId, sessionId) {
3143 - if (this._taskMessageQueue) {
3144 - // Reject any pending request resolvers
3145 - const messages = await this._taskMessageQueue.dequeueAll(taskId, sessionId);
3146 - for (const message of messages) {
3147 - if (message.type === 'request' && (0,_types_js__WEBPACK_IMPORTED_MODULE_1__.isJSONRPCRequest)(message.message)) {
3148 - // Extract request ID from the message
3149 - const requestId = message.message.id;
3150 - const resolver = this._requestResolvers.get(requestId);
3151 - if (resolver) {
3152 - resolver(new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InternalError, 'Task cancelled or completed'));
3153 - this._requestResolvers.delete(requestId);
3154 - }
3155 - else {
3156 - // Log error when resolver is missing during cleanup for better observability
3157 - this._onerror(new Error(`Resolver missing for request ${requestId} during task ${taskId} cleanup`));
3158 - }
3159 - }
3160 - }
3161 - }
3162 - }
3163 - /**
3164 - * Waits for a task update (new messages or status change) with abort signal support.
3165 - * Uses polling to check for updates at the task's configured poll interval.
3166 - * @param taskId The task ID to wait for
3167 - * @param signal Abort signal to cancel the wait
3168 - * @returns Promise that resolves when an update occurs or rejects if aborted
3169 - */
3170 - async _waitForTaskUpdate(taskId, signal) {
3171 - // Get the task's poll interval, falling back to default
3172 - let interval = this._options?.defaultTaskPollInterval ?? 1000;
3173 - try {
3174 - const task = await this._taskStore?.getTask(taskId);
3175 - if (task?.pollInterval) {
3176 - interval = task.pollInterval;
3177 - }
3178 - }
3179 - catch {
3180 - // Use default interval if task lookup fails
3181 - }
3182 - return new Promise((resolve, reject) => {
3183 - if (signal.aborted) {
3184 - reject(new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidRequest, 'Request cancelled'));
3185 - return;
3186 - }
3187 - // Wait for the poll interval, then resolve so caller can check for updates
3188 - const timeoutId = setTimeout(resolve, interval);
3189 - // Clean up timeout and reject if aborted
3190 - signal.addEventListener('abort', () => {
3191 - clearTimeout(timeoutId);
3192 - reject(new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidRequest, 'Request cancelled'));
3193 - }, { once: true });
3194 - });
3195 - }
3196 - requestTaskStore(request, sessionId) {
3197 - const taskStore = this._taskStore;
3198 - if (!taskStore) {
3199 - throw new Error('No task store configured');
3200 - }
3201 - return {
3202 - createTask: async (taskParams) => {
3203 - if (!request) {
3204 - throw new Error('No request provided');
3205 - }
3206 - return await taskStore.createTask(taskParams, request.id, {
3207 - method: request.method,
3208 - params: request.params
3209 - }, sessionId);
3210 - },
3211 - getTask: async (taskId) => {
3212 - const task = await taskStore.getTask(taskId, sessionId);
3213 - if (!task) {
3214 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, 'Failed to retrieve task: Task not found');
3215 - }
3216 - return task;
3217 - },
3218 - storeTaskResult: async (taskId, status, result) => {
3219 - await taskStore.storeTaskResult(taskId, status, result, sessionId);
3220 - // Get updated task state and send notification
3221 - const task = await taskStore.getTask(taskId, sessionId);
3222 - if (task) {
3223 - const notification = _types_js__WEBPACK_IMPORTED_MODULE_1__.TaskStatusNotificationSchema.parse({
3224 - method: 'notifications/tasks/status',
3225 - params: task
3226 - });
3227 - await this.notification(notification);
3228 - if ((0,_experimental_tasks_interfaces_js__WEBPACK_IMPORTED_MODULE_2__.isTerminal)(task.status)) {
3229 - this._cleanupTaskProgressHandler(taskId);
3230 - // Don't clear queue here - it will be cleared after delivery via tasks/result
3231 - }
3232 - }
3233 - },
3234 - getTaskResult: taskId => {
3235 - return taskStore.getTaskResult(taskId, sessionId);
3236 - },
3237 - updateTaskStatus: async (taskId, status, statusMessage) => {
3238 - // Check if task exists
3239 - const task = await taskStore.getTask(taskId, sessionId);
3240 - if (!task) {
3241 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`);
3242 - }
3243 - // Don't allow transitions from terminal states
3244 - if ((0,_experimental_tasks_interfaces_js__WEBPACK_IMPORTED_MODULE_2__.isTerminal)(task.status)) {
3245 - throw new _types_js__WEBPACK_IMPORTED_MODULE_1__.McpError(_types_js__WEBPACK_IMPORTED_MODULE_1__.ErrorCode.InvalidParams, `Cannot update task "${taskId}" from terminal status "${task.status}" to "${status}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);
3246 - }
3247 - await taskStore.updateTaskStatus(taskId, status, statusMessage, sessionId);
3248 - // Get updated task state and send notification
3249 - const updatedTask = await taskStore.getTask(taskId, sessionId);
3250 - if (updatedTask) {
3251 - const notification = _types_js__WEBPACK_IMPORTED_MODULE_1__.TaskStatusNotificationSchema.parse({
3252 - method: 'notifications/tasks/status',
3253 - params: updatedTask
3254 - });
3255 - await this.notification(notification);
3256 - if ((0,_experimental_tasks_interfaces_js__WEBPACK_IMPORTED_MODULE_2__.isTerminal)(updatedTask.status)) {
3257 - this._cleanupTaskProgressHandler(taskId);
3258 - // Don't clear queue here - it will be cleared after delivery via tasks/result
3259 - }
3260 - }
3261 - },
3262 - listTasks: cursor => {
3263 - return taskStore.listTasks(cursor, sessionId);
3264 - }
3265 - };
3266 - }
3267 -}
3268 -function isPlainObject(value) {
3269 - return value !== null && typeof value === 'object' && !Array.isArray(value);
3270 -}
3271 -function mergeCapabilities(base, additional) {
3272 - const result = { ...base };
3273 - for (const key in additional) {
3274 - const k = key;
3275 - const addValue = additional[k];
3276 - if (addValue === undefined)
3277 - continue;
3278 - const baseValue = result[k];
3279 - if (isPlainObject(baseValue) && isPlainObject(addValue)) {
3280 - result[k] = { ...baseValue, ...addValue };
3281 - }
3282 - else {
3283 - result[k] = addValue;
3284 - }
3285 - }
3286 - return result;
3287 -}
3288 -//# sourceMappingURL=protocol.js.map
3289 -
3290 -/***/ }),
3291 -
3292 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js":
3293 -/*!**************************************************************************************!*\
3294 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js ***!
3295 - \**************************************************************************************/
3296 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3297 -
3298 -__webpack_require__.r(__webpack_exports__);
3299 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3300 -/* harmony export */ issueToolNameWarning: function() { return /* binding */ issueToolNameWarning; },
3301 -/* harmony export */ validateAndWarnToolName: function() { return /* binding */ validateAndWarnToolName; },
3302 -/* harmony export */ validateToolName: function() { return /* binding */ validateToolName; }
3303 -/* harmony export */ });
3304 -/**
3305 - * Tool name validation utilities according to SEP: Specify Format for Tool Names
3306 - *
3307 - * Tool names SHOULD be between 1 and 128 characters in length (inclusive).
3308 - * Tool names are case-sensitive.
3309 - * Allowed characters: uppercase and lowercase ASCII letters (A-Z, a-z), digits
3310 - * (0-9), underscore (_), dash (-), and dot (.).
3311 - * Tool names SHOULD NOT contain spaces, commas, or other special characters.
3312 - */
3313 -/**
3314 - * Regular expression for valid tool names according to SEP-986 specification
3315 - */
3316 -const TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
3317 -/**
3318 - * Validates a tool name according to the SEP specification
3319 - * @param name - The tool name to validate
3320 - * @returns An object containing validation result and any warnings
3321 - */
3322 -function validateToolName(name) {
3323 - const warnings = [];
3324 - // Check length
3325 - if (name.length === 0) {
3326 - return {
3327 - isValid: false,
3328 - warnings: ['Tool name cannot be empty']
3329 - };
3330 - }
3331 - if (name.length > 128) {
3332 - return {
3333 - isValid: false,
3334 - warnings: [`Tool name exceeds maximum length of 128 characters (current: ${name.length})`]
3335 - };
3336 - }
3337 - // Check for specific problematic patterns (these are warnings, not validation failures)
3338 - if (name.includes(' ')) {
3339 - warnings.push('Tool name contains spaces, which may cause parsing issues');
3340 - }
3341 - if (name.includes(',')) {
3342 - warnings.push('Tool name contains commas, which may cause parsing issues');
3343 - }
3344 - // Check for potentially confusing patterns (leading/trailing dashes, dots, slashes)
3345 - if (name.startsWith('-') || name.endsWith('-')) {
3346 - warnings.push('Tool name starts or ends with a dash, which may cause parsing issues in some contexts');
3347 - }
3348 - if (name.startsWith('.') || name.endsWith('.')) {
3349 - warnings.push('Tool name starts or ends with a dot, which may cause parsing issues in some contexts');
3350 - }
3351 - // Check for invalid characters
3352 - if (!TOOL_NAME_REGEX.test(name)) {
3353 - const invalidChars = name
3354 - .split('')
3355 - .filter(char => !/[A-Za-z0-9._-]/.test(char))
3356 - .filter((char, index, arr) => arr.indexOf(char) === index); // Remove duplicates
3357 - warnings.push(`Tool name contains invalid characters: ${invalidChars.map(c => `"${c}"`).join(', ')}`, 'Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)');
3358 - return {
3359 - isValid: false,
3360 - warnings
3361 - };
3362 - }
3363 - return {
3364 - isValid: true,
3365 - warnings
3366 - };
3367 -}
3368 -/**
3369 - * Issues warnings for non-conforming tool names
3370 - * @param name - The tool name that triggered the warnings
3371 - * @param warnings - Array of warning messages
3372 - */
3373 -function issueToolNameWarning(name, warnings) {
3374 - if (warnings.length > 0) {
3375 - console.warn(`Tool name validation warning for "${name}":`);
3376 - for (const warning of warnings) {
3377 - console.warn(` - ${warning}`);
3378 - }
3379 - console.warn('Tool registration will proceed, but this may cause compatibility issues.');
3380 - console.warn('Consider updating the tool name to conform to the MCP tool naming standard.');
3381 - console.warn('See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.');
3382 - }
3383 -}
3384 -/**
3385 - * Validates a tool name and issues warnings for non-conforming names
3386 - * @param name - The tool name to validate
3387 - * @returns true if the name is valid, false otherwise
3388 - */
3389 -function validateAndWarnToolName(name) {
3390 - const result = validateToolName(name);
3391 - // Always issue warnings for any validation issues (both invalid names and warnings)
3392 - issueToolNameWarning(name, result.warnings);
3393 - return result.isValid;
3394 -}
3395 -//# sourceMappingURL=toolNameValidation.js.map
3396 -
3397 -/***/ }),
3398 -
3399 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js":
3400 -/*!*******************************************************************************!*\
3401 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js ***!
3402 - \*******************************************************************************/
3403 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3404 -
3405 -__webpack_require__.r(__webpack_exports__);
3406 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3407 -/* harmony export */ UriTemplate: function() { return /* binding */ UriTemplate; }
3408 -/* harmony export */ });
3409 -// Claude-authored implementation of RFC 6570 URI Templates
3410 -const MAX_TEMPLATE_LENGTH = 1000000; // 1MB
3411 -const MAX_VARIABLE_LENGTH = 1000000; // 1MB
3412 -const MAX_TEMPLATE_EXPRESSIONS = 10000;
3413 -const MAX_REGEX_LENGTH = 1000000; // 1MB
3414 -class UriTemplate {
3415 - /**
3416 - * Returns true if the given string contains any URI template expressions.
3417 - * A template expression is a sequence of characters enclosed in curly braces,
3418 - * like {foo} or {?bar}.
3419 - */
3420 - static isTemplate(str) {
3421 - // Look for any sequence of characters between curly braces
3422 - // that isn't just whitespace
3423 - return /\{[^}\s]+\}/.test(str);
3424 - }
3425 - static validateLength(str, max, context) {
3426 - if (str.length > max) {
3427 - throw new Error(`${context} exceeds maximum length of ${max} characters (got ${str.length})`);
3428 - }
3429 - }
3430 - get variableNames() {
3431 - return this.parts.flatMap(part => (typeof part === 'string' ? [] : part.names));
3432 - }
3433 - constructor(template) {
3434 - UriTemplate.validateLength(template, MAX_TEMPLATE_LENGTH, 'Template');
3435 - this.template = template;
3436 - this.parts = this.parse(template);
3437 - }
3438 - toString() {
3439 - return this.template;
3440 - }
3441 - parse(template) {
3442 - const parts = [];
3443 - let currentText = '';
3444 - let i = 0;
3445 - let expressionCount = 0;
3446 - while (i < template.length) {
3447 - if (template[i] === '{') {
3448 - if (currentText) {
3449 - parts.push(currentText);
3450 - currentText = '';
3451 - }
3452 - const end = template.indexOf('}', i);
3453 - if (end === -1)
3454 - throw new Error('Unclosed template expression');
3455 - expressionCount++;
3456 - if (expressionCount > MAX_TEMPLATE_EXPRESSIONS) {
3457 - throw new Error(`Template contains too many expressions (max ${MAX_TEMPLATE_EXPRESSIONS})`);
3458 - }
3459 - const expr = template.slice(i + 1, end);
3460 - const operator = this.getOperator(expr);
3461 - const exploded = expr.includes('*');
3462 - const names = this.getNames(expr);
3463 - const name = names[0];
3464 - // Validate variable name length
3465 - for (const name of names) {
3466 - UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name');
3467 - }
3468 - parts.push({ name, operator, names, exploded });
3469 - i = end + 1;
3470 - }
3471 - else {
3472 - currentText += template[i];
3473 - i++;
3474 - }
3475 - }
3476 - if (currentText) {
3477 - parts.push(currentText);
3478 - }
3479 - return parts;
3480 - }
3481 - getOperator(expr) {
3482 - const operators = ['+', '#', '.', '/', '?', '&'];
3483 - return operators.find(op => expr.startsWith(op)) || '';
3484 - }
3485 - getNames(expr) {
3486 - const operator = this.getOperator(expr);
3487 - return expr
3488 - .slice(operator.length)
3489 - .split(',')
3490 - .map(name => name.replace('*', '').trim())
3491 - .filter(name => name.length > 0);
3492 - }
3493 - encodeValue(value, operator) {
3494 - UriTemplate.validateLength(value, MAX_VARIABLE_LENGTH, 'Variable value');
3495 - if (operator === '+' || operator === '#') {
3496 - return encodeURI(value);
3497 - }
3498 - return encodeURIComponent(value);
3499 - }
3500 - expandPart(part, variables) {
3501 - if (part.operator === '?' || part.operator === '&') {
3502 - const pairs = part.names
3503 - .map(name => {
3504 - const value = variables[name];
3505 - if (value === undefined)
3506 - return '';
3507 - const encoded = Array.isArray(value)
3508 - ? value.map(v => this.encodeValue(v, part.operator)).join(',')
3509 - : this.encodeValue(value.toString(), part.operator);
3510 - return `${name}=${encoded}`;
3511 - })
3512 - .filter(pair => pair.length > 0);
3513 - if (pairs.length === 0)
3514 - return '';
3515 - const separator = part.operator === '?' ? '?' : '&';
3516 - return separator + pairs.join('&');
3517 - }
3518 - if (part.names.length > 1) {
3519 - const values = part.names.map(name => variables[name]).filter(v => v !== undefined);
3520 - if (values.length === 0)
3521 - return '';
3522 - return values.map(v => (Array.isArray(v) ? v[0] : v)).join(',');
3523 - }
3524 - const value = variables[part.name];
3525 - if (value === undefined)
3526 - return '';
3527 - const values = Array.isArray(value) ? value : [value];
3528 - const encoded = values.map(v => this.encodeValue(v, part.operator));
3529 - switch (part.operator) {
3530 - case '':
3531 - return encoded.join(',');
3532 - case '+':
3533 - return encoded.join(',');
3534 - case '#':
3535 - return '#' + encoded.join(',');
3536 - case '.':
3537 - return '.' + encoded.join('.');
3538 - case '/':
3539 - return '/' + encoded.join('/');
3540 - default:
3541 - return encoded.join(',');
3542 - }
3543 - }
3544 - expand(variables) {
3545 - let result = '';
3546 - let hasQueryParam = false;
3547 - for (const part of this.parts) {
3548 - if (typeof part === 'string') {
3549 - result += part;
3550 - continue;
3551 - }
3552 - const expanded = this.expandPart(part, variables);
3553 - if (!expanded)
3554 - continue;
3555 - // Convert ? to & if we already have a query parameter
3556 - if ((part.operator === '?' || part.operator === '&') && hasQueryParam) {
3557 - result += expanded.replace('?', '&');
3558 - }
3559 - else {
3560 - result += expanded;
3561 - }
3562 - if (part.operator === '?' || part.operator === '&') {
3563 - hasQueryParam = true;
3564 - }
3565 - }
3566 - return result;
3567 - }
3568 - escapeRegExp(str) {
3569 - return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
3570 - }
3571 - partToRegExp(part) {
3572 - const patterns = [];
3573 - // Validate variable name length for matching
3574 - for (const name of part.names) {
3575 - UriTemplate.validateLength(name, MAX_VARIABLE_LENGTH, 'Variable name');
3576 - }
3577 - if (part.operator === '?' || part.operator === '&') {
3578 - for (let i = 0; i < part.names.length; i++) {
3579 - const name = part.names[i];
3580 - const prefix = i === 0 ? '\\' + part.operator : '&';
3581 - patterns.push({
3582 - pattern: prefix + this.escapeRegExp(name) + '=([^&]+)',
3583 - name
3584 - });
3585 - }
3586 - return patterns;
3587 - }
3588 - let pattern;
3589 - const name = part.name;
3590 - switch (part.operator) {
3591 - case '':
3592 - pattern = part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)';
3593 - break;
3594 - case '+':
3595 - case '#':
3596 - pattern = '(.+)';
3597 - break;
3598 - case '.':
3599 - pattern = '\\.([^/,]+)';
3600 - break;
3601 - case '/':
3602 - pattern = '/' + (part.exploded ? '([^/,]+(?:,[^/,]+)*)' : '([^/,]+)');
3603 - break;
3604 - default:
3605 - pattern = '([^/]+)';
3606 - }
3607 - patterns.push({ pattern, name });
3608 - return patterns;
3609 - }
3610 - match(uri) {
3611 - UriTemplate.validateLength(uri, MAX_TEMPLATE_LENGTH, 'URI');
3612 - let pattern = '^';
3613 - const names = [];
3614 - for (const part of this.parts) {
3615 - if (typeof part === 'string') {
3616 - pattern += this.escapeRegExp(part);
3617 - }
3618 - else {
3619 - const patterns = this.partToRegExp(part);
3620 - for (const { pattern: partPattern, name } of patterns) {
3621 - pattern += partPattern;
3622 - names.push({ name, exploded: part.exploded });
3623 - }
3624 - }
3625 - }
3626 - pattern += '$';
3627 - UriTemplate.validateLength(pattern, MAX_REGEX_LENGTH, 'Generated regex pattern');
3628 - const regex = new RegExp(pattern);
3629 - const match = uri.match(regex);
3630 - if (!match)
3631 - return null;
3632 - const result = {};
3633 - for (let i = 0; i < names.length; i++) {
3634 - const { name, exploded } = names[i];
3635 - const value = match[i + 1];
3636 - const cleanName = name.replace('*', '');
3637 - if (exploded && value.includes(',')) {
3638 - result[cleanName] = value.split(',');
3639 - }
3640 - else {
3641 - result[cleanName] = value;
3642 - }
3643 - }
3644 - return result;
3645 - }
3646 -}
3647 -//# sourceMappingURL=uriTemplate.js.map
3648 -
3649 -/***/ }),
3650 -
3651 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js":
3652 -/*!******************************************************************!*\
3653 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js ***!
3654 - \******************************************************************/
3655 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
3656 -
3657 -__webpack_require__.r(__webpack_exports__);
3658 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
3659 -/* harmony export */ AnnotationsSchema: function() { return /* binding */ AnnotationsSchema; },
3660 -/* harmony export */ AudioContentSchema: function() { return /* binding */ AudioContentSchema; },
3661 -/* harmony export */ BaseMetadataSchema: function() { return /* binding */ BaseMetadataSchema; },
3662 -/* harmony export */ BlobResourceContentsSchema: function() { return /* binding */ BlobResourceContentsSchema; },
3663 -/* harmony export */ BooleanSchemaSchema: function() { return /* binding */ BooleanSchemaSchema; },
3664 -/* harmony export */ CallToolRequestParamsSchema: function() { return /* binding */ CallToolRequestParamsSchema; },
3665 -/* harmony export */ CallToolRequestSchema: function() { return /* binding */ CallToolRequestSchema; },
3666 -/* harmony export */ CallToolResultSchema: function() { return /* binding */ CallToolResultSchema; },
3667 -/* harmony export */ CancelTaskRequestSchema: function() { return /* binding */ CancelTaskRequestSchema; },
3668 -/* harmony export */ CancelTaskResultSchema: function() { return /* binding */ CancelTaskResultSchema; },
3669 -/* harmony export */ CancelledNotificationParamsSchema: function() { return /* binding */ CancelledNotificationParamsSchema; },
3670 -/* harmony export */ CancelledNotificationSchema: function() { return /* binding */ CancelledNotificationSchema; },
3671 -/* harmony export */ ClientCapabilitiesSchema: function() { return /* binding */ ClientCapabilitiesSchema; },
3672 -/* harmony export */ ClientNotificationSchema: function() { return /* binding */ ClientNotificationSchema; },
3673 -/* harmony export */ ClientRequestSchema: function() { return /* binding */ ClientRequestSchema; },
3674 -/* harmony export */ ClientResultSchema: function() { return /* binding */ ClientResultSchema; },
3675 -/* harmony export */ ClientTasksCapabilitySchema: function() { return /* binding */ ClientTasksCapabilitySchema; },
3676 -/* harmony export */ CompatibilityCallToolResultSchema: function() { return /* binding */ CompatibilityCallToolResultSchema; },
3677 -/* harmony export */ CompleteRequestParamsSchema: function() { return /* binding */ CompleteRequestParamsSchema; },
3678 -/* harmony export */ CompleteRequestSchema: function() { return /* binding */ CompleteRequestSchema; },
3679 -/* harmony export */ CompleteResultSchema: function() { return /* binding */ CompleteResultSchema; },
3680 -/* harmony export */ ContentBlockSchema: function() { return /* binding */ ContentBlockSchema; },
3681 -/* harmony export */ CreateMessageRequestParamsSchema: function() { return /* binding */ CreateMessageRequestParamsSchema; },
3682 -/* harmony export */ CreateMessageRequestSchema: function() { return /* binding */ CreateMessageRequestSchema; },
3683 -/* harmony export */ CreateMessageResultSchema: function() { return /* binding */ CreateMessageResultSchema; },
3684 -/* harmony export */ CreateMessageResultWithToolsSchema: function() { return /* binding */ CreateMessageResultWithToolsSchema; },
3685 -/* harmony export */ CreateTaskResultSchema: function() { return /* binding */ CreateTaskResultSchema; },
3686 -/* harmony export */ CursorSchema: function() { return /* binding */ CursorSchema; },
3687 -/* harmony export */ DEFAULT_NEGOTIATED_PROTOCOL_VERSION: function() { return /* binding */ DEFAULT_NEGOTIATED_PROTOCOL_VERSION; },
3688 -/* harmony export */ ElicitRequestFormParamsSchema: function() { return /* binding */ ElicitRequestFormParamsSchema; },
3689 -/* harmony export */ ElicitRequestParamsSchema: function() { return /* binding */ ElicitRequestParamsSchema; },
3690 -/* harmony export */ ElicitRequestSchema: function() { return /* binding */ ElicitRequestSchema; },
3691 -/* harmony export */ ElicitRequestURLParamsSchema: function() { return /* binding */ ElicitRequestURLParamsSchema; },
3692 -/* harmony export */ ElicitResultSchema: function() { return /* binding */ ElicitResultSchema; },
3693 -/* harmony export */ ElicitationCompleteNotificationParamsSchema: function() { return /* binding */ ElicitationCompleteNotificationParamsSchema; },
3694 -/* harmony export */ ElicitationCompleteNotificationSchema: function() { return /* binding */ ElicitationCompleteNotificationSchema; },
3695 -/* harmony export */ EmbeddedResourceSchema: function() { return /* binding */ EmbeddedResourceSchema; },
3696 -/* harmony export */ EmptyResultSchema: function() { return /* binding */ EmptyResultSchema; },
3697 -/* harmony export */ EnumSchemaSchema: function() { return /* binding */ EnumSchemaSchema; },
3698 -/* harmony export */ ErrorCode: function() { return /* binding */ ErrorCode; },
3699 -/* harmony export */ GetPromptRequestParamsSchema: function() { return /* binding */ GetPromptRequestParamsSchema; },
3700 -/* harmony export */ GetPromptRequestSchema: function() { return /* binding */ GetPromptRequestSchema; },
3701 -/* harmony export */ GetPromptResultSchema: function() { return /* binding */ GetPromptResultSchema; },
3702 -/* harmony export */ GetTaskPayloadRequestSchema: function() { return /* binding */ GetTaskPayloadRequestSchema; },
3703 -/* harmony export */ GetTaskPayloadResultSchema: function() { return /* binding */ GetTaskPayloadResultSchema; },
3704 -/* harmony export */ GetTaskRequestSchema: function() { return /* binding */ GetTaskRequestSchema; },
3705 -/* harmony export */ GetTaskResultSchema: function() { return /* binding */ GetTaskResultSchema; },
3706 -/* harmony export */ IconSchema: function() { return /* binding */ IconSchema; },
3707 -/* harmony export */ IconsSchema: function() { return /* binding */ IconsSchema; },
3708 -/* harmony export */ ImageContentSchema: function() { return /* binding */ ImageContentSchema; },
3709 -/* harmony export */ ImplementationSchema: function() { return /* binding */ ImplementationSchema; },
3710 -/* harmony export */ InitializeRequestParamsSchema: function() { return /* binding */ InitializeRequestParamsSchema; },
3711 -/* harmony export */ InitializeRequestSchema: function() { return /* binding */ InitializeRequestSchema; },
3712 -/* harmony export */ InitializeResultSchema: function() { return /* binding */ InitializeResultSchema; },
3713 -/* harmony export */ InitializedNotificationSchema: function() { return /* binding */ InitializedNotificationSchema; },
3714 -/* harmony export */ JSONRPCErrorResponseSchema: function() { return /* binding */ JSONRPCErrorResponseSchema; },
3715 -/* harmony export */ JSONRPCErrorSchema: function() { return /* binding */ JSONRPCErrorSchema; },
3716 -/* harmony export */ JSONRPCMessageSchema: function() { return /* binding */ JSONRPCMessageSchema; },
3717 -/* harmony export */ JSONRPCNotificationSchema: function() { return /* binding */ JSONRPCNotificationSchema; },
3718 -/* harmony export */ JSONRPCRequestSchema: function() { return /* binding */ JSONRPCRequestSchema; },
3719 -/* harmony export */ JSONRPCResponseSchema: function() { return /* binding */ JSONRPCResponseSchema; },
3720 -/* harmony export */ JSONRPCResultResponseSchema: function() { return /* binding */ JSONRPCResultResponseSchema; },
3721 -/* harmony export */ JSONRPC_VERSION: function() { return /* binding */ JSONRPC_VERSION; },
3722 -/* harmony export */ LATEST_PROTOCOL_VERSION: function() { return /* binding */ LATEST_PROTOCOL_VERSION; },
3723 -/* harmony export */ LegacyTitledEnumSchemaSchema: function() { return /* binding */ LegacyTitledEnumSchemaSchema; },
3724 -/* harmony export */ ListChangedOptionsBaseSchema: function() { return /* binding */ ListChangedOptionsBaseSchema; },
3725 -/* harmony export */ ListPromptsRequestSchema: function() { return /* binding */ ListPromptsRequestSchema; },
3726 -/* harmony export */ ListPromptsResultSchema: function() { return /* binding */ ListPromptsResultSchema; },
3727 -/* harmony export */ ListResourceTemplatesRequestSchema: function() { return /* binding */ ListResourceTemplatesRequestSchema; },
3728 -/* harmony export */ ListResourceTemplatesResultSchema: function() { return /* binding */ ListResourceTemplatesResultSchema; },
3729 -/* harmony export */ ListResourcesRequestSchema: function() { return /* binding */ ListResourcesRequestSchema; },
3730 -/* harmony export */ ListResourcesResultSchema: function() { return /* binding */ ListResourcesResultSchema; },
3731 -/* harmony export */ ListRootsRequestSchema: function() { return /* binding */ ListRootsRequestSchema; },
3732 -/* harmony export */ ListRootsResultSchema: function() { return /* binding */ ListRootsResultSchema; },
3733 -/* harmony export */ ListTasksRequestSchema: function() { return /* binding */ ListTasksRequestSchema; },
3734 -/* harmony export */ ListTasksResultSchema: function() { return /* binding */ ListTasksResultSchema; },
3735 -/* harmony export */ ListToolsRequestSchema: function() { return /* binding */ ListToolsRequestSchema; },
3736 -/* harmony export */ ListToolsResultSchema: function() { return /* binding */ ListToolsResultSchema; },
3737 -/* harmony export */ LoggingLevelSchema: function() { return /* binding */ LoggingLevelSchema; },
3738 -/* harmony export */ LoggingMessageNotificationParamsSchema: function() { return /* binding */ LoggingMessageNotificationParamsSchema; },
3739 -/* harmony export */ LoggingMessageNotificationSchema: function() { return /* binding */ LoggingMessageNotificationSchema; },
3740 -/* harmony export */ McpError: function() { return /* binding */ McpError; },
3741 -/* harmony export */ ModelHintSchema: function() { return /* binding */ ModelHintSchema; },
3742 -/* harmony export */ ModelPreferencesSchema: function() { return /* binding */ ModelPreferencesSchema; },
3743 -/* harmony export */ MultiSelectEnumSchemaSchema: function() { return /* binding */ MultiSelectEnumSchemaSchema; },
3744 -/* harmony export */ NotificationSchema: function() { return /* binding */ NotificationSchema; },
3745 -/* harmony export */ NumberSchemaSchema: function() { return /* binding */ NumberSchemaSchema; },
3746 -/* harmony export */ PaginatedRequestParamsSchema: function() { return /* binding */ PaginatedRequestParamsSchema; },
3747 -/* harmony export */ PaginatedRequestSchema: function() { return /* binding */ PaginatedRequestSchema; },
3748 -/* harmony export */ PaginatedResultSchema: function() { return /* binding */ PaginatedResultSchema; },
3749 -/* harmony export */ PingRequestSchema: function() { return /* binding */ PingRequestSchema; },
3750 -/* harmony export */ PrimitiveSchemaDefinitionSchema: function() { return /* binding */ PrimitiveSchemaDefinitionSchema; },
3751 -/* harmony export */ ProgressNotificationParamsSchema: function() { return /* binding */ ProgressNotificationParamsSchema; },
3752 -/* harmony export */ ProgressNotificationSchema: function() { return /* binding */ ProgressNotificationSchema; },
3753 -/* harmony export */ ProgressSchema: function() { return /* binding */ ProgressSchema; },
3754 -/* harmony export */ ProgressTokenSchema: function() { return /* binding */ ProgressTokenSchema; },
3755 -/* harmony export */ PromptArgumentSchema: function() { return /* binding */ PromptArgumentSchema; },
3756 -/* harmony export */ PromptListChangedNotificationSchema: function() { return /* binding */ PromptListChangedNotificationSchema; },
3757 -/* harmony export */ PromptMessageSchema: function() { return /* binding */ PromptMessageSchema; },
3758 -/* harmony export */ PromptReferenceSchema: function() { return /* binding */ PromptReferenceSchema; },
3759 -/* harmony export */ PromptSchema: function() { return /* binding */ PromptSchema; },
3760 -/* harmony export */ RELATED_TASK_META_KEY: function() { return /* binding */ RELATED_TASK_META_KEY; },
3761 -/* harmony export */ ReadResourceRequestParamsSchema: function() { return /* binding */ ReadResourceRequestParamsSchema; },
3762 -/* harmony export */ ReadResourceRequestSchema: function() { return /* binding */ ReadResourceRequestSchema; },
3763 -/* harmony export */ ReadResourceResultSchema: function() { return /* binding */ ReadResourceResultSchema; },
3764 -/* harmony export */ RelatedTaskMetadataSchema: function() { return /* binding */ RelatedTaskMetadataSchema; },
3765 -/* harmony export */ RequestIdSchema: function() { return /* binding */ RequestIdSchema; },
3766 -/* harmony export */ RequestSchema: function() { return /* binding */ RequestSchema; },
3767 -/* harmony export */ ResourceContentsSchema: function() { return /* binding */ ResourceContentsSchema; },
3768 -/* harmony export */ ResourceLinkSchema: function() { return /* binding */ ResourceLinkSchema; },
3769 -/* harmony export */ ResourceListChangedNotificationSchema: function() { return /* binding */ ResourceListChangedNotificationSchema; },
3770 -/* harmony export */ ResourceReferenceSchema: function() { return /* binding */ ResourceReferenceSchema; },
3771 -/* harmony export */ ResourceRequestParamsSchema: function() { return /* binding */ ResourceRequestParamsSchema; },
3772 -/* harmony export */ ResourceSchema: function() { return /* binding */ ResourceSchema; },
3773 -/* harmony export */ ResourceTemplateReferenceSchema: function() { return /* binding */ ResourceTemplateReferenceSchema; },
3774 -/* harmony export */ ResourceTemplateSchema: function() { return /* binding */ ResourceTemplateSchema; },
3775 -/* harmony export */ ResourceUpdatedNotificationParamsSchema: function() { return /* binding */ ResourceUpdatedNotificationParamsSchema; },
3776 -/* harmony export */ ResourceUpdatedNotificationSchema: function() { return /* binding */ ResourceUpdatedNotificationSchema; },
3777 -/* harmony export */ ResultSchema: function() { return /* binding */ ResultSchema; },
3778 -/* harmony export */ RoleSchema: function() { return /* binding */ RoleSchema; },
3779 -/* harmony export */ RootSchema: function() { return /* binding */ RootSchema; },
3780 -/* harmony export */ RootsListChangedNotificationSchema: function() { return /* binding */ RootsListChangedNotificationSchema; },
3781 -/* harmony export */ SUPPORTED_PROTOCOL_VERSIONS: function() { return /* binding */ SUPPORTED_PROTOCOL_VERSIONS; },
3782 -/* harmony export */ SamplingContentSchema: function() { return /* binding */ SamplingContentSchema; },
3783 -/* harmony export */ SamplingMessageContentBlockSchema: function() { return /* binding */ SamplingMessageContentBlockSchema; },
3784 -/* harmony export */ SamplingMessageSchema: function() { return /* binding */ SamplingMessageSchema; },
3785 -/* harmony export */ ServerCapabilitiesSchema: function() { return /* binding */ ServerCapabilitiesSchema; },
3786 -/* harmony export */ ServerNotificationSchema: function() { return /* binding */ ServerNotificationSchema; },
3787 -/* harmony export */ ServerRequestSchema: function() { return /* binding */ ServerRequestSchema; },
3788 -/* harmony export */ ServerResultSchema: function() { return /* binding */ ServerResultSchema; },
3789 -/* harmony export */ ServerTasksCapabilitySchema: function() { return /* binding */ ServerTasksCapabilitySchema; },
3790 -/* harmony export */ SetLevelRequestParamsSchema: function() { return /* binding */ SetLevelRequestParamsSchema; },
3791 -/* harmony export */ SetLevelRequestSchema: function() { return /* binding */ SetLevelRequestSchema; },
3792 -/* harmony export */ SingleSelectEnumSchemaSchema: function() { return /* binding */ SingleSelectEnumSchemaSchema; },
3793 -/* harmony export */ StringSchemaSchema: function() { return /* binding */ StringSchemaSchema; },
3794 -/* harmony export */ SubscribeRequestParamsSchema: function() { return /* binding */ SubscribeRequestParamsSchema; },
3795 -/* harmony export */ SubscribeRequestSchema: function() { return /* binding */ SubscribeRequestSchema; },
3796 -/* harmony export */ TaskAugmentedRequestParamsSchema: function() { return /* binding */ TaskAugmentedRequestParamsSchema; },
3797 -/* harmony export */ TaskCreationParamsSchema: function() { return /* binding */ TaskCreationParamsSchema; },
3798 -/* harmony export */ TaskMetadataSchema: function() { return /* binding */ TaskMetadataSchema; },
3799 -/* harmony export */ TaskSchema: function() { return /* binding */ TaskSchema; },
3800 -/* harmony export */ TaskStatusNotificationParamsSchema: function() { return /* binding */ TaskStatusNotificationParamsSchema; },
3801 -/* harmony export */ TaskStatusNotificationSchema: function() { return /* binding */ TaskStatusNotificationSchema; },
3802 -/* harmony export */ TaskStatusSchema: function() { return /* binding */ TaskStatusSchema; },
3803 -/* harmony export */ TextContentSchema: function() { return /* binding */ TextContentSchema; },
3804 -/* harmony export */ TextResourceContentsSchema: function() { return /* binding */ TextResourceContentsSchema; },
3805 -/* harmony export */ TitledMultiSelectEnumSchemaSchema: function() { return /* binding */ TitledMultiSelectEnumSchemaSchema; },
3806 -/* harmony export */ TitledSingleSelectEnumSchemaSchema: function() { return /* binding */ TitledSingleSelectEnumSchemaSchema; },
3807 -/* harmony export */ ToolAnnotationsSchema: function() { return /* binding */ ToolAnnotationsSchema; },
3808 -/* harmony export */ ToolChoiceSchema: function() { return /* binding */ ToolChoiceSchema; },
3809 -/* harmony export */ ToolExecutionSchema: function() { return /* binding */ ToolExecutionSchema; },
3810 -/* harmony export */ ToolListChangedNotificationSchema: function() { return /* binding */ ToolListChangedNotificationSchema; },
3811 -/* harmony export */ ToolResultContentSchema: function() { return /* binding */ ToolResultContentSchema; },
3812 -/* harmony export */ ToolSchema: function() { return /* binding */ ToolSchema; },
3813 -/* harmony export */ ToolUseContentSchema: function() { return /* binding */ ToolUseContentSchema; },
3814 -/* harmony export */ UnsubscribeRequestParamsSchema: function() { return /* binding */ UnsubscribeRequestParamsSchema; },
3815 -/* harmony export */ UnsubscribeRequestSchema: function() { return /* binding */ UnsubscribeRequestSchema; },
3816 -/* harmony export */ UntitledMultiSelectEnumSchemaSchema: function() { return /* binding */ UntitledMultiSelectEnumSchemaSchema; },
3817 -/* harmony export */ UntitledSingleSelectEnumSchemaSchema: function() { return /* binding */ UntitledSingleSelectEnumSchemaSchema; },
3818 -/* harmony export */ UrlElicitationRequiredError: function() { return /* binding */ UrlElicitationRequiredError; },
3819 -/* harmony export */ assertCompleteRequestPrompt: function() { return /* binding */ assertCompleteRequestPrompt; },
3820 -/* harmony export */ assertCompleteRequestResourceTemplate: function() { return /* binding */ assertCompleteRequestResourceTemplate; },
3821 -/* harmony export */ isInitializeRequest: function() { return /* binding */ isInitializeRequest; },
3822 -/* harmony export */ isInitializedNotification: function() { return /* binding */ isInitializedNotification; },
3823 -/* harmony export */ isJSONRPCError: function() { return /* binding */ isJSONRPCError; },
3824 -/* harmony export */ isJSONRPCErrorResponse: function() { return /* binding */ isJSONRPCErrorResponse; },
3825 -/* harmony export */ isJSONRPCNotification: function() { return /* binding */ isJSONRPCNotification; },
3826 -/* harmony export */ isJSONRPCRequest: function() { return /* binding */ isJSONRPCRequest; },
3827 -/* harmony export */ isJSONRPCResponse: function() { return /* binding */ isJSONRPCResponse; },
3828 -/* harmony export */ isJSONRPCResultResponse: function() { return /* binding */ isJSONRPCResultResponse; },
3829 -/* harmony export */ isTaskAugmentedRequestParams: function() { return /* binding */ isTaskAugmentedRequestParams; }
3830 -/* harmony export */ });
3831 -/* harmony import */ var zod_v4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod/v4 */ "./node_modules/zod/v4/classic/schemas.js");
3832 -/* harmony import */ var zod_v4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! zod/v4 */ "./node_modules/zod/v4/classic/iso.js");
3833 -
3834 -const LATEST_PROTOCOL_VERSION = '2025-11-25';
3835 -const DEFAULT_NEGOTIATED_PROTOCOL_VERSION = '2025-03-26';
3836 -const SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, '2025-06-18', '2025-03-26', '2024-11-05', '2024-10-07'];
3837 -const RELATED_TASK_META_KEY = 'io.modelcontextprotocol/related-task';
3838 -/* JSON-RPC types */
3839 -const JSONRPC_VERSION = '2.0';
3840 -/**
3841 - * Assert 'object' type schema.
3842 - *
3843 - * @internal
3844 - */
3845 -const AssertObjectSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.custom((v) => v !== null && (typeof v === 'object' || typeof v === 'function'));
3846 -/**
3847 - * A progress token, used to associate progress notifications with the original request.
3848 - */
3849 -const ProgressTokenSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().int()]);
3850 -/**
3851 - * An opaque token used to represent a cursor for pagination.
3852 - */
3853 -const CursorSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.string();
3854 -/**
3855 - * Task creation parameters, used to ask that the server create a task to represent a request.
3856 - */
3857 -const TaskCreationParamsSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
3858 - /**
3859 - * Time in milliseconds to keep task results available after completion.
3860 - * If null, the task has unlimited lifetime until manually cleaned up.
3861 - */
3862 - ttl: zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([zod_v4__WEBPACK_IMPORTED_MODULE_0__.number(), zod_v4__WEBPACK_IMPORTED_MODULE_0__["null"]()]).optional(),
3863 - /**
3864 - * Time in milliseconds to wait between task status requests.
3865 - */
3866 - pollInterval: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional()
3867 -});
3868 -const TaskMetadataSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
3869 - ttl: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional()
3870 -});
3871 -/**
3872 - * Metadata for associating messages with a task.
3873 - * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`.
3874 - */
3875 -const RelatedTaskMetadataSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
3876 - taskId: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
3877 -});
3878 -const RequestMetaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
3879 - /**
3880 - * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.
3881 - */
3882 - progressToken: ProgressTokenSchema.optional(),
3883 - /**
3884 - * If specified, this request is related to the provided task.
3885 - */
3886 - [RELATED_TASK_META_KEY]: RelatedTaskMetadataSchema.optional()
3887 -});
3888 -/**
3889 - * Common params for any request.
3890 - */
3891 -const BaseRequestParamsSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
3892 - /**
3893 - * See [General fields: `_meta`](/specification/draft/basic/index#meta) for notes on `_meta` usage.
3894 - */
3895 - _meta: RequestMetaSchema.optional()
3896 -});
3897 -/**
3898 - * Common params for any task-augmented request.
3899 - */
3900 -const TaskAugmentedRequestParamsSchema = BaseRequestParamsSchema.extend({
3901 - /**
3902 - * If specified, the caller is requesting task-augmented execution for this request.
3903 - * The request will return a CreateTaskResult immediately, and the actual result can be
3904 - * retrieved later via tasks/result.
3905 - *
3906 - * Task augmentation is subject to capability negotiation - receivers MUST declare support
3907 - * for task augmentation of specific request types in their capabilities.
3908 - */
3909 - task: TaskMetadataSchema.optional()
3910 -});
3911 -/**
3912 - * Checks if a value is a valid TaskAugmentedRequestParams.
3913 - * @param value - The value to check.
3914 - *
3915 - * @returns True if the value is a valid TaskAugmentedRequestParams, false otherwise.
3916 - */
3917 -const isTaskAugmentedRequestParams = (value) => TaskAugmentedRequestParamsSchema.safeParse(value).success;
3918 -const RequestSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
3919 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
3920 - params: BaseRequestParamsSchema.loose().optional()
3921 -});
3922 -const NotificationsParamsSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
3923 - /**
3924 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
3925 - * for notes on _meta usage.
3926 - */
3927 - _meta: RequestMetaSchema.optional()
3928 -});
3929 -const NotificationSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
3930 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
3931 - params: NotificationsParamsSchema.loose().optional()
3932 -});
3933 -const ResultSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
3934 - /**
3935 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
3936 - * for notes on _meta usage.
3937 - */
3938 - _meta: RequestMetaSchema.optional()
3939 -});
3940 -/**
3941 - * A uniquely identifying ID for a request in JSON-RPC.
3942 - */
3943 -const RequestIdSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().int()]);
3944 -/**
3945 - * A request that expects a response.
3946 - */
3947 -const JSONRPCRequestSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
3948 - jsonrpc: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal(JSONRPC_VERSION),
3949 - id: RequestIdSchema,
3950 - ...RequestSchema.shape
3951 -})
3952 - .strict();
3953 -const isJSONRPCRequest = (value) => JSONRPCRequestSchema.safeParse(value).success;
3954 -/**
3955 - * A notification which does not expect a response.
3956 - */
3957 -const JSONRPCNotificationSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
3958 - jsonrpc: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal(JSONRPC_VERSION),
3959 - ...NotificationSchema.shape
3960 -})
3961 - .strict();
3962 -const isJSONRPCNotification = (value) => JSONRPCNotificationSchema.safeParse(value).success;
3963 -/**
3964 - * A successful (non-error) response to a request.
3965 - */
3966 -const JSONRPCResultResponseSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
3967 - jsonrpc: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal(JSONRPC_VERSION),
3968 - id: RequestIdSchema,
3969 - result: ResultSchema
3970 -})
3971 - .strict();
3972 -/**
3973 - * Checks if a value is a valid JSONRPCResultResponse.
3974 - * @param value - The value to check.
3975 - *
3976 - * @returns True if the value is a valid JSONRPCResultResponse, false otherwise.
3977 - */
3978 -const isJSONRPCResultResponse = (value) => JSONRPCResultResponseSchema.safeParse(value).success;
3979 -/**
3980 - * @deprecated Use {@link isJSONRPCResultResponse} instead.
3981 - *
3982 - * Please note that {@link JSONRPCResponse} is a union of {@link JSONRPCResultResponse} and {@link JSONRPCErrorResponse} as per the updated JSON-RPC specification. (was previously just {@link JSONRPCResultResponse})
3983 - */
3984 -const isJSONRPCResponse = isJSONRPCResultResponse;
3985 -/**
3986 - * Error codes defined by the JSON-RPC specification.
3987 - */
3988 -var ErrorCode;
3989 -(function (ErrorCode) {
3990 - // SDK error codes
3991 - ErrorCode[ErrorCode["ConnectionClosed"] = -32000] = "ConnectionClosed";
3992 - ErrorCode[ErrorCode["RequestTimeout"] = -32001] = "RequestTimeout";
3993 - // Standard JSON-RPC error codes
3994 - ErrorCode[ErrorCode["ParseError"] = -32700] = "ParseError";
3995 - ErrorCode[ErrorCode["InvalidRequest"] = -32600] = "InvalidRequest";
3996 - ErrorCode[ErrorCode["MethodNotFound"] = -32601] = "MethodNotFound";
3997 - ErrorCode[ErrorCode["InvalidParams"] = -32602] = "InvalidParams";
3998 - ErrorCode[ErrorCode["InternalError"] = -32603] = "InternalError";
3999 - // MCP-specific error codes
4000 - ErrorCode[ErrorCode["UrlElicitationRequired"] = -32042] = "UrlElicitationRequired";
4001 -})(ErrorCode || (ErrorCode = {}));
4002 -/**
4003 - * A response to a request that indicates an error occurred.
4004 - */
4005 -const JSONRPCErrorResponseSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4006 - jsonrpc: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal(JSONRPC_VERSION),
4007 - id: RequestIdSchema.optional(),
4008 - error: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4009 - /**
4010 - * The error type that occurred.
4011 - */
4012 - code: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().int(),
4013 - /**
4014 - * A short description of the error. The message SHOULD be limited to a concise single sentence.
4015 - */
4016 - message: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4017 - /**
4018 - * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.).
4019 - */
4020 - data: zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown().optional()
4021 - })
4022 -})
4023 - .strict();
4024 -/**
4025 - * @deprecated Use {@link JSONRPCErrorResponseSchema} instead.
4026 - */
4027 -const JSONRPCErrorSchema = JSONRPCErrorResponseSchema;
4028 -/**
4029 - * Checks if a value is a valid JSONRPCErrorResponse.
4030 - * @param value - The value to check.
4031 - *
4032 - * @returns True if the value is a valid JSONRPCErrorResponse, false otherwise.
4033 - */
4034 -const isJSONRPCErrorResponse = (value) => JSONRPCErrorResponseSchema.safeParse(value).success;
4035 -/**
4036 - * @deprecated Use {@link isJSONRPCErrorResponse} instead.
4037 - */
4038 -const isJSONRPCError = isJSONRPCErrorResponse;
4039 -const JSONRPCMessageSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([
4040 - JSONRPCRequestSchema,
4041 - JSONRPCNotificationSchema,
4042 - JSONRPCResultResponseSchema,
4043 - JSONRPCErrorResponseSchema
4044 -]);
4045 -const JSONRPCResponseSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([JSONRPCResultResponseSchema, JSONRPCErrorResponseSchema]);
4046 -/* Empty result */
4047 -/**
4048 - * A response that indicates success but carries no data.
4049 - */
4050 -const EmptyResultSchema = ResultSchema.strict();
4051 -const CancelledNotificationParamsSchema = NotificationsParamsSchema.extend({
4052 - /**
4053 - * The ID of the request to cancel.
4054 - *
4055 - * This MUST correspond to the ID of a request previously issued in the same direction.
4056 - */
4057 - requestId: RequestIdSchema.optional(),
4058 - /**
4059 - * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user.
4060 - */
4061 - reason: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional()
4062 -});
4063 -/* Cancellation */
4064 -/**
4065 - * This notification can be sent by either side to indicate that it is cancelling a previously-issued request.
4066 - *
4067 - * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.
4068 - *
4069 - * This notification indicates that the result will be unused, so any associated processing SHOULD cease.
4070 - *
4071 - * A client MUST NOT attempt to cancel its `initialize` request.
4072 - */
4073 -const CancelledNotificationSchema = NotificationSchema.extend({
4074 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/cancelled'),
4075 - params: CancelledNotificationParamsSchema
4076 -});
4077 -/* Base Metadata */
4078 -/**
4079 - * Icon schema for use in tools, prompts, resources, and implementations.
4080 - */
4081 -const IconSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4082 - /**
4083 - * URL or data URI for the icon.
4084 - */
4085 - src: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4086 - /**
4087 - * Optional MIME type for the icon.
4088 - */
4089 - mimeType: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
4090 - /**
4091 - * Optional array of strings that specify sizes at which the icon can be used.
4092 - * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG.
4093 - *
4094 - * If not provided, the client should assume that the icon can be used at any size.
4095 - */
4096 - sizes: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional(),
4097 - /**
4098 - * Optional specifier for the theme this icon is designed for. `light` indicates
4099 - * the icon is designed to be used with a light background, and `dark` indicates
4100 - * the icon is designed to be used with a dark background.
4101 - *
4102 - * If not provided, the client should assume the icon can be used with any theme.
4103 - */
4104 - theme: zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['light', 'dark']).optional()
4105 -});
4106 -/**
4107 - * Base schema to add `icons` property.
4108 - *
4109 - */
4110 -const IconsSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4111 - /**
4112 - * Optional set of sized icons that the client can display in a user interface.
4113 - *
4114 - * Clients that support rendering icons MUST support at least the following MIME types:
4115 - * - `image/png` - PNG images (safe, universal compatibility)
4116 - * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility)
4117 - *
4118 - * Clients that support rendering icons SHOULD also support:
4119 - * - `image/svg+xml` - SVG images (scalable but requires security precautions)
4120 - * - `image/webp` - WebP images (modern, efficient format)
4121 - */
4122 - icons: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(IconSchema).optional()
4123 -});
4124 -/**
4125 - * Base metadata interface for common properties across resources, tools, prompts, and implementations.
4126 - */
4127 -const BaseMetadataSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4128 - /** Intended for programmatic or logical use, but used as a display name in past specs or fallback */
4129 - name: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4130 - /**
4131 - * Intended for UI and end-user contexts — optimized to be human-readable and easily understood,
4132 - * even by those unfamiliar with domain-specific terminology.
4133 - *
4134 - * If not provided, the name should be used for display (except for Tool,
4135 - * where `annotations.title` should be given precedence over using `name`,
4136 - * if present).
4137 - */
4138 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional()
4139 -});
4140 -/* Initialization */
4141 -/**
4142 - * Describes the name and version of an MCP implementation.
4143 - */
4144 -const ImplementationSchema = BaseMetadataSchema.extend({
4145 - ...BaseMetadataSchema.shape,
4146 - ...IconsSchema.shape,
4147 - version: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4148 - /**
4149 - * An optional URL of the website for this implementation.
4150 - */
4151 - websiteUrl: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
4152 - /**
4153 - * An optional human-readable description of what this implementation does.
4154 - *
4155 - * This can be used by clients or servers to provide context about their purpose
4156 - * and capabilities. For example, a server might describe the types of resources
4157 - * or tools it provides, while a client might describe its intended use case.
4158 - */
4159 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional()
4160 -});
4161 -const FormElicitationCapabilitySchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.intersection(zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4162 - applyDefaults: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional()
4163 -}), zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()));
4164 -const ElicitationCapabilitySchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.preprocess(value => {
4165 - if (value && typeof value === 'object' && !Array.isArray(value)) {
4166 - if (Object.keys(value).length === 0) {
4167 - return { form: {} };
4168 - }
4169 - }
4170 - return value;
4171 -}, zod_v4__WEBPACK_IMPORTED_MODULE_0__.intersection(zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4172 - form: FormElicitationCapabilitySchema.optional(),
4173 - url: AssertObjectSchema.optional()
4174 -}), zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()));
4175 -/**
4176 - * Task capabilities for clients, indicating which request types support task creation.
4177 - */
4178 -const ClientTasksCapabilitySchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
4179 - /**
4180 - * Present if the client supports listing tasks.
4181 - */
4182 - list: AssertObjectSchema.optional(),
4183 - /**
4184 - * Present if the client supports cancelling tasks.
4185 - */
4186 - cancel: AssertObjectSchema.optional(),
4187 - /**
4188 - * Capabilities for task creation on specific request types.
4189 - */
4190 - requests: zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
4191 - /**
4192 - * Task support for sampling requests.
4193 - */
4194 - sampling: zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
4195 - createMessage: AssertObjectSchema.optional()
4196 - })
4197 - .optional(),
4198 - /**
4199 - * Task support for elicitation requests.
4200 - */
4201 - elicitation: zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
4202 - create: AssertObjectSchema.optional()
4203 - })
4204 - .optional()
4205 - })
4206 - .optional()
4207 -});
4208 -/**
4209 - * Task capabilities for servers, indicating which request types support task creation.
4210 - */
4211 -const ServerTasksCapabilitySchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
4212 - /**
4213 - * Present if the server supports listing tasks.
4214 - */
4215 - list: AssertObjectSchema.optional(),
4216 - /**
4217 - * Present if the server supports cancelling tasks.
4218 - */
4219 - cancel: AssertObjectSchema.optional(),
4220 - /**
4221 - * Capabilities for task creation on specific request types.
4222 - */
4223 - requests: zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
4224 - /**
4225 - * Task support for tool requests.
4226 - */
4227 - tools: zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
4228 - call: AssertObjectSchema.optional()
4229 - })
4230 - .optional()
4231 - })
4232 - .optional()
4233 -});
4234 -/**
4235 - * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.
4236 - */
4237 -const ClientCapabilitiesSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4238 - /**
4239 - * Experimental, non-standard capabilities that the client supports.
4240 - */
4241 - experimental: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), AssertObjectSchema).optional(),
4242 - /**
4243 - * Present if the client supports sampling from an LLM.
4244 - */
4245 - sampling: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4246 - /**
4247 - * Present if the client supports context inclusion via includeContext parameter.
4248 - * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it).
4249 - */
4250 - context: AssertObjectSchema.optional(),
4251 - /**
4252 - * Present if the client supports tool use via tools and toolChoice parameters.
4253 - */
4254 - tools: AssertObjectSchema.optional()
4255 - })
4256 - .optional(),
4257 - /**
4258 - * Present if the client supports eliciting user input.
4259 - */
4260 - elicitation: ElicitationCapabilitySchema.optional(),
4261 - /**
4262 - * Present if the client supports listing roots.
4263 - */
4264 - roots: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4265 - /**
4266 - * Whether the client supports issuing notifications for changes to the roots list.
4267 - */
4268 - listChanged: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional()
4269 - })
4270 - .optional(),
4271 - /**
4272 - * Present if the client supports task creation.
4273 - */
4274 - tasks: ClientTasksCapabilitySchema.optional()
4275 -});
4276 -const InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
4277 - /**
4278 - * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well.
4279 - */
4280 - protocolVersion: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4281 - capabilities: ClientCapabilitiesSchema,
4282 - clientInfo: ImplementationSchema
4283 -});
4284 -/**
4285 - * This request is sent from the client to the server when it first connects, asking it to begin initialization.
4286 - */
4287 -const InitializeRequestSchema = RequestSchema.extend({
4288 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('initialize'),
4289 - params: InitializeRequestParamsSchema
4290 -});
4291 -const isInitializeRequest = (value) => InitializeRequestSchema.safeParse(value).success;
4292 -/**
4293 - * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.
4294 - */
4295 -const ServerCapabilitiesSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4296 - /**
4297 - * Experimental, non-standard capabilities that the server supports.
4298 - */
4299 - experimental: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), AssertObjectSchema).optional(),
4300 - /**
4301 - * Present if the server supports sending log messages to the client.
4302 - */
4303 - logging: AssertObjectSchema.optional(),
4304 - /**
4305 - * Present if the server supports sending completions to the client.
4306 - */
4307 - completions: AssertObjectSchema.optional(),
4308 - /**
4309 - * Present if the server offers any prompt templates.
4310 - */
4311 - prompts: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4312 - /**
4313 - * Whether this server supports issuing notifications for changes to the prompt list.
4314 - */
4315 - listChanged: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional()
4316 - })
4317 - .optional(),
4318 - /**
4319 - * Present if the server offers any resources to read.
4320 - */
4321 - resources: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4322 - /**
4323 - * Whether this server supports clients subscribing to resource updates.
4324 - */
4325 - subscribe: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional(),
4326 - /**
4327 - * Whether this server supports issuing notifications for changes to the resource list.
4328 - */
4329 - listChanged: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional()
4330 - })
4331 - .optional(),
4332 - /**
4333 - * Present if the server offers any tools to call.
4334 - */
4335 - tools: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4336 - /**
4337 - * Whether this server supports issuing notifications for changes to the tool list.
4338 - */
4339 - listChanged: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional()
4340 - })
4341 - .optional(),
4342 - /**
4343 - * Present if the server supports task creation.
4344 - */
4345 - tasks: ServerTasksCapabilitySchema.optional()
4346 -});
4347 -/**
4348 - * After receiving an initialize request from the client, the server sends this response.
4349 - */
4350 -const InitializeResultSchema = ResultSchema.extend({
4351 - /**
4352 - * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect.
4353 - */
4354 - protocolVersion: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4355 - capabilities: ServerCapabilitiesSchema,
4356 - serverInfo: ImplementationSchema,
4357 - /**
4358 - * Instructions describing how to use the server and its features.
4359 - *
4360 - * This can be used by clients to improve the LLM's understanding of available tools, resources, etc. It can be thought of like a "hint" to the model. For example, this information MAY be added to the system prompt.
4361 - */
4362 - instructions: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional()
4363 -});
4364 -/**
4365 - * This notification is sent from the client to the server after initialization has finished.
4366 - */
4367 -const InitializedNotificationSchema = NotificationSchema.extend({
4368 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/initialized'),
4369 - params: NotificationsParamsSchema.optional()
4370 -});
4371 -const isInitializedNotification = (value) => InitializedNotificationSchema.safeParse(value).success;
4372 -/* Ping */
4373 -/**
4374 - * A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.
4375 - */
4376 -const PingRequestSchema = RequestSchema.extend({
4377 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('ping'),
4378 - params: BaseRequestParamsSchema.optional()
4379 -});
4380 -/* Progress notifications */
4381 -const ProgressSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4382 - /**
4383 - * The progress thus far. This should increase every time progress is made, even if the total is unknown.
4384 - */
4385 - progress: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number(),
4386 - /**
4387 - * Total number of items to process (or total progress required), if known.
4388 - */
4389 - total: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.number()),
4390 - /**
4391 - * An optional message describing the current progress.
4392 - */
4393 - message: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string())
4394 -});
4395 -const ProgressNotificationParamsSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4396 - ...NotificationsParamsSchema.shape,
4397 - ...ProgressSchema.shape,
4398 - /**
4399 - * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding.
4400 - */
4401 - progressToken: ProgressTokenSchema
4402 -});
4403 -/**
4404 - * An out-of-band notification used to inform the receiver of a progress update for a long-running request.
4405 - *
4406 - * @category notifications/progress
4407 - */
4408 -const ProgressNotificationSchema = NotificationSchema.extend({
4409 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/progress'),
4410 - params: ProgressNotificationParamsSchema
4411 -});
4412 -const PaginatedRequestParamsSchema = BaseRequestParamsSchema.extend({
4413 - /**
4414 - * An opaque token representing the current pagination position.
4415 - * If provided, the server should return results starting after this cursor.
4416 - */
4417 - cursor: CursorSchema.optional()
4418 -});
4419 -/* Pagination */
4420 -const PaginatedRequestSchema = RequestSchema.extend({
4421 - params: PaginatedRequestParamsSchema.optional()
4422 -});
4423 -const PaginatedResultSchema = ResultSchema.extend({
4424 - /**
4425 - * An opaque token representing the pagination position after the last returned result.
4426 - * If present, there may be more results available.
4427 - */
4428 - nextCursor: CursorSchema.optional()
4429 -});
4430 -/**
4431 - * The status of a task.
4432 - * */
4433 -const TaskStatusSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['working', 'input_required', 'completed', 'failed', 'cancelled']);
4434 -/* Tasks */
4435 -/**
4436 - * A pollable state object associated with a request.
4437 - */
4438 -const TaskSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4439 - taskId: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4440 - status: TaskStatusSchema,
4441 - /**
4442 - * Time in milliseconds to keep task results available after completion.
4443 - * If null, the task has unlimited lifetime until manually cleaned up.
4444 - */
4445 - ttl: zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([zod_v4__WEBPACK_IMPORTED_MODULE_0__.number(), zod_v4__WEBPACK_IMPORTED_MODULE_0__["null"]()]),
4446 - /**
4447 - * ISO 8601 timestamp when the task was created.
4448 - */
4449 - createdAt: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4450 - /**
4451 - * ISO 8601 timestamp when the task was last updated.
4452 - */
4453 - lastUpdatedAt: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4454 - pollInterval: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.number()),
4455 - /**
4456 - * Optional diagnostic message for failed tasks or other status information.
4457 - */
4458 - statusMessage: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string())
4459 -});
4460 -/**
4461 - * Result returned when a task is created, containing the task data wrapped in a task field.
4462 - */
4463 -const CreateTaskResultSchema = ResultSchema.extend({
4464 - task: TaskSchema
4465 -});
4466 -/**
4467 - * Parameters for task status notification.
4468 - */
4469 -const TaskStatusNotificationParamsSchema = NotificationsParamsSchema.merge(TaskSchema);
4470 -/**
4471 - * A notification sent when a task's status changes.
4472 - */
4473 -const TaskStatusNotificationSchema = NotificationSchema.extend({
4474 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/tasks/status'),
4475 - params: TaskStatusNotificationParamsSchema
4476 -});
4477 -/**
4478 - * A request to get the state of a specific task.
4479 - */
4480 -const GetTaskRequestSchema = RequestSchema.extend({
4481 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('tasks/get'),
4482 - params: BaseRequestParamsSchema.extend({
4483 - taskId: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
4484 - })
4485 -});
4486 -/**
4487 - * The response to a tasks/get request.
4488 - */
4489 -const GetTaskResultSchema = ResultSchema.merge(TaskSchema);
4490 -/**
4491 - * A request to get the result of a specific task.
4492 - */
4493 -const GetTaskPayloadRequestSchema = RequestSchema.extend({
4494 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('tasks/result'),
4495 - params: BaseRequestParamsSchema.extend({
4496 - taskId: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
4497 - })
4498 -});
4499 -/**
4500 - * The response to a tasks/result request.
4501 - * The structure matches the result type of the original request.
4502 - * For example, a tools/call task would return the CallToolResult structure.
4503 - *
4504 - */
4505 -const GetTaskPayloadResultSchema = ResultSchema.loose();
4506 -/**
4507 - * A request to list tasks.
4508 - */
4509 -const ListTasksRequestSchema = PaginatedRequestSchema.extend({
4510 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('tasks/list')
4511 -});
4512 -/**
4513 - * The response to a tasks/list request.
4514 - */
4515 -const ListTasksResultSchema = PaginatedResultSchema.extend({
4516 - tasks: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(TaskSchema)
4517 -});
4518 -/**
4519 - * A request to cancel a specific task.
4520 - */
4521 -const CancelTaskRequestSchema = RequestSchema.extend({
4522 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('tasks/cancel'),
4523 - params: BaseRequestParamsSchema.extend({
4524 - taskId: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
4525 - })
4526 -});
4527 -/**
4528 - * The response to a tasks/cancel request.
4529 - */
4530 -const CancelTaskResultSchema = ResultSchema.merge(TaskSchema);
4531 -/* Resources */
4532 -/**
4533 - * The contents of a specific resource or sub-resource.
4534 - */
4535 -const ResourceContentsSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4536 - /**
4537 - * The URI of this resource.
4538 - */
4539 - uri: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4540 - /**
4541 - * The MIME type of this resource, if known.
4542 - */
4543 - mimeType: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()),
4544 - /**
4545 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
4546 - * for notes on _meta usage.
4547 - */
4548 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
4549 -});
4550 -const TextResourceContentsSchema = ResourceContentsSchema.extend({
4551 - /**
4552 - * The text of the item. This must only be set if the item can actually be represented as text (not binary data).
4553 - */
4554 - text: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
4555 -});
4556 -/**
4557 - * A Zod schema for validating Base64 strings that is more performant and
4558 - * robust for very large inputs than the default regex-based check. It avoids
4559 - * stack overflows by using the native `atob` function for validation.
4560 - */
4561 -const Base64Schema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().refine(val => {
4562 - try {
4563 - // atob throws a DOMException if the string contains characters
4564 - // that are not part of the Base64 character set.
4565 - atob(val);
4566 - return true;
4567 - }
4568 - catch {
4569 - return false;
4570 - }
4571 -}, { message: 'Invalid Base64 string' });
4572 -const BlobResourceContentsSchema = ResourceContentsSchema.extend({
4573 - /**
4574 - * A base64-encoded string representing the binary data of the item.
4575 - */
4576 - blob: Base64Schema
4577 -});
4578 -/**
4579 - * The sender or recipient of messages and data in a conversation.
4580 - */
4581 -const RoleSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['user', 'assistant']);
4582 -/**
4583 - * Optional annotations providing clients additional context about a resource.
4584 - */
4585 -const AnnotationsSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4586 - /**
4587 - * Intended audience(s) for the resource.
4588 - */
4589 - audience: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(RoleSchema).optional(),
4590 - /**
4591 - * Importance hint for the resource, from 0 (least) to 1 (most).
4592 - */
4593 - priority: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().min(0).max(1).optional(),
4594 - /**
4595 - * ISO 8601 timestamp for the most recent modification.
4596 - */
4597 - lastModified: zod_v4__WEBPACK_IMPORTED_MODULE_1__.datetime({ offset: true }).optional()
4598 -});
4599 -/**
4600 - * A known resource that the server is capable of reading.
4601 - */
4602 -const ResourceSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4603 - ...BaseMetadataSchema.shape,
4604 - ...IconsSchema.shape,
4605 - /**
4606 - * The URI of this resource.
4607 - */
4608 - uri: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4609 - /**
4610 - * A description of what this resource represents.
4611 - *
4612 - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
4613 - */
4614 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()),
4615 - /**
4616 - * The MIME type of this resource, if known.
4617 - */
4618 - mimeType: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()),
4619 - /**
4620 - * Optional annotations for the client.
4621 - */
4622 - annotations: AnnotationsSchema.optional(),
4623 - /**
4624 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
4625 - * for notes on _meta usage.
4626 - */
4627 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({}))
4628 -});
4629 -/**
4630 - * A template description for resources available on the server.
4631 - */
4632 -const ResourceTemplateSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4633 - ...BaseMetadataSchema.shape,
4634 - ...IconsSchema.shape,
4635 - /**
4636 - * A URI template (according to RFC 6570) that can be used to construct resource URIs.
4637 - */
4638 - uriTemplate: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4639 - /**
4640 - * A description of what this template is for.
4641 - *
4642 - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model.
4643 - */
4644 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()),
4645 - /**
4646 - * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type.
4647 - */
4648 - mimeType: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()),
4649 - /**
4650 - * Optional annotations for the client.
4651 - */
4652 - annotations: AnnotationsSchema.optional(),
4653 - /**
4654 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
4655 - * for notes on _meta usage.
4656 - */
4657 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({}))
4658 -});
4659 -/**
4660 - * Sent from the client to request a list of resources the server has.
4661 - */
4662 -const ListResourcesRequestSchema = PaginatedRequestSchema.extend({
4663 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('resources/list')
4664 -});
4665 -/**
4666 - * The server's response to a resources/list request from the client.
4667 - */
4668 -const ListResourcesResultSchema = PaginatedResultSchema.extend({
4669 - resources: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(ResourceSchema)
4670 -});
4671 -/**
4672 - * Sent from the client to request a list of resource templates the server has.
4673 - */
4674 -const ListResourceTemplatesRequestSchema = PaginatedRequestSchema.extend({
4675 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('resources/templates/list')
4676 -});
4677 -/**
4678 - * The server's response to a resources/templates/list request from the client.
4679 - */
4680 -const ListResourceTemplatesResultSchema = PaginatedResultSchema.extend({
4681 - resourceTemplates: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(ResourceTemplateSchema)
4682 -});
4683 -const ResourceRequestParamsSchema = BaseRequestParamsSchema.extend({
4684 - /**
4685 - * The URI of the resource to read. The URI can use any protocol; it is up to the server how to interpret it.
4686 - *
4687 - * @format uri
4688 - */
4689 - uri: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
4690 -});
4691 -/**
4692 - * Parameters for a `resources/read` request.
4693 - */
4694 -const ReadResourceRequestParamsSchema = ResourceRequestParamsSchema;
4695 -/**
4696 - * Sent from the client to the server, to read a specific resource URI.
4697 - */
4698 -const ReadResourceRequestSchema = RequestSchema.extend({
4699 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('resources/read'),
4700 - params: ReadResourceRequestParamsSchema
4701 -});
4702 -/**
4703 - * The server's response to a resources/read request from the client.
4704 - */
4705 -const ReadResourceResultSchema = ResultSchema.extend({
4706 - contents: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([TextResourceContentsSchema, BlobResourceContentsSchema]))
4707 -});
4708 -/**
4709 - * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.
4710 - */
4711 -const ResourceListChangedNotificationSchema = NotificationSchema.extend({
4712 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/resources/list_changed'),
4713 - params: NotificationsParamsSchema.optional()
4714 -});
4715 -const SubscribeRequestParamsSchema = ResourceRequestParamsSchema;
4716 -/**
4717 - * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.
4718 - */
4719 -const SubscribeRequestSchema = RequestSchema.extend({
4720 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('resources/subscribe'),
4721 - params: SubscribeRequestParamsSchema
4722 -});
4723 -const UnsubscribeRequestParamsSchema = ResourceRequestParamsSchema;
4724 -/**
4725 - * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.
4726 - */
4727 -const UnsubscribeRequestSchema = RequestSchema.extend({
4728 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('resources/unsubscribe'),
4729 - params: UnsubscribeRequestParamsSchema
4730 -});
4731 -/**
4732 - * Parameters for a `notifications/resources/updated` notification.
4733 - */
4734 -const ResourceUpdatedNotificationParamsSchema = NotificationsParamsSchema.extend({
4735 - /**
4736 - * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to.
4737 - */
4738 - uri: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
4739 -});
4740 -/**
4741 - * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.
4742 - */
4743 -const ResourceUpdatedNotificationSchema = NotificationSchema.extend({
4744 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/resources/updated'),
4745 - params: ResourceUpdatedNotificationParamsSchema
4746 -});
4747 -/* Prompts */
4748 -/**
4749 - * Describes an argument that a prompt can accept.
4750 - */
4751 -const PromptArgumentSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4752 - /**
4753 - * The name of the argument.
4754 - */
4755 - name: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4756 - /**
4757 - * A human-readable description of the argument.
4758 - */
4759 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()),
4760 - /**
4761 - * Whether this argument must be provided.
4762 - */
4763 - required: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean())
4764 -});
4765 -/**
4766 - * A prompt or prompt template that the server offers.
4767 - */
4768 -const PromptSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4769 - ...BaseMetadataSchema.shape,
4770 - ...IconsSchema.shape,
4771 - /**
4772 - * An optional description of what this prompt provides
4773 - */
4774 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()),
4775 - /**
4776 - * A list of arguments to use for templating the prompt.
4777 - */
4778 - arguments: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(PromptArgumentSchema)),
4779 - /**
4780 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
4781 - * for notes on _meta usage.
4782 - */
4783 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({}))
4784 -});
4785 -/**
4786 - * Sent from the client to request a list of prompts and prompt templates the server has.
4787 - */
4788 -const ListPromptsRequestSchema = PaginatedRequestSchema.extend({
4789 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('prompts/list')
4790 -});
4791 -/**
4792 - * The server's response to a prompts/list request from the client.
4793 - */
4794 -const ListPromptsResultSchema = PaginatedResultSchema.extend({
4795 - prompts: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(PromptSchema)
4796 -});
4797 -/**
4798 - * Parameters for a `prompts/get` request.
4799 - */
4800 -const GetPromptRequestParamsSchema = BaseRequestParamsSchema.extend({
4801 - /**
4802 - * The name of the prompt or prompt template.
4803 - */
4804 - name: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4805 - /**
4806 - * Arguments to use for templating the prompt.
4807 - */
4808 - arguments: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional()
4809 -});
4810 -/**
4811 - * Used by the client to get a prompt provided by the server.
4812 - */
4813 -const GetPromptRequestSchema = RequestSchema.extend({
4814 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('prompts/get'),
4815 - params: GetPromptRequestParamsSchema
4816 -});
4817 -/**
4818 - * Text provided to or from an LLM.
4819 - */
4820 -const TextContentSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4821 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('text'),
4822 - /**
4823 - * The text content of the message.
4824 - */
4825 - text: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4826 - /**
4827 - * Optional annotations for the client.
4828 - */
4829 - annotations: AnnotationsSchema.optional(),
4830 - /**
4831 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
4832 - * for notes on _meta usage.
4833 - */
4834 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
4835 -});
4836 -/**
4837 - * An image provided to or from an LLM.
4838 - */
4839 -const ImageContentSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4840 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('image'),
4841 - /**
4842 - * The base64-encoded image data.
4843 - */
4844 - data: Base64Schema,
4845 - /**
4846 - * The MIME type of the image. Different providers may support different image types.
4847 - */
4848 - mimeType: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4849 - /**
4850 - * Optional annotations for the client.
4851 - */
4852 - annotations: AnnotationsSchema.optional(),
4853 - /**
4854 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
4855 - * for notes on _meta usage.
4856 - */
4857 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
4858 -});
4859 -/**
4860 - * An Audio provided to or from an LLM.
4861 - */
4862 -const AudioContentSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4863 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('audio'),
4864 - /**
4865 - * The base64-encoded audio data.
4866 - */
4867 - data: Base64Schema,
4868 - /**
4869 - * The MIME type of the audio. Different providers may support different audio types.
4870 - */
4871 - mimeType: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4872 - /**
4873 - * Optional annotations for the client.
4874 - */
4875 - annotations: AnnotationsSchema.optional(),
4876 - /**
4877 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
4878 - * for notes on _meta usage.
4879 - */
4880 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
4881 -});
4882 -/**
4883 - * A tool call request from an assistant (LLM).
4884 - * Represents the assistant's request to use a tool.
4885 - */
4886 -const ToolUseContentSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4887 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('tool_use'),
4888 - /**
4889 - * The name of the tool to invoke.
4890 - * Must match a tool name from the request's tools array.
4891 - */
4892 - name: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4893 - /**
4894 - * Unique identifier for this tool call.
4895 - * Used to correlate with ToolResultContent in subsequent messages.
4896 - */
4897 - id: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
4898 - /**
4899 - * Arguments to pass to the tool.
4900 - * Must conform to the tool's inputSchema.
4901 - */
4902 - input: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()),
4903 - /**
4904 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
4905 - * for notes on _meta usage.
4906 - */
4907 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
4908 -});
4909 -/**
4910 - * The contents of a resource, embedded into a prompt or tool call result.
4911 - */
4912 -const EmbeddedResourceSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4913 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('resource'),
4914 - resource: zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([TextResourceContentsSchema, BlobResourceContentsSchema]),
4915 - /**
4916 - * Optional annotations for the client.
4917 - */
4918 - annotations: AnnotationsSchema.optional(),
4919 - /**
4920 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
4921 - * for notes on _meta usage.
4922 - */
4923 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
4924 -});
4925 -/**
4926 - * A resource that the server is capable of reading, included in a prompt or tool call result.
4927 - *
4928 - * Note: resource links returned by tools are not guaranteed to appear in the results of `resources/list` requests.
4929 - */
4930 -const ResourceLinkSchema = ResourceSchema.extend({
4931 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('resource_link')
4932 -});
4933 -/**
4934 - * A content block that can be used in prompts and tool results.
4935 - */
4936 -const ContentBlockSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([
4937 - TextContentSchema,
4938 - ImageContentSchema,
4939 - AudioContentSchema,
4940 - ResourceLinkSchema,
4941 - EmbeddedResourceSchema
4942 -]);
4943 -/**
4944 - * Describes a message returned as part of a prompt.
4945 - */
4946 -const PromptMessageSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4947 - role: RoleSchema,
4948 - content: ContentBlockSchema
4949 -});
4950 -/**
4951 - * The server's response to a prompts/get request from the client.
4952 - */
4953 -const GetPromptResultSchema = ResultSchema.extend({
4954 - /**
4955 - * An optional description for the prompt.
4956 - */
4957 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
4958 - messages: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(PromptMessageSchema)
4959 -});
4960 -/**
4961 - * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client.
4962 - */
4963 -const PromptListChangedNotificationSchema = NotificationSchema.extend({
4964 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/prompts/list_changed'),
4965 - params: NotificationsParamsSchema.optional()
4966 -});
4967 -/* Tools */
4968 -/**
4969 - * Additional properties describing a Tool to clients.
4970 - *
4971 - * NOTE: all properties in ToolAnnotations are **hints**.
4972 - * They are not guaranteed to provide a faithful description of
4973 - * tool behavior (including descriptive properties like `title`).
4974 - *
4975 - * Clients should never make tool use decisions based on ToolAnnotations
4976 - * received from untrusted servers.
4977 - */
4978 -const ToolAnnotationsSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
4979 - /**
4980 - * A human-readable title for the tool.
4981 - */
4982 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
4983 - /**
4984 - * If true, the tool does not modify its environment.
4985 - *
4986 - * Default: false
4987 - */
4988 - readOnlyHint: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional(),
4989 - /**
4990 - * If true, the tool may perform destructive updates to its environment.
4991 - * If false, the tool performs only additive updates.
4992 - *
4993 - * (This property is meaningful only when `readOnlyHint == false`)
4994 - *
4995 - * Default: true
4996 - */
4997 - destructiveHint: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional(),
4998 - /**
4999 - * If true, calling the tool repeatedly with the same arguments
5000 - * will have no additional effect on the its environment.
5001 - *
5002 - * (This property is meaningful only when `readOnlyHint == false`)
5003 - *
5004 - * Default: false
5005 - */
5006 - idempotentHint: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional(),
5007 - /**
5008 - * If true, this tool may interact with an "open world" of external
5009 - * entities. If false, the tool's domain of interaction is closed.
5010 - * For example, the world of a web search tool is open, whereas that
5011 - * of a memory tool is not.
5012 - *
5013 - * Default: true
5014 - */
5015 - openWorldHint: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional()
5016 -});
5017 -/**
5018 - * Execution-related properties for a tool.
5019 - */
5020 -const ToolExecutionSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5021 - /**
5022 - * Indicates the tool's preference for task-augmented execution.
5023 - * - "required": Clients MUST invoke the tool as a task
5024 - * - "optional": Clients MAY invoke the tool as a task or normal request
5025 - * - "forbidden": Clients MUST NOT attempt to invoke the tool as a task
5026 - *
5027 - * If not present, defaults to "forbidden".
5028 - */
5029 - taskSupport: zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['required', 'optional', 'forbidden']).optional()
5030 -});
5031 -/**
5032 - * Definition for a tool the client can call.
5033 - */
5034 -const ToolSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5035 - ...BaseMetadataSchema.shape,
5036 - ...IconsSchema.shape,
5037 - /**
5038 - * A human-readable description of the tool.
5039 - */
5040 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5041 - /**
5042 - * A JSON Schema 2020-12 object defining the expected parameters for the tool.
5043 - * Must have type: 'object' at the root level per MCP spec.
5044 - */
5045 - inputSchema: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5046 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('object'),
5047 - properties: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), AssertObjectSchema).optional(),
5048 - required: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional()
5049 - })
5050 - .catchall(zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()),
5051 - /**
5052 - * An optional JSON Schema 2020-12 object defining the structure of the tool's output
5053 - * returned in the structuredContent field of a CallToolResult.
5054 - * Must have type: 'object' at the root level per MCP spec.
5055 - */
5056 - outputSchema: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5057 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('object'),
5058 - properties: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), AssertObjectSchema).optional(),
5059 - required: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional()
5060 - })
5061 - .catchall(zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown())
5062 - .optional(),
5063 - /**
5064 - * Optional additional tool information.
5065 - */
5066 - annotations: ToolAnnotationsSchema.optional(),
5067 - /**
5068 - * Execution-related properties for this tool.
5069 - */
5070 - execution: ToolExecutionSchema.optional(),
5071 - /**
5072 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
5073 - * for notes on _meta usage.
5074 - */
5075 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
5076 -});
5077 -/**
5078 - * Sent from the client to request a list of tools the server has.
5079 - */
5080 -const ListToolsRequestSchema = PaginatedRequestSchema.extend({
5081 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('tools/list')
5082 -});
5083 -/**
5084 - * The server's response to a tools/list request from the client.
5085 - */
5086 -const ListToolsResultSchema = PaginatedResultSchema.extend({
5087 - tools: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(ToolSchema)
5088 -});
5089 -/**
5090 - * The server's response to a tool call.
5091 - */
5092 -const CallToolResultSchema = ResultSchema.extend({
5093 - /**
5094 - * A list of content objects that represent the result of the tool call.
5095 - *
5096 - * If the Tool does not define an outputSchema, this field MUST be present in the result.
5097 - * For backwards compatibility, this field is always present, but it may be empty.
5098 - */
5099 - content: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(ContentBlockSchema).default([]),
5100 - /**
5101 - * An object containing structured tool output.
5102 - *
5103 - * If the Tool defines an outputSchema, this field MUST be present in the result, and contain a JSON object that matches the schema.
5104 - */
5105 - structuredContent: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional(),
5106 - /**
5107 - * Whether the tool call ended in an error.
5108 - *
5109 - * If not set, this is assumed to be false (the call was successful).
5110 - *
5111 - * Any errors that originate from the tool SHOULD be reported inside the result
5112 - * object, with `isError` set to true, _not_ as an MCP protocol-level error
5113 - * response. Otherwise, the LLM would not be able to see that an error occurred
5114 - * and self-correct.
5115 - *
5116 - * However, any errors in _finding_ the tool, an error indicating that the
5117 - * server does not support tool calls, or any other exceptional conditions,
5118 - * should be reported as an MCP error response.
5119 - */
5120 - isError: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional()
5121 -});
5122 -/**
5123 - * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07.
5124 - */
5125 -const CompatibilityCallToolResultSchema = CallToolResultSchema.or(ResultSchema.extend({
5126 - toolResult: zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()
5127 -}));
5128 -/**
5129 - * Parameters for a `tools/call` request.
5130 - */
5131 -const CallToolRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
5132 - /**
5133 - * The name of the tool to call.
5134 - */
5135 - name: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
5136 - /**
5137 - * Arguments to pass to the tool.
5138 - */
5139 - arguments: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
5140 -});
5141 -/**
5142 - * Used by the client to invoke a tool provided by the server.
5143 - */
5144 -const CallToolRequestSchema = RequestSchema.extend({
5145 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('tools/call'),
5146 - params: CallToolRequestParamsSchema
5147 -});
5148 -/**
5149 - * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.
5150 - */
5151 -const ToolListChangedNotificationSchema = NotificationSchema.extend({
5152 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/tools/list_changed'),
5153 - params: NotificationsParamsSchema.optional()
5154 -});
5155 -/**
5156 - * Base schema for list changed subscription options (without callback).
5157 - * Used internally for Zod validation of autoRefresh and debounceMs.
5158 - */
5159 -const ListChangedOptionsBaseSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5160 - /**
5161 - * If true, the list will be refreshed automatically when a list changed notification is received.
5162 - * The callback will be called with the updated list.
5163 - *
5164 - * If false, the callback will be called with null items, allowing manual refresh.
5165 - *
5166 - * @default true
5167 - */
5168 - autoRefresh: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().default(true),
5169 - /**
5170 - * Debounce time in milliseconds for list changed notification processing.
5171 - *
5172 - * Multiple notifications received within this timeframe will only trigger one refresh.
5173 - * Set to 0 to disable debouncing.
5174 - *
5175 - * @default 300
5176 - */
5177 - debounceMs: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().int().nonnegative().default(300)
5178 -});
5179 -/* Logging */
5180 -/**
5181 - * The severity of a log message.
5182 - */
5183 -const LoggingLevelSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency']);
5184 -/**
5185 - * Parameters for a `logging/setLevel` request.
5186 - */
5187 -const SetLevelRequestParamsSchema = BaseRequestParamsSchema.extend({
5188 - /**
5189 - * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as notifications/logging/message.
5190 - */
5191 - level: LoggingLevelSchema
5192 -});
5193 -/**
5194 - * A request from the client to the server, to enable or adjust logging.
5195 - */
5196 -const SetLevelRequestSchema = RequestSchema.extend({
5197 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('logging/setLevel'),
5198 - params: SetLevelRequestParamsSchema
5199 -});
5200 -/**
5201 - * Parameters for a `notifications/message` notification.
5202 - */
5203 -const LoggingMessageNotificationParamsSchema = NotificationsParamsSchema.extend({
5204 - /**
5205 - * The severity of this log message.
5206 - */
5207 - level: LoggingLevelSchema,
5208 - /**
5209 - * An optional name of the logger issuing this message.
5210 - */
5211 - logger: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5212 - /**
5213 - * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here.
5214 - */
5215 - data: zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()
5216 -});
5217 -/**
5218 - * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.
5219 - */
5220 -const LoggingMessageNotificationSchema = NotificationSchema.extend({
5221 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/message'),
5222 - params: LoggingMessageNotificationParamsSchema
5223 -});
5224 -/* Sampling */
5225 -/**
5226 - * Hints to use for model selection.
5227 - */
5228 -const ModelHintSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5229 - /**
5230 - * A hint for a model name.
5231 - */
5232 - name: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional()
5233 -});
5234 -/**
5235 - * The server's preferences for model selection, requested of the client during sampling.
5236 - */
5237 -const ModelPreferencesSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5238 - /**
5239 - * Optional hints to use for model selection.
5240 - */
5241 - hints: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(ModelHintSchema).optional(),
5242 - /**
5243 - * How much to prioritize cost when selecting a model.
5244 - */
5245 - costPriority: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().min(0).max(1).optional(),
5246 - /**
5247 - * How much to prioritize sampling speed (latency) when selecting a model.
5248 - */
5249 - speedPriority: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().min(0).max(1).optional(),
5250 - /**
5251 - * How much to prioritize intelligence and capabilities when selecting a model.
5252 - */
5253 - intelligencePriority: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().min(0).max(1).optional()
5254 -});
5255 -/**
5256 - * Controls tool usage behavior in sampling requests.
5257 - */
5258 -const ToolChoiceSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5259 - /**
5260 - * Controls when tools are used:
5261 - * - "auto": Model decides whether to use tools (default)
5262 - * - "required": Model MUST use at least one tool before completing
5263 - * - "none": Model MUST NOT use any tools
5264 - */
5265 - mode: zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['auto', 'required', 'none']).optional()
5266 -});
5267 -/**
5268 - * The result of a tool execution, provided by the user (server).
5269 - * Represents the outcome of invoking a tool requested via ToolUseContent.
5270 - */
5271 -const ToolResultContentSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5272 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('tool_result'),
5273 - toolUseId: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().describe('The unique identifier for the corresponding tool call.'),
5274 - content: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(ContentBlockSchema).default([]),
5275 - structuredContent: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({}).loose().optional(),
5276 - isError: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional(),
5277 - /**
5278 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
5279 - * for notes on _meta usage.
5280 - */
5281 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
5282 -});
5283 -/**
5284 - * Basic content types for sampling responses (without tool use).
5285 - * Used for backwards-compatible CreateMessageResult when tools are not used.
5286 - */
5287 -const SamplingContentSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.discriminatedUnion('type', [TextContentSchema, ImageContentSchema, AudioContentSchema]);
5288 -/**
5289 - * Content block types allowed in sampling messages.
5290 - * This includes text, image, audio, tool use requests, and tool results.
5291 - */
5292 -const SamplingMessageContentBlockSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.discriminatedUnion('type', [
5293 - TextContentSchema,
5294 - ImageContentSchema,
5295 - AudioContentSchema,
5296 - ToolUseContentSchema,
5297 - ToolResultContentSchema
5298 -]);
5299 -/**
5300 - * Describes a message issued to or received from an LLM API.
5301 - */
5302 -const SamplingMessageSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5303 - role: RoleSchema,
5304 - content: zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([SamplingMessageContentBlockSchema, zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(SamplingMessageContentBlockSchema)]),
5305 - /**
5306 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
5307 - * for notes on _meta usage.
5308 - */
5309 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
5310 -});
5311 -/**
5312 - * Parameters for a `sampling/createMessage` request.
5313 - */
5314 -const CreateMessageRequestParamsSchema = TaskAugmentedRequestParamsSchema.extend({
5315 - messages: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(SamplingMessageSchema),
5316 - /**
5317 - * The server's preferences for which model to select. The client MAY modify or omit this request.
5318 - */
5319 - modelPreferences: ModelPreferencesSchema.optional(),
5320 - /**
5321 - * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
5322 - */
5323 - systemPrompt: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5324 - /**
5325 - * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
5326 - * The client MAY ignore this request.
5327 - *
5328 - * Default is "none". Values "thisServer" and "allServers" are soft-deprecated. Servers SHOULD only use these values if the client
5329 - * declares ClientCapabilities.sampling.context. These values may be removed in future spec releases.
5330 - */
5331 - includeContext: zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['none', 'thisServer', 'allServers']).optional(),
5332 - temperature: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional(),
5333 - /**
5334 - * The requested maximum number of tokens to sample (to prevent runaway completions).
5335 - *
5336 - * The client MAY choose to sample fewer tokens than the requested maximum.
5337 - */
5338 - maxTokens: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().int(),
5339 - stopSequences: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional(),
5340 - /**
5341 - * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
5342 - */
5343 - metadata: AssertObjectSchema.optional(),
5344 - /**
5345 - * Tools that the model may use during generation.
5346 - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
5347 - */
5348 - tools: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(ToolSchema).optional(),
5349 - /**
5350 - * Controls how the model uses tools.
5351 - * The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.
5352 - * Default is `{ mode: "auto" }`.
5353 - */
5354 - toolChoice: ToolChoiceSchema.optional()
5355 -});
5356 -/**
5357 - * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
5358 - */
5359 -const CreateMessageRequestSchema = RequestSchema.extend({
5360 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('sampling/createMessage'),
5361 - params: CreateMessageRequestParamsSchema
5362 -});
5363 -/**
5364 - * The client's response to a sampling/create_message request from the server.
5365 - * This is the backwards-compatible version that returns single content (no arrays).
5366 - * Used when the request does not include tools.
5367 - */
5368 -const CreateMessageResultSchema = ResultSchema.extend({
5369 - /**
5370 - * The name of the model that generated the message.
5371 - */
5372 - model: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
5373 - /**
5374 - * The reason why sampling stopped, if known.
5375 - *
5376 - * Standard values:
5377 - * - "endTurn": Natural end of the assistant's turn
5378 - * - "stopSequence": A stop sequence was encountered
5379 - * - "maxTokens": Maximum token limit was reached
5380 - *
5381 - * This field is an open string to allow for provider-specific stop reasons.
5382 - */
5383 - stopReason: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['endTurn', 'stopSequence', 'maxTokens']).or(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string())),
5384 - role: RoleSchema,
5385 - /**
5386 - * Response content. Single content block (text, image, or audio).
5387 - */
5388 - content: SamplingContentSchema
5389 -});
5390 -/**
5391 - * The client's response to a sampling/create_message request when tools were provided.
5392 - * This version supports array content for tool use flows.
5393 - */
5394 -const CreateMessageResultWithToolsSchema = ResultSchema.extend({
5395 - /**
5396 - * The name of the model that generated the message.
5397 - */
5398 - model: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
5399 - /**
5400 - * The reason why sampling stopped, if known.
5401 - *
5402 - * Standard values:
5403 - * - "endTurn": Natural end of the assistant's turn
5404 - * - "stopSequence": A stop sequence was encountered
5405 - * - "maxTokens": Maximum token limit was reached
5406 - * - "toolUse": The model wants to use one or more tools
5407 - *
5408 - * This field is an open string to allow for provider-specific stop reasons.
5409 - */
5410 - stopReason: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['endTurn', 'stopSequence', 'maxTokens', 'toolUse']).or(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string())),
5411 - role: RoleSchema,
5412 - /**
5413 - * Response content. May be a single block or array. May include ToolUseContent if stopReason is "toolUse".
5414 - */
5415 - content: zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([SamplingMessageContentBlockSchema, zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(SamplingMessageContentBlockSchema)])
5416 -});
5417 -/* Elicitation */
5418 -/**
5419 - * Primitive schema definition for boolean fields.
5420 - */
5421 -const BooleanSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5422 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('boolean'),
5423 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5424 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5425 - default: zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean().optional()
5426 -});
5427 -/**
5428 - * Primitive schema definition for string fields.
5429 - */
5430 -const StringSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5431 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('string'),
5432 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5433 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5434 - minLength: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional(),
5435 - maxLength: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional(),
5436 - format: zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['email', 'uri', 'date', 'date-time']).optional(),
5437 - default: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional()
5438 -});
5439 -/**
5440 - * Primitive schema definition for number fields.
5441 - */
5442 -const NumberSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5443 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['number', 'integer']),
5444 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5445 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5446 - minimum: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional(),
5447 - maximum: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional(),
5448 - default: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional()
5449 -});
5450 -/**
5451 - * Schema for single-selection enumeration without display titles for options.
5452 - */
5453 -const UntitledSingleSelectEnumSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5454 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('string'),
5455 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5456 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5457 - enum: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()),
5458 - default: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional()
5459 -});
5460 -/**
5461 - * Schema for single-selection enumeration with display titles for each option.
5462 - */
5463 -const TitledSingleSelectEnumSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5464 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('string'),
5465 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5466 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5467 - oneOf: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5468 - const: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
5469 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
5470 - })),
5471 - default: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional()
5472 -});
5473 -/**
5474 - * Use TitledSingleSelectEnumSchema instead.
5475 - * This interface will be removed in a future version.
5476 - */
5477 -const LegacyTitledEnumSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5478 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('string'),
5479 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5480 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5481 - enum: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()),
5482 - enumNames: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional(),
5483 - default: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional()
5484 -});
5485 -// Combined single selection enumeration
5486 -const SingleSelectEnumSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([UntitledSingleSelectEnumSchemaSchema, TitledSingleSelectEnumSchemaSchema]);
5487 -/**
5488 - * Schema for multiple-selection enumeration without display titles for options.
5489 - */
5490 -const UntitledMultiSelectEnumSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5491 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('array'),
5492 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5493 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5494 - minItems: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional(),
5495 - maxItems: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional(),
5496 - items: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5497 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('string'),
5498 - enum: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string())
5499 - }),
5500 - default: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional()
5501 -});
5502 -/**
5503 - * Schema for multiple-selection enumeration with display titles for each option.
5504 - */
5505 -const TitledMultiSelectEnumSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5506 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('array'),
5507 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5508 - description: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5509 - minItems: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional(),
5510 - maxItems: zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().optional(),
5511 - items: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5512 - anyOf: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5513 - const: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
5514 - title: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
5515 - }))
5516 - }),
5517 - default: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional()
5518 -});
5519 -/**
5520 - * Combined schema for multiple-selection enumeration
5521 - */
5522 -const MultiSelectEnumSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([UntitledMultiSelectEnumSchemaSchema, TitledMultiSelectEnumSchemaSchema]);
5523 -/**
5524 - * Primitive schema definition for enum fields.
5525 - */
5526 -const EnumSchemaSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([LegacyTitledEnumSchemaSchema, SingleSelectEnumSchemaSchema, MultiSelectEnumSchemaSchema]);
5527 -/**
5528 - * Union of all primitive schema definitions.
5529 - */
5530 -const PrimitiveSchemaDefinitionSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([EnumSchemaSchema, BooleanSchemaSchema, StringSchemaSchema, NumberSchemaSchema]);
5531 -/**
5532 - * Parameters for an `elicitation/create` request for form-based elicitation.
5533 - */
5534 -const ElicitRequestFormParamsSchema = TaskAugmentedRequestParamsSchema.extend({
5535 - /**
5536 - * The elicitation mode.
5537 - *
5538 - * Optional for backward compatibility. Clients MUST treat missing mode as "form".
5539 - */
5540 - mode: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('form').optional(),
5541 - /**
5542 - * The message to present to the user describing what information is being requested.
5543 - */
5544 - message: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
5545 - /**
5546 - * A restricted subset of JSON Schema.
5547 - * Only top-level properties are allowed, without nesting.
5548 - */
5549 - requestedSchema: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5550 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('object'),
5551 - properties: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), PrimitiveSchemaDefinitionSchema),
5552 - required: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional()
5553 - })
5554 -});
5555 -/**
5556 - * Parameters for an `elicitation/create` request for URL-based elicitation.
5557 - */
5558 -const ElicitRequestURLParamsSchema = TaskAugmentedRequestParamsSchema.extend({
5559 - /**
5560 - * The elicitation mode.
5561 - */
5562 - mode: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('url'),
5563 - /**
5564 - * The message to present to the user explaining why the interaction is needed.
5565 - */
5566 - message: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
5567 - /**
5568 - * The ID of the elicitation, which must be unique within the context of the server.
5569 - * The client MUST treat this ID as an opaque value.
5570 - */
5571 - elicitationId: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
5572 - /**
5573 - * The URL that the user should navigate to.
5574 - */
5575 - url: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().url()
5576 -});
5577 -/**
5578 - * The parameters for a request to elicit additional information from the user via the client.
5579 - */
5580 -const ElicitRequestParamsSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([ElicitRequestFormParamsSchema, ElicitRequestURLParamsSchema]);
5581 -/**
5582 - * A request from the server to elicit user input via the client.
5583 - * The client should present the message and form fields to the user (form mode)
5584 - * or navigate to a URL (URL mode).
5585 - */
5586 -const ElicitRequestSchema = RequestSchema.extend({
5587 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('elicitation/create'),
5588 - params: ElicitRequestParamsSchema
5589 -});
5590 -/**
5591 - * Parameters for a `notifications/elicitation/complete` notification.
5592 - *
5593 - * @category notifications/elicitation/complete
5594 - */
5595 -const ElicitationCompleteNotificationParamsSchema = NotificationsParamsSchema.extend({
5596 - /**
5597 - * The ID of the elicitation that completed.
5598 - */
5599 - elicitationId: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
5600 -});
5601 -/**
5602 - * A notification from the server to the client, informing it of a completion of an out-of-band elicitation request.
5603 - *
5604 - * @category notifications/elicitation/complete
5605 - */
5606 -const ElicitationCompleteNotificationSchema = NotificationSchema.extend({
5607 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/elicitation/complete'),
5608 - params: ElicitationCompleteNotificationParamsSchema
5609 -});
5610 -/**
5611 - * The client's response to an elicitation/create request from the server.
5612 - */
5613 -const ElicitResultSchema = ResultSchema.extend({
5614 - /**
5615 - * The user action in response to the elicitation.
5616 - * - "accept": User submitted the form/confirmed the action
5617 - * - "decline": User explicitly decline the action
5618 - * - "cancel": User dismissed without making an explicit choice
5619 - */
5620 - action: zod_v4__WEBPACK_IMPORTED_MODULE_0__["enum"](['accept', 'decline', 'cancel']),
5621 - /**
5622 - * The submitted form data, only present when action is "accept".
5623 - * Contains values matching the requested schema.
5624 - * Per MCP spec, content is "typically omitted" for decline/cancel actions.
5625 - * We normalize null to undefined for leniency while maintaining type compatibility.
5626 - */
5627 - content: zod_v4__WEBPACK_IMPORTED_MODULE_0__.preprocess(val => (val === null ? undefined : val), zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.number(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string())])).optional())
5628 -});
5629 -/* Autocomplete */
5630 -/**
5631 - * A reference to a resource or resource template definition.
5632 - */
5633 -const ResourceTemplateReferenceSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5634 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('ref/resource'),
5635 - /**
5636 - * The URI or URI template of the resource.
5637 - */
5638 - uri: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
5639 -});
5640 -/**
5641 - * @deprecated Use ResourceTemplateReferenceSchema instead
5642 - */
5643 -const ResourceReferenceSchema = ResourceTemplateReferenceSchema;
5644 -/**
5645 - * Identifies a prompt.
5646 - */
5647 -const PromptReferenceSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5648 - type: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('ref/prompt'),
5649 - /**
5650 - * The name of the prompt or prompt template
5651 - */
5652 - name: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
5653 -});
5654 -/**
5655 - * Parameters for a `completion/complete` request.
5656 - */
5657 -const CompleteRequestParamsSchema = BaseRequestParamsSchema.extend({
5658 - ref: zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([PromptReferenceSchema, ResourceTemplateReferenceSchema]),
5659 - /**
5660 - * The argument's information
5661 - */
5662 - argument: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5663 - /**
5664 - * The name of the argument
5665 - */
5666 - name: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(),
5667 - /**
5668 - * The value of the argument to use for completion matching.
5669 - */
5670 - value: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()
5671 - }),
5672 - context: zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5673 - /**
5674 - * Previously-resolved variables in a URI template or prompt.
5675 - */
5676 - arguments: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).optional()
5677 - })
5678 - .optional()
5679 -});
5680 -/**
5681 - * A request from the client to the server, to ask for completion options.
5682 - */
5683 -const CompleteRequestSchema = RequestSchema.extend({
5684 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('completion/complete'),
5685 - params: CompleteRequestParamsSchema
5686 -});
5687 -function assertCompleteRequestPrompt(request) {
5688 - if (request.params.ref.type !== 'ref/prompt') {
5689 - throw new TypeError(`Expected CompleteRequestPrompt, but got ${request.params.ref.type}`);
5690 - }
5691 - void request;
5692 -}
5693 -function assertCompleteRequestResourceTemplate(request) {
5694 - if (request.params.ref.type !== 'ref/resource') {
5695 - throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${request.params.ref.type}`);
5696 - }
5697 - void request;
5698 -}
5699 -/**
5700 - * The server's response to a completion/complete request
5701 - */
5702 -const CompleteResultSchema = ResultSchema.extend({
5703 - completion: zod_v4__WEBPACK_IMPORTED_MODULE_0__.looseObject({
5704 - /**
5705 - * An array of completion values. Must not exceed 100 items.
5706 - */
5707 - values: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string()).max(100),
5708 - /**
5709 - * The total number of completion options available. This can exceed the number of values actually sent in the response.
5710 - */
5711 - total: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.number().int()),
5712 - /**
5713 - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown.
5714 - */
5715 - hasMore: zod_v4__WEBPACK_IMPORTED_MODULE_0__.optional(zod_v4__WEBPACK_IMPORTED_MODULE_0__.boolean())
5716 - })
5717 -});
5718 -/* Roots */
5719 -/**
5720 - * Represents a root directory or file that the server can operate on.
5721 - */
5722 -const RootSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.object({
5723 - /**
5724 - * The URI identifying the root. This *must* start with file:// for now.
5725 - */
5726 - uri: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().startsWith('file://'),
5727 - /**
5728 - * An optional name for the root.
5729 - */
5730 - name: zod_v4__WEBPACK_IMPORTED_MODULE_0__.string().optional(),
5731 - /**
5732 - * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields)
5733 - * for notes on _meta usage.
5734 - */
5735 - _meta: zod_v4__WEBPACK_IMPORTED_MODULE_0__.record(zod_v4__WEBPACK_IMPORTED_MODULE_0__.string(), zod_v4__WEBPACK_IMPORTED_MODULE_0__.unknown()).optional()
5736 -});
5737 -/**
5738 - * Sent from the server to request a list of root URIs from the client.
5739 - */
5740 -const ListRootsRequestSchema = RequestSchema.extend({
5741 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('roots/list'),
5742 - params: BaseRequestParamsSchema.optional()
5743 -});
5744 -/**
5745 - * The client's response to a roots/list request from the server.
5746 - */
5747 -const ListRootsResultSchema = ResultSchema.extend({
5748 - roots: zod_v4__WEBPACK_IMPORTED_MODULE_0__.array(RootSchema)
5749 -});
5750 -/**
5751 - * A notification from the client to the server, informing it that the list of roots has changed.
5752 - */
5753 -const RootsListChangedNotificationSchema = NotificationSchema.extend({
5754 - method: zod_v4__WEBPACK_IMPORTED_MODULE_0__.literal('notifications/roots/list_changed'),
5755 - params: NotificationsParamsSchema.optional()
5756 -});
5757 -/* Client messages */
5758 -const ClientRequestSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([
5759 - PingRequestSchema,
5760 - InitializeRequestSchema,
5761 - CompleteRequestSchema,
5762 - SetLevelRequestSchema,
5763 - GetPromptRequestSchema,
5764 - ListPromptsRequestSchema,
5765 - ListResourcesRequestSchema,
5766 - ListResourceTemplatesRequestSchema,
5767 - ReadResourceRequestSchema,
5768 - SubscribeRequestSchema,
5769 - UnsubscribeRequestSchema,
5770 - CallToolRequestSchema,
5771 - ListToolsRequestSchema,
5772 - GetTaskRequestSchema,
5773 - GetTaskPayloadRequestSchema,
5774 - ListTasksRequestSchema,
5775 - CancelTaskRequestSchema
5776 -]);
5777 -const ClientNotificationSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([
5778 - CancelledNotificationSchema,
5779 - ProgressNotificationSchema,
5780 - InitializedNotificationSchema,
5781 - RootsListChangedNotificationSchema,
5782 - TaskStatusNotificationSchema
5783 -]);
5784 -const ClientResultSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([
5785 - EmptyResultSchema,
5786 - CreateMessageResultSchema,
5787 - CreateMessageResultWithToolsSchema,
5788 - ElicitResultSchema,
5789 - ListRootsResultSchema,
5790 - GetTaskResultSchema,
5791 - ListTasksResultSchema,
5792 - CreateTaskResultSchema
5793 -]);
5794 -/* Server messages */
5795 -const ServerRequestSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([
5796 - PingRequestSchema,
5797 - CreateMessageRequestSchema,
5798 - ElicitRequestSchema,
5799 - ListRootsRequestSchema,
5800 - GetTaskRequestSchema,
5801 - GetTaskPayloadRequestSchema,
5802 - ListTasksRequestSchema,
5803 - CancelTaskRequestSchema
5804 -]);
5805 -const ServerNotificationSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([
5806 - CancelledNotificationSchema,
5807 - ProgressNotificationSchema,
5808 - LoggingMessageNotificationSchema,
5809 - ResourceUpdatedNotificationSchema,
5810 - ResourceListChangedNotificationSchema,
5811 - ToolListChangedNotificationSchema,
5812 - PromptListChangedNotificationSchema,
5813 - TaskStatusNotificationSchema,
5814 - ElicitationCompleteNotificationSchema
5815 -]);
5816 -const ServerResultSchema = zod_v4__WEBPACK_IMPORTED_MODULE_0__.union([
5817 - EmptyResultSchema,
5818 - InitializeResultSchema,
5819 - CompleteResultSchema,
5820 - GetPromptResultSchema,
5821 - ListPromptsResultSchema,
5822 - ListResourcesResultSchema,
5823 - ListResourceTemplatesResultSchema,
5824 - ReadResourceResultSchema,
5825 - CallToolResultSchema,
5826 - ListToolsResultSchema,
5827 - GetTaskResultSchema,
5828 - ListTasksResultSchema,
5829 - CreateTaskResultSchema
5830 -]);
5831 -class McpError extends Error {
5832 - constructor(code, message, data) {
5833 - super(`MCP error ${code}: ${message}`);
5834 - this.code = code;
5835 - this.data = data;
5836 - this.name = 'McpError';
5837 - }
5838 - /**
5839 - * Factory method to create the appropriate error type based on the error code and data
5840 - */
5841 - static fromError(code, message, data) {
5842 - // Check for specific error types
5843 - if (code === ErrorCode.UrlElicitationRequired && data) {
5844 - const errorData = data;
5845 - if (errorData.elicitations) {
5846 - return new UrlElicitationRequiredError(errorData.elicitations, message);
5847 - }
5848 - }
5849 - // Default to generic McpError
5850 - return new McpError(code, message, data);
5851 - }
5852 -}
5853 -/**
5854 - * Specialized error type when a tool requires a URL mode elicitation.
5855 - * This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.
5856 - */
5857 -class UrlElicitationRequiredError extends McpError {
5858 - constructor(elicitations, message = `URL elicitation${elicitations.length > 1 ? 's' : ''} required`) {
5859 - super(ErrorCode.UrlElicitationRequired, message, {
5860 - elicitations: elicitations
5861 - });
5862 - }
5863 - get elicitations() {
5864 - return this.data?.elicitations ?? [];
5865 - }
5866 -}
5867 -//# sourceMappingURL=types.js.map
5868 -
5869 -/***/ }),
5870 -
5871 -/***/ "./node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js":
5872 -/*!************************************************************************************!*\
5873 - !*** ./node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js ***!
5874 - \************************************************************************************/
5875 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
5876 -
5877 -__webpack_require__.r(__webpack_exports__);
5878 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
5879 -/* harmony export */ AjvJsonSchemaValidator: function() { return /* binding */ AjvJsonSchemaValidator; }
5880 -/* harmony export */ });
5881 -/* harmony import */ var ajv__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ajv */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js");
5882 -/* harmony import */ var ajv_formats__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ajv-formats */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/index.js");
5883 -/**
5884 - * AJV-based JSON Schema validator provider
5885 - */
5886 -
5887 -
5888 -function createDefaultAjvInstance() {
5889 - const ajv = new ajv__WEBPACK_IMPORTED_MODULE_0__({
5890 - strict: false,
5891 - validateFormats: true,
5892 - validateSchema: false,
5893 - allErrors: true
5894 - });
5895 - const addFormats = ajv_formats__WEBPACK_IMPORTED_MODULE_1__;
5896 - addFormats(ajv);
5897 - return ajv;
5898 -}
5899 -/**
5900 - * @example
5901 - * ```typescript
5902 - * // Use with default AJV instance (recommended)
5903 - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
5904 - * const validator = new AjvJsonSchemaValidator();
5905 - *
5906 - * // Use with custom AJV instance
5907 - * import { Ajv } from 'ajv';
5908 - * const ajv = new Ajv({ strict: true, allErrors: true });
5909 - * const validator = new AjvJsonSchemaValidator(ajv);
5910 - * ```
5911 - */
5912 -class AjvJsonSchemaValidator {
5913 - /**
5914 - * Create an AJV validator
5915 - *
5916 - * @param ajv - Optional pre-configured AJV instance. If not provided, a default instance will be created.
5917 - *
5918 - * @example
5919 - * ```typescript
5920 - * // Use default configuration (recommended for most cases)
5921 - * import { AjvJsonSchemaValidator } from '@modelcontextprotocol/sdk/validation/ajv';
5922 - * const validator = new AjvJsonSchemaValidator();
5923 - *
5924 - * // Or provide custom AJV instance for advanced configuration
5925 - * import { Ajv } from 'ajv';
5926 - * import addFormats from 'ajv-formats';
5927 - *
5928 - * const ajv = new Ajv({ validateFormats: true });
5929 - * addFormats(ajv);
5930 - * const validator = new AjvJsonSchemaValidator(ajv);
5931 - * ```
5932 - */
5933 - constructor(ajv) {
5934 - this._ajv = ajv ?? createDefaultAjvInstance();
5935 - }
5936 - /**
5937 - * Create a validator for the given JSON Schema
5938 - *
5939 - * The validator is compiled once and can be reused multiple times.
5940 - * If the schema has an $id, it will be cached by AJV automatically.
5941 - *
5942 - * @param schema - Standard JSON Schema object
5943 - * @returns A validator function that validates input data
5944 - */
5945 - getValidator(schema) {
5946 - // Check if schema has $id and is already compiled/cached
5947 - const ajvValidator = '$id' in schema && typeof schema.$id === 'string'
5948 - ? (this._ajv.getSchema(schema.$id) ?? this._ajv.compile(schema))
5949 - : this._ajv.compile(schema);
5950 - return (input) => {
5951 - const valid = ajvValidator(input);
5952 - if (valid) {
5953 - return {
5954 - valid: true,
5955 - data: input,
5956 - errorMessage: undefined
5957 - };
5958 - }
5959 - else {
5960 - return {
5961 - valid: false,
5962 - data: undefined,
5963 - errorMessage: this._ajv.errorsText(ajvValidator.errors)
5964 - };
5965 - }
5966 - };
5967 - }
5968 -}
5969 -//# sourceMappingURL=ajv-provider.js.map
5970 -
5971 -/***/ }),
5972 -
5973 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/formats.js":
5974 -/*!*****************************************************************************************!*\
5975 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/formats.js ***!
5976 - \*****************************************************************************************/
5977 -/***/ (function(__unused_webpack_module, exports) {
5978 -
5979 -
5980 -Object.defineProperty(exports, "__esModule", ({ value: true }));
5981 -exports.formatNames = exports.fastFormats = exports.fullFormats = void 0;
5982 -function fmtDef(validate, compare) {
5983 - return { validate, compare };
5984 -}
5985 -exports.fullFormats = {
5986 - // date: http://tools.ietf.org/html/rfc3339#section-5.6
5987 - date: fmtDef(date, compareDate),
5988 - // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
5989 - time: fmtDef(getTime(true), compareTime),
5990 - "date-time": fmtDef(getDateTime(true), compareDateTime),
5991 - "iso-time": fmtDef(getTime(), compareIsoTime),
5992 - "iso-date-time": fmtDef(getDateTime(), compareIsoDateTime),
5993 - // duration: https://tools.ietf.org/html/rfc3339#appendix-A
5994 - duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,
5995 - uri,
5996 - "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,
5997 - // uri-template: https://tools.ietf.org/html/rfc6570
5998 - "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,
5999 - // For the source: https://gist.github.com/dperini/729294
6000 - // For test cases: https://mathiasbynens.be/demo/url-regex
6001 - url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,
6002 - email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
6003 - hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,
6004 - // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
6005 - ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,
6006 - ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,
6007 - regex,
6008 - // uuid: http://tools.ietf.org/html/rfc4122
6009 - uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,
6010 - // JSON-pointer: https://tools.ietf.org/html/rfc6901
6011 - // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
6012 - "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/,
6013 - "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,
6014 - // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
6015 - "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,
6016 - // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types
6017 - // byte: https://github.com/miguelmota/is-base64
6018 - byte,
6019 - // signed 32 bit integer
6020 - int32: { type: "number", validate: validateInt32 },
6021 - // signed 64 bit integer
6022 - int64: { type: "number", validate: validateInt64 },
6023 - // C-type float
6024 - float: { type: "number", validate: validateNumber },
6025 - // C-type double
6026 - double: { type: "number", validate: validateNumber },
6027 - // hint to the UI to hide input strings
6028 - password: true,
6029 - // unchecked string payload
6030 - binary: true,
6031 -};
6032 -exports.fastFormats = {
6033 - ...exports.fullFormats,
6034 - date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate),
6035 - time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime),
6036 - "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime),
6037 - "iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime),
6038 - "iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime),
6039 - // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
6040 - uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
6041 - "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
6042 - // email (sources from jsen validator):
6043 - // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
6044 - // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation')
6045 - email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
6046 -};
6047 -exports.formatNames = Object.keys(exports.fullFormats);
6048 -function isLeapYear(year) {
6049 - // https://tools.ietf.org/html/rfc3339#appendix-C
6050 - return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
6051 -}
6052 -const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
6053 -const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
6054 -function date(str) {
6055 - // full-date from http://tools.ietf.org/html/rfc3339#section-5.6
6056 - const matches = DATE.exec(str);
6057 - if (!matches)
6058 - return false;
6059 - const year = +matches[1];
6060 - const month = +matches[2];
6061 - const day = +matches[3];
6062 - return (month >= 1 &&
6063 - month <= 12 &&
6064 - day >= 1 &&
6065 - day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]));
6066 -}
6067 -function compareDate(d1, d2) {
6068 - if (!(d1 && d2))
6069 - return undefined;
6070 - if (d1 > d2)
6071 - return 1;
6072 - if (d1 < d2)
6073 - return -1;
6074 - return 0;
6075 -}
6076 -const TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;
6077 -function getTime(strictTimeZone) {
6078 - return function time(str) {
6079 - const matches = TIME.exec(str);
6080 - if (!matches)
6081 - return false;
6082 - const hr = +matches[1];
6083 - const min = +matches[2];
6084 - const sec = +matches[3];
6085 - const tz = matches[4];
6086 - const tzSign = matches[5] === "-" ? -1 : 1;
6087 - const tzH = +(matches[6] || 0);
6088 - const tzM = +(matches[7] || 0);
6089 - if (tzH > 23 || tzM > 59 || (strictTimeZone && !tz))
6090 - return false;
6091 - if (hr <= 23 && min <= 59 && sec < 60)
6092 - return true;
6093 - // leap second
6094 - const utcMin = min - tzM * tzSign;
6095 - const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0);
6096 - return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61;
6097 - };
6098 -}
6099 -function compareTime(s1, s2) {
6100 - if (!(s1 && s2))
6101 - return undefined;
6102 - const t1 = new Date("2020-01-01T" + s1).valueOf();
6103 - const t2 = new Date("2020-01-01T" + s2).valueOf();
6104 - if (!(t1 && t2))
6105 - return undefined;
6106 - return t1 - t2;
6107 -}
6108 -function compareIsoTime(t1, t2) {
6109 - if (!(t1 && t2))
6110 - return undefined;
6111 - const a1 = TIME.exec(t1);
6112 - const a2 = TIME.exec(t2);
6113 - if (!(a1 && a2))
6114 - return undefined;
6115 - t1 = a1[1] + a1[2] + a1[3];
6116 - t2 = a2[1] + a2[2] + a2[3];
6117 - if (t1 > t2)
6118 - return 1;
6119 - if (t1 < t2)
6120 - return -1;
6121 - return 0;
6122 -}
6123 -const DATE_TIME_SEPARATOR = /t|\s/i;
6124 -function getDateTime(strictTimeZone) {
6125 - const time = getTime(strictTimeZone);
6126 - return function date_time(str) {
6127 - // http://tools.ietf.org/html/rfc3339#section-5.6
6128 - const dateTime = str.split(DATE_TIME_SEPARATOR);
6129 - return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]);
6130 - };
6131 -}
6132 -function compareDateTime(dt1, dt2) {
6133 - if (!(dt1 && dt2))
6134 - return undefined;
6135 - const d1 = new Date(dt1).valueOf();
6136 - const d2 = new Date(dt2).valueOf();
6137 - if (!(d1 && d2))
6138 - return undefined;
6139 - return d1 - d2;
6140 -}
6141 -function compareIsoDateTime(dt1, dt2) {
6142 - if (!(dt1 && dt2))
6143 - return undefined;
6144 - const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR);
6145 - const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR);
6146 - const res = compareDate(d1, d2);
6147 - if (res === undefined)
6148 - return undefined;
6149 - return res || compareTime(t1, t2);
6150 -}
6151 -const NOT_URI_FRAGMENT = /\/|:/;
6152 -const URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
6153 -function uri(str) {
6154 - // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
6155 - return NOT_URI_FRAGMENT.test(str) && URI.test(str);
6156 -}
6157 -const BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;
6158 -function byte(str) {
6159 - BYTE.lastIndex = 0;
6160 - return BYTE.test(str);
6161 -}
6162 -const MIN_INT32 = -(2 ** 31);
6163 -const MAX_INT32 = 2 ** 31 - 1;
6164 -function validateInt32(value) {
6165 - return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32;
6166 -}
6167 -function validateInt64(value) {
6168 - // JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64
6169 - return Number.isInteger(value);
6170 -}
6171 -function validateNumber() {
6172 - return true;
6173 -}
6174 -const Z_ANCHOR = /[^\\]\\Z/;
6175 -function regex(str) {
6176 - if (Z_ANCHOR.test(str))
6177 - return false;
6178 - try {
6179 - new RegExp(str);
6180 - return true;
6181 - }
6182 - catch (e) {
6183 - return false;
6184 - }
6185 -}
6186 -//# sourceMappingURL=formats.js.map
6187 -
6188 -/***/ }),
6189 -
6190 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/index.js":
6191 -/*!***************************************************************************************!*\
6192 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/index.js ***!
6193 - \***************************************************************************************/
6194 -/***/ (function(module, exports, __webpack_require__) {
6195 -
6196 -
6197 -Object.defineProperty(exports, "__esModule", ({ value: true }));
6198 -const formats_1 = __webpack_require__(/*! ./formats */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/formats.js");
6199 -const limit_1 = __webpack_require__(/*! ./limit */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/limit.js");
6200 -const codegen_1 = __webpack_require__(/*! ajv/dist/compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
6201 -const fullName = new codegen_1.Name("fullFormats");
6202 -const fastName = new codegen_1.Name("fastFormats");
6203 -const formatsPlugin = (ajv, opts = { keywords: true }) => {
6204 - if (Array.isArray(opts)) {
6205 - addFormats(ajv, opts, formats_1.fullFormats, fullName);
6206 - return ajv;
6207 - }
6208 - const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
6209 - const list = opts.formats || formats_1.formatNames;
6210 - addFormats(ajv, list, formats, exportName);
6211 - if (opts.keywords)
6212 - (0, limit_1.default)(ajv);
6213 - return ajv;
6214 -};
6215 -formatsPlugin.get = (name, mode = "full") => {
6216 - const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
6217 - const f = formats[name];
6218 - if (!f)
6219 - throw new Error(`Unknown format "${name}"`);
6220 - return f;
6221 -};
6222 -function addFormats(ajv, list, fs, exportName) {
6223 - var _a;
6224 - var _b;
6225 - (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : (_b.formats = (0, codegen_1._) `require("ajv-formats/dist/formats").${exportName}`);
6226 - for (const f of list)
6227 - ajv.addFormat(f, fs[f]);
6228 -}
6229 -module.exports = exports = formatsPlugin;
6230 -Object.defineProperty(exports, "__esModule", ({ value: true }));
6231 -exports["default"] = formatsPlugin;
6232 -//# sourceMappingURL=index.js.map
6233 -
6234 -/***/ }),
6235 -
6236 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/limit.js":
6237 -/*!***************************************************************************************!*\
6238 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/limit.js ***!
6239 - \***************************************************************************************/
6240 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6241 -
6242 -
6243 -Object.defineProperty(exports, "__esModule", ({ value: true }));
6244 -exports.formatLimitDefinition = void 0;
6245 -const ajv_1 = __webpack_require__(/*! ajv */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js");
6246 -const codegen_1 = __webpack_require__(/*! ajv/dist/compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
6247 -const ops = codegen_1.operators;
6248 -const KWDs = {
6249 - formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
6250 - formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
6251 - formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
6252 - formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE },
6253 -};
6254 -const error = {
6255 - message: ({ keyword, schemaCode }) => (0, codegen_1.str) `should be ${KWDs[keyword].okStr} ${schemaCode}`,
6256 - params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,
6257 -};
6258 -exports.formatLimitDefinition = {
6259 - keyword: Object.keys(KWDs),
6260 - type: "string",
6261 - schemaType: "string",
6262 - $data: true,
6263 - error,
6264 - code(cxt) {
6265 - const { gen, data, schemaCode, keyword, it } = cxt;
6266 - const { opts, self } = it;
6267 - if (!opts.validateFormats)
6268 - return;
6269 - const fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, "format");
6270 - if (fCxt.$data)
6271 - validate$DataFormat();
6272 - else
6273 - validateFormat();
6274 - function validate$DataFormat() {
6275 - const fmts = gen.scopeValue("formats", {
6276 - ref: self.formats,
6277 - code: opts.code.formats,
6278 - });
6279 - const fmt = gen.const("fmt", (0, codegen_1._) `${fmts}[${fCxt.schemaCode}]`);
6280 - cxt.fail$data((0, codegen_1.or)((0, codegen_1._) `typeof ${fmt} != "object"`, (0, codegen_1._) `${fmt} instanceof RegExp`, (0, codegen_1._) `typeof ${fmt}.compare != "function"`, compareCode(fmt)));
6281 - }
6282 - function validateFormat() {
6283 - const format = fCxt.schema;
6284 - const fmtDef = self.formats[format];
6285 - if (!fmtDef || fmtDef === true)
6286 - return;
6287 - if (typeof fmtDef != "object" ||
6288 - fmtDef instanceof RegExp ||
6289 - typeof fmtDef.compare != "function") {
6290 - throw new Error(`"${keyword}": format "${format}" does not define "compare" function`);
6291 - }
6292 - const fmt = gen.scopeValue("formats", {
6293 - key: format,
6294 - ref: fmtDef,
6295 - code: opts.code.formats ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(format)}` : undefined,
6296 - });
6297 - cxt.fail$data(compareCode(fmt));
6298 - }
6299 - function compareCode(fmt) {
6300 - return (0, codegen_1._) `${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`;
6301 - }
6302 - },
6303 - dependencies: ["format"],
6304 -};
6305 -const formatLimitPlugin = (ajv) => {
6306 - ajv.addKeyword(exports.formatLimitDefinition);
6307 - return ajv;
6308 -};
6309 -exports["default"] = formatLimitPlugin;
6310 -//# sourceMappingURL=limit.js.map
6311 -
6312 -/***/ }),
6313 -
6314 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js":
6315 -/*!*****************************************************************************!*\
6316 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js ***!
6317 - \*****************************************************************************/
6318 -/***/ (function(module, exports, __webpack_require__) {
6319 -
6320 -
6321 -Object.defineProperty(exports, "__esModule", ({ value: true }));
6322 -exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0;
6323 -const core_1 = __webpack_require__(/*! ./core */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js");
6324 -const draft7_1 = __webpack_require__(/*! ./vocabularies/draft7 */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js");
6325 -const discriminator_1 = __webpack_require__(/*! ./vocabularies/discriminator */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js");
6326 -const draft7MetaSchema = __webpack_require__(/*! ./refs/json-schema-draft-07.json */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json");
6327 -const META_SUPPORT_DATA = ["/properties"];
6328 -const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
6329 -class Ajv extends core_1.default {
6330 - _addVocabularies() {
6331 - super._addVocabularies();
6332 - draft7_1.default.forEach((v) => this.addVocabulary(v));
6333 - if (this.opts.discriminator)
6334 - this.addKeyword(discriminator_1.default);
6335 - }
6336 - _addDefaultMetaSchema() {
6337 - super._addDefaultMetaSchema();
6338 - if (!this.opts.meta)
6339 - return;
6340 - const metaSchema = this.opts.$data
6341 - ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)
6342 - : draft7MetaSchema;
6343 - this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
6344 - this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
6345 - }
6346 - defaultMeta() {
6347 - return (this.opts.defaultMeta =
6348 - super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
6349 - }
6350 -}
6351 -exports.Ajv = Ajv;
6352 -module.exports = exports = Ajv;
6353 -module.exports.Ajv = Ajv;
6354 -Object.defineProperty(exports, "__esModule", ({ value: true }));
6355 -exports["default"] = Ajv;
6356 -var validate_1 = __webpack_require__(/*! ./compile/validate */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");
6357 -Object.defineProperty(exports, "KeywordCxt", ({ enumerable: true, get: function () { return validate_1.KeywordCxt; } }));
6358 -var codegen_1 = __webpack_require__(/*! ./compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
6359 -Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return codegen_1._; } }));
6360 -Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return codegen_1.str; } }));
6361 -Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return codegen_1.stringify; } }));
6362 -Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return codegen_1.nil; } }));
6363 -Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return codegen_1.Name; } }));
6364 -Object.defineProperty(exports, "CodeGen", ({ enumerable: true, get: function () { return codegen_1.CodeGen; } }));
6365 -var validation_error_1 = __webpack_require__(/*! ./runtime/validation_error */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js");
6366 -Object.defineProperty(exports, "ValidationError", ({ enumerable: true, get: function () { return validation_error_1.default; } }));
6367 -var ref_error_1 = __webpack_require__(/*! ./compile/ref_error */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js");
6368 -Object.defineProperty(exports, "MissingRefError", ({ enumerable: true, get: function () { return ref_error_1.default; } }));
6369 -//# sourceMappingURL=ajv.js.map
6370 -
6371 -/***/ }),
6372 -
6373 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js":
6374 -/*!**********************************************************************************************!*\
6375 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js ***!
6376 - \**********************************************************************************************/
6377 -/***/ (function(__unused_webpack_module, exports) {
6378 -
6379 -
6380 -Object.defineProperty(exports, "__esModule", ({ value: true }));
6381 -exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0;
6382 -// eslint-disable-next-line @typescript-eslint/no-extraneous-class
6383 -class _CodeOrName {
6384 -}
6385 -exports._CodeOrName = _CodeOrName;
6386 -exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
6387 -class Name extends _CodeOrName {
6388 - constructor(s) {
6389 - super();
6390 - if (!exports.IDENTIFIER.test(s))
6391 - throw new Error("CodeGen: name must be a valid identifier");
6392 - this.str = s;
6393 - }
6394 - toString() {
6395 - return this.str;
6396 - }
6397 - emptyStr() {
6398 - return false;
6399 - }
6400 - get names() {
6401 - return { [this.str]: 1 };
6402 - }
6403 -}
6404 -exports.Name = Name;
6405 -class _Code extends _CodeOrName {
6406 - constructor(code) {
6407 - super();
6408 - this._items = typeof code === "string" ? [code] : code;
6409 - }
6410 - toString() {
6411 - return this.str;
6412 - }
6413 - emptyStr() {
6414 - if (this._items.length > 1)
6415 - return false;
6416 - const item = this._items[0];
6417 - return item === "" || item === '""';
6418 - }
6419 - get str() {
6420 - var _a;
6421 - return ((_a = this._str) !== null && _a !== void 0 ? _a : (this._str = this._items.reduce((s, c) => `${s}${c}`, "")));
6422 - }
6423 - get names() {
6424 - var _a;
6425 - return ((_a = this._names) !== null && _a !== void 0 ? _a : (this._names = this._items.reduce((names, c) => {
6426 - if (c instanceof Name)
6427 - names[c.str] = (names[c.str] || 0) + 1;
6428 - return names;
6429 - }, {})));
6430 - }
6431 -}
6432 -exports._Code = _Code;
6433 -exports.nil = new _Code("");
6434 -function _(strs, ...args) {
6435 - const code = [strs[0]];
6436 - let i = 0;
6437 - while (i < args.length) {
6438 - addCodeArg(code, args[i]);
6439 - code.push(strs[++i]);
6440 - }
6441 - return new _Code(code);
6442 -}
6443 -exports._ = _;
6444 -const plus = new _Code("+");
6445 -function str(strs, ...args) {
6446 - const expr = [safeStringify(strs[0])];
6447 - let i = 0;
6448 - while (i < args.length) {
6449 - expr.push(plus);
6450 - addCodeArg(expr, args[i]);
6451 - expr.push(plus, safeStringify(strs[++i]));
6452 - }
6453 - optimize(expr);
6454 - return new _Code(expr);
6455 -}
6456 -exports.str = str;
6457 -function addCodeArg(code, arg) {
6458 - if (arg instanceof _Code)
6459 - code.push(...arg._items);
6460 - else if (arg instanceof Name)
6461 - code.push(arg);
6462 - else
6463 - code.push(interpolate(arg));
6464 -}
6465 -exports.addCodeArg = addCodeArg;
6466 -function optimize(expr) {
6467 - let i = 1;
6468 - while (i < expr.length - 1) {
6469 - if (expr[i] === plus) {
6470 - const res = mergeExprItems(expr[i - 1], expr[i + 1]);
6471 - if (res !== undefined) {
6472 - expr.splice(i - 1, 3, res);
6473 - continue;
6474 - }
6475 - expr[i++] = "+";
6476 - }
6477 - i++;
6478 - }
6479 -}
6480 -function mergeExprItems(a, b) {
6481 - if (b === '""')
6482 - return a;
6483 - if (a === '""')
6484 - return b;
6485 - if (typeof a == "string") {
6486 - if (b instanceof Name || a[a.length - 1] !== '"')
6487 - return;
6488 - if (typeof b != "string")
6489 - return `${a.slice(0, -1)}${b}"`;
6490 - if (b[0] === '"')
6491 - return a.slice(0, -1) + b.slice(1);
6492 - return;
6493 - }
6494 - if (typeof b == "string" && b[0] === '"' && !(a instanceof Name))
6495 - return `"${a}${b.slice(1)}`;
6496 - return;
6497 -}
6498 -function strConcat(c1, c2) {
6499 - return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str `${c1}${c2}`;
6500 -}
6501 -exports.strConcat = strConcat;
6502 -// TODO do not allow arrays here
6503 -function interpolate(x) {
6504 - return typeof x == "number" || typeof x == "boolean" || x === null
6505 - ? x
6506 - : safeStringify(Array.isArray(x) ? x.join(",") : x);
6507 -}
6508 -function stringify(x) {
6509 - return new _Code(safeStringify(x));
6510 -}
6511 -exports.stringify = stringify;
6512 -function safeStringify(x) {
6513 - return JSON.stringify(x)
6514 - .replace(/\u2028/g, "\\u2028")
6515 - .replace(/\u2029/g, "\\u2029");
6516 -}
6517 -exports.safeStringify = safeStringify;
6518 -function getProperty(key) {
6519 - return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _ `[${key}]`;
6520 -}
6521 -exports.getProperty = getProperty;
6522 -//Does best effort to format the name properly
6523 -function getEsmExportName(key) {
6524 - if (typeof key == "string" && exports.IDENTIFIER.test(key)) {
6525 - return new _Code(`${key}`);
6526 - }
6527 - throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`);
6528 -}
6529 -exports.getEsmExportName = getEsmExportName;
6530 -function regexpCode(rx) {
6531 - return new _Code(rx.toString());
6532 -}
6533 -exports.regexpCode = regexpCode;
6534 -//# sourceMappingURL=code.js.map
6535 -
6536 -/***/ }),
6537 -
6538 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js":
6539 -/*!***********************************************************************************************!*\
6540 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js ***!
6541 - \***********************************************************************************************/
6542 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
6543 -
6544 -
6545 -Object.defineProperty(exports, "__esModule", ({ value: true }));
6546 -exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0;
6547 -const code_1 = __webpack_require__(/*! ./code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");
6548 -const scope_1 = __webpack_require__(/*! ./scope */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js");
6549 -var code_2 = __webpack_require__(/*! ./code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");
6550 -Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return code_2._; } }));
6551 -Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return code_2.str; } }));
6552 -Object.defineProperty(exports, "strConcat", ({ enumerable: true, get: function () { return code_2.strConcat; } }));
6553 -Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return code_2.nil; } }));
6554 -Object.defineProperty(exports, "getProperty", ({ enumerable: true, get: function () { return code_2.getProperty; } }));
6555 -Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return code_2.stringify; } }));
6556 -Object.defineProperty(exports, "regexpCode", ({ enumerable: true, get: function () { return code_2.regexpCode; } }));
6557 -Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return code_2.Name; } }));
6558 -var scope_2 = __webpack_require__(/*! ./scope */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js");
6559 -Object.defineProperty(exports, "Scope", ({ enumerable: true, get: function () { return scope_2.Scope; } }));
6560 -Object.defineProperty(exports, "ValueScope", ({ enumerable: true, get: function () { return scope_2.ValueScope; } }));
6561 -Object.defineProperty(exports, "ValueScopeName", ({ enumerable: true, get: function () { return scope_2.ValueScopeName; } }));
6562 -Object.defineProperty(exports, "varKinds", ({ enumerable: true, get: function () { return scope_2.varKinds; } }));
6563 -exports.operators = {
6564 - GT: new code_1._Code(">"),
6565 - GTE: new code_1._Code(">="),
6566 - LT: new code_1._Code("<"),
6567 - LTE: new code_1._Code("<="),
6568 - EQ: new code_1._Code("==="),
6569 - NEQ: new code_1._Code("!=="),
6570 - NOT: new code_1._Code("!"),
6571 - OR: new code_1._Code("||"),
6572 - AND: new code_1._Code("&&"),
6573 - ADD: new code_1._Code("+"),
6574 -};
6575 -class Node {
6576 - optimizeNodes() {
6577 - return this;
6578 - }
6579 - optimizeNames(_names, _constants) {
6580 - return this;
6581 - }
6582 -}
6583 -class Def extends Node {
6584 - constructor(varKind, name, rhs) {
6585 - super();
6586 - this.varKind = varKind;
6587 - this.name = name;
6588 - this.rhs = rhs;
6589 - }
6590 - render({ es5, _n }) {
6591 - const varKind = es5 ? scope_1.varKinds.var : this.varKind;
6592 - const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`;
6593 - return `${varKind} ${this.name}${rhs};` + _n;
6594 - }
6595 - optimizeNames(names, constants) {
6596 - if (!names[this.name.str])
6597 - return;
6598 - if (this.rhs)
6599 - this.rhs = optimizeExpr(this.rhs, names, constants);
6600 - return this;
6601 - }
6602 - get names() {
6603 - return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {};
6604 - }
6605 -}
6606 -class Assign extends Node {
6607 - constructor(lhs, rhs, sideEffects) {
6608 - super();
6609 - this.lhs = lhs;
6610 - this.rhs = rhs;
6611 - this.sideEffects = sideEffects;
6612 - }
6613 - render({ _n }) {
6614 - return `${this.lhs} = ${this.rhs};` + _n;
6615 - }
6616 - optimizeNames(names, constants) {
6617 - if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects)
6618 - return;
6619 - this.rhs = optimizeExpr(this.rhs, names, constants);
6620 - return this;
6621 - }
6622 - get names() {
6623 - const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names };
6624 - return addExprNames(names, this.rhs);
6625 - }
6626 -}
6627 -class AssignOp extends Assign {
6628 - constructor(lhs, op, rhs, sideEffects) {
6629 - super(lhs, rhs, sideEffects);
6630 - this.op = op;
6631 - }
6632 - render({ _n }) {
6633 - return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
6634 - }
6635 -}
6636 -class Label extends Node {
6637 - constructor(label) {
6638 - super();
6639 - this.label = label;
6640 - this.names = {};
6641 - }
6642 - render({ _n }) {
6643 - return `${this.label}:` + _n;
6644 - }
6645 -}
6646 -class Break extends Node {
6647 - constructor(label) {
6648 - super();
6649 - this.label = label;
6650 - this.names = {};
6651 - }
6652 - render({ _n }) {
6653 - const label = this.label ? ` ${this.label}` : "";
6654 - return `break${label};` + _n;
6655 - }
6656 -}
6657 -class Throw extends Node {
6658 - constructor(error) {
6659 - super();
6660 - this.error = error;
6661 - }
6662 - render({ _n }) {
6663 - return `throw ${this.error};` + _n;
6664 - }
6665 - get names() {
6666 - return this.error.names;
6667 - }
6668 -}
6669 -class AnyCode extends Node {
6670 - constructor(code) {
6671 - super();
6672 - this.code = code;
6673 - }
6674 - render({ _n }) {
6675 - return `${this.code};` + _n;
6676 - }
6677 - optimizeNodes() {
6678 - return `${this.code}` ? this : undefined;
6679 - }
6680 - optimizeNames(names, constants) {
6681 - this.code = optimizeExpr(this.code, names, constants);
6682 - return this;
6683 - }
6684 - get names() {
6685 - return this.code instanceof code_1._CodeOrName ? this.code.names : {};
6686 - }
6687 -}
6688 -class ParentNode extends Node {
6689 - constructor(nodes = []) {
6690 - super();
6691 - this.nodes = nodes;
6692 - }
6693 - render(opts) {
6694 - return this.nodes.reduce((code, n) => code + n.render(opts), "");
6695 - }
6696 - optimizeNodes() {
6697 - const { nodes } = this;
6698 - let i = nodes.length;
6699 - while (i--) {
6700 - const n = nodes[i].optimizeNodes();
6701 - if (Array.isArray(n))
6702 - nodes.splice(i, 1, ...n);
6703 - else if (n)
6704 - nodes[i] = n;
6705 - else
6706 - nodes.splice(i, 1);
6707 - }
6708 - return nodes.length > 0 ? this : undefined;
6709 - }
6710 - optimizeNames(names, constants) {
6711 - const { nodes } = this;
6712 - let i = nodes.length;
6713 - while (i--) {
6714 - // iterating backwards improves 1-pass optimization
6715 - const n = nodes[i];
6716 - if (n.optimizeNames(names, constants))
6717 - continue;
6718 - subtractNames(names, n.names);
6719 - nodes.splice(i, 1);
6720 - }
6721 - return nodes.length > 0 ? this : undefined;
6722 - }
6723 - get names() {
6724 - return this.nodes.reduce((names, n) => addNames(names, n.names), {});
6725 - }
6726 -}
6727 -class BlockNode extends ParentNode {
6728 - render(opts) {
6729 - return "{" + opts._n + super.render(opts) + "}" + opts._n;
6730 - }
6731 -}
6732 -class Root extends ParentNode {
6733 -}
6734 -class Else extends BlockNode {
6735 -}
6736 -Else.kind = "else";
6737 -class If extends BlockNode {
6738 - constructor(condition, nodes) {
6739 - super(nodes);
6740 - this.condition = condition;
6741 - }
6742 - render(opts) {
6743 - let code = `if(${this.condition})` + super.render(opts);
6744 - if (this.else)
6745 - code += "else " + this.else.render(opts);
6746 - return code;
6747 - }
6748 - optimizeNodes() {
6749 - super.optimizeNodes();
6750 - const cond = this.condition;
6751 - if (cond === true)
6752 - return this.nodes; // else is ignored here
6753 - let e = this.else;
6754 - if (e) {
6755 - const ns = e.optimizeNodes();
6756 - e = this.else = Array.isArray(ns) ? new Else(ns) : ns;
6757 - }
6758 - if (e) {
6759 - if (cond === false)
6760 - return e instanceof If ? e : e.nodes;
6761 - if (this.nodes.length)
6762 - return this;
6763 - return new If(not(cond), e instanceof If ? [e] : e.nodes);
6764 - }
6765 - if (cond === false || !this.nodes.length)
6766 - return undefined;
6767 - return this;
6768 - }
6769 - optimizeNames(names, constants) {
6770 - var _a;
6771 - this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
6772 - if (!(super.optimizeNames(names, constants) || this.else))
6773 - return;
6774 - this.condition = optimizeExpr(this.condition, names, constants);
6775 - return this;
6776 - }
6777 - get names() {
6778 - const names = super.names;
6779 - addExprNames(names, this.condition);
6780 - if (this.else)
6781 - addNames(names, this.else.names);
6782 - return names;
6783 - }
6784 -}
6785 -If.kind = "if";
6786 -class For extends BlockNode {
6787 -}
6788 -For.kind = "for";
6789 -class ForLoop extends For {
6790 - constructor(iteration) {
6791 - super();
6792 - this.iteration = iteration;
6793 - }
6794 - render(opts) {
6795 - return `for(${this.iteration})` + super.render(opts);
6796 - }
6797 - optimizeNames(names, constants) {
6798 - if (!super.optimizeNames(names, constants))
6799 - return;
6800 - this.iteration = optimizeExpr(this.iteration, names, constants);
6801 - return this;
6802 - }
6803 - get names() {
6804 - return addNames(super.names, this.iteration.names);
6805 - }
6806 -}
6807 -class ForRange extends For {
6808 - constructor(varKind, name, from, to) {
6809 - super();
6810 - this.varKind = varKind;
6811 - this.name = name;
6812 - this.from = from;
6813 - this.to = to;
6814 - }
6815 - render(opts) {
6816 - const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind;
6817 - const { name, from, to } = this;
6818 - return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts);
6819 - }
6820 - get names() {
6821 - const names = addExprNames(super.names, this.from);
6822 - return addExprNames(names, this.to);
6823 - }
6824 -}
6825 -class ForIter extends For {
6826 - constructor(loop, varKind, name, iterable) {
6827 - super();
6828 - this.loop = loop;
6829 - this.varKind = varKind;
6830 - this.name = name;
6831 - this.iterable = iterable;
6832 - }
6833 - render(opts) {
6834 - return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts);
6835 - }
6836 - optimizeNames(names, constants) {
6837 - if (!super.optimizeNames(names, constants))
6838 - return;
6839 - this.iterable = optimizeExpr(this.iterable, names, constants);
6840 - return this;
6841 - }
6842 - get names() {
6843 - return addNames(super.names, this.iterable.names);
6844 - }
6845 -}
6846 -class Func extends BlockNode {
6847 - constructor(name, args, async) {
6848 - super();
6849 - this.name = name;
6850 - this.args = args;
6851 - this.async = async;
6852 - }
6853 - render(opts) {
6854 - const _async = this.async ? "async " : "";
6855 - return `${_async}function ${this.name}(${this.args})` + super.render(opts);
6856 - }
6857 -}
6858 -Func.kind = "func";
6859 -class Return extends ParentNode {
6860 - render(opts) {
6861 - return "return " + super.render(opts);
6862 - }
6863 -}
6864 -Return.kind = "return";
6865 -class Try extends BlockNode {
6866 - render(opts) {
6867 - let code = "try" + super.render(opts);
6868 - if (this.catch)
6869 - code += this.catch.render(opts);
6870 - if (this.finally)
6871 - code += this.finally.render(opts);
6872 - return code;
6873 - }
6874 - optimizeNodes() {
6875 - var _a, _b;
6876 - super.optimizeNodes();
6877 - (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();
6878 - (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
6879 - return this;
6880 - }
6881 - optimizeNames(names, constants) {
6882 - var _a, _b;
6883 - super.optimizeNames(names, constants);
6884 - (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
6885 - (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
6886 - return this;
6887 - }
6888 - get names() {
6889 - const names = super.names;
6890 - if (this.catch)
6891 - addNames(names, this.catch.names);
6892 - if (this.finally)
6893 - addNames(names, this.finally.names);
6894 - return names;
6895 - }
6896 -}
6897 -class Catch extends BlockNode {
6898 - constructor(error) {
6899 - super();
6900 - this.error = error;
6901 - }
6902 - render(opts) {
6903 - return `catch(${this.error})` + super.render(opts);
6904 - }
6905 -}
6906 -Catch.kind = "catch";
6907 -class Finally extends BlockNode {
6908 - render(opts) {
6909 - return "finally" + super.render(opts);
6910 - }
6911 -}
6912 -Finally.kind = "finally";
6913 -class CodeGen {
6914 - constructor(extScope, opts = {}) {
6915 - this._values = {};
6916 - this._blockStarts = [];
6917 - this._constants = {};
6918 - this.opts = { ...opts, _n: opts.lines ? "\n" : "" };
6919 - this._extScope = extScope;
6920 - this._scope = new scope_1.Scope({ parent: extScope });
6921 - this._nodes = [new Root()];
6922 - }
6923 - toString() {
6924 - return this._root.render(this.opts);
6925 - }
6926 - // returns unique name in the internal scope
6927 - name(prefix) {
6928 - return this._scope.name(prefix);
6929 - }
6930 - // reserves unique name in the external scope
6931 - scopeName(prefix) {
6932 - return this._extScope.name(prefix);
6933 - }
6934 - // reserves unique name in the external scope and assigns value to it
6935 - scopeValue(prefixOrName, value) {
6936 - const name = this._extScope.value(prefixOrName, value);
6937 - const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set());
6938 - vs.add(name);
6939 - return name;
6940 - }
6941 - getScopeValue(prefix, keyOrRef) {
6942 - return this._extScope.getValue(prefix, keyOrRef);
6943 - }
6944 - // return code that assigns values in the external scope to the names that are used internally
6945 - // (same names that were returned by gen.scopeName or gen.scopeValue)
6946 - scopeRefs(scopeName) {
6947 - return this._extScope.scopeRefs(scopeName, this._values);
6948 - }
6949 - scopeCode() {
6950 - return this._extScope.scopeCode(this._values);
6951 - }
6952 - _def(varKind, nameOrPrefix, rhs, constant) {
6953 - const name = this._scope.toName(nameOrPrefix);
6954 - if (rhs !== undefined && constant)
6955 - this._constants[name.str] = rhs;
6956 - this._leafNode(new Def(varKind, name, rhs));
6957 - return name;
6958 - }
6959 - // `const` declaration (`var` in es5 mode)
6960 - const(nameOrPrefix, rhs, _constant) {
6961 - return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant);
6962 - }
6963 - // `let` declaration with optional assignment (`var` in es5 mode)
6964 - let(nameOrPrefix, rhs, _constant) {
6965 - return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant);
6966 - }
6967 - // `var` declaration with optional assignment
6968 - var(nameOrPrefix, rhs, _constant) {
6969 - return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant);
6970 - }
6971 - // assignment code
6972 - assign(lhs, rhs, sideEffects) {
6973 - return this._leafNode(new Assign(lhs, rhs, sideEffects));
6974 - }
6975 - // `+=` code
6976 - add(lhs, rhs) {
6977 - return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs));
6978 - }
6979 - // appends passed SafeExpr to code or executes Block
6980 - code(c) {
6981 - if (typeof c == "function")
6982 - c();
6983 - else if (c !== code_1.nil)
6984 - this._leafNode(new AnyCode(c));
6985 - return this;
6986 - }
6987 - // returns code for object literal for the passed argument list of key-value pairs
6988 - object(...keyValues) {
6989 - const code = ["{"];
6990 - for (const [key, value] of keyValues) {
6991 - if (code.length > 1)
6992 - code.push(",");
6993 - code.push(key);
6994 - if (key !== value || this.opts.es5) {
6995 - code.push(":");
6996 - (0, code_1.addCodeArg)(code, value);
6997 - }
6998 - }
6999 - code.push("}");
7000 - return new code_1._Code(code);
7001 - }
7002 - // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
7003 - if(condition, thenBody, elseBody) {
7004 - this._blockNode(new If(condition));
7005 - if (thenBody && elseBody) {
7006 - this.code(thenBody).else().code(elseBody).endIf();
7007 - }
7008 - else if (thenBody) {
7009 - this.code(thenBody).endIf();
7010 - }
7011 - else if (elseBody) {
7012 - throw new Error('CodeGen: "else" body without "then" body');
7013 - }
7014 - return this;
7015 - }
7016 - // `else if` clause - invalid without `if` or after `else` clauses
7017 - elseIf(condition) {
7018 - return this._elseNode(new If(condition));
7019 - }
7020 - // `else` clause - only valid after `if` or `else if` clauses
7021 - else() {
7022 - return this._elseNode(new Else());
7023 - }
7024 - // end `if` statement (needed if gen.if was used only with condition)
7025 - endIf() {
7026 - return this._endBlockNode(If, Else);
7027 - }
7028 - _for(node, forBody) {
7029 - this._blockNode(node);
7030 - if (forBody)
7031 - this.code(forBody).endFor();
7032 - return this;
7033 - }
7034 - // a generic `for` clause (or statement if `forBody` is passed)
7035 - for(iteration, forBody) {
7036 - return this._for(new ForLoop(iteration), forBody);
7037 - }
7038 - // `for` statement for a range of values
7039 - forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) {
7040 - const name = this._scope.toName(nameOrPrefix);
7041 - return this._for(new ForRange(varKind, name, from, to), () => forBody(name));
7042 - }
7043 - // `for-of` statement (in es5 mode replace with a normal for loop)
7044 - forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) {
7045 - const name = this._scope.toName(nameOrPrefix);
7046 - if (this.opts.es5) {
7047 - const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable);
7048 - return this.forRange("_i", 0, (0, code_1._) `${arr}.length`, (i) => {
7049 - this.var(name, (0, code_1._) `${arr}[${i}]`);
7050 - forBody(name);
7051 - });
7052 - }
7053 - return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name));
7054 - }
7055 - // `for-in` statement.
7056 - // With option `ownProperties` replaced with a `for-of` loop for object keys
7057 - forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) {
7058 - if (this.opts.ownProperties) {
7059 - return this.forOf(nameOrPrefix, (0, code_1._) `Object.keys(${obj})`, forBody);
7060 - }
7061 - const name = this._scope.toName(nameOrPrefix);
7062 - return this._for(new ForIter("in", varKind, name, obj), () => forBody(name));
7063 - }
7064 - // end `for` loop
7065 - endFor() {
7066 - return this._endBlockNode(For);
7067 - }
7068 - // `label` statement
7069 - label(label) {
7070 - return this._leafNode(new Label(label));
7071 - }
7072 - // `break` statement
7073 - break(label) {
7074 - return this._leafNode(new Break(label));
7075 - }
7076 - // `return` statement
7077 - return(value) {
7078 - const node = new Return();
7079 - this._blockNode(node);
7080 - this.code(value);
7081 - if (node.nodes.length !== 1)
7082 - throw new Error('CodeGen: "return" should have one node');
7083 - return this._endBlockNode(Return);
7084 - }
7085 - // `try` statement
7086 - try(tryBody, catchCode, finallyCode) {
7087 - if (!catchCode && !finallyCode)
7088 - throw new Error('CodeGen: "try" without "catch" and "finally"');
7089 - const node = new Try();
7090 - this._blockNode(node);
7091 - this.code(tryBody);
7092 - if (catchCode) {
7093 - const error = this.name("e");
7094 - this._currNode = node.catch = new Catch(error);
7095 - catchCode(error);
7096 - }
7097 - if (finallyCode) {
7098 - this._currNode = node.finally = new Finally();
7099 - this.code(finallyCode);
7100 - }
7101 - return this._endBlockNode(Catch, Finally);
7102 - }
7103 - // `throw` statement
7104 - throw(error) {
7105 - return this._leafNode(new Throw(error));
7106 - }
7107 - // start self-balancing block
7108 - block(body, nodeCount) {
7109 - this._blockStarts.push(this._nodes.length);
7110 - if (body)
7111 - this.code(body).endBlock(nodeCount);
7112 - return this;
7113 - }
7114 - // end the current self-balancing block
7115 - endBlock(nodeCount) {
7116 - const len = this._blockStarts.pop();
7117 - if (len === undefined)
7118 - throw new Error("CodeGen: not in self-balancing block");
7119 - const toClose = this._nodes.length - len;
7120 - if (toClose < 0 || (nodeCount !== undefined && toClose !== nodeCount)) {
7121 - throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`);
7122 - }
7123 - this._nodes.length = len;
7124 - return this;
7125 - }
7126 - // `function` heading (or definition if funcBody is passed)
7127 - func(name, args = code_1.nil, async, funcBody) {
7128 - this._blockNode(new Func(name, args, async));
7129 - if (funcBody)
7130 - this.code(funcBody).endFunc();
7131 - return this;
7132 - }
7133 - // end function definition
7134 - endFunc() {
7135 - return this._endBlockNode(Func);
7136 - }
7137 - optimize(n = 1) {
7138 - while (n-- > 0) {
7139 - this._root.optimizeNodes();
7140 - this._root.optimizeNames(this._root.names, this._constants);
7141 - }
7142 - }
7143 - _leafNode(node) {
7144 - this._currNode.nodes.push(node);
7145 - return this;
7146 - }
7147 - _blockNode(node) {
7148 - this._currNode.nodes.push(node);
7149 - this._nodes.push(node);
7150 - }
7151 - _endBlockNode(N1, N2) {
7152 - const n = this._currNode;
7153 - if (n instanceof N1 || (N2 && n instanceof N2)) {
7154 - this._nodes.pop();
7155 - return this;
7156 - }
7157 - throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`);
7158 - }
7159 - _elseNode(node) {
7160 - const n = this._currNode;
7161 - if (!(n instanceof If)) {
7162 - throw new Error('CodeGen: "else" without "if"');
7163 - }
7164 - this._currNode = n.else = node;
7165 - return this;
7166 - }
7167 - get _root() {
7168 - return this._nodes[0];
7169 - }
7170 - get _currNode() {
7171 - const ns = this._nodes;
7172 - return ns[ns.length - 1];
7173 - }
7174 - set _currNode(node) {
7175 - const ns = this._nodes;
7176 - ns[ns.length - 1] = node;
7177 - }
7178 -}
7179 -exports.CodeGen = CodeGen;
7180 -function addNames(names, from) {
7181 - for (const n in from)
7182 - names[n] = (names[n] || 0) + (from[n] || 0);
7183 - return names;
7184 -}
7185 -function addExprNames(names, from) {
7186 - return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names;
7187 -}
7188 -function optimizeExpr(expr, names, constants) {
7189 - if (expr instanceof code_1.Name)
7190 - return replaceName(expr);
7191 - if (!canOptimize(expr))
7192 - return expr;
7193 - return new code_1._Code(expr._items.reduce((items, c) => {
7194 - if (c instanceof code_1.Name)
7195 - c = replaceName(c);
7196 - if (c instanceof code_1._Code)
7197 - items.push(...c._items);
7198 - else
7199 - items.push(c);
7200 - return items;
7201 - }, []));
7202 - function replaceName(n) {
7203 - const c = constants[n.str];
7204 - if (c === undefined || names[n.str] !== 1)
7205 - return n;
7206 - delete names[n.str];
7207 - return c;
7208 - }
7209 - function canOptimize(e) {
7210 - return (e instanceof code_1._Code &&
7211 - e._items.some((c) => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined));
7212 - }
7213 -}
7214 -function subtractNames(names, from) {
7215 - for (const n in from)
7216 - names[n] = (names[n] || 0) - (from[n] || 0);
7217 -}
7218 -function not(x) {
7219 - return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._) `!${par(x)}`;
7220 -}
7221 -exports.not = not;
7222 -const andCode = mappend(exports.operators.AND);
7223 -// boolean AND (&&) expression with the passed arguments
7224 -function and(...args) {
7225 - return args.reduce(andCode);
7226 -}
7227 -exports.and = and;
7228 -const orCode = mappend(exports.operators.OR);
7229 -// boolean OR (||) expression with the passed arguments
7230 -function or(...args) {
7231 - return args.reduce(orCode);
7232 -}
7233 -exports.or = or;
7234 -function mappend(op) {
7235 - return (x, y) => (x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._) `${par(x)} ${op} ${par(y)}`);
7236 -}
7237 -function par(x) {
7238 - return x instanceof code_1.Name ? x : (0, code_1._) `(${x})`;
7239 -}
7240 -//# sourceMappingURL=index.js.map
7241 -
7242 -/***/ }),
7243 -
7244 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js":
7245 -/*!***********************************************************************************************!*\
7246 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js ***!
7247 - \***********************************************************************************************/
7248 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7249 -
7250 -
7251 -Object.defineProperty(exports, "__esModule", ({ value: true }));
7252 -exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0;
7253 -const code_1 = __webpack_require__(/*! ./code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");
7254 -class ValueError extends Error {
7255 - constructor(name) {
7256 - super(`CodeGen: "code" for ${name} not defined`);
7257 - this.value = name.value;
7258 - }
7259 -}
7260 -var UsedValueState;
7261 -(function (UsedValueState) {
7262 - UsedValueState[UsedValueState["Started"] = 0] = "Started";
7263 - UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
7264 -})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
7265 -exports.varKinds = {
7266 - const: new code_1.Name("const"),
7267 - let: new code_1.Name("let"),
7268 - var: new code_1.Name("var"),
7269 -};
7270 -class Scope {
7271 - constructor({ prefixes, parent } = {}) {
7272 - this._names = {};
7273 - this._prefixes = prefixes;
7274 - this._parent = parent;
7275 - }
7276 - toName(nameOrPrefix) {
7277 - return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix);
7278 - }
7279 - name(prefix) {
7280 - return new code_1.Name(this._newName(prefix));
7281 - }
7282 - _newName(prefix) {
7283 - const ng = this._names[prefix] || this._nameGroup(prefix);
7284 - return `${prefix}${ng.index++}`;
7285 - }
7286 - _nameGroup(prefix) {
7287 - var _a, _b;
7288 - if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || (this._prefixes && !this._prefixes.has(prefix))) {
7289 - throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
7290 - }
7291 - return (this._names[prefix] = { prefix, index: 0 });
7292 - }
7293 -}
7294 -exports.Scope = Scope;
7295 -class ValueScopeName extends code_1.Name {
7296 - constructor(prefix, nameStr) {
7297 - super(nameStr);
7298 - this.prefix = prefix;
7299 - }
7300 - setValue(value, { property, itemIndex }) {
7301 - this.value = value;
7302 - this.scopePath = (0, code_1._) `.${new code_1.Name(property)}[${itemIndex}]`;
7303 - }
7304 -}
7305 -exports.ValueScopeName = ValueScopeName;
7306 -const line = (0, code_1._) `\n`;
7307 -class ValueScope extends Scope {
7308 - constructor(opts) {
7309 - super(opts);
7310 - this._values = {};
7311 - this._scope = opts.scope;
7312 - this.opts = { ...opts, _n: opts.lines ? line : code_1.nil };
7313 - }
7314 - get() {
7315 - return this._scope;
7316 - }
7317 - name(prefix) {
7318 - return new ValueScopeName(prefix, this._newName(prefix));
7319 - }
7320 - value(nameOrPrefix, value) {
7321 - var _a;
7322 - if (value.ref === undefined)
7323 - throw new Error("CodeGen: ref must be passed in value");
7324 - const name = this.toName(nameOrPrefix);
7325 - const { prefix } = name;
7326 - const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;
7327 - let vs = this._values[prefix];
7328 - if (vs) {
7329 - const _name = vs.get(valueKey);
7330 - if (_name)
7331 - return _name;
7332 - }
7333 - else {
7334 - vs = this._values[prefix] = new Map();
7335 - }
7336 - vs.set(valueKey, name);
7337 - const s = this._scope[prefix] || (this._scope[prefix] = []);
7338 - const itemIndex = s.length;
7339 - s[itemIndex] = value.ref;
7340 - name.setValue(value, { property: prefix, itemIndex });
7341 - return name;
7342 - }
7343 - getValue(prefix, keyOrRef) {
7344 - const vs = this._values[prefix];
7345 - if (!vs)
7346 - return;
7347 - return vs.get(keyOrRef);
7348 - }
7349 - scopeRefs(scopeName, values = this._values) {
7350 - return this._reduceValues(values, (name) => {
7351 - if (name.scopePath === undefined)
7352 - throw new Error(`CodeGen: name "${name}" has no value`);
7353 - return (0, code_1._) `${scopeName}${name.scopePath}`;
7354 - });
7355 - }
7356 - scopeCode(values = this._values, usedValues, getCode) {
7357 - return this._reduceValues(values, (name) => {
7358 - if (name.value === undefined)
7359 - throw new Error(`CodeGen: name "${name}" has no value`);
7360 - return name.value.code;
7361 - }, usedValues, getCode);
7362 - }
7363 - _reduceValues(values, valueCode, usedValues = {}, getCode) {
7364 - let code = code_1.nil;
7365 - for (const prefix in values) {
7366 - const vs = values[prefix];
7367 - if (!vs)
7368 - continue;
7369 - const nameSet = (usedValues[prefix] = usedValues[prefix] || new Map());
7370 - vs.forEach((name) => {
7371 - if (nameSet.has(name))
7372 - return;
7373 - nameSet.set(name, UsedValueState.Started);
7374 - let c = valueCode(name);
7375 - if (c) {
7376 - const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
7377 - code = (0, code_1._) `${code}${def} ${name} = ${c};${this.opts._n}`;
7378 - }
7379 - else if ((c = getCode === null || getCode === void 0 ? void 0 : getCode(name))) {
7380 - code = (0, code_1._) `${code}${c}${this.opts._n}`;
7381 - }
7382 - else {
7383 - throw new ValueError(name);
7384 - }
7385 - nameSet.set(name, UsedValueState.Completed);
7386 - });
7387 - }
7388 - return code;
7389 - }
7390 -}
7391 -exports.ValueScope = ValueScope;
7392 -//# sourceMappingURL=scope.js.map
7393 -
7394 -/***/ }),
7395 -
7396 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js":
7397 -/*!****************************************************************************************!*\
7398 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js ***!
7399 - \****************************************************************************************/
7400 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7401 -
7402 -
7403 -Object.defineProperty(exports, "__esModule", ({ value: true }));
7404 -exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0;
7405 -const codegen_1 = __webpack_require__(/*! ./codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
7406 -const util_1 = __webpack_require__(/*! ./util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
7407 -const names_1 = __webpack_require__(/*! ./names */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");
7408 -exports.keywordError = {
7409 - message: ({ keyword }) => (0, codegen_1.str) `must pass "${keyword}" keyword validation`,
7410 -};
7411 -exports.keyword$DataError = {
7412 - message: ({ keyword, schemaType }) => schemaType
7413 - ? (0, codegen_1.str) `"${keyword}" keyword must be ${schemaType} ($data)`
7414 - : (0, codegen_1.str) `"${keyword}" keyword is invalid ($data)`,
7415 -};
7416 -function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) {
7417 - const { it } = cxt;
7418 - const { gen, compositeRule, allErrors } = it;
7419 - const errObj = errorObjectCode(cxt, error, errorPaths);
7420 - if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : (compositeRule || allErrors)) {
7421 - addError(gen, errObj);
7422 - }
7423 - else {
7424 - returnErrors(it, (0, codegen_1._) `[${errObj}]`);
7425 - }
7426 -}
7427 -exports.reportError = reportError;
7428 -function reportExtraError(cxt, error = exports.keywordError, errorPaths) {
7429 - const { it } = cxt;
7430 - const { gen, compositeRule, allErrors } = it;
7431 - const errObj = errorObjectCode(cxt, error, errorPaths);
7432 - addError(gen, errObj);
7433 - if (!(compositeRule || allErrors)) {
7434 - returnErrors(it, names_1.default.vErrors);
7435 - }
7436 -}
7437 -exports.reportExtraError = reportExtraError;
7438 -function resetErrorsCount(gen, errsCount) {
7439 - gen.assign(names_1.default.errors, errsCount);
7440 - gen.if((0, codegen_1._) `${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._) `${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null)));
7441 -}
7442 -exports.resetErrorsCount = resetErrorsCount;
7443 -function extendErrors({ gen, keyword, schemaValue, data, errsCount, it, }) {
7444 - /* istanbul ignore if */
7445 - if (errsCount === undefined)
7446 - throw new Error("ajv implementation error");
7447 - const err = gen.name("err");
7448 - gen.forRange("i", errsCount, names_1.default.errors, (i) => {
7449 - gen.const(err, (0, codegen_1._) `${names_1.default.vErrors}[${i}]`);
7450 - gen.if((0, codegen_1._) `${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._) `${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath)));
7451 - gen.assign((0, codegen_1._) `${err}.schemaPath`, (0, codegen_1.str) `${it.errSchemaPath}/${keyword}`);
7452 - if (it.opts.verbose) {
7453 - gen.assign((0, codegen_1._) `${err}.schema`, schemaValue);
7454 - gen.assign((0, codegen_1._) `${err}.data`, data);
7455 - }
7456 - });
7457 -}
7458 -exports.extendErrors = extendErrors;
7459 -function addError(gen, errObj) {
7460 - const err = gen.const("err", errObj);
7461 - gen.if((0, codegen_1._) `${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._) `[${err}]`), (0, codegen_1._) `${names_1.default.vErrors}.push(${err})`);
7462 - gen.code((0, codegen_1._) `${names_1.default.errors}++`);
7463 -}
7464 -function returnErrors(it, errs) {
7465 - const { gen, validateName, schemaEnv } = it;
7466 - if (schemaEnv.$async) {
7467 - gen.throw((0, codegen_1._) `new ${it.ValidationError}(${errs})`);
7468 - }
7469 - else {
7470 - gen.assign((0, codegen_1._) `${validateName}.errors`, errs);
7471 - gen.return(false);
7472 - }
7473 -}
7474 -const E = {
7475 - keyword: new codegen_1.Name("keyword"),
7476 - schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors
7477 - params: new codegen_1.Name("params"),
7478 - propertyName: new codegen_1.Name("propertyName"),
7479 - message: new codegen_1.Name("message"),
7480 - schema: new codegen_1.Name("schema"),
7481 - parentSchema: new codegen_1.Name("parentSchema"),
7482 -};
7483 -function errorObjectCode(cxt, error, errorPaths) {
7484 - const { createErrors } = cxt.it;
7485 - if (createErrors === false)
7486 - return (0, codegen_1._) `{}`;
7487 - return errorObject(cxt, error, errorPaths);
7488 -}
7489 -function errorObject(cxt, error, errorPaths = {}) {
7490 - const { gen, it } = cxt;
7491 - const keyValues = [
7492 - errorInstancePath(it, errorPaths),
7493 - errorSchemaPath(cxt, errorPaths),
7494 - ];
7495 - extraErrorProps(cxt, error, keyValues);
7496 - return gen.object(...keyValues);
7497 -}
7498 -function errorInstancePath({ errorPath }, { instancePath }) {
7499 - const instPath = instancePath
7500 - ? (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}`
7501 - : errorPath;
7502 - return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)];
7503 -}
7504 -function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) {
7505 - let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str) `${errSchemaPath}/${keyword}`;
7506 - if (schemaPath) {
7507 - schPath = (0, codegen_1.str) `${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`;
7508 - }
7509 - return [E.schemaPath, schPath];
7510 -}
7511 -function extraErrorProps(cxt, { params, message }, keyValues) {
7512 - const { keyword, data, schemaValue, it } = cxt;
7513 - const { opts, propertyName, topSchemaRef, schemaPath } = it;
7514 - keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._) `{}`]);
7515 - if (opts.messages) {
7516 - keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]);
7517 - }
7518 - if (opts.verbose) {
7519 - keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._) `${topSchemaRef}${schemaPath}`], [names_1.default.data, data]);
7520 - }
7521 - if (propertyName)
7522 - keyValues.push([E.propertyName, propertyName]);
7523 -}
7524 -//# sourceMappingURL=errors.js.map
7525 -
7526 -/***/ }),
7527 -
7528 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js":
7529 -/*!***************************************************************************************!*\
7530 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js ***!
7531 - \***************************************************************************************/
7532 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7533 -
7534 -
7535 -Object.defineProperty(exports, "__esModule", ({ value: true }));
7536 -exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0;
7537 -const codegen_1 = __webpack_require__(/*! ./codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
7538 -const validation_error_1 = __webpack_require__(/*! ../runtime/validation_error */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js");
7539 -const names_1 = __webpack_require__(/*! ./names */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");
7540 -const resolve_1 = __webpack_require__(/*! ./resolve */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js");
7541 -const util_1 = __webpack_require__(/*! ./util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
7542 -const validate_1 = __webpack_require__(/*! ./validate */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");
7543 -class SchemaEnv {
7544 - constructor(env) {
7545 - var _a;
7546 - this.refs = {};
7547 - this.dynamicAnchors = {};
7548 - let schema;
7549 - if (typeof env.schema == "object")
7550 - schema = env.schema;
7551 - this.schema = env.schema;
7552 - this.schemaId = env.schemaId;
7553 - this.root = env.root || this;
7554 - this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]);
7555 - this.schemaPath = env.schemaPath;
7556 - this.localRefs = env.localRefs;
7557 - this.meta = env.meta;
7558 - this.$async = schema === null || schema === void 0 ? void 0 : schema.$async;
7559 - this.refs = {};
7560 - }
7561 -}
7562 -exports.SchemaEnv = SchemaEnv;
7563 -// let codeSize = 0
7564 -// let nodeCount = 0
7565 -// Compiles schema in SchemaEnv
7566 -function compileSchema(sch) {
7567 - // TODO refactor - remove compilations
7568 - const _sch = getCompilingSchema.call(this, sch);
7569 - if (_sch)
7570 - return _sch;
7571 - const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails
7572 - const { es5, lines } = this.opts.code;
7573 - const { ownProperties } = this.opts;
7574 - const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties });
7575 - let _ValidationError;
7576 - if (sch.$async) {
7577 - _ValidationError = gen.scopeValue("Error", {
7578 - ref: validation_error_1.default,
7579 - code: (0, codegen_1._) `require("ajv/dist/runtime/validation_error").default`,
7580 - });
7581 - }
7582 - const validateName = gen.scopeName("validate");
7583 - sch.validateName = validateName;
7584 - const schemaCxt = {
7585 - gen,
7586 - allErrors: this.opts.allErrors,
7587 - data: names_1.default.data,
7588 - parentData: names_1.default.parentData,
7589 - parentDataProperty: names_1.default.parentDataProperty,
7590 - dataNames: [names_1.default.data],
7591 - dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed?
7592 - dataLevel: 0,
7593 - dataTypes: [],
7594 - definedProperties: new Set(),
7595 - topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true
7596 - ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) }
7597 - : { ref: sch.schema }),
7598 - validateName,
7599 - ValidationError: _ValidationError,
7600 - schema: sch.schema,
7601 - schemaEnv: sch,
7602 - rootId,
7603 - baseId: sch.baseId || rootId,
7604 - schemaPath: codegen_1.nil,
7605 - errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"),
7606 - errorPath: (0, codegen_1._) `""`,
7607 - opts: this.opts,
7608 - self: this,
7609 - };
7610 - let sourceCode;
7611 - try {
7612 - this._compilations.add(sch);
7613 - (0, validate_1.validateFunctionCode)(schemaCxt);
7614 - gen.optimize(this.opts.code.optimize);
7615 - // gen.optimize(1)
7616 - const validateCode = gen.toString();
7617 - sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`;
7618 - // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount))
7619 - if (this.opts.code.process)
7620 - sourceCode = this.opts.code.process(sourceCode, sch);
7621 - // console.log("\n\n\n *** \n", sourceCode)
7622 - const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
7623 - const validate = makeValidate(this, this.scope.get());
7624 - this.scope.value(validateName, { ref: validate });
7625 - validate.errors = null;
7626 - validate.schema = sch.schema;
7627 - validate.schemaEnv = sch;
7628 - if (sch.$async)
7629 - validate.$async = true;
7630 - if (this.opts.code.source === true) {
7631 - validate.source = { validateName, validateCode, scopeValues: gen._values };
7632 - }
7633 - if (this.opts.unevaluated) {
7634 - const { props, items } = schemaCxt;
7635 - validate.evaluated = {
7636 - props: props instanceof codegen_1.Name ? undefined : props,
7637 - items: items instanceof codegen_1.Name ? undefined : items,
7638 - dynamicProps: props instanceof codegen_1.Name,
7639 - dynamicItems: items instanceof codegen_1.Name,
7640 - };
7641 - if (validate.source)
7642 - validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);
7643 - }
7644 - sch.validate = validate;
7645 - return sch;
7646 - }
7647 - catch (e) {
7648 - delete sch.validate;
7649 - delete sch.validateName;
7650 - if (sourceCode)
7651 - this.logger.error("Error compiling schema, function code:", sourceCode);
7652 - // console.log("\n\n\n *** \n", sourceCode, this.opts)
7653 - throw e;
7654 - }
7655 - finally {
7656 - this._compilations.delete(sch);
7657 - }
7658 -}
7659 -exports.compileSchema = compileSchema;
7660 -function resolveRef(root, baseId, ref) {
7661 - var _a;
7662 - ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
7663 - const schOrFunc = root.refs[ref];
7664 - if (schOrFunc)
7665 - return schOrFunc;
7666 - let _sch = resolve.call(this, root, ref);
7667 - if (_sch === undefined) {
7668 - const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv
7669 - const { schemaId } = this.opts;
7670 - if (schema)
7671 - _sch = new SchemaEnv({ schema, schemaId, root, baseId });
7672 - }
7673 - if (_sch === undefined)
7674 - return;
7675 - return (root.refs[ref] = inlineOrCompile.call(this, _sch));
7676 -}
7677 -exports.resolveRef = resolveRef;
7678 -function inlineOrCompile(sch) {
7679 - if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs))
7680 - return sch.schema;
7681 - return sch.validate ? sch : compileSchema.call(this, sch);
7682 -}
7683 -// Index of schema compilation in the currently compiled list
7684 -function getCompilingSchema(schEnv) {
7685 - for (const sch of this._compilations) {
7686 - if (sameSchemaEnv(sch, schEnv))
7687 - return sch;
7688 - }
7689 -}
7690 -exports.getCompilingSchema = getCompilingSchema;
7691 -function sameSchemaEnv(s1, s2) {
7692 - return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
7693 -}
7694 -// resolve and compile the references ($ref)
7695 -// TODO returns AnySchemaObject (if the schema can be inlined) or validation function
7696 -function resolve(root, // information about the root schema for the current schema
7697 -ref // reference to resolve
7698 -) {
7699 - let sch;
7700 - while (typeof (sch = this.refs[ref]) == "string")
7701 - ref = sch;
7702 - return sch || this.schemas[ref] || resolveSchema.call(this, root, ref);
7703 -}
7704 -// Resolve schema, its root and baseId
7705 -function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it
7706 -ref // reference to resolve
7707 -) {
7708 - const p = this.opts.uriResolver.parse(ref);
7709 - const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p);
7710 - let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined);
7711 - // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests
7712 - if (Object.keys(root.schema).length > 0 && refPath === baseId) {
7713 - return getJsonPointer.call(this, p, root);
7714 - }
7715 - const id = (0, resolve_1.normalizeId)(refPath);
7716 - const schOrRef = this.refs[id] || this.schemas[id];
7717 - if (typeof schOrRef == "string") {
7718 - const sch = resolveSchema.call(this, root, schOrRef);
7719 - if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object")
7720 - return;
7721 - return getJsonPointer.call(this, p, sch);
7722 - }
7723 - if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object")
7724 - return;
7725 - if (!schOrRef.validate)
7726 - compileSchema.call(this, schOrRef);
7727 - if (id === (0, resolve_1.normalizeId)(ref)) {
7728 - const { schema } = schOrRef;
7729 - const { schemaId } = this.opts;
7730 - const schId = schema[schemaId];
7731 - if (schId)
7732 - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
7733 - return new SchemaEnv({ schema, schemaId, root, baseId });
7734 - }
7735 - return getJsonPointer.call(this, p, schOrRef);
7736 -}
7737 -exports.resolveSchema = resolveSchema;
7738 -const PREVENT_SCOPE_CHANGE = new Set([
7739 - "properties",
7740 - "patternProperties",
7741 - "enum",
7742 - "dependencies",
7743 - "definitions",
7744 -]);
7745 -function getJsonPointer(parsedRef, { baseId, schema, root }) {
7746 - var _a;
7747 - if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/")
7748 - return;
7749 - for (const part of parsedRef.fragment.slice(1).split("/")) {
7750 - if (typeof schema === "boolean")
7751 - return;
7752 - const partSchema = schema[(0, util_1.unescapeFragment)(part)];
7753 - if (partSchema === undefined)
7754 - return;
7755 - schema = partSchema;
7756 - // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def?
7757 - const schId = typeof schema === "object" && schema[this.opts.schemaId];
7758 - if (!PREVENT_SCOPE_CHANGE.has(part) && schId) {
7759 - baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId);
7760 - }
7761 - }
7762 - let env;
7763 - if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) {
7764 - const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref);
7765 - env = resolveSchema.call(this, root, $ref);
7766 - }
7767 - // even though resolution failed we need to return SchemaEnv to throw exception
7768 - // so that compileAsync loads missing schema.
7769 - const { schemaId } = this.opts;
7770 - env = env || new SchemaEnv({ schema, schemaId, root, baseId });
7771 - if (env.schema !== env.root.schema)
7772 - return env;
7773 - return undefined;
7774 -}
7775 -//# sourceMappingURL=index.js.map
7776 -
7777 -/***/ }),
7778 -
7779 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js":
7780 -/*!***************************************************************************************!*\
7781 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js ***!
7782 - \***************************************************************************************/
7783 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7784 -
7785 -
7786 -Object.defineProperty(exports, "__esModule", ({ value: true }));
7787 -const codegen_1 = __webpack_require__(/*! ./codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
7788 -const names = {
7789 - // validation function arguments
7790 - data: new codegen_1.Name("data"), // data passed to validation function
7791 - // args passed from referencing schema
7792 - valCxt: new codegen_1.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below
7793 - instancePath: new codegen_1.Name("instancePath"),
7794 - parentData: new codegen_1.Name("parentData"),
7795 - parentDataProperty: new codegen_1.Name("parentDataProperty"),
7796 - rootData: new codegen_1.Name("rootData"), // root data - same as the data passed to the first/top validation function
7797 - dynamicAnchors: new codegen_1.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef
7798 - // function scoped variables
7799 - vErrors: new codegen_1.Name("vErrors"), // null or array of validation errors
7800 - errors: new codegen_1.Name("errors"), // counter of validation errors
7801 - this: new codegen_1.Name("this"),
7802 - // "globals"
7803 - self: new codegen_1.Name("self"),
7804 - scope: new codegen_1.Name("scope"),
7805 - // JTD serialize/parse name for JSON string and position
7806 - json: new codegen_1.Name("json"),
7807 - jsonPos: new codegen_1.Name("jsonPos"),
7808 - jsonLen: new codegen_1.Name("jsonLen"),
7809 - jsonPart: new codegen_1.Name("jsonPart"),
7810 -};
7811 -exports["default"] = names;
7812 -//# sourceMappingURL=names.js.map
7813 -
7814 -/***/ }),
7815 -
7816 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js":
7817 -/*!*******************************************************************************************!*\
7818 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js ***!
7819 - \*******************************************************************************************/
7820 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7821 -
7822 -
7823 -Object.defineProperty(exports, "__esModule", ({ value: true }));
7824 -const resolve_1 = __webpack_require__(/*! ./resolve */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js");
7825 -class MissingRefError extends Error {
7826 - constructor(resolver, baseId, ref, msg) {
7827 - super(msg || `can't resolve reference ${ref} from id ${baseId}`);
7828 - this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref);
7829 - this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef));
7830 - }
7831 -}
7832 -exports["default"] = MissingRefError;
7833 -//# sourceMappingURL=ref_error.js.map
7834 -
7835 -/***/ }),
7836 -
7837 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js":
7838 -/*!*****************************************************************************************!*\
7839 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js ***!
7840 - \*****************************************************************************************/
7841 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
7842 -
7843 -
7844 -Object.defineProperty(exports, "__esModule", ({ value: true }));
7845 -exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0;
7846 -const util_1 = __webpack_require__(/*! ./util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
7847 -const equal = __webpack_require__(/*! fast-deep-equal */ "./node_modules/fast-deep-equal/index.js");
7848 -const traverse = __webpack_require__(/*! json-schema-traverse */ "./node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js");
7849 -// TODO refactor to use keyword definitions
7850 -const SIMPLE_INLINED = new Set([
7851 - "type",
7852 - "format",
7853 - "pattern",
7854 - "maxLength",
7855 - "minLength",
7856 - "maxProperties",
7857 - "minProperties",
7858 - "maxItems",
7859 - "minItems",
7860 - "maximum",
7861 - "minimum",
7862 - "uniqueItems",
7863 - "multipleOf",
7864 - "required",
7865 - "enum",
7866 - "const",
7867 -]);
7868 -function inlineRef(schema, limit = true) {
7869 - if (typeof schema == "boolean")
7870 - return true;
7871 - if (limit === true)
7872 - return !hasRef(schema);
7873 - if (!limit)
7874 - return false;
7875 - return countKeys(schema) <= limit;
7876 -}
7877 -exports.inlineRef = inlineRef;
7878 -const REF_KEYWORDS = new Set([
7879 - "$ref",
7880 - "$recursiveRef",
7881 - "$recursiveAnchor",
7882 - "$dynamicRef",
7883 - "$dynamicAnchor",
7884 -]);
7885 -function hasRef(schema) {
7886 - for (const key in schema) {
7887 - if (REF_KEYWORDS.has(key))
7888 - return true;
7889 - const sch = schema[key];
7890 - if (Array.isArray(sch) && sch.some(hasRef))
7891 - return true;
7892 - if (typeof sch == "object" && hasRef(sch))
7893 - return true;
7894 - }
7895 - return false;
7896 -}
7897 -function countKeys(schema) {
7898 - let count = 0;
7899 - for (const key in schema) {
7900 - if (key === "$ref")
7901 - return Infinity;
7902 - count++;
7903 - if (SIMPLE_INLINED.has(key))
7904 - continue;
7905 - if (typeof schema[key] == "object") {
7906 - (0, util_1.eachItem)(schema[key], (sch) => (count += countKeys(sch)));
7907 - }
7908 - if (count === Infinity)
7909 - return Infinity;
7910 - }
7911 - return count;
7912 -}
7913 -function getFullPath(resolver, id = "", normalize) {
7914 - if (normalize !== false)
7915 - id = normalizeId(id);
7916 - const p = resolver.parse(id);
7917 - return _getFullPath(resolver, p);
7918 -}
7919 -exports.getFullPath = getFullPath;
7920 -function _getFullPath(resolver, p) {
7921 - const serialized = resolver.serialize(p);
7922 - return serialized.split("#")[0] + "#";
7923 -}
7924 -exports._getFullPath = _getFullPath;
7925 -const TRAILING_SLASH_HASH = /#\/?$/;
7926 -function normalizeId(id) {
7927 - return id ? id.replace(TRAILING_SLASH_HASH, "") : "";
7928 -}
7929 -exports.normalizeId = normalizeId;
7930 -function resolveUrl(resolver, baseId, id) {
7931 - id = normalizeId(id);
7932 - return resolver.resolve(baseId, id);
7933 -}
7934 -exports.resolveUrl = resolveUrl;
7935 -const ANCHOR = /^[a-z_][-a-z0-9._]*$/i;
7936 -function getSchemaRefs(schema, baseId) {
7937 - if (typeof schema == "boolean")
7938 - return {};
7939 - const { schemaId, uriResolver } = this.opts;
7940 - const schId = normalizeId(schema[schemaId] || baseId);
7941 - const baseIds = { "": schId };
7942 - const pathPrefix = getFullPath(uriResolver, schId, false);
7943 - const localRefs = {};
7944 - const schemaRefs = new Set();
7945 - traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => {
7946 - if (parentJsonPtr === undefined)
7947 - return;
7948 - const fullPath = pathPrefix + jsonPtr;
7949 - let innerBaseId = baseIds[parentJsonPtr];
7950 - if (typeof sch[schemaId] == "string")
7951 - innerBaseId = addRef.call(this, sch[schemaId]);
7952 - addAnchor.call(this, sch.$anchor);
7953 - addAnchor.call(this, sch.$dynamicAnchor);
7954 - baseIds[jsonPtr] = innerBaseId;
7955 - function addRef(ref) {
7956 - // eslint-disable-next-line @typescript-eslint/unbound-method
7957 - const _resolve = this.opts.uriResolver.resolve;
7958 - ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref);
7959 - if (schemaRefs.has(ref))
7960 - throw ambiguos(ref);
7961 - schemaRefs.add(ref);
7962 - let schOrRef = this.refs[ref];
7963 - if (typeof schOrRef == "string")
7964 - schOrRef = this.refs[schOrRef];
7965 - if (typeof schOrRef == "object") {
7966 - checkAmbiguosRef(sch, schOrRef.schema, ref);
7967 - }
7968 - else if (ref !== normalizeId(fullPath)) {
7969 - if (ref[0] === "#") {
7970 - checkAmbiguosRef(sch, localRefs[ref], ref);
7971 - localRefs[ref] = sch;
7972 - }
7973 - else {
7974 - this.refs[ref] = fullPath;
7975 - }
7976 - }
7977 - return ref;
7978 - }
7979 - function addAnchor(anchor) {
7980 - if (typeof anchor == "string") {
7981 - if (!ANCHOR.test(anchor))
7982 - throw new Error(`invalid anchor "${anchor}"`);
7983 - addRef.call(this, `#${anchor}`);
7984 - }
7985 - }
7986 - });
7987 - return localRefs;
7988 - function checkAmbiguosRef(sch1, sch2, ref) {
7989 - if (sch2 !== undefined && !equal(sch1, sch2))
7990 - throw ambiguos(ref);
7991 - }
7992 - function ambiguos(ref) {
7993 - return new Error(`reference "${ref}" resolves to more than one schema`);
7994 - }
7995 -}
7996 -exports.getSchemaRefs = getSchemaRefs;
7997 -//# sourceMappingURL=resolve.js.map
7998 -
7999 -/***/ }),
8000 -
8001 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js":
8002 -/*!***************************************************************************************!*\
8003 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js ***!
8004 - \***************************************************************************************/
8005 -/***/ (function(__unused_webpack_module, exports) {
8006 -
8007 -
8008 -Object.defineProperty(exports, "__esModule", ({ value: true }));
8009 -exports.getRules = exports.isJSONType = void 0;
8010 -const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
8011 -const jsonTypes = new Set(_jsonTypes);
8012 -function isJSONType(x) {
8013 - return typeof x == "string" && jsonTypes.has(x);
8014 -}
8015 -exports.isJSONType = isJSONType;
8016 -function getRules() {
8017 - const groups = {
8018 - number: { type: "number", rules: [] },
8019 - string: { type: "string", rules: [] },
8020 - array: { type: "array", rules: [] },
8021 - object: { type: "object", rules: [] },
8022 - };
8023 - return {
8024 - types: { ...groups, integer: true, boolean: true, null: true },
8025 - rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],
8026 - post: { rules: [] },
8027 - all: {},
8028 - keywords: {},
8029 - };
8030 -}
8031 -exports.getRules = getRules;
8032 -//# sourceMappingURL=rules.js.map
8033 -
8034 -/***/ }),
8035 -
8036 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js":
8037 -/*!**************************************************************************************!*\
8038 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js ***!
8039 - \**************************************************************************************/
8040 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8041 -
8042 -
8043 -Object.defineProperty(exports, "__esModule", ({ value: true }));
8044 -exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0;
8045 -const codegen_1 = __webpack_require__(/*! ./codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
8046 -const code_1 = __webpack_require__(/*! ./codegen/code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");
8047 -// TODO refactor to use Set
8048 -function toHash(arr) {
8049 - const hash = {};
8050 - for (const item of arr)
8051 - hash[item] = true;
8052 - return hash;
8053 -}
8054 -exports.toHash = toHash;
8055 -function alwaysValidSchema(it, schema) {
8056 - if (typeof schema == "boolean")
8057 - return schema;
8058 - if (Object.keys(schema).length === 0)
8059 - return true;
8060 - checkUnknownRules(it, schema);
8061 - return !schemaHasRules(schema, it.self.RULES.all);
8062 -}
8063 -exports.alwaysValidSchema = alwaysValidSchema;
8064 -function checkUnknownRules(it, schema = it.schema) {
8065 - const { opts, self } = it;
8066 - if (!opts.strictSchema)
8067 - return;
8068 - if (typeof schema === "boolean")
8069 - return;
8070 - const rules = self.RULES.keywords;
8071 - for (const key in schema) {
8072 - if (!rules[key])
8073 - checkStrictMode(it, `unknown keyword: "${key}"`);
8074 - }
8075 -}
8076 -exports.checkUnknownRules = checkUnknownRules;
8077 -function schemaHasRules(schema, rules) {
8078 - if (typeof schema == "boolean")
8079 - return !schema;
8080 - for (const key in schema)
8081 - if (rules[key])
8082 - return true;
8083 - return false;
8084 -}
8085 -exports.schemaHasRules = schemaHasRules;
8086 -function schemaHasRulesButRef(schema, RULES) {
8087 - if (typeof schema == "boolean")
8088 - return !schema;
8089 - for (const key in schema)
8090 - if (key !== "$ref" && RULES.all[key])
8091 - return true;
8092 - return false;
8093 -}
8094 -exports.schemaHasRulesButRef = schemaHasRulesButRef;
8095 -function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) {
8096 - if (!$data) {
8097 - if (typeof schema == "number" || typeof schema == "boolean")
8098 - return schema;
8099 - if (typeof schema == "string")
8100 - return (0, codegen_1._) `${schema}`;
8101 - }
8102 - return (0, codegen_1._) `${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`;
8103 -}
8104 -exports.schemaRefOrVal = schemaRefOrVal;
8105 -function unescapeFragment(str) {
8106 - return unescapeJsonPointer(decodeURIComponent(str));
8107 -}
8108 -exports.unescapeFragment = unescapeFragment;
8109 -function escapeFragment(str) {
8110 - return encodeURIComponent(escapeJsonPointer(str));
8111 -}
8112 -exports.escapeFragment = escapeFragment;
8113 -function escapeJsonPointer(str) {
8114 - if (typeof str == "number")
8115 - return `${str}`;
8116 - return str.replace(/~/g, "~0").replace(/\//g, "~1");
8117 -}
8118 -exports.escapeJsonPointer = escapeJsonPointer;
8119 -function unescapeJsonPointer(str) {
8120 - return str.replace(/~1/g, "/").replace(/~0/g, "~");
8121 -}
8122 -exports.unescapeJsonPointer = unescapeJsonPointer;
8123 -function eachItem(xs, f) {
8124 - if (Array.isArray(xs)) {
8125 - for (const x of xs)
8126 - f(x);
8127 - }
8128 - else {
8129 - f(xs);
8130 - }
8131 -}
8132 -exports.eachItem = eachItem;
8133 -function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName, }) {
8134 - return (gen, from, to, toName) => {
8135 - const res = to === undefined
8136 - ? from
8137 - : to instanceof codegen_1.Name
8138 - ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to)
8139 - : from instanceof codegen_1.Name
8140 - ? (mergeToName(gen, to, from), from)
8141 - : mergeValues(from, to);
8142 - return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res;
8143 - };
8144 -}
8145 -exports.mergeEvaluated = {
8146 - props: makeMergeEvaluated({
8147 - mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => {
8148 - gen.if((0, codegen_1._) `${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._) `${to} || {}`).code((0, codegen_1._) `Object.assign(${to}, ${from})`));
8149 - }),
8150 - mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => {
8151 - if (from === true) {
8152 - gen.assign(to, true);
8153 - }
8154 - else {
8155 - gen.assign(to, (0, codegen_1._) `${to} || {}`);
8156 - setEvaluated(gen, to, from);
8157 - }
8158 - }),
8159 - mergeValues: (from, to) => (from === true ? true : { ...from, ...to }),
8160 - resultToName: evaluatedPropsToName,
8161 - }),
8162 - items: makeMergeEvaluated({
8163 - mergeNames: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._) `${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)),
8164 - mergeToName: (gen, from, to) => gen.if((0, codegen_1._) `${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._) `${to} > ${from} ? ${to} : ${from}`)),
8165 - mergeValues: (from, to) => (from === true ? true : Math.max(from, to)),
8166 - resultToName: (gen, items) => gen.var("items", items),
8167 - }),
8168 -};
8169 -function evaluatedPropsToName(gen, ps) {
8170 - if (ps === true)
8171 - return gen.var("props", true);
8172 - const props = gen.var("props", (0, codegen_1._) `{}`);
8173 - if (ps !== undefined)
8174 - setEvaluated(gen, props, ps);
8175 - return props;
8176 -}
8177 -exports.evaluatedPropsToName = evaluatedPropsToName;
8178 -function setEvaluated(gen, props, ps) {
8179 - Object.keys(ps).forEach((p) => gen.assign((0, codegen_1._) `${props}${(0, codegen_1.getProperty)(p)}`, true));
8180 -}
8181 -exports.setEvaluated = setEvaluated;
8182 -const snippets = {};
8183 -function useFunc(gen, f) {
8184 - return gen.scopeValue("func", {
8185 - ref: f,
8186 - code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)),
8187 - });
8188 -}
8189 -exports.useFunc = useFunc;
8190 -var Type;
8191 -(function (Type) {
8192 - Type[Type["Num"] = 0] = "Num";
8193 - Type[Type["Str"] = 1] = "Str";
8194 -})(Type || (exports.Type = Type = {}));
8195 -function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
8196 - // let path
8197 - if (dataProp instanceof codegen_1.Name) {
8198 - const isNumber = dataPropType === Type.Num;
8199 - return jsPropertySyntax
8200 - ? isNumber
8201 - ? (0, codegen_1._) `"[" + ${dataProp} + "]"`
8202 - : (0, codegen_1._) `"['" + ${dataProp} + "']"`
8203 - : isNumber
8204 - ? (0, codegen_1._) `"/" + ${dataProp}`
8205 - : (0, codegen_1._) `"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer
8206 - }
8207 - return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp);
8208 -}
8209 -exports.getErrorPath = getErrorPath;
8210 -function checkStrictMode(it, msg, mode = it.opts.strictSchema) {
8211 - if (!mode)
8212 - return;
8213 - msg = `strict mode: ${msg}`;
8214 - if (mode === true)
8215 - throw new Error(msg);
8216 - it.self.logger.warn(msg);
8217 -}
8218 -exports.checkStrictMode = checkStrictMode;
8219 -//# sourceMappingURL=util.js.map
8220 -
8221 -/***/ }),
8222 -
8223 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js":
8224 -/*!********************************************************************************************************!*\
8225 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js ***!
8226 - \********************************************************************************************************/
8227 -/***/ (function(__unused_webpack_module, exports) {
8228 -
8229 -
8230 -Object.defineProperty(exports, "__esModule", ({ value: true }));
8231 -exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
8232 -function schemaHasRulesForType({ schema, self }, type) {
8233 - const group = self.RULES.types[type];
8234 - return group && group !== true && shouldUseGroup(schema, group);
8235 -}
8236 -exports.schemaHasRulesForType = schemaHasRulesForType;
8237 -function shouldUseGroup(schema, group) {
8238 - return group.rules.some((rule) => shouldUseRule(schema, rule));
8239 -}
8240 -exports.shouldUseGroup = shouldUseGroup;
8241 -function shouldUseRule(schema, rule) {
8242 - var _a;
8243 - return (schema[rule.keyword] !== undefined ||
8244 - ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));
8245 -}
8246 -exports.shouldUseRule = shouldUseRule;
8247 -//# sourceMappingURL=applicability.js.map
8248 -
8249 -/***/ }),
8250 -
8251 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js":
8252 -/*!*****************************************************************************************************!*\
8253 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js ***!
8254 - \*****************************************************************************************************/
8255 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8256 -
8257 -
8258 -Object.defineProperty(exports, "__esModule", ({ value: true }));
8259 -exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0;
8260 -const errors_1 = __webpack_require__(/*! ../errors */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js");
8261 -const codegen_1 = __webpack_require__(/*! ../codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
8262 -const names_1 = __webpack_require__(/*! ../names */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");
8263 -const boolError = {
8264 - message: "boolean schema is false",
8265 -};
8266 -function topBoolOrEmptySchema(it) {
8267 - const { gen, schema, validateName } = it;
8268 - if (schema === false) {
8269 - falseSchemaError(it, false);
8270 - }
8271 - else if (typeof schema == "object" && schema.$async === true) {
8272 - gen.return(names_1.default.data);
8273 - }
8274 - else {
8275 - gen.assign((0, codegen_1._) `${validateName}.errors`, null);
8276 - gen.return(true);
8277 - }
8278 -}
8279 -exports.topBoolOrEmptySchema = topBoolOrEmptySchema;
8280 -function boolOrEmptySchema(it, valid) {
8281 - const { gen, schema } = it;
8282 - if (schema === false) {
8283 - gen.var(valid, false); // TODO var
8284 - falseSchemaError(it);
8285 - }
8286 - else {
8287 - gen.var(valid, true); // TODO var
8288 - }
8289 -}
8290 -exports.boolOrEmptySchema = boolOrEmptySchema;
8291 -function falseSchemaError(it, overrideAllErrors) {
8292 - const { gen, data } = it;
8293 - // TODO maybe some other interface should be used for non-keyword validation errors...
8294 - const cxt = {
8295 - gen,
8296 - keyword: "false schema",
8297 - data,
8298 - schema: false,
8299 - schemaCode: false,
8300 - schemaValue: false,
8301 - params: {},
8302 - it,
8303 - };
8304 - (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors);
8305 -}
8306 -//# sourceMappingURL=boolSchema.js.map
8307 -
8308 -/***/ }),
8309 -
8310 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js":
8311 -/*!***************************************************************************************************!*\
8312 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js ***!
8313 - \***************************************************************************************************/
8314 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8315 -
8316 -
8317 -Object.defineProperty(exports, "__esModule", ({ value: true }));
8318 -exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0;
8319 -const rules_1 = __webpack_require__(/*! ../rules */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js");
8320 -const applicability_1 = __webpack_require__(/*! ./applicability */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js");
8321 -const errors_1 = __webpack_require__(/*! ../errors */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js");
8322 -const codegen_1 = __webpack_require__(/*! ../codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
8323 -const util_1 = __webpack_require__(/*! ../util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
8324 -var DataType;
8325 -(function (DataType) {
8326 - DataType[DataType["Correct"] = 0] = "Correct";
8327 - DataType[DataType["Wrong"] = 1] = "Wrong";
8328 -})(DataType || (exports.DataType = DataType = {}));
8329 -function getSchemaTypes(schema) {
8330 - const types = getJSONTypes(schema.type);
8331 - const hasNull = types.includes("null");
8332 - if (hasNull) {
8333 - if (schema.nullable === false)
8334 - throw new Error("type: null contradicts nullable: false");
8335 - }
8336 - else {
8337 - if (!types.length && schema.nullable !== undefined) {
8338 - throw new Error('"nullable" cannot be used without "type"');
8339 - }
8340 - if (schema.nullable === true)
8341 - types.push("null");
8342 - }
8343 - return types;
8344 -}
8345 -exports.getSchemaTypes = getSchemaTypes;
8346 -// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
8347 -function getJSONTypes(ts) {
8348 - const types = Array.isArray(ts) ? ts : ts ? [ts] : [];
8349 - if (types.every(rules_1.isJSONType))
8350 - return types;
8351 - throw new Error("type must be JSONType or JSONType[]: " + types.join(","));
8352 -}
8353 -exports.getJSONTypes = getJSONTypes;
8354 -function coerceAndCheckDataType(it, types) {
8355 - const { gen, data, opts } = it;
8356 - const coerceTo = coerceToTypes(types, opts.coerceTypes);
8357 - const checkTypes = types.length > 0 &&
8358 - !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0]));
8359 - if (checkTypes) {
8360 - const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong);
8361 - gen.if(wrongType, () => {
8362 - if (coerceTo.length)
8363 - coerceData(it, types, coerceTo);
8364 - else
8365 - reportTypeError(it);
8366 - });
8367 - }
8368 - return checkTypes;
8369 -}
8370 -exports.coerceAndCheckDataType = coerceAndCheckDataType;
8371 -const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]);
8372 -function coerceToTypes(types, coerceTypes) {
8373 - return coerceTypes
8374 - ? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array"))
8375 - : [];
8376 -}
8377 -function coerceData(it, types, coerceTo) {
8378 - const { gen, data, opts } = it;
8379 - const dataType = gen.let("dataType", (0, codegen_1._) `typeof ${data}`);
8380 - const coerced = gen.let("coerced", (0, codegen_1._) `undefined`);
8381 - if (opts.coerceTypes === "array") {
8382 - gen.if((0, codegen_1._) `${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen
8383 - .assign(data, (0, codegen_1._) `${data}[0]`)
8384 - .assign(dataType, (0, codegen_1._) `typeof ${data}`)
8385 - .if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data)));
8386 - }
8387 - gen.if((0, codegen_1._) `${coerced} !== undefined`);
8388 - for (const t of coerceTo) {
8389 - if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) {
8390 - coerceSpecificType(t);
8391 - }
8392 - }
8393 - gen.else();
8394 - reportTypeError(it);
8395 - gen.endIf();
8396 - gen.if((0, codegen_1._) `${coerced} !== undefined`, () => {
8397 - gen.assign(data, coerced);
8398 - assignParentData(it, coerced);
8399 - });
8400 - function coerceSpecificType(t) {
8401 - switch (t) {
8402 - case "string":
8403 - gen
8404 - .elseIf((0, codegen_1._) `${dataType} == "number" || ${dataType} == "boolean"`)
8405 - .assign(coerced, (0, codegen_1._) `"" + ${data}`)
8406 - .elseIf((0, codegen_1._) `${data} === null`)
8407 - .assign(coerced, (0, codegen_1._) `""`);
8408 - return;
8409 - case "number":
8410 - gen
8411 - .elseIf((0, codegen_1._) `${dataType} == "boolean" || ${data} === null
8412 - || (${dataType} == "string" && ${data} && ${data} == +${data})`)
8413 - .assign(coerced, (0, codegen_1._) `+${data}`);
8414 - return;
8415 - case "integer":
8416 - gen
8417 - .elseIf((0, codegen_1._) `${dataType} === "boolean" || ${data} === null
8418 - || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`)
8419 - .assign(coerced, (0, codegen_1._) `+${data}`);
8420 - return;
8421 - case "boolean":
8422 - gen
8423 - .elseIf((0, codegen_1._) `${data} === "false" || ${data} === 0 || ${data} === null`)
8424 - .assign(coerced, false)
8425 - .elseIf((0, codegen_1._) `${data} === "true" || ${data} === 1`)
8426 - .assign(coerced, true);
8427 - return;
8428 - case "null":
8429 - gen.elseIf((0, codegen_1._) `${data} === "" || ${data} === 0 || ${data} === false`);
8430 - gen.assign(coerced, null);
8431 - return;
8432 - case "array":
8433 - gen
8434 - .elseIf((0, codegen_1._) `${dataType} === "string" || ${dataType} === "number"
8435 - || ${dataType} === "boolean" || ${data} === null`)
8436 - .assign(coerced, (0, codegen_1._) `[${data}]`);
8437 - }
8438 - }
8439 -}
8440 -function assignParentData({ gen, parentData, parentDataProperty }, expr) {
8441 - // TODO use gen.property
8442 - gen.if((0, codegen_1._) `${parentData} !== undefined`, () => gen.assign((0, codegen_1._) `${parentData}[${parentDataProperty}]`, expr));
8443 -}
8444 -function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
8445 - const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ;
8446 - let cond;
8447 - switch (dataType) {
8448 - case "null":
8449 - return (0, codegen_1._) `${data} ${EQ} null`;
8450 - case "array":
8451 - cond = (0, codegen_1._) `Array.isArray(${data})`;
8452 - break;
8453 - case "object":
8454 - cond = (0, codegen_1._) `${data} && typeof ${data} == "object" && !Array.isArray(${data})`;
8455 - break;
8456 - case "integer":
8457 - cond = numCond((0, codegen_1._) `!(${data} % 1) && !isNaN(${data})`);
8458 - break;
8459 - case "number":
8460 - cond = numCond();
8461 - break;
8462 - default:
8463 - return (0, codegen_1._) `typeof ${data} ${EQ} ${dataType}`;
8464 - }
8465 - return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond);
8466 - function numCond(_cond = codegen_1.nil) {
8467 - return (0, codegen_1.and)((0, codegen_1._) `typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._) `isFinite(${data})` : codegen_1.nil);
8468 - }
8469 -}
8470 -exports.checkDataType = checkDataType;
8471 -function checkDataTypes(dataTypes, data, strictNums, correct) {
8472 - if (dataTypes.length === 1) {
8473 - return checkDataType(dataTypes[0], data, strictNums, correct);
8474 - }
8475 - let cond;
8476 - const types = (0, util_1.toHash)(dataTypes);
8477 - if (types.array && types.object) {
8478 - const notObj = (0, codegen_1._) `typeof ${data} != "object"`;
8479 - cond = types.null ? notObj : (0, codegen_1._) `!${data} || ${notObj}`;
8480 - delete types.null;
8481 - delete types.array;
8482 - delete types.object;
8483 - }
8484 - else {
8485 - cond = codegen_1.nil;
8486 - }
8487 - if (types.number)
8488 - delete types.integer;
8489 - for (const t in types)
8490 - cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct));
8491 - return cond;
8492 -}
8493 -exports.checkDataTypes = checkDataTypes;
8494 -const typeError = {
8495 - message: ({ schema }) => `must be ${schema}`,
8496 - params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._) `{type: ${schema}}` : (0, codegen_1._) `{type: ${schemaValue}}`,
8497 -};
8498 -function reportTypeError(it) {
8499 - const cxt = getTypeErrorContext(it);
8500 - (0, errors_1.reportError)(cxt, typeError);
8501 -}
8502 -exports.reportTypeError = reportTypeError;
8503 -function getTypeErrorContext(it) {
8504 - const { gen, data, schema } = it;
8505 - const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type");
8506 - return {
8507 - gen,
8508 - keyword: "type",
8509 - data,
8510 - schema: schema.type,
8511 - schemaCode,
8512 - schemaValue: schemaCode,
8513 - parentSchema: schema,
8514 - params: {},
8515 - it,
8516 - };
8517 -}
8518 -//# sourceMappingURL=dataType.js.map
8519 -
8520 -/***/ }),
8521 -
8522 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js":
8523 -/*!***************************************************************************************************!*\
8524 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js ***!
8525 - \***************************************************************************************************/
8526 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8527 -
8528 -
8529 -Object.defineProperty(exports, "__esModule", ({ value: true }));
8530 -exports.assignDefaults = void 0;
8531 -const codegen_1 = __webpack_require__(/*! ../codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
8532 -const util_1 = __webpack_require__(/*! ../util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
8533 -function assignDefaults(it, ty) {
8534 - const { properties, items } = it.schema;
8535 - if (ty === "object" && properties) {
8536 - for (const key in properties) {
8537 - assignDefault(it, key, properties[key].default);
8538 - }
8539 - }
8540 - else if (ty === "array" && Array.isArray(items)) {
8541 - items.forEach((sch, i) => assignDefault(it, i, sch.default));
8542 - }
8543 -}
8544 -exports.assignDefaults = assignDefaults;
8545 -function assignDefault(it, prop, defaultValue) {
8546 - const { gen, compositeRule, data, opts } = it;
8547 - if (defaultValue === undefined)
8548 - return;
8549 - const childData = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(prop)}`;
8550 - if (compositeRule) {
8551 - (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
8552 - return;
8553 - }
8554 - let condition = (0, codegen_1._) `${childData} === undefined`;
8555 - if (opts.useDefaults === "empty") {
8556 - condition = (0, codegen_1._) `${condition} || ${childData} === null || ${childData} === ""`;
8557 - }
8558 - // `${childData} === undefined` +
8559 - // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "")
8560 - gen.if(condition, (0, codegen_1._) `${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
8561 -}
8562 -//# sourceMappingURL=defaults.js.map
8563 -
8564 -/***/ }),
8565 -
8566 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js":
8567 -/*!************************************************************************************************!*\
8568 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js ***!
8569 - \************************************************************************************************/
8570 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
8571 -
8572 -
8573 -Object.defineProperty(exports, "__esModule", ({ value: true }));
8574 -exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0;
8575 -const boolSchema_1 = __webpack_require__(/*! ./boolSchema */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js");
8576 -const dataType_1 = __webpack_require__(/*! ./dataType */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js");
8577 -const applicability_1 = __webpack_require__(/*! ./applicability */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js");
8578 -const dataType_2 = __webpack_require__(/*! ./dataType */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js");
8579 -const defaults_1 = __webpack_require__(/*! ./defaults */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js");
8580 -const keyword_1 = __webpack_require__(/*! ./keyword */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js");
8581 -const subschema_1 = __webpack_require__(/*! ./subschema */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js");
8582 -const codegen_1 = __webpack_require__(/*! ../codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
8583 -const names_1 = __webpack_require__(/*! ../names */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");
8584 -const resolve_1 = __webpack_require__(/*! ../resolve */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js");
8585 -const util_1 = __webpack_require__(/*! ../util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
8586 -const errors_1 = __webpack_require__(/*! ../errors */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js");
8587 -// schema compilation - generates validation function, subschemaCode (below) is used for subschemas
8588 -function validateFunctionCode(it) {
8589 - if (isSchemaObj(it)) {
8590 - checkKeywords(it);
8591 - if (schemaCxtHasRules(it)) {
8592 - topSchemaObjCode(it);
8593 - return;
8594 - }
8595 - }
8596 - validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it));
8597 -}
8598 -exports.validateFunctionCode = validateFunctionCode;
8599 -function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) {
8600 - if (opts.code.es5) {
8601 - gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => {
8602 - gen.code((0, codegen_1._) `"use strict"; ${funcSourceUrl(schema, opts)}`);
8603 - destructureValCxtES5(gen, opts);
8604 - gen.code(body);
8605 - });
8606 - }
8607 - else {
8608 - gen.func(validateName, (0, codegen_1._) `${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body));
8609 - }
8610 -}
8611 -function destructureValCxt(opts) {
8612 - return (0, codegen_1._) `{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._) `, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`;
8613 -}
8614 -function destructureValCxtES5(gen, opts) {
8615 - gen.if(names_1.default.valCxt, () => {
8616 - gen.var(names_1.default.instancePath, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.instancePath}`);
8617 - gen.var(names_1.default.parentData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentData}`);
8618 - gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.parentDataProperty}`);
8619 - gen.var(names_1.default.rootData, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.rootData}`);
8620 - if (opts.dynamicRef)
8621 - gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`);
8622 - }, () => {
8623 - gen.var(names_1.default.instancePath, (0, codegen_1._) `""`);
8624 - gen.var(names_1.default.parentData, (0, codegen_1._) `undefined`);
8625 - gen.var(names_1.default.parentDataProperty, (0, codegen_1._) `undefined`);
8626 - gen.var(names_1.default.rootData, names_1.default.data);
8627 - if (opts.dynamicRef)
8628 - gen.var(names_1.default.dynamicAnchors, (0, codegen_1._) `{}`);
8629 - });
8630 -}
8631 -function topSchemaObjCode(it) {
8632 - const { schema, opts, gen } = it;
8633 - validateFunction(it, () => {
8634 - if (opts.$comment && schema.$comment)
8635 - commentKeyword(it);
8636 - checkNoDefault(it);
8637 - gen.let(names_1.default.vErrors, null);
8638 - gen.let(names_1.default.errors, 0);
8639 - if (opts.unevaluated)
8640 - resetEvaluated(it);
8641 - typeAndKeywords(it);
8642 - returnResults(it);
8643 - });
8644 - return;
8645 -}
8646 -function resetEvaluated(it) {
8647 - // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated
8648 - const { gen, validateName } = it;
8649 - it.evaluated = gen.const("evaluated", (0, codegen_1._) `${validateName}.evaluated`);
8650 - gen.if((0, codegen_1._) `${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._) `${it.evaluated}.props`, (0, codegen_1._) `undefined`));
8651 - gen.if((0, codegen_1._) `${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._) `${it.evaluated}.items`, (0, codegen_1._) `undefined`));
8652 -}
8653 -function funcSourceUrl(schema, opts) {
8654 - const schId = typeof schema == "object" && schema[opts.schemaId];
8655 - return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._) `/*# sourceURL=${schId} */` : codegen_1.nil;
8656 -}
8657 -// schema compilation - this function is used recursively to generate code for sub-schemas
8658 -function subschemaCode(it, valid) {
8659 - if (isSchemaObj(it)) {
8660 - checkKeywords(it);
8661 - if (schemaCxtHasRules(it)) {
8662 - subSchemaObjCode(it, valid);
8663 - return;
8664 - }
8665 - }
8666 - (0, boolSchema_1.boolOrEmptySchema)(it, valid);
8667 -}
8668 -function schemaCxtHasRules({ schema, self }) {
8669 - if (typeof schema == "boolean")
8670 - return !schema;
8671 - for (const key in schema)
8672 - if (self.RULES.all[key])
8673 - return true;
8674 - return false;
8675 -}
8676 -function isSchemaObj(it) {
8677 - return typeof it.schema != "boolean";
8678 -}
8679 -function subSchemaObjCode(it, valid) {
8680 - const { schema, gen, opts } = it;
8681 - if (opts.$comment && schema.$comment)
8682 - commentKeyword(it);
8683 - updateContext(it);
8684 - checkAsyncSchema(it);
8685 - const errsCount = gen.const("_errs", names_1.default.errors);
8686 - typeAndKeywords(it, errsCount);
8687 - // TODO var
8688 - gen.var(valid, (0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
8689 -}
8690 -function checkKeywords(it) {
8691 - (0, util_1.checkUnknownRules)(it);
8692 - checkRefsAndKeywords(it);
8693 -}
8694 -function typeAndKeywords(it, errsCount) {
8695 - if (it.opts.jtd)
8696 - return schemaKeywords(it, [], false, errsCount);
8697 - const types = (0, dataType_1.getSchemaTypes)(it.schema);
8698 - const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types);
8699 - schemaKeywords(it, types, !checkedTypes, errsCount);
8700 -}
8701 -function checkRefsAndKeywords(it) {
8702 - const { schema, errSchemaPath, opts, self } = it;
8703 - if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) {
8704 - self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`);
8705 - }
8706 -}
8707 -function checkNoDefault(it) {
8708 - const { schema, opts } = it;
8709 - if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) {
8710 - (0, util_1.checkStrictMode)(it, "default is ignored in the schema root");
8711 - }
8712 -}
8713 -function updateContext(it) {
8714 - const schId = it.schema[it.opts.schemaId];
8715 - if (schId)
8716 - it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId);
8717 -}
8718 -function checkAsyncSchema(it) {
8719 - if (it.schema.$async && !it.schemaEnv.$async)
8720 - throw new Error("async schema in sync schema");
8721 -}
8722 -function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) {
8723 - const msg = schema.$comment;
8724 - if (opts.$comment === true) {
8725 - gen.code((0, codegen_1._) `${names_1.default.self}.logger.log(${msg})`);
8726 - }
8727 - else if (typeof opts.$comment == "function") {
8728 - const schemaPath = (0, codegen_1.str) `${errSchemaPath}/$comment`;
8729 - const rootName = gen.scopeValue("root", { ref: schemaEnv.root });
8730 - gen.code((0, codegen_1._) `${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`);
8731 - }
8732 -}
8733 -function returnResults(it) {
8734 - const { gen, schemaEnv, validateName, ValidationError, opts } = it;
8735 - if (schemaEnv.$async) {
8736 - // TODO assign unevaluated
8737 - gen.if((0, codegen_1._) `${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._) `new ${ValidationError}(${names_1.default.vErrors})`));
8738 - }
8739 - else {
8740 - gen.assign((0, codegen_1._) `${validateName}.errors`, names_1.default.vErrors);
8741 - if (opts.unevaluated)
8742 - assignEvaluated(it);
8743 - gen.return((0, codegen_1._) `${names_1.default.errors} === 0`);
8744 - }
8745 -}
8746 -function assignEvaluated({ gen, evaluated, props, items }) {
8747 - if (props instanceof codegen_1.Name)
8748 - gen.assign((0, codegen_1._) `${evaluated}.props`, props);
8749 - if (items instanceof codegen_1.Name)
8750 - gen.assign((0, codegen_1._) `${evaluated}.items`, items);
8751 -}
8752 -function schemaKeywords(it, types, typeErrors, errsCount) {
8753 - const { gen, schema, data, allErrors, opts, self } = it;
8754 - const { RULES } = self;
8755 - if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) {
8756 - gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast
8757 - return;
8758 - }
8759 - if (!opts.jtd)
8760 - checkStrictTypes(it, types);
8761 - gen.block(() => {
8762 - for (const group of RULES.rules)
8763 - groupKeywords(group);
8764 - groupKeywords(RULES.post);
8765 - });
8766 - function groupKeywords(group) {
8767 - if (!(0, applicability_1.shouldUseGroup)(schema, group))
8768 - return;
8769 - if (group.type) {
8770 - gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers));
8771 - iterateKeywords(it, group);
8772 - if (types.length === 1 && types[0] === group.type && typeErrors) {
8773 - gen.else();
8774 - (0, dataType_2.reportTypeError)(it);
8775 - }
8776 - gen.endIf();
8777 - }
8778 - else {
8779 - iterateKeywords(it, group);
8780 - }
8781 - // TODO make it "ok" call?
8782 - if (!allErrors)
8783 - gen.if((0, codegen_1._) `${names_1.default.errors} === ${errsCount || 0}`);
8784 - }
8785 -}
8786 -function iterateKeywords(it, group) {
8787 - const { gen, schema, opts: { useDefaults }, } = it;
8788 - if (useDefaults)
8789 - (0, defaults_1.assignDefaults)(it, group.type);
8790 - gen.block(() => {
8791 - for (const rule of group.rules) {
8792 - if ((0, applicability_1.shouldUseRule)(schema, rule)) {
8793 - keywordCode(it, rule.keyword, rule.definition, group.type);
8794 - }
8795 - }
8796 - });
8797 -}
8798 -function checkStrictTypes(it, types) {
8799 - if (it.schemaEnv.meta || !it.opts.strictTypes)
8800 - return;
8801 - checkContextTypes(it, types);
8802 - if (!it.opts.allowUnionTypes)
8803 - checkMultipleTypes(it, types);
8804 - checkKeywordTypes(it, it.dataTypes);
8805 -}
8806 -function checkContextTypes(it, types) {
8807 - if (!types.length)
8808 - return;
8809 - if (!it.dataTypes.length) {
8810 - it.dataTypes = types;
8811 - return;
8812 - }
8813 - types.forEach((t) => {
8814 - if (!includesType(it.dataTypes, t)) {
8815 - strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`);
8816 - }
8817 - });
8818 - narrowSchemaTypes(it, types);
8819 -}
8820 -function checkMultipleTypes(it, ts) {
8821 - if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) {
8822 - strictTypesError(it, "use allowUnionTypes to allow union type keyword");
8823 - }
8824 -}
8825 -function checkKeywordTypes(it, ts) {
8826 - const rules = it.self.RULES.all;
8827 - for (const keyword in rules) {
8828 - const rule = rules[keyword];
8829 - if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) {
8830 - const { type } = rule.definition;
8831 - if (type.length && !type.some((t) => hasApplicableType(ts, t))) {
8832 - strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`);
8833 - }
8834 - }
8835 - }
8836 -}
8837 -function hasApplicableType(schTs, kwdT) {
8838 - return schTs.includes(kwdT) || (kwdT === "number" && schTs.includes("integer"));
8839 -}
8840 -function includesType(ts, t) {
8841 - return ts.includes(t) || (t === "integer" && ts.includes("number"));
8842 -}
8843 -function narrowSchemaTypes(it, withTypes) {
8844 - const ts = [];
8845 - for (const t of it.dataTypes) {
8846 - if (includesType(withTypes, t))
8847 - ts.push(t);
8848 - else if (withTypes.includes("integer") && t === "number")
8849 - ts.push("integer");
8850 - }
8851 - it.dataTypes = ts;
8852 -}
8853 -function strictTypesError(it, msg) {
8854 - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
8855 - msg += ` at "${schemaPath}" (strictTypes)`;
8856 - (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes);
8857 -}
8858 -class KeywordCxt {
8859 - constructor(it, def, keyword) {
8860 - (0, keyword_1.validateKeywordUsage)(it, def, keyword);
8861 - this.gen = it.gen;
8862 - this.allErrors = it.allErrors;
8863 - this.keyword = keyword;
8864 - this.data = it.data;
8865 - this.schema = it.schema[keyword];
8866 - this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data;
8867 - this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data);
8868 - this.schemaType = def.schemaType;
8869 - this.parentSchema = it.schema;
8870 - this.params = {};
8871 - this.it = it;
8872 - this.def = def;
8873 - if (this.$data) {
8874 - this.schemaCode = it.gen.const("vSchema", getData(this.$data, it));
8875 - }
8876 - else {
8877 - this.schemaCode = this.schemaValue;
8878 - if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) {
8879 - throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`);
8880 - }
8881 - }
8882 - if ("code" in def ? def.trackErrors : def.errors !== false) {
8883 - this.errsCount = it.gen.const("_errs", names_1.default.errors);
8884 - }
8885 - }
8886 - result(condition, successAction, failAction) {
8887 - this.failResult((0, codegen_1.not)(condition), successAction, failAction);
8888 - }
8889 - failResult(condition, successAction, failAction) {
8890 - this.gen.if(condition);
8891 - if (failAction)
8892 - failAction();
8893 - else
8894 - this.error();
8895 - if (successAction) {
8896 - this.gen.else();
8897 - successAction();
8898 - if (this.allErrors)
8899 - this.gen.endIf();
8900 - }
8901 - else {
8902 - if (this.allErrors)
8903 - this.gen.endIf();
8904 - else
8905 - this.gen.else();
8906 - }
8907 - }
8908 - pass(condition, failAction) {
8909 - this.failResult((0, codegen_1.not)(condition), undefined, failAction);
8910 - }
8911 - fail(condition) {
8912 - if (condition === undefined) {
8913 - this.error();
8914 - if (!this.allErrors)
8915 - this.gen.if(false); // this branch will be removed by gen.optimize
8916 - return;
8917 - }
8918 - this.gen.if(condition);
8919 - this.error();
8920 - if (this.allErrors)
8921 - this.gen.endIf();
8922 - else
8923 - this.gen.else();
8924 - }
8925 - fail$data(condition) {
8926 - if (!this.$data)
8927 - return this.fail(condition);
8928 - const { schemaCode } = this;
8929 - this.fail((0, codegen_1._) `${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`);
8930 - }
8931 - error(append, errorParams, errorPaths) {
8932 - if (errorParams) {
8933 - this.setParams(errorParams);
8934 - this._error(append, errorPaths);
8935 - this.setParams({});
8936 - return;
8937 - }
8938 - this._error(append, errorPaths);
8939 - }
8940 - _error(append, errorPaths) {
8941 - ;
8942 - (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths);
8943 - }
8944 - $dataError() {
8945 - (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError);
8946 - }
8947 - reset() {
8948 - if (this.errsCount === undefined)
8949 - throw new Error('add "trackErrors" to keyword definition');
8950 - (0, errors_1.resetErrorsCount)(this.gen, this.errsCount);
8951 - }
8952 - ok(cond) {
8953 - if (!this.allErrors)
8954 - this.gen.if(cond);
8955 - }
8956 - setParams(obj, assign) {
8957 - if (assign)
8958 - Object.assign(this.params, obj);
8959 - else
8960 - this.params = obj;
8961 - }
8962 - block$data(valid, codeBlock, $dataValid = codegen_1.nil) {
8963 - this.gen.block(() => {
8964 - this.check$data(valid, $dataValid);
8965 - codeBlock();
8966 - });
8967 - }
8968 - check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
8969 - if (!this.$data)
8970 - return;
8971 - const { gen, schemaCode, schemaType, def } = this;
8972 - gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid));
8973 - if (valid !== codegen_1.nil)
8974 - gen.assign(valid, true);
8975 - if (schemaType.length || def.validateSchema) {
8976 - gen.elseIf(this.invalid$data());
8977 - this.$dataError();
8978 - if (valid !== codegen_1.nil)
8979 - gen.assign(valid, false);
8980 - }
8981 - gen.else();
8982 - }
8983 - invalid$data() {
8984 - const { gen, schemaCode, schemaType, def, it } = this;
8985 - return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());
8986 - function wrong$DataType() {
8987 - if (schemaType.length) {
8988 - /* istanbul ignore if */
8989 - if (!(schemaCode instanceof codegen_1.Name))
8990 - throw new Error("ajv implementation error");
8991 - const st = Array.isArray(schemaType) ? schemaType : [schemaType];
8992 - return (0, codegen_1._) `${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`;
8993 - }
8994 - return codegen_1.nil;
8995 - }
8996 - function invalid$DataSchema() {
8997 - if (def.validateSchema) {
8998 - const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone
8999 - return (0, codegen_1._) `!${validateSchemaRef}(${schemaCode})`;
9000 - }
9001 - return codegen_1.nil;
9002 - }
9003 - }
9004 - subschema(appl, valid) {
9005 - const subschema = (0, subschema_1.getSubschema)(this.it, appl);
9006 - (0, subschema_1.extendSubschemaData)(subschema, this.it, appl);
9007 - (0, subschema_1.extendSubschemaMode)(subschema, appl);
9008 - const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined };
9009 - subschemaCode(nextContext, valid);
9010 - return nextContext;
9011 - }
9012 - mergeEvaluated(schemaCxt, toName) {
9013 - const { it, gen } = this;
9014 - if (!it.opts.unevaluated)
9015 - return;
9016 - if (it.props !== true && schemaCxt.props !== undefined) {
9017 - it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName);
9018 - }
9019 - if (it.items !== true && schemaCxt.items !== undefined) {
9020 - it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName);
9021 - }
9022 - }
9023 - mergeValidEvaluated(schemaCxt, valid) {
9024 - const { it, gen } = this;
9025 - if (it.opts.unevaluated && (it.props !== true || it.items !== true)) {
9026 - gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name));
9027 - return true;
9028 - }
9029 - }
9030 -}
9031 -exports.KeywordCxt = KeywordCxt;
9032 -function keywordCode(it, keyword, def, ruleType) {
9033 - const cxt = new KeywordCxt(it, def, keyword);
9034 - if ("code" in def) {
9035 - def.code(cxt, ruleType);
9036 - }
9037 - else if (cxt.$data && def.validate) {
9038 - (0, keyword_1.funcKeywordCode)(cxt, def);
9039 - }
9040 - else if ("macro" in def) {
9041 - (0, keyword_1.macroKeywordCode)(cxt, def);
9042 - }
9043 - else if (def.compile || def.validate) {
9044 - (0, keyword_1.funcKeywordCode)(cxt, def);
9045 - }
9046 -}
9047 -const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
9048 -const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
9049 -function getData($data, { dataLevel, dataNames, dataPathArr }) {
9050 - let jsonPointer;
9051 - let data;
9052 - if ($data === "")
9053 - return names_1.default.rootData;
9054 - if ($data[0] === "/") {
9055 - if (!JSON_POINTER.test($data))
9056 - throw new Error(`Invalid JSON-pointer: ${$data}`);
9057 - jsonPointer = $data;
9058 - data = names_1.default.rootData;
9059 - }
9060 - else {
9061 - const matches = RELATIVE_JSON_POINTER.exec($data);
9062 - if (!matches)
9063 - throw new Error(`Invalid JSON-pointer: ${$data}`);
9064 - const up = +matches[1];
9065 - jsonPointer = matches[2];
9066 - if (jsonPointer === "#") {
9067 - if (up >= dataLevel)
9068 - throw new Error(errorMsg("property/index", up));
9069 - return dataPathArr[dataLevel - up];
9070 - }
9071 - if (up > dataLevel)
9072 - throw new Error(errorMsg("data", up));
9073 - data = dataNames[dataLevel - up];
9074 - if (!jsonPointer)
9075 - return data;
9076 - }
9077 - let expr = data;
9078 - const segments = jsonPointer.split("/");
9079 - for (const segment of segments) {
9080 - if (segment) {
9081 - data = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`;
9082 - expr = (0, codegen_1._) `${expr} && ${data}`;
9083 - }
9084 - }
9085 - return expr;
9086 - function errorMsg(pointerType, up) {
9087 - return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`;
9088 - }
9089 -}
9090 -exports.getData = getData;
9091 -//# sourceMappingURL=index.js.map
9092 -
9093 -/***/ }),
9094 -
9095 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js":
9096 -/*!**************************************************************************************************!*\
9097 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js ***!
9098 - \**************************************************************************************************/
9099 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
9100 -
9101 -
9102 -Object.defineProperty(exports, "__esModule", ({ value: true }));
9103 -exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0;
9104 -const codegen_1 = __webpack_require__(/*! ../codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
9105 -const names_1 = __webpack_require__(/*! ../names */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");
9106 -const code_1 = __webpack_require__(/*! ../../vocabularies/code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
9107 -const errors_1 = __webpack_require__(/*! ../errors */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js");
9108 -function macroKeywordCode(cxt, def) {
9109 - const { gen, keyword, schema, parentSchema, it } = cxt;
9110 - const macroSchema = def.macro.call(it.self, schema, parentSchema, it);
9111 - const schemaRef = useKeyword(gen, keyword, macroSchema);
9112 - if (it.opts.validateSchema !== false)
9113 - it.self.validateSchema(macroSchema, true);
9114 - const valid = gen.name("valid");
9115 - cxt.subschema({
9116 - schema: macroSchema,
9117 - schemaPath: codegen_1.nil,
9118 - errSchemaPath: `${it.errSchemaPath}/${keyword}`,
9119 - topSchemaRef: schemaRef,
9120 - compositeRule: true,
9121 - }, valid);
9122 - cxt.pass(valid, () => cxt.error(true));
9123 -}
9124 -exports.macroKeywordCode = macroKeywordCode;
9125 -function funcKeywordCode(cxt, def) {
9126 - var _a;
9127 - const { gen, keyword, schema, parentSchema, $data, it } = cxt;
9128 - checkAsyncKeyword(it, def);
9129 - const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate;
9130 - const validateRef = useKeyword(gen, keyword, validate);
9131 - const valid = gen.let("valid");
9132 - cxt.block$data(valid, validateKeyword);
9133 - cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);
9134 - function validateKeyword() {
9135 - if (def.errors === false) {
9136 - assignValid();
9137 - if (def.modifying)
9138 - modifyData(cxt);
9139 - reportErrs(() => cxt.error());
9140 - }
9141 - else {
9142 - const ruleErrs = def.async ? validateAsync() : validateSync();
9143 - if (def.modifying)
9144 - modifyData(cxt);
9145 - reportErrs(() => addErrs(cxt, ruleErrs));
9146 - }
9147 - }
9148 - function validateAsync() {
9149 - const ruleErrs = gen.let("ruleErrs", null);
9150 - gen.try(() => assignValid((0, codegen_1._) `await `), (e) => gen.assign(valid, false).if((0, codegen_1._) `${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._) `${e}.errors`), () => gen.throw(e)));
9151 - return ruleErrs;
9152 - }
9153 - function validateSync() {
9154 - const validateErrs = (0, codegen_1._) `${validateRef}.errors`;
9155 - gen.assign(validateErrs, null);
9156 - assignValid(codegen_1.nil);
9157 - return validateErrs;
9158 - }
9159 - function assignValid(_await = def.async ? (0, codegen_1._) `await ` : codegen_1.nil) {
9160 - const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self;
9161 - const passSchema = !(("compile" in def && !$data) || def.schema === false);
9162 - gen.assign(valid, (0, codegen_1._) `${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
9163 - }
9164 - function reportErrs(errors) {
9165 - var _a;
9166 - gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors);
9167 - }
9168 -}
9169 -exports.funcKeywordCode = funcKeywordCode;
9170 -function modifyData(cxt) {
9171 - const { gen, data, it } = cxt;
9172 - gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._) `${it.parentData}[${it.parentDataProperty}]`));
9173 -}
9174 -function addErrs(cxt, errs) {
9175 - const { gen } = cxt;
9176 - gen.if((0, codegen_1._) `Array.isArray(${errs})`, () => {
9177 - gen
9178 - .assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`)
9179 - .assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);
9180 - (0, errors_1.extendErrors)(cxt);
9181 - }, () => cxt.error());
9182 -}
9183 -function checkAsyncKeyword({ schemaEnv }, def) {
9184 - if (def.async && !schemaEnv.$async)
9185 - throw new Error("async keyword in sync schema");
9186 -}
9187 -function useKeyword(gen, keyword, result) {
9188 - if (result === undefined)
9189 - throw new Error(`keyword "${keyword}" failed to compile`);
9190 - return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) });
9191 -}
9192 -function validSchemaType(schema, schemaType, allowUndefined = false) {
9193 - // TODO add tests
9194 - return (!schemaType.length ||
9195 - schemaType.some((st) => st === "array"
9196 - ? Array.isArray(schema)
9197 - : st === "object"
9198 - ? schema && typeof schema == "object" && !Array.isArray(schema)
9199 - : typeof schema == st || (allowUndefined && typeof schema == "undefined")));
9200 -}
9201 -exports.validSchemaType = validSchemaType;
9202 -function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) {
9203 - /* istanbul ignore if */
9204 - if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
9205 - throw new Error("ajv implementation error");
9206 - }
9207 - const deps = def.dependencies;
9208 - if (deps === null || deps === void 0 ? void 0 : deps.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {
9209 - throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`);
9210 - }
9211 - if (def.validateSchema) {
9212 - const valid = def.validateSchema(schema[keyword]);
9213 - if (!valid) {
9214 - const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` +
9215 - self.errorsText(def.validateSchema.errors);
9216 - if (opts.validateSchema === "log")
9217 - self.logger.error(msg);
9218 - else
9219 - throw new Error(msg);
9220 - }
9221 - }
9222 -}
9223 -exports.validateKeywordUsage = validateKeywordUsage;
9224 -//# sourceMappingURL=keyword.js.map
9225 -
9226 -/***/ }),
9227 -
9228 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js":
9229 -/*!****************************************************************************************************!*\
9230 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js ***!
9231 - \****************************************************************************************************/
9232 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
9233 -
9234 -
9235 -Object.defineProperty(exports, "__esModule", ({ value: true }));
9236 -exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0;
9237 -const codegen_1 = __webpack_require__(/*! ../codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
9238 -const util_1 = __webpack_require__(/*! ../util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
9239 -function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) {
9240 - if (keyword !== undefined && schema !== undefined) {
9241 - throw new Error('both "keyword" and "schema" passed, only one allowed');
9242 - }
9243 - if (keyword !== undefined) {
9244 - const sch = it.schema[keyword];
9245 - return schemaProp === undefined
9246 - ? {
9247 - schema: sch,
9248 - schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`,
9249 - errSchemaPath: `${it.errSchemaPath}/${keyword}`,
9250 - }
9251 - : {
9252 - schema: sch[schemaProp],
9253 - schemaPath: (0, codegen_1._) `${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`,
9254 - errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}`,
9255 - };
9256 - }
9257 - if (schema !== undefined) {
9258 - if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {
9259 - throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');
9260 - }
9261 - return {
9262 - schema,
9263 - schemaPath,
9264 - topSchemaRef,
9265 - errSchemaPath,
9266 - };
9267 - }
9268 - throw new Error('either "keyword" or "schema" must be passed');
9269 -}
9270 -exports.getSubschema = getSubschema;
9271 -function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) {
9272 - if (data !== undefined && dataProp !== undefined) {
9273 - throw new Error('both "data" and "dataProp" passed, only one allowed');
9274 - }
9275 - const { gen } = it;
9276 - if (dataProp !== undefined) {
9277 - const { errorPath, dataPathArr, opts } = it;
9278 - const nextData = gen.let("data", (0, codegen_1._) `${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true);
9279 - dataContextProps(nextData);
9280 - subschema.errorPath = (0, codegen_1.str) `${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`;
9281 - subschema.parentDataProperty = (0, codegen_1._) `${dataProp}`;
9282 - subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty];
9283 - }
9284 - if (data !== undefined) {
9285 - const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once?
9286 - dataContextProps(nextData);
9287 - if (propertyName !== undefined)
9288 - subschema.propertyName = propertyName;
9289 - // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr
9290 - }
9291 - if (dataTypes)
9292 - subschema.dataTypes = dataTypes;
9293 - function dataContextProps(_nextData) {
9294 - subschema.data = _nextData;
9295 - subschema.dataLevel = it.dataLevel + 1;
9296 - subschema.dataTypes = [];
9297 - it.definedProperties = new Set();
9298 - subschema.parentData = it.data;
9299 - subschema.dataNames = [...it.dataNames, _nextData];
9300 - }
9301 -}
9302 -exports.extendSubschemaData = extendSubschemaData;
9303 -function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) {
9304 - if (compositeRule !== undefined)
9305 - subschema.compositeRule = compositeRule;
9306 - if (createErrors !== undefined)
9307 - subschema.createErrors = createErrors;
9308 - if (allErrors !== undefined)
9309 - subschema.allErrors = allErrors;
9310 - subschema.jtdDiscriminator = jtdDiscriminator; // not inherited
9311 - subschema.jtdMetadata = jtdMetadata; // not inherited
9312 -}
9313 -exports.extendSubschemaMode = extendSubschemaMode;
9314 -//# sourceMappingURL=subschema.js.map
9315 -
9316 -/***/ }),
9317 -
9318 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js":
9319 -/*!******************************************************************************!*\
9320 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js ***!
9321 - \******************************************************************************/
9322 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
9323 -
9324 -
9325 -Object.defineProperty(exports, "__esModule", ({ value: true }));
9326 -exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
9327 -var validate_1 = __webpack_require__(/*! ./compile/validate */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");
9328 -Object.defineProperty(exports, "KeywordCxt", ({ enumerable: true, get: function () { return validate_1.KeywordCxt; } }));
9329 -var codegen_1 = __webpack_require__(/*! ./compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
9330 -Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return codegen_1._; } }));
9331 -Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return codegen_1.str; } }));
9332 -Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return codegen_1.stringify; } }));
9333 -Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return codegen_1.nil; } }));
9334 -Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return codegen_1.Name; } }));
9335 -Object.defineProperty(exports, "CodeGen", ({ enumerable: true, get: function () { return codegen_1.CodeGen; } }));
9336 -const validation_error_1 = __webpack_require__(/*! ./runtime/validation_error */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js");
9337 -const ref_error_1 = __webpack_require__(/*! ./compile/ref_error */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js");
9338 -const rules_1 = __webpack_require__(/*! ./compile/rules */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js");
9339 -const compile_1 = __webpack_require__(/*! ./compile */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js");
9340 -const codegen_2 = __webpack_require__(/*! ./compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
9341 -const resolve_1 = __webpack_require__(/*! ./compile/resolve */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js");
9342 -const dataType_1 = __webpack_require__(/*! ./compile/validate/dataType */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js");
9343 -const util_1 = __webpack_require__(/*! ./compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
9344 -const $dataRefSchema = __webpack_require__(/*! ./refs/data.json */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json");
9345 -const uri_1 = __webpack_require__(/*! ./runtime/uri */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js");
9346 -const defaultRegExp = (str, flags) => new RegExp(str, flags);
9347 -defaultRegExp.code = "new RegExp";
9348 -const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"];
9349 -const EXT_SCOPE_NAMES = new Set([
9350 - "validate",
9351 - "serialize",
9352 - "parse",
9353 - "wrapper",
9354 - "root",
9355 - "schema",
9356 - "keyword",
9357 - "pattern",
9358 - "formats",
9359 - "validate$data",
9360 - "func",
9361 - "obj",
9362 - "Error",
9363 -]);
9364 -const removedOptions = {
9365 - errorDataPath: "",
9366 - format: "`validateFormats: false` can be used instead.",
9367 - nullable: '"nullable" keyword is supported by default.',
9368 - jsonPointers: "Deprecated jsPropertySyntax can be used instead.",
9369 - extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.",
9370 - missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.",
9371 - processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`",
9372 - sourceCode: "Use option `code: {source: true}`",
9373 - strictDefaults: "It is default now, see option `strict`.",
9374 - strictKeywords: "It is default now, see option `strict`.",
9375 - uniqueItems: '"uniqueItems" keyword is always validated.',
9376 - unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",
9377 - cache: "Map is used as cache, schema object as key.",
9378 - serialize: "Map is used as cache, schema object as key.",
9379 - ajvErrors: "It is default now.",
9380 -};
9381 -const deprecatedOptions = {
9382 - ignoreKeywordsWithRef: "",
9383 - jsPropertySyntax: "",
9384 - unicode: '"minLength"/"maxLength" account for unicode characters by default.',
9385 -};
9386 -const MAX_EXPRESSION = 200;
9387 -// eslint-disable-next-line complexity
9388 -function requiredOptions(o) {
9389 - var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
9390 - const s = o.strict;
9391 - const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
9392 - const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0;
9393 - const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
9394 - const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
9395 - return {
9396 - strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true,
9397 - strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true,
9398 - strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log",
9399 - strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log",
9400 - strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false,
9401 - code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp },
9402 - loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
9403 - loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION,
9404 - meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true,
9405 - messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true,
9406 - inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true,
9407 - schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id",
9408 - addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true,
9409 - validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true,
9410 - validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true,
9411 - unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true,
9412 - int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true,
9413 - uriResolver: uriResolver,
9414 - };
9415 -}
9416 -class Ajv {
9417 - constructor(opts = {}) {
9418 - this.schemas = {};
9419 - this.refs = {};
9420 - this.formats = {};
9421 - this._compilations = new Set();
9422 - this._loading = {};
9423 - this._cache = new Map();
9424 - opts = this.opts = { ...opts, ...requiredOptions(opts) };
9425 - const { es5, lines } = this.opts.code;
9426 - this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines });
9427 - this.logger = getLogger(opts.logger);
9428 - const formatOpt = opts.validateFormats;
9429 - opts.validateFormats = false;
9430 - this.RULES = (0, rules_1.getRules)();
9431 - checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED");
9432 - checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn");
9433 - this._metaOpts = getMetaSchemaOptions.call(this);
9434 - if (opts.formats)
9435 - addInitialFormats.call(this);
9436 - this._addVocabularies();
9437 - this._addDefaultMetaSchema();
9438 - if (opts.keywords)
9439 - addInitialKeywords.call(this, opts.keywords);
9440 - if (typeof opts.meta == "object")
9441 - this.addMetaSchema(opts.meta);
9442 - addInitialSchemas.call(this);
9443 - opts.validateFormats = formatOpt;
9444 - }
9445 - _addVocabularies() {
9446 - this.addKeyword("$async");
9447 - }
9448 - _addDefaultMetaSchema() {
9449 - const { $data, meta, schemaId } = this.opts;
9450 - let _dataRefSchema = $dataRefSchema;
9451 - if (schemaId === "id") {
9452 - _dataRefSchema = { ...$dataRefSchema };
9453 - _dataRefSchema.id = _dataRefSchema.$id;
9454 - delete _dataRefSchema.$id;
9455 - }
9456 - if (meta && $data)
9457 - this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false);
9458 - }
9459 - defaultMeta() {
9460 - const { meta, schemaId } = this.opts;
9461 - return (this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined);
9462 - }
9463 - validate(schemaKeyRef, // key, ref or schema object
9464 - // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
9465 - data // to be validated
9466 - ) {
9467 - let v;
9468 - if (typeof schemaKeyRef == "string") {
9469 - v = this.getSchema(schemaKeyRef);
9470 - if (!v)
9471 - throw new Error(`no schema with key or ref "${schemaKeyRef}"`);
9472 - }
9473 - else {
9474 - v = this.compile(schemaKeyRef);
9475 - }
9476 - const valid = v(data);
9477 - if (!("$async" in v))
9478 - this.errors = v.errors;
9479 - return valid;
9480 - }
9481 - compile(schema, _meta) {
9482 - const sch = this._addSchema(schema, _meta);
9483 - return (sch.validate || this._compileSchemaEnv(sch));
9484 - }
9485 - compileAsync(schema, meta) {
9486 - if (typeof this.opts.loadSchema != "function") {
9487 - throw new Error("options.loadSchema should be a function");
9488 - }
9489 - const { loadSchema } = this.opts;
9490 - return runCompileAsync.call(this, schema, meta);
9491 - async function runCompileAsync(_schema, _meta) {
9492 - await loadMetaSchema.call(this, _schema.$schema);
9493 - const sch = this._addSchema(_schema, _meta);
9494 - return sch.validate || _compileAsync.call(this, sch);
9495 - }
9496 - async function loadMetaSchema($ref) {
9497 - if ($ref && !this.getSchema($ref)) {
9498 - await runCompileAsync.call(this, { $ref }, true);
9499 - }
9500 - }
9501 - async function _compileAsync(sch) {
9502 - try {
9503 - return this._compileSchemaEnv(sch);
9504 - }
9505 - catch (e) {
9506 - if (!(e instanceof ref_error_1.default))
9507 - throw e;
9508 - checkLoaded.call(this, e);
9509 - await loadMissingSchema.call(this, e.missingSchema);
9510 - return _compileAsync.call(this, sch);
9511 - }
9512 - }
9513 - function checkLoaded({ missingSchema: ref, missingRef }) {
9514 - if (this.refs[ref]) {
9515 - throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`);
9516 - }
9517 - }
9518 - async function loadMissingSchema(ref) {
9519 - const _schema = await _loadSchema.call(this, ref);
9520 - if (!this.refs[ref])
9521 - await loadMetaSchema.call(this, _schema.$schema);
9522 - if (!this.refs[ref])
9523 - this.addSchema(_schema, ref, meta);
9524 - }
9525 - async function _loadSchema(ref) {
9526 - const p = this._loading[ref];
9527 - if (p)
9528 - return p;
9529 - try {
9530 - return await (this._loading[ref] = loadSchema(ref));
9531 - }
9532 - finally {
9533 - delete this._loading[ref];
9534 - }
9535 - }
9536 - }
9537 - // Adds schema to the instance
9538 - addSchema(schema, // If array is passed, `key` will be ignored
9539 - key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
9540 - _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
9541 - _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead.
9542 - ) {
9543 - if (Array.isArray(schema)) {
9544 - for (const sch of schema)
9545 - this.addSchema(sch, undefined, _meta, _validateSchema);
9546 - return this;
9547 - }
9548 - let id;
9549 - if (typeof schema === "object") {
9550 - const { schemaId } = this.opts;
9551 - id = schema[schemaId];
9552 - if (id !== undefined && typeof id != "string") {
9553 - throw new Error(`schema ${schemaId} must be string`);
9554 - }
9555 - }
9556 - key = (0, resolve_1.normalizeId)(key || id);
9557 - this._checkUnique(key);
9558 - this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true);
9559 - return this;
9560 - }
9561 - // Add schema that will be used to validate other schemas
9562 - // options in META_IGNORE_OPTIONS are alway set to false
9563 - addMetaSchema(schema, key, // schema key
9564 - _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema
9565 - ) {
9566 - this.addSchema(schema, key, true, _validateSchema);
9567 - return this;
9568 - }
9569 - // Validate schema against its meta-schema
9570 - validateSchema(schema, throwOrLogError) {
9571 - if (typeof schema == "boolean")
9572 - return true;
9573 - let $schema;
9574 - $schema = schema.$schema;
9575 - if ($schema !== undefined && typeof $schema != "string") {
9576 - throw new Error("$schema must be a string");
9577 - }
9578 - $schema = $schema || this.opts.defaultMeta || this.defaultMeta();
9579 - if (!$schema) {
9580 - this.logger.warn("meta-schema not available");
9581 - this.errors = null;
9582 - return true;
9583 - }
9584 - const valid = this.validate($schema, schema);
9585 - if (!valid && throwOrLogError) {
9586 - const message = "schema is invalid: " + this.errorsText();
9587 - if (this.opts.validateSchema === "log")
9588 - this.logger.error(message);
9589 - else
9590 - throw new Error(message);
9591 - }
9592 - return valid;
9593 - }
9594 - // Get compiled schema by `key` or `ref`.
9595 - // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id)
9596 - getSchema(keyRef) {
9597 - let sch;
9598 - while (typeof (sch = getSchEnv.call(this, keyRef)) == "string")
9599 - keyRef = sch;
9600 - if (sch === undefined) {
9601 - const { schemaId } = this.opts;
9602 - const root = new compile_1.SchemaEnv({ schema: {}, schemaId });
9603 - sch = compile_1.resolveSchema.call(this, root, keyRef);
9604 - if (!sch)
9605 - return;
9606 - this.refs[keyRef] = sch;
9607 - }
9608 - return (sch.validate || this._compileSchemaEnv(sch));
9609 - }
9610 - // Remove cached schema(s).
9611 - // If no parameter is passed all schemas but meta-schemas are removed.
9612 - // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
9613 - // Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
9614 - removeSchema(schemaKeyRef) {
9615 - if (schemaKeyRef instanceof RegExp) {
9616 - this._removeAllSchemas(this.schemas, schemaKeyRef);
9617 - this._removeAllSchemas(this.refs, schemaKeyRef);
9618 - return this;
9619 - }
9620 - switch (typeof schemaKeyRef) {
9621 - case "undefined":
9622 - this._removeAllSchemas(this.schemas);
9623 - this._removeAllSchemas(this.refs);
9624 - this._cache.clear();
9625 - return this;
9626 - case "string": {
9627 - const sch = getSchEnv.call(this, schemaKeyRef);
9628 - if (typeof sch == "object")
9629 - this._cache.delete(sch.schema);
9630 - delete this.schemas[schemaKeyRef];
9631 - delete this.refs[schemaKeyRef];
9632 - return this;
9633 - }
9634 - case "object": {
9635 - const cacheKey = schemaKeyRef;
9636 - this._cache.delete(cacheKey);
9637 - let id = schemaKeyRef[this.opts.schemaId];
9638 - if (id) {
9639 - id = (0, resolve_1.normalizeId)(id);
9640 - delete this.schemas[id];
9641 - delete this.refs[id];
9642 - }
9643 - return this;
9644 - }
9645 - default:
9646 - throw new Error("ajv.removeSchema: invalid parameter");
9647 - }
9648 - }
9649 - // add "vocabulary" - a collection of keywords
9650 - addVocabulary(definitions) {
9651 - for (const def of definitions)
9652 - this.addKeyword(def);
9653 - return this;
9654 - }
9655 - addKeyword(kwdOrDef, def // deprecated
9656 - ) {
9657 - let keyword;
9658 - if (typeof kwdOrDef == "string") {
9659 - keyword = kwdOrDef;
9660 - if (typeof def == "object") {
9661 - this.logger.warn("these parameters are deprecated, see docs for addKeyword");
9662 - def.keyword = keyword;
9663 - }
9664 - }
9665 - else if (typeof kwdOrDef == "object" && def === undefined) {
9666 - def = kwdOrDef;
9667 - keyword = def.keyword;
9668 - if (Array.isArray(keyword) && !keyword.length) {
9669 - throw new Error("addKeywords: keyword must be string or non-empty array");
9670 - }
9671 - }
9672 - else {
9673 - throw new Error("invalid addKeywords parameters");
9674 - }
9675 - checkKeyword.call(this, keyword, def);
9676 - if (!def) {
9677 - (0, util_1.eachItem)(keyword, (kwd) => addRule.call(this, kwd));
9678 - return this;
9679 - }
9680 - keywordMetaschema.call(this, def);
9681 - const definition = {
9682 - ...def,
9683 - type: (0, dataType_1.getJSONTypes)(def.type),
9684 - schemaType: (0, dataType_1.getJSONTypes)(def.schemaType),
9685 - };
9686 - (0, util_1.eachItem)(keyword, definition.type.length === 0
9687 - ? (k) => addRule.call(this, k, definition)
9688 - : (k) => definition.type.forEach((t) => addRule.call(this, k, definition, t)));
9689 - return this;
9690 - }
9691 - getKeyword(keyword) {
9692 - const rule = this.RULES.all[keyword];
9693 - return typeof rule == "object" ? rule.definition : !!rule;
9694 - }
9695 - // Remove keyword
9696 - removeKeyword(keyword) {
9697 - // TODO return type should be Ajv
9698 - const { RULES } = this;
9699 - delete RULES.keywords[keyword];
9700 - delete RULES.all[keyword];
9701 - for (const group of RULES.rules) {
9702 - const i = group.rules.findIndex((rule) => rule.keyword === keyword);
9703 - if (i >= 0)
9704 - group.rules.splice(i, 1);
9705 - }
9706 - return this;
9707 - }
9708 - // Add format
9709 - addFormat(name, format) {
9710 - if (typeof format == "string")
9711 - format = new RegExp(format);
9712 - this.formats[name] = format;
9713 - return this;
9714 - }
9715 - errorsText(errors = this.errors, // optional array of validation errors
9716 - { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar`
9717 - ) {
9718 - if (!errors || errors.length === 0)
9719 - return "No errors";
9720 - return errors
9721 - .map((e) => `${dataVar}${e.instancePath} ${e.message}`)
9722 - .reduce((text, msg) => text + separator + msg);
9723 - }
9724 - $dataMetaSchema(metaSchema, keywordsJsonPointers) {
9725 - const rules = this.RULES.all;
9726 - metaSchema = JSON.parse(JSON.stringify(metaSchema));
9727 - for (const jsonPointer of keywordsJsonPointers) {
9728 - const segments = jsonPointer.split("/").slice(1); // first segment is an empty string
9729 - let keywords = metaSchema;
9730 - for (const seg of segments)
9731 - keywords = keywords[seg];
9732 - for (const key in rules) {
9733 - const rule = rules[key];
9734 - if (typeof rule != "object")
9735 - continue;
9736 - const { $data } = rule.definition;
9737 - const schema = keywords[key];
9738 - if ($data && schema)
9739 - keywords[key] = schemaOrData(schema);
9740 - }
9741 - }
9742 - return metaSchema;
9743 - }
9744 - _removeAllSchemas(schemas, regex) {
9745 - for (const keyRef in schemas) {
9746 - const sch = schemas[keyRef];
9747 - if (!regex || regex.test(keyRef)) {
9748 - if (typeof sch == "string") {
9749 - delete schemas[keyRef];
9750 - }
9751 - else if (sch && !sch.meta) {
9752 - this._cache.delete(sch.schema);
9753 - delete schemas[keyRef];
9754 - }
9755 - }
9756 - }
9757 - }
9758 - _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) {
9759 - let id;
9760 - const { schemaId } = this.opts;
9761 - if (typeof schema == "object") {
9762 - id = schema[schemaId];
9763 - }
9764 - else {
9765 - if (this.opts.jtd)
9766 - throw new Error("schema must be object");
9767 - else if (typeof schema != "boolean")
9768 - throw new Error("schema must be object or boolean");
9769 - }
9770 - let sch = this._cache.get(schema);
9771 - if (sch !== undefined)
9772 - return sch;
9773 - baseId = (0, resolve_1.normalizeId)(id || baseId);
9774 - const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId);
9775 - sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs });
9776 - this._cache.set(sch.schema, sch);
9777 - if (addSchema && !baseId.startsWith("#")) {
9778 - // TODO atm it is allowed to overwrite schemas without id (instead of not adding them)
9779 - if (baseId)
9780 - this._checkUnique(baseId);
9781 - this.refs[baseId] = sch;
9782 - }
9783 - if (validateSchema)
9784 - this.validateSchema(schema, true);
9785 - return sch;
9786 - }
9787 - _checkUnique(id) {
9788 - if (this.schemas[id] || this.refs[id]) {
9789 - throw new Error(`schema with key or id "${id}" already exists`);
9790 - }
9791 - }
9792 - _compileSchemaEnv(sch) {
9793 - if (sch.meta)
9794 - this._compileMetaSchema(sch);
9795 - else
9796 - compile_1.compileSchema.call(this, sch);
9797 - /* istanbul ignore if */
9798 - if (!sch.validate)
9799 - throw new Error("ajv implementation error");
9800 - return sch.validate;
9801 - }
9802 - _compileMetaSchema(sch) {
9803 - const currentOpts = this.opts;
9804 - this.opts = this._metaOpts;
9805 - try {
9806 - compile_1.compileSchema.call(this, sch);
9807 - }
9808 - finally {
9809 - this.opts = currentOpts;
9810 - }
9811 - }
9812 -}
9813 -Ajv.ValidationError = validation_error_1.default;
9814 -Ajv.MissingRefError = ref_error_1.default;
9815 -exports["default"] = Ajv;
9816 -function checkOptions(checkOpts, options, msg, log = "error") {
9817 - for (const key in checkOpts) {
9818 - const opt = key;
9819 - if (opt in options)
9820 - this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`);
9821 - }
9822 -}
9823 -function getSchEnv(keyRef) {
9824 - keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line
9825 - return this.schemas[keyRef] || this.refs[keyRef];
9826 -}
9827 -function addInitialSchemas() {
9828 - const optsSchemas = this.opts.schemas;
9829 - if (!optsSchemas)
9830 - return;
9831 - if (Array.isArray(optsSchemas))
9832 - this.addSchema(optsSchemas);
9833 - else
9834 - for (const key in optsSchemas)
9835 - this.addSchema(optsSchemas[key], key);
9836 -}
9837 -function addInitialFormats() {
9838 - for (const name in this.opts.formats) {
9839 - const format = this.opts.formats[name];
9840 - if (format)
9841 - this.addFormat(name, format);
9842 - }
9843 -}
9844 -function addInitialKeywords(defs) {
9845 - if (Array.isArray(defs)) {
9846 - this.addVocabulary(defs);
9847 - return;
9848 - }
9849 - this.logger.warn("keywords option as map is deprecated, pass array");
9850 - for (const keyword in defs) {
9851 - const def = defs[keyword];
9852 - if (!def.keyword)
9853 - def.keyword = keyword;
9854 - this.addKeyword(def);
9855 - }
9856 -}
9857 -function getMetaSchemaOptions() {
9858 - const metaOpts = { ...this.opts };
9859 - for (const opt of META_IGNORE_OPTIONS)
9860 - delete metaOpts[opt];
9861 - return metaOpts;
9862 -}
9863 -const noLogs = { log() { }, warn() { }, error() { } };
9864 -function getLogger(logger) {
9865 - if (logger === false)
9866 - return noLogs;
9867 - if (logger === undefined)
9868 - return console;
9869 - if (logger.log && logger.warn && logger.error)
9870 - return logger;
9871 - throw new Error("logger must implement log, warn and error methods");
9872 -}
9873 -const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i;
9874 -function checkKeyword(keyword, def) {
9875 - const { RULES } = this;
9876 - (0, util_1.eachItem)(keyword, (kwd) => {
9877 - if (RULES.keywords[kwd])
9878 - throw new Error(`Keyword ${kwd} is already defined`);
9879 - if (!KEYWORD_NAME.test(kwd))
9880 - throw new Error(`Keyword ${kwd} has invalid name`);
9881 - });
9882 - if (!def)
9883 - return;
9884 - if (def.$data && !("code" in def || "validate" in def)) {
9885 - throw new Error('$data keyword must have "code" or "validate" function');
9886 - }
9887 -}
9888 -function addRule(keyword, definition, dataType) {
9889 - var _a;
9890 - const post = definition === null || definition === void 0 ? void 0 : definition.post;
9891 - if (dataType && post)
9892 - throw new Error('keyword with "post" flag cannot have "type"');
9893 - const { RULES } = this;
9894 - let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType);
9895 - if (!ruleGroup) {
9896 - ruleGroup = { type: dataType, rules: [] };
9897 - RULES.rules.push(ruleGroup);
9898 - }
9899 - RULES.keywords[keyword] = true;
9900 - if (!definition)
9901 - return;
9902 - const rule = {
9903 - keyword,
9904 - definition: {
9905 - ...definition,
9906 - type: (0, dataType_1.getJSONTypes)(definition.type),
9907 - schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType),
9908 - },
9909 - };
9910 - if (definition.before)
9911 - addBeforeRule.call(this, ruleGroup, rule, definition.before);
9912 - else
9913 - ruleGroup.rules.push(rule);
9914 - RULES.all[keyword] = rule;
9915 - (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
9916 -}
9917 -function addBeforeRule(ruleGroup, rule, before) {
9918 - const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
9919 - if (i >= 0) {
9920 - ruleGroup.rules.splice(i, 0, rule);
9921 - }
9922 - else {
9923 - ruleGroup.rules.push(rule);
9924 - this.logger.warn(`rule ${before} is not defined`);
9925 - }
9926 -}
9927 -function keywordMetaschema(def) {
9928 - let { metaSchema } = def;
9929 - if (metaSchema === undefined)
9930 - return;
9931 - if (def.$data && this.opts.$data)
9932 - metaSchema = schemaOrData(metaSchema);
9933 - def.validateSchema = this.compile(metaSchema, true);
9934 -}
9935 -const $dataRef = {
9936 - $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
9937 -};
9938 -function schemaOrData(schema) {
9939 - return { anyOf: [schema, $dataRef] };
9940 -}
9941 -//# sourceMappingURL=core.js.map
9942 -
9943 -/***/ }),
9944 -
9945 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json":
9946 -/*!*************************************************************************************!*\
9947 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json ***!
9948 - \*************************************************************************************/
9949 -/***/ (function(module) {
9950 -
9951 -module.exports = /*#__PURE__*/JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}');
9952 -
9953 -/***/ }),
9954 -
9955 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json":
9956 -/*!*****************************************************************************************************!*\
9957 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json ***!
9958 - \*****************************************************************************************************/
9959 -/***/ (function(module) {
9960 -
9961 -module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}');
9962 -
9963 -/***/ }),
9964 -
9965 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js":
9966 -/*!***************************************************************************************!*\
9967 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js ***!
9968 - \***************************************************************************************/
9969 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
9970 -
9971 -
9972 -Object.defineProperty(exports, "__esModule", ({ value: true }));
9973 -// https://github.com/ajv-validator/ajv/issues/889
9974 -const equal = __webpack_require__(/*! fast-deep-equal */ "./node_modules/fast-deep-equal/index.js");
9975 -equal.code = 'require("ajv/dist/runtime/equal").default';
9976 -exports["default"] = equal;
9977 -//# sourceMappingURL=equal.js.map
9978 -
9979 -/***/ }),
9980 -
9981 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js":
9982 -/*!********************************************************************************************!*\
9983 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js ***!
9984 - \********************************************************************************************/
9985 -/***/ (function(__unused_webpack_module, exports) {
9986 -
9987 -
9988 -Object.defineProperty(exports, "__esModule", ({ value: true }));
9989 -// https://mathiasbynens.be/notes/javascript-encoding
9990 -// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
9991 -function ucs2length(str) {
9992 - const len = str.length;
9993 - let length = 0;
9994 - let pos = 0;
9995 - let value;
9996 - while (pos < len) {
9997 - length++;
9998 - value = str.charCodeAt(pos++);
9999 - if (value >= 0xd800 && value <= 0xdbff && pos < len) {
10000 - // high surrogate, and there is a next character
10001 - value = str.charCodeAt(pos);
10002 - if ((value & 0xfc00) === 0xdc00)
10003 - pos++; // low surrogate
10004 - }
10005 - }
10006 - return length;
10007 -}
10008 -exports["default"] = ucs2length;
10009 -ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
10010 -//# sourceMappingURL=ucs2length.js.map
10011 -
10012 -/***/ }),
10013 -
10014 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js":
10015 -/*!*************************************************************************************!*\
10016 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js ***!
10017 - \*************************************************************************************/
10018 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10019 -
10020 -
10021 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10022 -const uri = __webpack_require__(/*! fast-uri */ "./node_modules/fast-uri/index.js");
10023 -uri.code = 'require("ajv/dist/runtime/uri").default';
10024 -exports["default"] = uri;
10025 -//# sourceMappingURL=uri.js.map
10026 -
10027 -/***/ }),
10028 -
10029 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js":
10030 -/*!**************************************************************************************************!*\
10031 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js ***!
10032 - \**************************************************************************************************/
10033 -/***/ (function(__unused_webpack_module, exports) {
10034 -
10035 -
10036 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10037 -class ValidationError extends Error {
10038 - constructor(errors) {
10039 - super("validation failed");
10040 - this.errors = errors;
10041 - this.ajv = this.validation = true;
10042 - }
10043 -}
10044 -exports["default"] = ValidationError;
10045 -//# sourceMappingURL=validation_error.js.map
10046 -
10047 -/***/ }),
10048 -
10049 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js":
10050 -/*!*****************************************************************************************************************!*\
10051 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js ***!
10052 - \*****************************************************************************************************************/
10053 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10054 -
10055 -
10056 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10057 -exports.validateAdditionalItems = void 0;
10058 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10059 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10060 -const error = {
10061 - message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
10062 - params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
10063 -};
10064 -const def = {
10065 - keyword: "additionalItems",
10066 - type: "array",
10067 - schemaType: ["boolean", "object"],
10068 - before: "uniqueItems",
10069 - error,
10070 - code(cxt) {
10071 - const { parentSchema, it } = cxt;
10072 - const { items } = parentSchema;
10073 - if (!Array.isArray(items)) {
10074 - (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas');
10075 - return;
10076 - }
10077 - validateAdditionalItems(cxt, items);
10078 - },
10079 -};
10080 -function validateAdditionalItems(cxt, items) {
10081 - const { gen, schema, data, keyword, it } = cxt;
10082 - it.items = true;
10083 - const len = gen.const("len", (0, codegen_1._) `${data}.length`);
10084 - if (schema === false) {
10085 - cxt.setParams({ len: items.length });
10086 - cxt.pass((0, codegen_1._) `${len} <= ${items.length}`);
10087 - }
10088 - else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
10089 - const valid = gen.var("valid", (0, codegen_1._) `${len} <= ${items.length}`); // TODO var
10090 - gen.if((0, codegen_1.not)(valid), () => validateItems(valid));
10091 - cxt.ok(valid);
10092 - }
10093 - function validateItems(valid) {
10094 - gen.forRange("i", items.length, len, (i) => {
10095 - cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid);
10096 - if (!it.allErrors)
10097 - gen.if((0, codegen_1.not)(valid), () => gen.break());
10098 - });
10099 - }
10100 -}
10101 -exports.validateAdditionalItems = validateAdditionalItems;
10102 -exports["default"] = def;
10103 -//# sourceMappingURL=additionalItems.js.map
10104 -
10105 -/***/ }),
10106 -
10107 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js":
10108 -/*!**********************************************************************************************************************!*\
10109 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js ***!
10110 - \**********************************************************************************************************************/
10111 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10112 -
10113 -
10114 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10115 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
10116 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10117 -const names_1 = __webpack_require__(/*! ../../compile/names */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");
10118 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10119 -const error = {
10120 - message: "must NOT have additional properties",
10121 - params: ({ params }) => (0, codegen_1._) `{additionalProperty: ${params.additionalProperty}}`,
10122 -};
10123 -const def = {
10124 - keyword: "additionalProperties",
10125 - type: ["object"],
10126 - schemaType: ["boolean", "object"],
10127 - allowUndefined: true,
10128 - trackErrors: true,
10129 - error,
10130 - code(cxt) {
10131 - const { gen, schema, parentSchema, data, errsCount, it } = cxt;
10132 - /* istanbul ignore if */
10133 - if (!errsCount)
10134 - throw new Error("ajv implementation error");
10135 - const { allErrors, opts } = it;
10136 - it.props = true;
10137 - if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema))
10138 - return;
10139 - const props = (0, code_1.allSchemaProperties)(parentSchema.properties);
10140 - const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties);
10141 - checkAdditionalProperties();
10142 - cxt.ok((0, codegen_1._) `${errsCount} === ${names_1.default.errors}`);
10143 - function checkAdditionalProperties() {
10144 - gen.forIn("key", data, (key) => {
10145 - if (!props.length && !patProps.length)
10146 - additionalPropertyCode(key);
10147 - else
10148 - gen.if(isAdditional(key), () => additionalPropertyCode(key));
10149 - });
10150 - }
10151 - function isAdditional(key) {
10152 - let definedProp;
10153 - if (props.length > 8) {
10154 - // TODO maybe an option instead of hard-coded 8?
10155 - const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties");
10156 - definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key);
10157 - }
10158 - else if (props.length) {
10159 - definedProp = (0, codegen_1.or)(...props.map((p) => (0, codegen_1._) `${key} === ${p}`));
10160 - }
10161 - else {
10162 - definedProp = codegen_1.nil;
10163 - }
10164 - if (patProps.length) {
10165 - definedProp = (0, codegen_1.or)(definedProp, ...patProps.map((p) => (0, codegen_1._) `${(0, code_1.usePattern)(cxt, p)}.test(${key})`));
10166 - }
10167 - return (0, codegen_1.not)(definedProp);
10168 - }
10169 - function deleteAdditional(key) {
10170 - gen.code((0, codegen_1._) `delete ${data}[${key}]`);
10171 - }
10172 - function additionalPropertyCode(key) {
10173 - if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) {
10174 - deleteAdditional(key);
10175 - return;
10176 - }
10177 - if (schema === false) {
10178 - cxt.setParams({ additionalProperty: key });
10179 - cxt.error();
10180 - if (!allErrors)
10181 - gen.break();
10182 - return;
10183 - }
10184 - if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) {
10185 - const valid = gen.name("valid");
10186 - if (opts.removeAdditional === "failing") {
10187 - applyAdditionalSchema(key, valid, false);
10188 - gen.if((0, codegen_1.not)(valid), () => {
10189 - cxt.reset();
10190 - deleteAdditional(key);
10191 - });
10192 - }
10193 - else {
10194 - applyAdditionalSchema(key, valid);
10195 - if (!allErrors)
10196 - gen.if((0, codegen_1.not)(valid), () => gen.break());
10197 - }
10198 - }
10199 - }
10200 - function applyAdditionalSchema(key, valid, errors) {
10201 - const subschema = {
10202 - keyword: "additionalProperties",
10203 - dataProp: key,
10204 - dataPropType: util_1.Type.Str,
10205 - };
10206 - if (errors === false) {
10207 - Object.assign(subschema, {
10208 - compositeRule: true,
10209 - createErrors: false,
10210 - allErrors: false,
10211 - });
10212 - }
10213 - cxt.subschema(subschema, valid);
10214 - }
10215 - },
10216 -};
10217 -exports["default"] = def;
10218 -//# sourceMappingURL=additionalProperties.js.map
10219 -
10220 -/***/ }),
10221 -
10222 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js":
10223 -/*!*******************************************************************************************************!*\
10224 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js ***!
10225 - \*******************************************************************************************************/
10226 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10227 -
10228 -
10229 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10230 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10231 -const def = {
10232 - keyword: "allOf",
10233 - schemaType: "array",
10234 - code(cxt) {
10235 - const { gen, schema, it } = cxt;
10236 - /* istanbul ignore if */
10237 - if (!Array.isArray(schema))
10238 - throw new Error("ajv implementation error");
10239 - const valid = gen.name("valid");
10240 - schema.forEach((sch, i) => {
10241 - if ((0, util_1.alwaysValidSchema)(it, sch))
10242 - return;
10243 - const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
10244 - cxt.ok(valid);
10245 - cxt.mergeEvaluated(schCxt);
10246 - });
10247 - },
10248 -};
10249 -exports["default"] = def;
10250 -//# sourceMappingURL=allOf.js.map
10251 -
10252 -/***/ }),
10253 -
10254 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js":
10255 -/*!*******************************************************************************************************!*\
10256 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js ***!
10257 - \*******************************************************************************************************/
10258 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10259 -
10260 -
10261 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10262 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
10263 -const def = {
10264 - keyword: "anyOf",
10265 - schemaType: "array",
10266 - trackErrors: true,
10267 - code: code_1.validateUnion,
10268 - error: { message: "must match a schema in anyOf" },
10269 -};
10270 -exports["default"] = def;
10271 -//# sourceMappingURL=anyOf.js.map
10272 -
10273 -/***/ }),
10274 -
10275 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js":
10276 -/*!**********************************************************************************************************!*\
10277 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js ***!
10278 - \**********************************************************************************************************/
10279 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10280 -
10281 -
10282 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10283 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10284 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10285 -const error = {
10286 - message: ({ params: { min, max } }) => max === undefined
10287 - ? (0, codegen_1.str) `must contain at least ${min} valid item(s)`
10288 - : (0, codegen_1.str) `must contain at least ${min} and no more than ${max} valid item(s)`,
10289 - params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._) `{minContains: ${min}}` : (0, codegen_1._) `{minContains: ${min}, maxContains: ${max}}`,
10290 -};
10291 -const def = {
10292 - keyword: "contains",
10293 - type: "array",
10294 - schemaType: ["object", "boolean"],
10295 - before: "uniqueItems",
10296 - trackErrors: true,
10297 - error,
10298 - code(cxt) {
10299 - const { gen, schema, parentSchema, data, it } = cxt;
10300 - let min;
10301 - let max;
10302 - const { minContains, maxContains } = parentSchema;
10303 - if (it.opts.next) {
10304 - min = minContains === undefined ? 1 : minContains;
10305 - max = maxContains;
10306 - }
10307 - else {
10308 - min = 1;
10309 - }
10310 - const len = gen.const("len", (0, codegen_1._) `${data}.length`);
10311 - cxt.setParams({ min, max });
10312 - if (max === undefined && min === 0) {
10313 - (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`);
10314 - return;
10315 - }
10316 - if (max !== undefined && min > max) {
10317 - (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`);
10318 - cxt.fail();
10319 - return;
10320 - }
10321 - if ((0, util_1.alwaysValidSchema)(it, schema)) {
10322 - let cond = (0, codegen_1._) `${len} >= ${min}`;
10323 - if (max !== undefined)
10324 - cond = (0, codegen_1._) `${cond} && ${len} <= ${max}`;
10325 - cxt.pass(cond);
10326 - return;
10327 - }
10328 - it.items = true;
10329 - const valid = gen.name("valid");
10330 - if (max === undefined && min === 1) {
10331 - validateItems(valid, () => gen.if(valid, () => gen.break()));
10332 - }
10333 - else if (min === 0) {
10334 - gen.let(valid, true);
10335 - if (max !== undefined)
10336 - gen.if((0, codegen_1._) `${data}.length > 0`, validateItemsWithCount);
10337 - }
10338 - else {
10339 - gen.let(valid, false);
10340 - validateItemsWithCount();
10341 - }
10342 - cxt.result(valid, () => cxt.reset());
10343 - function validateItemsWithCount() {
10344 - const schValid = gen.name("_valid");
10345 - const count = gen.let("count", 0);
10346 - validateItems(schValid, () => gen.if(schValid, () => checkLimits(count)));
10347 - }
10348 - function validateItems(_valid, block) {
10349 - gen.forRange("i", 0, len, (i) => {
10350 - cxt.subschema({
10351 - keyword: "contains",
10352 - dataProp: i,
10353 - dataPropType: util_1.Type.Num,
10354 - compositeRule: true,
10355 - }, _valid);
10356 - block();
10357 - });
10358 - }
10359 - function checkLimits(count) {
10360 - gen.code((0, codegen_1._) `${count}++`);
10361 - if (max === undefined) {
10362 - gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true).break());
10363 - }
10364 - else {
10365 - gen.if((0, codegen_1._) `${count} > ${max}`, () => gen.assign(valid, false).break());
10366 - if (min === 1)
10367 - gen.assign(valid, true);
10368 - else
10369 - gen.if((0, codegen_1._) `${count} >= ${min}`, () => gen.assign(valid, true));
10370 - }
10371 - }
10372 - },
10373 -};
10374 -exports["default"] = def;
10375 -//# sourceMappingURL=contains.js.map
10376 -
10377 -/***/ }),
10378 -
10379 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js":
10380 -/*!**************************************************************************************************************!*\
10381 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js ***!
10382 - \**************************************************************************************************************/
10383 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10384 -
10385 -
10386 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10387 -exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0;
10388 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10389 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10390 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
10391 -exports.error = {
10392 - message: ({ params: { property, depsCount, deps } }) => {
10393 - const property_ies = depsCount === 1 ? "property" : "properties";
10394 - return (0, codegen_1.str) `must have ${property_ies} ${deps} when property ${property} is present`;
10395 - },
10396 - params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._) `{property: ${property},
10397 - missingProperty: ${missingProperty},
10398 - depsCount: ${depsCount},
10399 - deps: ${deps}}`, // TODO change to reference
10400 -};
10401 -const def = {
10402 - keyword: "dependencies",
10403 - type: "object",
10404 - schemaType: "object",
10405 - error: exports.error,
10406 - code(cxt) {
10407 - const [propDeps, schDeps] = splitDependencies(cxt);
10408 - validatePropertyDeps(cxt, propDeps);
10409 - validateSchemaDeps(cxt, schDeps);
10410 - },
10411 -};
10412 -function splitDependencies({ schema }) {
10413 - const propertyDeps = {};
10414 - const schemaDeps = {};
10415 - for (const key in schema) {
10416 - if (key === "__proto__")
10417 - continue;
10418 - const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps;
10419 - deps[key] = schema[key];
10420 - }
10421 - return [propertyDeps, schemaDeps];
10422 -}
10423 -function validatePropertyDeps(cxt, propertyDeps = cxt.schema) {
10424 - const { gen, data, it } = cxt;
10425 - if (Object.keys(propertyDeps).length === 0)
10426 - return;
10427 - const missing = gen.let("missing");
10428 - for (const prop in propertyDeps) {
10429 - const deps = propertyDeps[prop];
10430 - if (deps.length === 0)
10431 - continue;
10432 - const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties);
10433 - cxt.setParams({
10434 - property: prop,
10435 - depsCount: deps.length,
10436 - deps: deps.join(", "),
10437 - });
10438 - if (it.allErrors) {
10439 - gen.if(hasProperty, () => {
10440 - for (const depProp of deps) {
10441 - (0, code_1.checkReportMissingProp)(cxt, depProp);
10442 - }
10443 - });
10444 - }
10445 - else {
10446 - gen.if((0, codegen_1._) `${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`);
10447 - (0, code_1.reportMissingProp)(cxt, missing);
10448 - gen.else();
10449 - }
10450 - }
10451 -}
10452 -exports.validatePropertyDeps = validatePropertyDeps;
10453 -function validateSchemaDeps(cxt, schemaDeps = cxt.schema) {
10454 - const { gen, data, keyword, it } = cxt;
10455 - const valid = gen.name("valid");
10456 - for (const prop in schemaDeps) {
10457 - if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop]))
10458 - continue;
10459 - gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => {
10460 - const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid);
10461 - cxt.mergeValidEvaluated(schCxt, valid);
10462 - }, () => gen.var(valid, true) // TODO var
10463 - );
10464 - cxt.ok(valid);
10465 - }
10466 -}
10467 -exports.validateSchemaDeps = validateSchemaDeps;
10468 -exports["default"] = def;
10469 -//# sourceMappingURL=dependencies.js.map
10470 -
10471 -/***/ }),
10472 -
10473 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js":
10474 -/*!****************************************************************************************************!*\
10475 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js ***!
10476 - \****************************************************************************************************/
10477 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10478 -
10479 -
10480 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10481 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10482 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10483 -const error = {
10484 - message: ({ params }) => (0, codegen_1.str) `must match "${params.ifClause}" schema`,
10485 - params: ({ params }) => (0, codegen_1._) `{failingKeyword: ${params.ifClause}}`,
10486 -};
10487 -const def = {
10488 - keyword: "if",
10489 - schemaType: ["object", "boolean"],
10490 - trackErrors: true,
10491 - error,
10492 - code(cxt) {
10493 - const { gen, parentSchema, it } = cxt;
10494 - if (parentSchema.then === undefined && parentSchema.else === undefined) {
10495 - (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored');
10496 - }
10497 - const hasThen = hasSchema(it, "then");
10498 - const hasElse = hasSchema(it, "else");
10499 - if (!hasThen && !hasElse)
10500 - return;
10501 - const valid = gen.let("valid", true);
10502 - const schValid = gen.name("_valid");
10503 - validateIf();
10504 - cxt.reset();
10505 - if (hasThen && hasElse) {
10506 - const ifClause = gen.let("ifClause");
10507 - cxt.setParams({ ifClause });
10508 - gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause));
10509 - }
10510 - else if (hasThen) {
10511 - gen.if(schValid, validateClause("then"));
10512 - }
10513 - else {
10514 - gen.if((0, codegen_1.not)(schValid), validateClause("else"));
10515 - }
10516 - cxt.pass(valid, () => cxt.error(true));
10517 - function validateIf() {
10518 - const schCxt = cxt.subschema({
10519 - keyword: "if",
10520 - compositeRule: true,
10521 - createErrors: false,
10522 - allErrors: false,
10523 - }, schValid);
10524 - cxt.mergeEvaluated(schCxt);
10525 - }
10526 - function validateClause(keyword, ifClause) {
10527 - return () => {
10528 - const schCxt = cxt.subschema({ keyword }, schValid);
10529 - gen.assign(valid, schValid);
10530 - cxt.mergeValidEvaluated(schCxt, valid);
10531 - if (ifClause)
10532 - gen.assign(ifClause, (0, codegen_1._) `${keyword}`);
10533 - else
10534 - cxt.setParams({ ifClause: keyword });
10535 - };
10536 - }
10537 - },
10538 -};
10539 -function hasSchema(it, keyword) {
10540 - const schema = it.schema[keyword];
10541 - return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema);
10542 -}
10543 -exports["default"] = def;
10544 -//# sourceMappingURL=if.js.map
10545 -
10546 -/***/ }),
10547 -
10548 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js":
10549 -/*!*******************************************************************************************************!*\
10550 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js ***!
10551 - \*******************************************************************************************************/
10552 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10553 -
10554 -
10555 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10556 -const additionalItems_1 = __webpack_require__(/*! ./additionalItems */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js");
10557 -const prefixItems_1 = __webpack_require__(/*! ./prefixItems */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js");
10558 -const items_1 = __webpack_require__(/*! ./items */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js");
10559 -const items2020_1 = __webpack_require__(/*! ./items2020 */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js");
10560 -const contains_1 = __webpack_require__(/*! ./contains */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js");
10561 -const dependencies_1 = __webpack_require__(/*! ./dependencies */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js");
10562 -const propertyNames_1 = __webpack_require__(/*! ./propertyNames */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js");
10563 -const additionalProperties_1 = __webpack_require__(/*! ./additionalProperties */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js");
10564 -const properties_1 = __webpack_require__(/*! ./properties */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js");
10565 -const patternProperties_1 = __webpack_require__(/*! ./patternProperties */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js");
10566 -const not_1 = __webpack_require__(/*! ./not */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js");
10567 -const anyOf_1 = __webpack_require__(/*! ./anyOf */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js");
10568 -const oneOf_1 = __webpack_require__(/*! ./oneOf */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js");
10569 -const allOf_1 = __webpack_require__(/*! ./allOf */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js");
10570 -const if_1 = __webpack_require__(/*! ./if */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js");
10571 -const thenElse_1 = __webpack_require__(/*! ./thenElse */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js");
10572 -function getApplicator(draft2020 = false) {
10573 - const applicator = [
10574 - // any
10575 - not_1.default,
10576 - anyOf_1.default,
10577 - oneOf_1.default,
10578 - allOf_1.default,
10579 - if_1.default,
10580 - thenElse_1.default,
10581 - // object
10582 - propertyNames_1.default,
10583 - additionalProperties_1.default,
10584 - dependencies_1.default,
10585 - properties_1.default,
10586 - patternProperties_1.default,
10587 - ];
10588 - // array
10589 - if (draft2020)
10590 - applicator.push(prefixItems_1.default, items2020_1.default);
10591 - else
10592 - applicator.push(additionalItems_1.default, items_1.default);
10593 - applicator.push(contains_1.default);
10594 - return applicator;
10595 -}
10596 -exports["default"] = getApplicator;
10597 -//# sourceMappingURL=index.js.map
10598 -
10599 -/***/ }),
10600 -
10601 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js":
10602 -/*!*******************************************************************************************************!*\
10603 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js ***!
10604 - \*******************************************************************************************************/
10605 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10606 -
10607 -
10608 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10609 -exports.validateTuple = void 0;
10610 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10611 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10612 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
10613 -const def = {
10614 - keyword: "items",
10615 - type: "array",
10616 - schemaType: ["object", "array", "boolean"],
10617 - before: "uniqueItems",
10618 - code(cxt) {
10619 - const { schema, it } = cxt;
10620 - if (Array.isArray(schema))
10621 - return validateTuple(cxt, "additionalItems", schema);
10622 - it.items = true;
10623 - if ((0, util_1.alwaysValidSchema)(it, schema))
10624 - return;
10625 - cxt.ok((0, code_1.validateArray)(cxt));
10626 - },
10627 -};
10628 -function validateTuple(cxt, extraItems, schArr = cxt.schema) {
10629 - const { gen, parentSchema, data, keyword, it } = cxt;
10630 - checkStrictTuple(parentSchema);
10631 - if (it.opts.unevaluated && schArr.length && it.items !== true) {
10632 - it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items);
10633 - }
10634 - const valid = gen.name("valid");
10635 - const len = gen.const("len", (0, codegen_1._) `${data}.length`);
10636 - schArr.forEach((sch, i) => {
10637 - if ((0, util_1.alwaysValidSchema)(it, sch))
10638 - return;
10639 - gen.if((0, codegen_1._) `${len} > ${i}`, () => cxt.subschema({
10640 - keyword,
10641 - schemaProp: i,
10642 - dataProp: i,
10643 - }, valid));
10644 - cxt.ok(valid);
10645 - });
10646 - function checkStrictTuple(sch) {
10647 - const { opts, errSchemaPath } = it;
10648 - const l = schArr.length;
10649 - const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false);
10650 - if (opts.strictTuples && !fullTuple) {
10651 - const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`;
10652 - (0, util_1.checkStrictMode)(it, msg, opts.strictTuples);
10653 - }
10654 - }
10655 -}
10656 -exports.validateTuple = validateTuple;
10657 -exports["default"] = def;
10658 -//# sourceMappingURL=items.js.map
10659 -
10660 -/***/ }),
10661 -
10662 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js":
10663 -/*!***********************************************************************************************************!*\
10664 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js ***!
10665 - \***********************************************************************************************************/
10666 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10667 -
10668 -
10669 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10670 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10671 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10672 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
10673 -const additionalItems_1 = __webpack_require__(/*! ./additionalItems */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js");
10674 -const error = {
10675 - message: ({ params: { len } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
10676 - params: ({ params: { len } }) => (0, codegen_1._) `{limit: ${len}}`,
10677 -};
10678 -const def = {
10679 - keyword: "items",
10680 - type: "array",
10681 - schemaType: ["object", "boolean"],
10682 - before: "uniqueItems",
10683 - error,
10684 - code(cxt) {
10685 - const { schema, parentSchema, it } = cxt;
10686 - const { prefixItems } = parentSchema;
10687 - it.items = true;
10688 - if ((0, util_1.alwaysValidSchema)(it, schema))
10689 - return;
10690 - if (prefixItems)
10691 - (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
10692 - else
10693 - cxt.ok((0, code_1.validateArray)(cxt));
10694 - },
10695 -};
10696 -exports["default"] = def;
10697 -//# sourceMappingURL=items2020.js.map
10698 -
10699 -/***/ }),
10700 -
10701 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js":
10702 -/*!*****************************************************************************************************!*\
10703 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js ***!
10704 - \*****************************************************************************************************/
10705 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10706 -
10707 -
10708 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10709 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10710 -const def = {
10711 - keyword: "not",
10712 - schemaType: ["object", "boolean"],
10713 - trackErrors: true,
10714 - code(cxt) {
10715 - const { gen, schema, it } = cxt;
10716 - if ((0, util_1.alwaysValidSchema)(it, schema)) {
10717 - cxt.fail();
10718 - return;
10719 - }
10720 - const valid = gen.name("valid");
10721 - cxt.subschema({
10722 - keyword: "not",
10723 - compositeRule: true,
10724 - createErrors: false,
10725 - allErrors: false,
10726 - }, valid);
10727 - cxt.failResult(valid, () => cxt.reset(), () => cxt.error());
10728 - },
10729 - error: { message: "must NOT be valid" },
10730 -};
10731 -exports["default"] = def;
10732 -//# sourceMappingURL=not.js.map
10733 -
10734 -/***/ }),
10735 -
10736 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js":
10737 -/*!*******************************************************************************************************!*\
10738 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js ***!
10739 - \*******************************************************************************************************/
10740 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10741 -
10742 -
10743 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10744 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10745 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10746 -const error = {
10747 - message: "must match exactly one schema in oneOf",
10748 - params: ({ params }) => (0, codegen_1._) `{passingSchemas: ${params.passing}}`,
10749 -};
10750 -const def = {
10751 - keyword: "oneOf",
10752 - schemaType: "array",
10753 - trackErrors: true,
10754 - error,
10755 - code(cxt) {
10756 - const { gen, schema, parentSchema, it } = cxt;
10757 - /* istanbul ignore if */
10758 - if (!Array.isArray(schema))
10759 - throw new Error("ajv implementation error");
10760 - if (it.opts.discriminator && parentSchema.discriminator)
10761 - return;
10762 - const schArr = schema;
10763 - const valid = gen.let("valid", false);
10764 - const passing = gen.let("passing", null);
10765 - const schValid = gen.name("_valid");
10766 - cxt.setParams({ passing });
10767 - // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas
10768 - gen.block(validateOneOf);
10769 - cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
10770 - function validateOneOf() {
10771 - schArr.forEach((sch, i) => {
10772 - let schCxt;
10773 - if ((0, util_1.alwaysValidSchema)(it, sch)) {
10774 - gen.var(schValid, true);
10775 - }
10776 - else {
10777 - schCxt = cxt.subschema({
10778 - keyword: "oneOf",
10779 - schemaProp: i,
10780 - compositeRule: true,
10781 - }, schValid);
10782 - }
10783 - if (i > 0) {
10784 - gen
10785 - .if((0, codegen_1._) `${schValid} && ${valid}`)
10786 - .assign(valid, false)
10787 - .assign(passing, (0, codegen_1._) `[${passing}, ${i}]`)
10788 - .else();
10789 - }
10790 - gen.if(schValid, () => {
10791 - gen.assign(valid, true);
10792 - gen.assign(passing, i);
10793 - if (schCxt)
10794 - cxt.mergeEvaluated(schCxt, codegen_1.Name);
10795 - });
10796 - });
10797 - }
10798 - },
10799 -};
10800 -exports["default"] = def;
10801 -//# sourceMappingURL=oneOf.js.map
10802 -
10803 -/***/ }),
10804 -
10805 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js":
10806 -/*!*******************************************************************************************************************!*\
10807 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js ***!
10808 - \*******************************************************************************************************************/
10809 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10810 -
10811 -
10812 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10813 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
10814 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10815 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10816 -const util_2 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10817 -const def = {
10818 - keyword: "patternProperties",
10819 - type: "object",
10820 - schemaType: "object",
10821 - code(cxt) {
10822 - const { gen, schema, data, parentSchema, it } = cxt;
10823 - const { opts } = it;
10824 - const patterns = (0, code_1.allSchemaProperties)(schema);
10825 - const alwaysValidPatterns = patterns.filter((p) => (0, util_1.alwaysValidSchema)(it, schema[p]));
10826 - if (patterns.length === 0 ||
10827 - (alwaysValidPatterns.length === patterns.length &&
10828 - (!it.opts.unevaluated || it.props === true))) {
10829 - return;
10830 - }
10831 - const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties;
10832 - const valid = gen.name("valid");
10833 - if (it.props !== true && !(it.props instanceof codegen_1.Name)) {
10834 - it.props = (0, util_2.evaluatedPropsToName)(gen, it.props);
10835 - }
10836 - const { props } = it;
10837 - validatePatternProperties();
10838 - function validatePatternProperties() {
10839 - for (const pat of patterns) {
10840 - if (checkProperties)
10841 - checkMatchingProperties(pat);
10842 - if (it.allErrors) {
10843 - validateProperties(pat);
10844 - }
10845 - else {
10846 - gen.var(valid, true); // TODO var
10847 - validateProperties(pat);
10848 - gen.if(valid);
10849 - }
10850 - }
10851 - }
10852 - function checkMatchingProperties(pat) {
10853 - for (const prop in checkProperties) {
10854 - if (new RegExp(pat).test(prop)) {
10855 - (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`);
10856 - }
10857 - }
10858 - }
10859 - function validateProperties(pat) {
10860 - gen.forIn("key", data, (key) => {
10861 - gen.if((0, codegen_1._) `${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => {
10862 - const alwaysValid = alwaysValidPatterns.includes(pat);
10863 - if (!alwaysValid) {
10864 - cxt.subschema({
10865 - keyword: "patternProperties",
10866 - schemaProp: pat,
10867 - dataProp: key,
10868 - dataPropType: util_2.Type.Str,
10869 - }, valid);
10870 - }
10871 - if (it.opts.unevaluated && props !== true) {
10872 - gen.assign((0, codegen_1._) `${props}[${key}]`, true);
10873 - }
10874 - else if (!alwaysValid && !it.allErrors) {
10875 - // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false)
10876 - // or if all properties were evaluated (props === true)
10877 - gen.if((0, codegen_1.not)(valid), () => gen.break());
10878 - }
10879 - });
10880 - });
10881 - }
10882 - },
10883 -};
10884 -exports["default"] = def;
10885 -//# sourceMappingURL=patternProperties.js.map
10886 -
10887 -/***/ }),
10888 -
10889 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js":
10890 -/*!*************************************************************************************************************!*\
10891 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js ***!
10892 - \*************************************************************************************************************/
10893 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10894 -
10895 -
10896 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10897 -const items_1 = __webpack_require__(/*! ./items */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js");
10898 -const def = {
10899 - keyword: "prefixItems",
10900 - type: "array",
10901 - schemaType: ["array"],
10902 - before: "uniqueItems",
10903 - code: (cxt) => (0, items_1.validateTuple)(cxt, "items"),
10904 -};
10905 -exports["default"] = def;
10906 -//# sourceMappingURL=prefixItems.js.map
10907 -
10908 -/***/ }),
10909 -
10910 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js":
10911 -/*!************************************************************************************************************!*\
10912 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js ***!
10913 - \************************************************************************************************************/
10914 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10915 -
10916 -
10917 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10918 -const validate_1 = __webpack_require__(/*! ../../compile/validate */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");
10919 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
10920 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10921 -const additionalProperties_1 = __webpack_require__(/*! ./additionalProperties */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js");
10922 -const def = {
10923 - keyword: "properties",
10924 - type: "object",
10925 - schemaType: "object",
10926 - code(cxt) {
10927 - const { gen, schema, parentSchema, data, it } = cxt;
10928 - if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) {
10929 - additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties"));
10930 - }
10931 - const allProps = (0, code_1.allSchemaProperties)(schema);
10932 - for (const prop of allProps) {
10933 - it.definedProperties.add(prop);
10934 - }
10935 - if (it.opts.unevaluated && allProps.length && it.props !== true) {
10936 - it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props);
10937 - }
10938 - const properties = allProps.filter((p) => !(0, util_1.alwaysValidSchema)(it, schema[p]));
10939 - if (properties.length === 0)
10940 - return;
10941 - const valid = gen.name("valid");
10942 - for (const prop of properties) {
10943 - if (hasDefault(prop)) {
10944 - applyPropertySchema(prop);
10945 - }
10946 - else {
10947 - gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties));
10948 - applyPropertySchema(prop);
10949 - if (!it.allErrors)
10950 - gen.else().var(valid, true);
10951 - gen.endIf();
10952 - }
10953 - cxt.it.definedProperties.add(prop);
10954 - cxt.ok(valid);
10955 - }
10956 - function hasDefault(prop) {
10957 - return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined;
10958 - }
10959 - function applyPropertySchema(prop) {
10960 - cxt.subschema({
10961 - keyword: "properties",
10962 - schemaProp: prop,
10963 - dataProp: prop,
10964 - }, valid);
10965 - }
10966 - },
10967 -};
10968 -exports["default"] = def;
10969 -//# sourceMappingURL=properties.js.map
10970 -
10971 -/***/ }),
10972 -
10973 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js":
10974 -/*!***************************************************************************************************************!*\
10975 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js ***!
10976 - \***************************************************************************************************************/
10977 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10978 -
10979 -
10980 -Object.defineProperty(exports, "__esModule", ({ value: true }));
10981 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
10982 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
10983 -const error = {
10984 - message: "property name must be valid",
10985 - params: ({ params }) => (0, codegen_1._) `{propertyName: ${params.propertyName}}`,
10986 -};
10987 -const def = {
10988 - keyword: "propertyNames",
10989 - type: "object",
10990 - schemaType: ["object", "boolean"],
10991 - error,
10992 - code(cxt) {
10993 - const { gen, schema, data, it } = cxt;
10994 - if ((0, util_1.alwaysValidSchema)(it, schema))
10995 - return;
10996 - const valid = gen.name("valid");
10997 - gen.forIn("key", data, (key) => {
10998 - cxt.setParams({ propertyName: key });
10999 - cxt.subschema({
11000 - keyword: "propertyNames",
11001 - data: key,
11002 - dataTypes: ["string"],
11003 - propertyName: key,
11004 - compositeRule: true,
11005 - }, valid);
11006 - gen.if((0, codegen_1.not)(valid), () => {
11007 - cxt.error(true);
11008 - if (!it.allErrors)
11009 - gen.break();
11010 - });
11011 - });
11012 - cxt.ok(valid);
11013 - },
11014 -};
11015 -exports["default"] = def;
11016 -//# sourceMappingURL=propertyNames.js.map
11017 -
11018 -/***/ }),
11019 -
11020 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js":
11021 -/*!**********************************************************************************************************!*\
11022 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js ***!
11023 - \**********************************************************************************************************/
11024 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11025 -
11026 -
11027 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11028 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
11029 -const def = {
11030 - keyword: ["then", "else"],
11031 - schemaType: ["object", "boolean"],
11032 - code({ keyword, parentSchema, it }) {
11033 - if (parentSchema.if === undefined)
11034 - (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`);
11035 - },
11036 -};
11037 -exports["default"] = def;
11038 -//# sourceMappingURL=thenElse.js.map
11039 -
11040 -/***/ }),
11041 -
11042 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js":
11043 -/*!*******************************************************************************************!*\
11044 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js ***!
11045 - \*******************************************************************************************/
11046 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11047 -
11048 -
11049 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11050 -exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0;
11051 -const codegen_1 = __webpack_require__(/*! ../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11052 -const util_1 = __webpack_require__(/*! ../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
11053 -const names_1 = __webpack_require__(/*! ../compile/names */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");
11054 -const util_2 = __webpack_require__(/*! ../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
11055 -function checkReportMissingProp(cxt, prop) {
11056 - const { gen, data, it } = cxt;
11057 - gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
11058 - cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true);
11059 - cxt.error();
11060 - });
11061 -}
11062 -exports.checkReportMissingProp = checkReportMissingProp;
11063 -function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
11064 - return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`)));
11065 -}
11066 -exports.checkMissingProp = checkMissingProp;
11067 -function reportMissingProp(cxt, missing) {
11068 - cxt.setParams({ missingProperty: missing }, true);
11069 - cxt.error();
11070 -}
11071 -exports.reportMissingProp = reportMissingProp;
11072 -function hasPropFunc(gen) {
11073 - return gen.scopeValue("func", {
11074 - // eslint-disable-next-line @typescript-eslint/unbound-method
11075 - ref: Object.prototype.hasOwnProperty,
11076 - code: (0, codegen_1._) `Object.prototype.hasOwnProperty`,
11077 - });
11078 -}
11079 -exports.hasPropFunc = hasPropFunc;
11080 -function isOwnProperty(gen, data, property) {
11081 - return (0, codegen_1._) `${hasPropFunc(gen)}.call(${data}, ${property})`;
11082 -}
11083 -exports.isOwnProperty = isOwnProperty;
11084 -function propertyInData(gen, data, property, ownProperties) {
11085 - const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} !== undefined`;
11086 - return ownProperties ? (0, codegen_1._) `${cond} && ${isOwnProperty(gen, data, property)}` : cond;
11087 -}
11088 -exports.propertyInData = propertyInData;
11089 -function noPropertyInData(gen, data, property, ownProperties) {
11090 - const cond = (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(property)} === undefined`;
11091 - return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond;
11092 -}
11093 -exports.noPropertyInData = noPropertyInData;
11094 -function allSchemaProperties(schemaMap) {
11095 - return schemaMap ? Object.keys(schemaMap).filter((p) => p !== "__proto__") : [];
11096 -}
11097 -exports.allSchemaProperties = allSchemaProperties;
11098 -function schemaProperties(it, schemaMap) {
11099 - return allSchemaProperties(schemaMap).filter((p) => !(0, util_1.alwaysValidSchema)(it, schemaMap[p]));
11100 -}
11101 -exports.schemaProperties = schemaProperties;
11102 -function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) {
11103 - const dataAndSchema = passSchema ? (0, codegen_1._) `${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data;
11104 - const valCxt = [
11105 - [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)],
11106 - [names_1.default.parentData, it.parentData],
11107 - [names_1.default.parentDataProperty, it.parentDataProperty],
11108 - [names_1.default.rootData, names_1.default.rootData],
11109 - ];
11110 - if (it.opts.dynamicRef)
11111 - valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]);
11112 - const args = (0, codegen_1._) `${dataAndSchema}, ${gen.object(...valCxt)}`;
11113 - return context !== codegen_1.nil ? (0, codegen_1._) `${func}.call(${context}, ${args})` : (0, codegen_1._) `${func}(${args})`;
11114 -}
11115 -exports.callValidateCode = callValidateCode;
11116 -const newRegExp = (0, codegen_1._) `new RegExp`;
11117 -function usePattern({ gen, it: { opts } }, pattern) {
11118 - const u = opts.unicodeRegExp ? "u" : "";
11119 - const { regExp } = opts.code;
11120 - const rx = regExp(pattern, u);
11121 - return gen.scopeValue("pattern", {
11122 - key: rx.toString(),
11123 - ref: rx,
11124 - code: (0, codegen_1._) `${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})`,
11125 - });
11126 -}
11127 -exports.usePattern = usePattern;
11128 -function validateArray(cxt) {
11129 - const { gen, data, keyword, it } = cxt;
11130 - const valid = gen.name("valid");
11131 - if (it.allErrors) {
11132 - const validArr = gen.let("valid", true);
11133 - validateItems(() => gen.assign(validArr, false));
11134 - return validArr;
11135 - }
11136 - gen.var(valid, true);
11137 - validateItems(() => gen.break());
11138 - return valid;
11139 - function validateItems(notValid) {
11140 - const len = gen.const("len", (0, codegen_1._) `${data}.length`);
11141 - gen.forRange("i", 0, len, (i) => {
11142 - cxt.subschema({
11143 - keyword,
11144 - dataProp: i,
11145 - dataPropType: util_1.Type.Num,
11146 - }, valid);
11147 - gen.if((0, codegen_1.not)(valid), notValid);
11148 - });
11149 - }
11150 -}
11151 -exports.validateArray = validateArray;
11152 -function validateUnion(cxt) {
11153 - const { gen, schema, keyword, it } = cxt;
11154 - /* istanbul ignore if */
11155 - if (!Array.isArray(schema))
11156 - throw new Error("ajv implementation error");
11157 - const alwaysValid = schema.some((sch) => (0, util_1.alwaysValidSchema)(it, sch));
11158 - if (alwaysValid && !it.opts.unevaluated)
11159 - return;
11160 - const valid = gen.let("valid", false);
11161 - const schValid = gen.name("_valid");
11162 - gen.block(() => schema.forEach((_sch, i) => {
11163 - const schCxt = cxt.subschema({
11164 - keyword,
11165 - schemaProp: i,
11166 - compositeRule: true,
11167 - }, schValid);
11168 - gen.assign(valid, (0, codegen_1._) `${valid} || ${schValid}`);
11169 - const merged = cxt.mergeValidEvaluated(schCxt, schValid);
11170 - // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true)
11171 - // or if all properties and items were evaluated (it.props === true && it.items === true)
11172 - if (!merged)
11173 - gen.if((0, codegen_1.not)(valid));
11174 - }));
11175 - cxt.result(valid, () => cxt.reset(), () => cxt.error(true));
11176 -}
11177 -exports.validateUnion = validateUnion;
11178 -//# sourceMappingURL=code.js.map
11179 -
11180 -/***/ }),
11181 -
11182 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js":
11183 -/*!**********************************************************************************************!*\
11184 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js ***!
11185 - \**********************************************************************************************/
11186 -/***/ (function(__unused_webpack_module, exports) {
11187 -
11188 -
11189 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11190 -const def = {
11191 - keyword: "id",
11192 - code() {
11193 - throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID');
11194 - },
11195 -};
11196 -exports["default"] = def;
11197 -//# sourceMappingURL=id.js.map
11198 -
11199 -/***/ }),
11200 -
11201 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js":
11202 -/*!*************************************************************************************************!*\
11203 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js ***!
11204 - \*************************************************************************************************/
11205 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11206 -
11207 -
11208 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11209 -const id_1 = __webpack_require__(/*! ./id */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js");
11210 -const ref_1 = __webpack_require__(/*! ./ref */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js");
11211 -const core = [
11212 - "$schema",
11213 - "$id",
11214 - "$defs",
11215 - "$vocabulary",
11216 - { keyword: "$comment" },
11217 - "definitions",
11218 - id_1.default,
11219 - ref_1.default,
11220 -];
11221 -exports["default"] = core;
11222 -//# sourceMappingURL=index.js.map
11223 -
11224 -/***/ }),
11225 -
11226 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js":
11227 -/*!***********************************************************************************************!*\
11228 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js ***!
11229 - \***********************************************************************************************/
11230 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11231 -
11232 -
11233 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11234 -exports.callRef = exports.getValidate = void 0;
11235 -const ref_error_1 = __webpack_require__(/*! ../../compile/ref_error */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js");
11236 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
11237 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11238 -const names_1 = __webpack_require__(/*! ../../compile/names */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");
11239 -const compile_1 = __webpack_require__(/*! ../../compile */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js");
11240 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
11241 -const def = {
11242 - keyword: "$ref",
11243 - schemaType: "string",
11244 - code(cxt) {
11245 - const { gen, schema: $ref, it } = cxt;
11246 - const { baseId, schemaEnv: env, validateName, opts, self } = it;
11247 - const { root } = env;
11248 - if (($ref === "#" || $ref === "#/") && baseId === root.baseId)
11249 - return callRootRef();
11250 - const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref);
11251 - if (schOrEnv === undefined)
11252 - throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref);
11253 - if (schOrEnv instanceof compile_1.SchemaEnv)
11254 - return callValidate(schOrEnv);
11255 - return inlineRefSchema(schOrEnv);
11256 - function callRootRef() {
11257 - if (env === root)
11258 - return callRef(cxt, validateName, env, env.$async);
11259 - const rootName = gen.scopeValue("root", { ref: root });
11260 - return callRef(cxt, (0, codegen_1._) `${rootName}.validate`, root, root.$async);
11261 - }
11262 - function callValidate(sch) {
11263 - const v = getValidate(cxt, sch);
11264 - callRef(cxt, v, sch, sch.$async);
11265 - }
11266 - function inlineRefSchema(sch) {
11267 - const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch });
11268 - const valid = gen.name("valid");
11269 - const schCxt = cxt.subschema({
11270 - schema: sch,
11271 - dataTypes: [],
11272 - schemaPath: codegen_1.nil,
11273 - topSchemaRef: schName,
11274 - errSchemaPath: $ref,
11275 - }, valid);
11276 - cxt.mergeEvaluated(schCxt);
11277 - cxt.ok(valid);
11278 - }
11279 - },
11280 -};
11281 -function getValidate(cxt, sch) {
11282 - const { gen } = cxt;
11283 - return sch.validate
11284 - ? gen.scopeValue("validate", { ref: sch.validate })
11285 - : (0, codegen_1._) `${gen.scopeValue("wrapper", { ref: sch })}.validate`;
11286 -}
11287 -exports.getValidate = getValidate;
11288 -function callRef(cxt, v, sch, $async) {
11289 - const { gen, it } = cxt;
11290 - const { allErrors, schemaEnv: env, opts } = it;
11291 - const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil;
11292 - if ($async)
11293 - callAsyncRef();
11294 - else
11295 - callSyncRef();
11296 - function callAsyncRef() {
11297 - if (!env.$async)
11298 - throw new Error("async schema referenced by sync schema");
11299 - const valid = gen.let("valid");
11300 - gen.try(() => {
11301 - gen.code((0, codegen_1._) `await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`);
11302 - addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result
11303 - if (!allErrors)
11304 - gen.assign(valid, true);
11305 - }, (e) => {
11306 - gen.if((0, codegen_1._) `!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e));
11307 - addErrorsFrom(e);
11308 - if (!allErrors)
11309 - gen.assign(valid, false);
11310 - });
11311 - cxt.ok(valid);
11312 - }
11313 - function callSyncRef() {
11314 - cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v));
11315 - }
11316 - function addErrorsFrom(source) {
11317 - const errs = (0, codegen_1._) `${source}.errors`;
11318 - gen.assign(names_1.default.vErrors, (0, codegen_1._) `${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged
11319 - gen.assign(names_1.default.errors, (0, codegen_1._) `${names_1.default.vErrors}.length`);
11320 - }
11321 - function addEvaluatedFrom(source) {
11322 - var _a;
11323 - if (!it.opts.unevaluated)
11324 - return;
11325 - const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
11326 - // TODO refactor
11327 - if (it.props !== true) {
11328 - if (schEvaluated && !schEvaluated.dynamicProps) {
11329 - if (schEvaluated.props !== undefined) {
11330 - it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
11331 - }
11332 - }
11333 - else {
11334 - const props = gen.var("props", (0, codegen_1._) `${source}.evaluated.props`);
11335 - it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
11336 - }
11337 - }
11338 - if (it.items !== true) {
11339 - if (schEvaluated && !schEvaluated.dynamicItems) {
11340 - if (schEvaluated.items !== undefined) {
11341 - it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
11342 - }
11343 - }
11344 - else {
11345 - const items = gen.var("items", (0, codegen_1._) `${source}.evaluated.items`);
11346 - it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
11347 - }
11348 - }
11349 - }
11350 -}
11351 -exports.callRef = callRef;
11352 -exports["default"] = def;
11353 -//# sourceMappingURL=ref.js.map
11354 -
11355 -/***/ }),
11356 -
11357 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js":
11358 -/*!**********************************************************************************************************!*\
11359 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js ***!
11360 - \**********************************************************************************************************/
11361 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11362 -
11363 -
11364 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11365 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11366 -const types_1 = __webpack_require__(/*! ../discriminator/types */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js");
11367 -const compile_1 = __webpack_require__(/*! ../../compile */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js");
11368 -const ref_error_1 = __webpack_require__(/*! ../../compile/ref_error */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js");
11369 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
11370 -const error = {
11371 - message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
11372 - ? `tag "${tagName}" must be string`
11373 - : `value of tag "${tagName}" must be in oneOf`,
11374 - params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,
11375 -};
11376 -const def = {
11377 - keyword: "discriminator",
11378 - type: "object",
11379 - schemaType: "object",
11380 - error,
11381 - code(cxt) {
11382 - const { gen, data, schema, parentSchema, it } = cxt;
11383 - const { oneOf } = parentSchema;
11384 - if (!it.opts.discriminator) {
11385 - throw new Error("discriminator: requires discriminator option");
11386 - }
11387 - const tagName = schema.propertyName;
11388 - if (typeof tagName != "string")
11389 - throw new Error("discriminator: requires propertyName");
11390 - if (schema.mapping)
11391 - throw new Error("discriminator: mapping is not supported");
11392 - if (!oneOf)
11393 - throw new Error("discriminator: requires oneOf keyword");
11394 - const valid = gen.let("valid", false);
11395 - const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);
11396 - gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
11397 - cxt.ok(valid);
11398 - function validateMapping() {
11399 - const mapping = getMapping();
11400 - gen.if(false);
11401 - for (const tagValue in mapping) {
11402 - gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`);
11403 - gen.assign(valid, applyTagSchema(mapping[tagValue]));
11404 - }
11405 - gen.else();
11406 - cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
11407 - gen.endIf();
11408 - }
11409 - function applyTagSchema(schemaProp) {
11410 - const _valid = gen.name("valid");
11411 - const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid);
11412 - cxt.mergeEvaluated(schCxt, codegen_1.Name);
11413 - return _valid;
11414 - }
11415 - function getMapping() {
11416 - var _a;
11417 - const oneOfMapping = {};
11418 - const topRequired = hasRequired(parentSchema);
11419 - let tagRequired = true;
11420 - for (let i = 0; i < oneOf.length; i++) {
11421 - let sch = oneOf[i];
11422 - if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) {
11423 - const ref = sch.$ref;
11424 - sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref);
11425 - if (sch instanceof compile_1.SchemaEnv)
11426 - sch = sch.schema;
11427 - if (sch === undefined)
11428 - throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
11429 - }
11430 - const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
11431 - if (typeof propSch != "object") {
11432 - throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
11433 - }
11434 - tagRequired = tagRequired && (topRequired || hasRequired(sch));
11435 - addMappings(propSch, i);
11436 - }
11437 - if (!tagRequired)
11438 - throw new Error(`discriminator: "${tagName}" must be required`);
11439 - return oneOfMapping;
11440 - function hasRequired({ required }) {
11441 - return Array.isArray(required) && required.includes(tagName);
11442 - }
11443 - function addMappings(sch, i) {
11444 - if (sch.const) {
11445 - addMapping(sch.const, i);
11446 - }
11447 - else if (sch.enum) {
11448 - for (const tagValue of sch.enum) {
11449 - addMapping(tagValue, i);
11450 - }
11451 - }
11452 - else {
11453 - throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`);
11454 - }
11455 - }
11456 - function addMapping(tagValue, i) {
11457 - if (typeof tagValue != "string" || tagValue in oneOfMapping) {
11458 - throw new Error(`discriminator: "${tagName}" values must be unique strings`);
11459 - }
11460 - oneOfMapping[tagValue] = i;
11461 - }
11462 - }
11463 - },
11464 -};
11465 -exports["default"] = def;
11466 -//# sourceMappingURL=index.js.map
11467 -
11468 -/***/ }),
11469 -
11470 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js":
11471 -/*!**********************************************************************************************************!*\
11472 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js ***!
11473 - \**********************************************************************************************************/
11474 -/***/ (function(__unused_webpack_module, exports) {
11475 -
11476 -
11477 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11478 -exports.DiscrError = void 0;
11479 -var DiscrError;
11480 -(function (DiscrError) {
11481 - DiscrError["Tag"] = "tag";
11482 - DiscrError["Mapping"] = "mapping";
11483 -})(DiscrError || (exports.DiscrError = DiscrError = {}));
11484 -//# sourceMappingURL=types.js.map
11485 -
11486 -/***/ }),
11487 -
11488 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js":
11489 -/*!*********************************************************************************************!*\
11490 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js ***!
11491 - \*********************************************************************************************/
11492 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11493 -
11494 -
11495 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11496 -const core_1 = __webpack_require__(/*! ./core */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js");
11497 -const validation_1 = __webpack_require__(/*! ./validation */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js");
11498 -const applicator_1 = __webpack_require__(/*! ./applicator */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js");
11499 -const format_1 = __webpack_require__(/*! ./format */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js");
11500 -const metadata_1 = __webpack_require__(/*! ./metadata */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js");
11501 -const draft7Vocabularies = [
11502 - core_1.default,
11503 - validation_1.default,
11504 - (0, applicator_1.default)(),
11505 - format_1.default,
11506 - metadata_1.metadataVocabulary,
11507 - metadata_1.contentVocabulary,
11508 -];
11509 -exports["default"] = draft7Vocabularies;
11510 -//# sourceMappingURL=draft7.js.map
11511 -
11512 -/***/ }),
11513 -
11514 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js":
11515 -/*!****************************************************************************************************!*\
11516 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js ***!
11517 - \****************************************************************************************************/
11518 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11519 -
11520 -
11521 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11522 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11523 -const error = {
11524 - message: ({ schemaCode }) => (0, codegen_1.str) `must match format "${schemaCode}"`,
11525 - params: ({ schemaCode }) => (0, codegen_1._) `{format: ${schemaCode}}`,
11526 -};
11527 -const def = {
11528 - keyword: "format",
11529 - type: ["number", "string"],
11530 - schemaType: "string",
11531 - $data: true,
11532 - error,
11533 - code(cxt, ruleType) {
11534 - const { gen, data, $data, schema, schemaCode, it } = cxt;
11535 - const { opts, errSchemaPath, schemaEnv, self } = it;
11536 - if (!opts.validateFormats)
11537 - return;
11538 - if ($data)
11539 - validate$DataFormat();
11540 - else
11541 - validateFormat();
11542 - function validate$DataFormat() {
11543 - const fmts = gen.scopeValue("formats", {
11544 - ref: self.formats,
11545 - code: opts.code.formats,
11546 - });
11547 - const fDef = gen.const("fDef", (0, codegen_1._) `${fmts}[${schemaCode}]`);
11548 - const fType = gen.let("fType");
11549 - const format = gen.let("format");
11550 - // TODO simplify
11551 - gen.if((0, codegen_1._) `typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._) `${fDef}.type || "string"`).assign(format, (0, codegen_1._) `${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._) `"string"`).assign(format, fDef));
11552 - cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt()));
11553 - function unknownFmt() {
11554 - if (opts.strictSchema === false)
11555 - return codegen_1.nil;
11556 - return (0, codegen_1._) `${schemaCode} && !${format}`;
11557 - }
11558 - function invalidFmt() {
11559 - const callFormat = schemaEnv.$async
11560 - ? (0, codegen_1._) `(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))`
11561 - : (0, codegen_1._) `${format}(${data})`;
11562 - const validData = (0, codegen_1._) `(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`;
11563 - return (0, codegen_1._) `${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`;
11564 - }
11565 - }
11566 - function validateFormat() {
11567 - const formatDef = self.formats[schema];
11568 - if (!formatDef) {
11569 - unknownFormat();
11570 - return;
11571 - }
11572 - if (formatDef === true)
11573 - return;
11574 - const [fmtType, format, fmtRef] = getFormat(formatDef);
11575 - if (fmtType === ruleType)
11576 - cxt.pass(validCondition());
11577 - function unknownFormat() {
11578 - if (opts.strictSchema === false) {
11579 - self.logger.warn(unknownMsg());
11580 - return;
11581 - }
11582 - throw new Error(unknownMsg());
11583 - function unknownMsg() {
11584 - return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`;
11585 - }
11586 - }
11587 - function getFormat(fmtDef) {
11588 - const code = fmtDef instanceof RegExp
11589 - ? (0, codegen_1.regexpCode)(fmtDef)
11590 - : opts.code.formats
11591 - ? (0, codegen_1._) `${opts.code.formats}${(0, codegen_1.getProperty)(schema)}`
11592 - : undefined;
11593 - const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
11594 - if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
11595 - return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._) `${fmt}.validate`];
11596 - }
11597 - return ["string", fmtDef, fmt];
11598 - }
11599 - function validCondition() {
11600 - if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) {
11601 - if (!schemaEnv.$async)
11602 - throw new Error("async format in sync schema");
11603 - return (0, codegen_1._) `await ${fmtRef}(${data})`;
11604 - }
11605 - return typeof format == "function" ? (0, codegen_1._) `${fmtRef}(${data})` : (0, codegen_1._) `${fmtRef}.test(${data})`;
11606 - }
11607 - }
11608 - },
11609 -};
11610 -exports["default"] = def;
11611 -//# sourceMappingURL=format.js.map
11612 -
11613 -/***/ }),
11614 -
11615 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js":
11616 -/*!***************************************************************************************************!*\
11617 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js ***!
11618 - \***************************************************************************************************/
11619 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11620 -
11621 -
11622 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11623 -const format_1 = __webpack_require__(/*! ./format */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js");
11624 -const format = [format_1.default];
11625 -exports["default"] = format;
11626 -//# sourceMappingURL=index.js.map
11627 -
11628 -/***/ }),
11629 -
11630 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js":
11631 -/*!***********************************************************************************************!*\
11632 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js ***!
11633 - \***********************************************************************************************/
11634 -/***/ (function(__unused_webpack_module, exports) {
11635 -
11636 -
11637 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11638 -exports.contentVocabulary = exports.metadataVocabulary = void 0;
11639 -exports.metadataVocabulary = [
11640 - "title",
11641 - "description",
11642 - "default",
11643 - "deprecated",
11644 - "readOnly",
11645 - "writeOnly",
11646 - "examples",
11647 -];
11648 -exports.contentVocabulary = [
11649 - "contentMediaType",
11650 - "contentEncoding",
11651 - "contentSchema",
11652 -];
11653 -//# sourceMappingURL=metadata.js.map
11654 -
11655 -/***/ }),
11656 -
11657 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js":
11658 -/*!*******************************************************************************************************!*\
11659 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js ***!
11660 - \*******************************************************************************************************/
11661 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11662 -
11663 -
11664 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11665 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11666 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
11667 -const equal_1 = __webpack_require__(/*! ../../runtime/equal */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js");
11668 -const error = {
11669 - message: "must be equal to constant",
11670 - params: ({ schemaCode }) => (0, codegen_1._) `{allowedValue: ${schemaCode}}`,
11671 -};
11672 -const def = {
11673 - keyword: "const",
11674 - $data: true,
11675 - error,
11676 - code(cxt) {
11677 - const { gen, data, $data, schemaCode, schema } = cxt;
11678 - if ($data || (schema && typeof schema == "object")) {
11679 - cxt.fail$data((0, codegen_1._) `!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`);
11680 - }
11681 - else {
11682 - cxt.fail((0, codegen_1._) `${schema} !== ${data}`);
11683 - }
11684 - },
11685 -};
11686 -exports["default"] = def;
11687 -//# sourceMappingURL=const.js.map
11688 -
11689 -/***/ }),
11690 -
11691 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js":
11692 -/*!******************************************************************************************************!*\
11693 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js ***!
11694 - \******************************************************************************************************/
11695 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11696 -
11697 -
11698 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11699 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11700 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
11701 -const equal_1 = __webpack_require__(/*! ../../runtime/equal */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js");
11702 -const error = {
11703 - message: "must be equal to one of the allowed values",
11704 - params: ({ schemaCode }) => (0, codegen_1._) `{allowedValues: ${schemaCode}}`,
11705 -};
11706 -const def = {
11707 - keyword: "enum",
11708 - schemaType: "array",
11709 - $data: true,
11710 - error,
11711 - code(cxt) {
11712 - const { gen, data, $data, schema, schemaCode, it } = cxt;
11713 - if (!$data && schema.length === 0)
11714 - throw new Error("enum must have non-empty array");
11715 - const useLoop = schema.length >= it.opts.loopEnum;
11716 - let eql;
11717 - const getEql = () => (eql !== null && eql !== void 0 ? eql : (eql = (0, util_1.useFunc)(gen, equal_1.default)));
11718 - let valid;
11719 - if (useLoop || $data) {
11720 - valid = gen.let("valid");
11721 - cxt.block$data(valid, loopEnum);
11722 - }
11723 - else {
11724 - /* istanbul ignore if */
11725 - if (!Array.isArray(schema))
11726 - throw new Error("ajv implementation error");
11727 - const vSchema = gen.const("vSchema", schemaCode);
11728 - valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i)));
11729 - }
11730 - cxt.pass(valid);
11731 - function loopEnum() {
11732 - gen.assign(valid, false);
11733 - gen.forOf("v", schemaCode, (v) => gen.if((0, codegen_1._) `${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break()));
11734 - }
11735 - function equalCode(vSchema, i) {
11736 - const sch = schema[i];
11737 - return typeof sch === "object" && sch !== null
11738 - ? (0, codegen_1._) `${getEql()}(${data}, ${vSchema}[${i}])`
11739 - : (0, codegen_1._) `${data} === ${sch}`;
11740 - }
11741 - },
11742 -};
11743 -exports["default"] = def;
11744 -//# sourceMappingURL=enum.js.map
11745 -
11746 -/***/ }),
11747 -
11748 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js":
11749 -/*!*******************************************************************************************************!*\
11750 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js ***!
11751 - \*******************************************************************************************************/
11752 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11753 -
11754 -
11755 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11756 -const limitNumber_1 = __webpack_require__(/*! ./limitNumber */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js");
11757 -const multipleOf_1 = __webpack_require__(/*! ./multipleOf */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js");
11758 -const limitLength_1 = __webpack_require__(/*! ./limitLength */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js");
11759 -const pattern_1 = __webpack_require__(/*! ./pattern */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js");
11760 -const limitProperties_1 = __webpack_require__(/*! ./limitProperties */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js");
11761 -const required_1 = __webpack_require__(/*! ./required */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js");
11762 -const limitItems_1 = __webpack_require__(/*! ./limitItems */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js");
11763 -const uniqueItems_1 = __webpack_require__(/*! ./uniqueItems */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js");
11764 -const const_1 = __webpack_require__(/*! ./const */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js");
11765 -const enum_1 = __webpack_require__(/*! ./enum */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js");
11766 -const validation = [
11767 - // number
11768 - limitNumber_1.default,
11769 - multipleOf_1.default,
11770 - // string
11771 - limitLength_1.default,
11772 - pattern_1.default,
11773 - // object
11774 - limitProperties_1.default,
11775 - required_1.default,
11776 - // array
11777 - limitItems_1.default,
11778 - uniqueItems_1.default,
11779 - // any
11780 - { keyword: "type", schemaType: ["string", "array"] },
11781 - { keyword: "nullable", schemaType: "boolean" },
11782 - const_1.default,
11783 - enum_1.default,
11784 -];
11785 -exports["default"] = validation;
11786 -//# sourceMappingURL=index.js.map
11787 -
11788 -/***/ }),
11789 -
11790 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js":
11791 -/*!************************************************************************************************************!*\
11792 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js ***!
11793 - \************************************************************************************************************/
11794 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11795 -
11796 -
11797 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11798 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11799 -const error = {
11800 - message({ keyword, schemaCode }) {
11801 - const comp = keyword === "maxItems" ? "more" : "fewer";
11802 - return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} items`;
11803 - },
11804 - params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
11805 -};
11806 -const def = {
11807 - keyword: ["maxItems", "minItems"],
11808 - type: "array",
11809 - schemaType: "number",
11810 - $data: true,
11811 - error,
11812 - code(cxt) {
11813 - const { keyword, data, schemaCode } = cxt;
11814 - const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT;
11815 - cxt.fail$data((0, codegen_1._) `${data}.length ${op} ${schemaCode}`);
11816 - },
11817 -};
11818 -exports["default"] = def;
11819 -//# sourceMappingURL=limitItems.js.map
11820 -
11821 -/***/ }),
11822 -
11823 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js":
11824 -/*!*************************************************************************************************************!*\
11825 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js ***!
11826 - \*************************************************************************************************************/
11827 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11828 -
11829 -
11830 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11831 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11832 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
11833 -const ucs2length_1 = __webpack_require__(/*! ../../runtime/ucs2length */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js");
11834 -const error = {
11835 - message({ keyword, schemaCode }) {
11836 - const comp = keyword === "maxLength" ? "more" : "fewer";
11837 - return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} characters`;
11838 - },
11839 - params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
11840 -};
11841 -const def = {
11842 - keyword: ["maxLength", "minLength"],
11843 - type: "string",
11844 - schemaType: "number",
11845 - $data: true,
11846 - error,
11847 - code(cxt) {
11848 - const { keyword, data, schemaCode, it } = cxt;
11849 - const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT;
11850 - const len = it.opts.unicode === false ? (0, codegen_1._) `${data}.length` : (0, codegen_1._) `${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`;
11851 - cxt.fail$data((0, codegen_1._) `${len} ${op} ${schemaCode}`);
11852 - },
11853 -};
11854 -exports["default"] = def;
11855 -//# sourceMappingURL=limitLength.js.map
11856 -
11857 -/***/ }),
11858 -
11859 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js":
11860 -/*!*************************************************************************************************************!*\
11861 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js ***!
11862 - \*************************************************************************************************************/
11863 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11864 -
11865 -
11866 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11867 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11868 -const ops = codegen_1.operators;
11869 -const KWDs = {
11870 - maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT },
11871 - minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT },
11872 - exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE },
11873 - exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE },
11874 -};
11875 -const error = {
11876 - message: ({ keyword, schemaCode }) => (0, codegen_1.str) `must be ${KWDs[keyword].okStr} ${schemaCode}`,
11877 - params: ({ keyword, schemaCode }) => (0, codegen_1._) `{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}`,
11878 -};
11879 -const def = {
11880 - keyword: Object.keys(KWDs),
11881 - type: "number",
11882 - schemaType: "number",
11883 - $data: true,
11884 - error,
11885 - code(cxt) {
11886 - const { keyword, data, schemaCode } = cxt;
11887 - cxt.fail$data((0, codegen_1._) `${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`);
11888 - },
11889 -};
11890 -exports["default"] = def;
11891 -//# sourceMappingURL=limitNumber.js.map
11892 -
11893 -/***/ }),
11894 -
11895 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js":
11896 -/*!*****************************************************************************************************************!*\
11897 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js ***!
11898 - \*****************************************************************************************************************/
11899 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11900 -
11901 -
11902 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11903 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11904 -const error = {
11905 - message({ keyword, schemaCode }) {
11906 - const comp = keyword === "maxProperties" ? "more" : "fewer";
11907 - return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`;
11908 - },
11909 - params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
11910 -};
11911 -const def = {
11912 - keyword: ["maxProperties", "minProperties"],
11913 - type: "object",
11914 - schemaType: "number",
11915 - $data: true,
11916 - error,
11917 - code(cxt) {
11918 - const { keyword, data, schemaCode } = cxt;
11919 - const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
11920 - cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`);
11921 - },
11922 -};
11923 -exports["default"] = def;
11924 -//# sourceMappingURL=limitProperties.js.map
11925 -
11926 -/***/ }),
11927 -
11928 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js":
11929 -/*!************************************************************************************************************!*\
11930 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js ***!
11931 - \************************************************************************************************************/
11932 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11933 -
11934 -
11935 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11936 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11937 -const error = {
11938 - message: ({ schemaCode }) => (0, codegen_1.str) `must be multiple of ${schemaCode}`,
11939 - params: ({ schemaCode }) => (0, codegen_1._) `{multipleOf: ${schemaCode}}`,
11940 -};
11941 -const def = {
11942 - keyword: "multipleOf",
11943 - type: "number",
11944 - schemaType: "number",
11945 - $data: true,
11946 - error,
11947 - code(cxt) {
11948 - const { gen, data, schemaCode, it } = cxt;
11949 - // const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)
11950 - const prec = it.opts.multipleOfPrecision;
11951 - const res = gen.let("res");
11952 - const invalid = prec
11953 - ? (0, codegen_1._) `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`
11954 - : (0, codegen_1._) `${res} !== parseInt(${res})`;
11955 - cxt.fail$data((0, codegen_1._) `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
11956 - },
11957 -};
11958 -exports["default"] = def;
11959 -//# sourceMappingURL=multipleOf.js.map
11960 -
11961 -/***/ }),
11962 -
11963 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js":
11964 -/*!*********************************************************************************************************!*\
11965 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js ***!
11966 - \*********************************************************************************************************/
11967 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
11968 -
11969 -
11970 -Object.defineProperty(exports, "__esModule", ({ value: true }));
11971 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
11972 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
11973 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
11974 -const error = {
11975 - message: ({ schemaCode }) => (0, codegen_1.str) `must match pattern "${schemaCode}"`,
11976 - params: ({ schemaCode }) => (0, codegen_1._) `{pattern: ${schemaCode}}`,
11977 -};
11978 -const def = {
11979 - keyword: "pattern",
11980 - type: "string",
11981 - schemaType: "string",
11982 - $data: true,
11983 - error,
11984 - code(cxt) {
11985 - const { gen, data, $data, schema, schemaCode, it } = cxt;
11986 - const u = it.opts.unicodeRegExp ? "u" : "";
11987 - if ($data) {
11988 - const { regExp } = it.opts.code;
11989 - const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._) `new RegExp` : (0, util_1.useFunc)(gen, regExp);
11990 - const valid = gen.let("valid");
11991 - gen.try(() => gen.assign(valid, (0, codegen_1._) `${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
11992 - cxt.fail$data((0, codegen_1._) `!${valid}`);
11993 - }
11994 - else {
11995 - const regExp = (0, code_1.usePattern)(cxt, schema);
11996 - cxt.fail$data((0, codegen_1._) `!${regExp}.test(${data})`);
11997 - }
11998 - },
11999 -};
12000 -exports["default"] = def;
12001 -//# sourceMappingURL=pattern.js.map
12002 -
12003 -/***/ }),
12004 -
12005 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js":
12006 -/*!**********************************************************************************************************!*\
12007 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js ***!
12008 - \**********************************************************************************************************/
12009 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12010 -
12011 -
12012 -Object.defineProperty(exports, "__esModule", ({ value: true }));
12013 -const code_1 = __webpack_require__(/*! ../code */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");
12014 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
12015 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
12016 -const error = {
12017 - message: ({ params: { missingProperty } }) => (0, codegen_1.str) `must have required property '${missingProperty}'`,
12018 - params: ({ params: { missingProperty } }) => (0, codegen_1._) `{missingProperty: ${missingProperty}}`,
12019 -};
12020 -const def = {
12021 - keyword: "required",
12022 - type: "object",
12023 - schemaType: "array",
12024 - $data: true,
12025 - error,
12026 - code(cxt) {
12027 - const { gen, schema, schemaCode, data, $data, it } = cxt;
12028 - const { opts } = it;
12029 - if (!$data && schema.length === 0)
12030 - return;
12031 - const useLoop = schema.length >= opts.loopRequired;
12032 - if (it.allErrors)
12033 - allErrorsMode();
12034 - else
12035 - exitOnErrorMode();
12036 - if (opts.strictRequired) {
12037 - const props = cxt.parentSchema.properties;
12038 - const { definedProperties } = cxt.it;
12039 - for (const requiredKey of schema) {
12040 - if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) {
12041 - const schemaPath = it.schemaEnv.baseId + it.errSchemaPath;
12042 - const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`;
12043 - (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired);
12044 - }
12045 - }
12046 - }
12047 - function allErrorsMode() {
12048 - if (useLoop || $data) {
12049 - cxt.block$data(codegen_1.nil, loopAllRequired);
12050 - }
12051 - else {
12052 - for (const prop of schema) {
12053 - (0, code_1.checkReportMissingProp)(cxt, prop);
12054 - }
12055 - }
12056 - }
12057 - function exitOnErrorMode() {
12058 - const missing = gen.let("missing");
12059 - if (useLoop || $data) {
12060 - const valid = gen.let("valid", true);
12061 - cxt.block$data(valid, () => loopUntilMissing(missing, valid));
12062 - cxt.ok(valid);
12063 - }
12064 - else {
12065 - gen.if((0, code_1.checkMissingProp)(cxt, schema, missing));
12066 - (0, code_1.reportMissingProp)(cxt, missing);
12067 - gen.else();
12068 - }
12069 - }
12070 - function loopAllRequired() {
12071 - gen.forOf("prop", schemaCode, (prop) => {
12072 - cxt.setParams({ missingProperty: prop });
12073 - gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error());
12074 - });
12075 - }
12076 - function loopUntilMissing(missing, valid) {
12077 - cxt.setParams({ missingProperty: missing });
12078 - gen.forOf(missing, schemaCode, () => {
12079 - gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties));
12080 - gen.if((0, codegen_1.not)(valid), () => {
12081 - cxt.error();
12082 - gen.break();
12083 - });
12084 - }, codegen_1.nil);
12085 - }
12086 - },
12087 -};
12088 -exports["default"] = def;
12089 -//# sourceMappingURL=required.js.map
12090 -
12091 -/***/ }),
12092 -
12093 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js":
12094 -/*!*************************************************************************************************************!*\
12095 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js ***!
12096 - \*************************************************************************************************************/
12097 -/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12098 -
12099 -
12100 -Object.defineProperty(exports, "__esModule", ({ value: true }));
12101 -const dataType_1 = __webpack_require__(/*! ../../compile/validate/dataType */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js");
12102 -const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");
12103 -const util_1 = __webpack_require__(/*! ../../compile/util */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");
12104 -const equal_1 = __webpack_require__(/*! ../../runtime/equal */ "./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js");
12105 -const error = {
12106 - message: ({ params: { i, j } }) => (0, codegen_1.str) `must NOT have duplicate items (items ## ${j} and ${i} are identical)`,
12107 - params: ({ params: { i, j } }) => (0, codegen_1._) `{i: ${i}, j: ${j}}`,
12108 -};
12109 -const def = {
12110 - keyword: "uniqueItems",
12111 - type: "array",
12112 - schemaType: "boolean",
12113 - $data: true,
12114 - error,
12115 - code(cxt) {
12116 - const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt;
12117 - if (!$data && !schema)
12118 - return;
12119 - const valid = gen.let("valid");
12120 - const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : [];
12121 - cxt.block$data(valid, validateUniqueItems, (0, codegen_1._) `${schemaCode} === false`);
12122 - cxt.ok(valid);
12123 - function validateUniqueItems() {
12124 - const i = gen.let("i", (0, codegen_1._) `${data}.length`);
12125 - const j = gen.let("j");
12126 - cxt.setParams({ i, j });
12127 - gen.assign(valid, true);
12128 - gen.if((0, codegen_1._) `${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j));
12129 - }
12130 - function canOptimize() {
12131 - return itemTypes.length > 0 && !itemTypes.some((t) => t === "object" || t === "array");
12132 - }
12133 - function loopN(i, j) {
12134 - const item = gen.name("item");
12135 - const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong);
12136 - const indices = gen.const("indices", (0, codegen_1._) `{}`);
12137 - gen.for((0, codegen_1._) `;${i}--;`, () => {
12138 - gen.let(item, (0, codegen_1._) `${data}[${i}]`);
12139 - gen.if(wrongType, (0, codegen_1._) `continue`);
12140 - if (itemTypes.length > 1)
12141 - gen.if((0, codegen_1._) `typeof ${item} == "string"`, (0, codegen_1._) `${item} += "_"`);
12142 - gen
12143 - .if((0, codegen_1._) `typeof ${indices}[${item}] == "number"`, () => {
12144 - gen.assign(j, (0, codegen_1._) `${indices}[${item}]`);
12145 - cxt.error();
12146 - gen.assign(valid, false).break();
12147 - })
12148 - .code((0, codegen_1._) `${indices}[${item}] = ${i}`);
12149 - });
12150 - }
12151 - function loopN2(i, j) {
12152 - const eql = (0, util_1.useFunc)(gen, equal_1.default);
12153 - const outer = gen.name("outer");
12154 - gen.label(outer).for((0, codegen_1._) `;${i}--;`, () => gen.for((0, codegen_1._) `${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._) `${eql}(${data}[${i}], ${data}[${j}])`, () => {
12155 - cxt.error();
12156 - gen.assign(valid, false).break(outer);
12157 - })));
12158 - }
12159 - },
12160 -};
12161 -exports["default"] = def;
12162 -//# sourceMappingURL=uniqueItems.js.map
12163 -
12164 -/***/ }),
12165 -
12166 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js":
12167 -/*!*******************************************************************************************!*\
12168 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js ***!
12169 - \*******************************************************************************************/
12170 -/***/ (function(module) {
12171 -
12172 -
12173 -
12174 -var traverse = module.exports = function (schema, opts, cb) {
12175 - // Legacy support for v0.3.1 and earlier.
12176 - if (typeof opts == 'function') {
12177 - cb = opts;
12178 - opts = {};
12179 - }
12180 -
12181 - cb = opts.cb || cb;
12182 - var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};
12183 - var post = cb.post || function() {};
12184 -
12185 - _traverse(opts, pre, post, schema, '', schema);
12186 -};
12187 -
12188 -
12189 -traverse.keywords = {
12190 - additionalItems: true,
12191 - items: true,
12192 - contains: true,
12193 - additionalProperties: true,
12194 - propertyNames: true,
12195 - not: true,
12196 - if: true,
12197 - then: true,
12198 - else: true
12199 -};
12200 -
12201 -traverse.arrayKeywords = {
12202 - items: true,
12203 - allOf: true,
12204 - anyOf: true,
12205 - oneOf: true
12206 -};
12207 -
12208 -traverse.propsKeywords = {
12209 - $defs: true,
12210 - definitions: true,
12211 - properties: true,
12212 - patternProperties: true,
12213 - dependencies: true
12214 -};
12215 -
12216 -traverse.skipKeywords = {
12217 - default: true,
12218 - enum: true,
12219 - const: true,
12220 - required: true,
12221 - maximum: true,
12222 - minimum: true,
12223 - exclusiveMaximum: true,
12224 - exclusiveMinimum: true,
12225 - multipleOf: true,
12226 - maxLength: true,
12227 - minLength: true,
12228 - pattern: true,
12229 - format: true,
12230 - maxItems: true,
12231 - minItems: true,
12232 - uniqueItems: true,
12233 - maxProperties: true,
12234 - minProperties: true
12235 -};
12236 -
12237 -
12238 -function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
12239 - if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
12240 - pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
12241 - for (var key in schema) {
12242 - var sch = schema[key];
12243 - if (Array.isArray(sch)) {
12244 - if (key in traverse.arrayKeywords) {
12245 - for (var i=0; i<sch.length; i++)
12246 - _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
12247 - }
12248 - } else if (key in traverse.propsKeywords) {
12249 - if (sch && typeof sch == 'object') {
12250 - for (var prop in sch)
12251 - _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
12252 - }
12253 - } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
12254 - _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
12255 - }
12256 - }
12257 - post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
12258 - }
12259 -}
12260 -
12261 -
12262 -function escapeJsonPtr(str) {
12263 - return str.replace(/~/g, '~0').replace(/\//g, '~1');
12264 -}
12265 -
12266 -
12267 -/***/ }),
12268 -
12269 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js":
12270 -/*!****************************************************************************************************!*\
12271 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js ***!
12272 - \****************************************************************************************************/
12273 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12274 -
12275 -__webpack_require__.r(__webpack_exports__);
12276 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12277 -/* harmony export */ defaultOptions: function() { return /* binding */ defaultOptions; },
12278 -/* harmony export */ getDefaultOptions: function() { return /* binding */ getDefaultOptions; },
12279 -/* harmony export */ ignoreOverride: function() { return /* binding */ ignoreOverride; },
12280 -/* harmony export */ jsonDescription: function() { return /* binding */ jsonDescription; }
12281 -/* harmony export */ });
12282 -const ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
12283 -const jsonDescription = (jsonSchema, def) => {
12284 - if (def.description) {
12285 - try {
12286 - return {
12287 - ...jsonSchema,
12288 - ...JSON.parse(def.description),
12289 - };
12290 - }
12291 - catch { }
12292 - }
12293 - return jsonSchema;
12294 -};
12295 -const defaultOptions = {
12296 - name: undefined,
12297 - $refStrategy: "root",
12298 - basePath: ["#"],
12299 - effectStrategy: "input",
12300 - pipeStrategy: "all",
12301 - dateStrategy: "format:date-time",
12302 - mapStrategy: "entries",
12303 - removeAdditionalStrategy: "passthrough",
12304 - allowedAdditionalProperties: true,
12305 - rejectedAdditionalProperties: false,
12306 - definitionPath: "definitions",
12307 - target: "jsonSchema7",
12308 - strictUnions: false,
12309 - definitions: {},
12310 - errorMessages: false,
12311 - markdownDescription: false,
12312 - patternStrategy: "escape",
12313 - applyRegexFlags: false,
12314 - emailStrategy: "format:email",
12315 - base64Strategy: "contentEncoding:base64",
12316 - nameStrategy: "ref",
12317 - openAiAnyTypeName: "OpenAiAnyType"
12318 -};
12319 -const getDefaultOptions = (options) => (typeof options === "string"
12320 - ? {
12321 - ...defaultOptions,
12322 - name: options,
12323 - }
12324 - : {
12325 - ...defaultOptions,
12326 - ...options,
12327 - });
12328 -
12329 -
12330 -/***/ }),
12331 -
12332 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js":
12333 -/*!*************************************************************************************************!*\
12334 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js ***!
12335 - \*************************************************************************************************/
12336 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12337 -
12338 -__webpack_require__.r(__webpack_exports__);
12339 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12340 -/* harmony export */ getRefs: function() { return /* binding */ getRefs; }
12341 -/* harmony export */ });
12342 -/* harmony import */ var _Options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js");
12343 -
12344 -const getRefs = (options) => {
12345 - const _options = (0,_Options_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions)(options);
12346 - const currentPath = _options.name !== undefined
12347 - ? [..._options.basePath, _options.definitionPath, _options.name]
12348 - : _options.basePath;
12349 - return {
12350 - ..._options,
12351 - flags: { hasReferencedOpenAiAnyType: false },
12352 - currentPath: currentPath,
12353 - propertyPath: undefined,
12354 - seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
12355 - def._def,
12356 - {
12357 - def: def._def,
12358 - path: [..._options.basePath, _options.definitionPath, name],
12359 - // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
12360 - jsonSchema: undefined,
12361 - },
12362 - ])),
12363 - };
12364 -};
12365 -
12366 -
12367 -/***/ }),
12368 -
12369 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js":
12370 -/*!**********************************************************************************************************!*\
12371 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js ***!
12372 - \**********************************************************************************************************/
12373 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12374 -
12375 -__webpack_require__.r(__webpack_exports__);
12376 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12377 -/* harmony export */ addErrorMessage: function() { return /* binding */ addErrorMessage; },
12378 -/* harmony export */ setResponseValueAndErrors: function() { return /* binding */ setResponseValueAndErrors; }
12379 -/* harmony export */ });
12380 -function addErrorMessage(res, key, errorMessage, refs) {
12381 - if (!refs?.errorMessages)
12382 - return;
12383 - if (errorMessage) {
12384 - res.errorMessage = {
12385 - ...res.errorMessage,
12386 - [key]: errorMessage,
12387 - };
12388 - }
12389 -}
12390 -function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
12391 - res[key] = value;
12392 - addErrorMessage(res, key, errorMessage, refs);
12393 -}
12394 -
12395 -
12396 -/***/ }),
12397 -
12398 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js":
12399 -/*!************************************************************************************************************!*\
12400 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js ***!
12401 - \************************************************************************************************************/
12402 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12403 -
12404 -__webpack_require__.r(__webpack_exports__);
12405 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12406 -/* harmony export */ getRelativePath: function() { return /* binding */ getRelativePath; }
12407 -/* harmony export */ });
12408 -const getRelativePath = (pathA, pathB) => {
12409 - let i = 0;
12410 - for (; i < pathA.length && i < pathB.length; i++) {
12411 - if (pathA[i] !== pathB[i])
12412 - break;
12413 - }
12414 - return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
12415 -};
12416 -
12417 -
12418 -/***/ }),
12419 -
12420 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/index.js":
12421 -/*!**************************************************************************************************!*\
12422 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/index.js ***!
12423 - \**************************************************************************************************/
12424 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12425 -
12426 -__webpack_require__.r(__webpack_exports__);
12427 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12428 -/* harmony export */ addErrorMessage: function() { return /* reexport safe */ _errorMessages_js__WEBPACK_IMPORTED_MODULE_2__.addErrorMessage; },
12429 -/* harmony export */ defaultOptions: function() { return /* reexport safe */ _Options_js__WEBPACK_IMPORTED_MODULE_0__.defaultOptions; },
12430 -/* harmony export */ getDefaultOptions: function() { return /* reexport safe */ _Options_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions; },
12431 -/* harmony export */ getRefs: function() { return /* reexport safe */ _Refs_js__WEBPACK_IMPORTED_MODULE_1__.getRefs; },
12432 -/* harmony export */ getRelativePath: function() { return /* reexport safe */ _getRelativePath_js__WEBPACK_IMPORTED_MODULE_3__.getRelativePath; },
12433 -/* harmony export */ ignoreOverride: function() { return /* reexport safe */ _Options_js__WEBPACK_IMPORTED_MODULE_0__.ignoreOverride; },
12434 -/* harmony export */ jsonDescription: function() { return /* reexport safe */ _Options_js__WEBPACK_IMPORTED_MODULE_0__.jsonDescription; },
12435 -/* harmony export */ parseAnyDef: function() { return /* reexport safe */ _parsers_any_js__WEBPACK_IMPORTED_MODULE_6__.parseAnyDef; },
12436 -/* harmony export */ parseArrayDef: function() { return /* reexport safe */ _parsers_array_js__WEBPACK_IMPORTED_MODULE_7__.parseArrayDef; },
12437 -/* harmony export */ parseBigintDef: function() { return /* reexport safe */ _parsers_bigint_js__WEBPACK_IMPORTED_MODULE_8__.parseBigintDef; },
12438 -/* harmony export */ parseBooleanDef: function() { return /* reexport safe */ _parsers_boolean_js__WEBPACK_IMPORTED_MODULE_9__.parseBooleanDef; },
12439 -/* harmony export */ parseBrandedDef: function() { return /* reexport safe */ _parsers_branded_js__WEBPACK_IMPORTED_MODULE_10__.parseBrandedDef; },
12440 -/* harmony export */ parseCatchDef: function() { return /* reexport safe */ _parsers_catch_js__WEBPACK_IMPORTED_MODULE_11__.parseCatchDef; },
12441 -/* harmony export */ parseDateDef: function() { return /* reexport safe */ _parsers_date_js__WEBPACK_IMPORTED_MODULE_12__.parseDateDef; },
12442 -/* harmony export */ parseDef: function() { return /* reexport safe */ _parseDef_js__WEBPACK_IMPORTED_MODULE_4__.parseDef; },
12443 -/* harmony export */ parseDefaultDef: function() { return /* reexport safe */ _parsers_default_js__WEBPACK_IMPORTED_MODULE_13__.parseDefaultDef; },
12444 -/* harmony export */ parseEffectsDef: function() { return /* reexport safe */ _parsers_effects_js__WEBPACK_IMPORTED_MODULE_14__.parseEffectsDef; },
12445 -/* harmony export */ parseEnumDef: function() { return /* reexport safe */ _parsers_enum_js__WEBPACK_IMPORTED_MODULE_15__.parseEnumDef; },
12446 -/* harmony export */ parseIntersectionDef: function() { return /* reexport safe */ _parsers_intersection_js__WEBPACK_IMPORTED_MODULE_16__.parseIntersectionDef; },
12447 -/* harmony export */ parseLiteralDef: function() { return /* reexport safe */ _parsers_literal_js__WEBPACK_IMPORTED_MODULE_17__.parseLiteralDef; },
12448 -/* harmony export */ parseMapDef: function() { return /* reexport safe */ _parsers_map_js__WEBPACK_IMPORTED_MODULE_18__.parseMapDef; },
12449 -/* harmony export */ parseNativeEnumDef: function() { return /* reexport safe */ _parsers_nativeEnum_js__WEBPACK_IMPORTED_MODULE_19__.parseNativeEnumDef; },
12450 -/* harmony export */ parseNeverDef: function() { return /* reexport safe */ _parsers_never_js__WEBPACK_IMPORTED_MODULE_20__.parseNeverDef; },
12451 -/* harmony export */ parseNullDef: function() { return /* reexport safe */ _parsers_null_js__WEBPACK_IMPORTED_MODULE_21__.parseNullDef; },
12452 -/* harmony export */ parseNullableDef: function() { return /* reexport safe */ _parsers_nullable_js__WEBPACK_IMPORTED_MODULE_22__.parseNullableDef; },
12453 -/* harmony export */ parseNumberDef: function() { return /* reexport safe */ _parsers_number_js__WEBPACK_IMPORTED_MODULE_23__.parseNumberDef; },
12454 -/* harmony export */ parseObjectDef: function() { return /* reexport safe */ _parsers_object_js__WEBPACK_IMPORTED_MODULE_24__.parseObjectDef; },
12455 -/* harmony export */ parseOptionalDef: function() { return /* reexport safe */ _parsers_optional_js__WEBPACK_IMPORTED_MODULE_25__.parseOptionalDef; },
12456 -/* harmony export */ parsePipelineDef: function() { return /* reexport safe */ _parsers_pipeline_js__WEBPACK_IMPORTED_MODULE_26__.parsePipelineDef; },
12457 -/* harmony export */ parsePromiseDef: function() { return /* reexport safe */ _parsers_promise_js__WEBPACK_IMPORTED_MODULE_27__.parsePromiseDef; },
12458 -/* harmony export */ parseReadonlyDef: function() { return /* reexport safe */ _parsers_readonly_js__WEBPACK_IMPORTED_MODULE_28__.parseReadonlyDef; },
12459 -/* harmony export */ parseRecordDef: function() { return /* reexport safe */ _parsers_record_js__WEBPACK_IMPORTED_MODULE_29__.parseRecordDef; },
12460 -/* harmony export */ parseSetDef: function() { return /* reexport safe */ _parsers_set_js__WEBPACK_IMPORTED_MODULE_30__.parseSetDef; },
12461 -/* harmony export */ parseStringDef: function() { return /* reexport safe */ _parsers_string_js__WEBPACK_IMPORTED_MODULE_31__.parseStringDef; },
12462 -/* harmony export */ parseTupleDef: function() { return /* reexport safe */ _parsers_tuple_js__WEBPACK_IMPORTED_MODULE_32__.parseTupleDef; },
12463 -/* harmony export */ parseUndefinedDef: function() { return /* reexport safe */ _parsers_undefined_js__WEBPACK_IMPORTED_MODULE_33__.parseUndefinedDef; },
12464 -/* harmony export */ parseUnionDef: function() { return /* reexport safe */ _parsers_union_js__WEBPACK_IMPORTED_MODULE_34__.parseUnionDef; },
12465 -/* harmony export */ parseUnknownDef: function() { return /* reexport safe */ _parsers_unknown_js__WEBPACK_IMPORTED_MODULE_35__.parseUnknownDef; },
12466 -/* harmony export */ primitiveMappings: function() { return /* reexport safe */ _parsers_union_js__WEBPACK_IMPORTED_MODULE_34__.primitiveMappings; },
12467 -/* harmony export */ selectParser: function() { return /* reexport safe */ _selectParser_js__WEBPACK_IMPORTED_MODULE_36__.selectParser; },
12468 -/* harmony export */ setResponseValueAndErrors: function() { return /* reexport safe */ _errorMessages_js__WEBPACK_IMPORTED_MODULE_2__.setResponseValueAndErrors; },
12469 -/* harmony export */ zodPatterns: function() { return /* reexport safe */ _parsers_string_js__WEBPACK_IMPORTED_MODULE_31__.zodPatterns; },
12470 -/* harmony export */ zodToJsonSchema: function() { return /* reexport safe */ _zodToJsonSchema_js__WEBPACK_IMPORTED_MODULE_37__.zodToJsonSchema; }
12471 -/* harmony export */ });
12472 -/* harmony import */ var _Options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js");
12473 -/* harmony import */ var _Refs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Refs.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js");
12474 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./errorMessages.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
12475 -/* harmony import */ var _getRelativePath_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getRelativePath.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");
12476 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
12477 -/* harmony import */ var _parseTypes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parseTypes.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseTypes.js");
12478 -/* harmony import */ var _parsers_any_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parsers/any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
12479 -/* harmony import */ var _parsers_array_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./parsers/array.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js");
12480 -/* harmony import */ var _parsers_bigint_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./parsers/bigint.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js");
12481 -/* harmony import */ var _parsers_boolean_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./parsers/boolean.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js");
12482 -/* harmony import */ var _parsers_branded_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./parsers/branded.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js");
12483 -/* harmony import */ var _parsers_catch_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./parsers/catch.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js");
12484 -/* harmony import */ var _parsers_date_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parsers/date.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js");
12485 -/* harmony import */ var _parsers_default_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./parsers/default.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js");
12486 -/* harmony import */ var _parsers_effects_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./parsers/effects.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js");
12487 -/* harmony import */ var _parsers_enum_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./parsers/enum.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js");
12488 -/* harmony import */ var _parsers_intersection_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./parsers/intersection.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js");
12489 -/* harmony import */ var _parsers_literal_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./parsers/literal.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js");
12490 -/* harmony import */ var _parsers_map_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./parsers/map.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js");
12491 -/* harmony import */ var _parsers_nativeEnum_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./parsers/nativeEnum.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js");
12492 -/* harmony import */ var _parsers_never_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./parsers/never.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js");
12493 -/* harmony import */ var _parsers_null_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./parsers/null.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js");
12494 -/* harmony import */ var _parsers_nullable_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./parsers/nullable.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js");
12495 -/* harmony import */ var _parsers_number_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./parsers/number.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js");
12496 -/* harmony import */ var _parsers_object_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./parsers/object.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js");
12497 -/* harmony import */ var _parsers_optional_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./parsers/optional.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js");
12498 -/* harmony import */ var _parsers_pipeline_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./parsers/pipeline.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js");
12499 -/* harmony import */ var _parsers_promise_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./parsers/promise.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js");
12500 -/* harmony import */ var _parsers_readonly_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./parsers/readonly.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");
12501 -/* harmony import */ var _parsers_record_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./parsers/record.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js");
12502 -/* harmony import */ var _parsers_set_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./parsers/set.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js");
12503 -/* harmony import */ var _parsers_string_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./parsers/string.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js");
12504 -/* harmony import */ var _parsers_tuple_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./parsers/tuple.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js");
12505 -/* harmony import */ var _parsers_undefined_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./parsers/undefined.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js");
12506 -/* harmony import */ var _parsers_union_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./parsers/union.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js");
12507 -/* harmony import */ var _parsers_unknown_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./parsers/unknown.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js");
12508 -/* harmony import */ var _selectParser_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./selectParser.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js");
12509 -/* harmony import */ var _zodToJsonSchema_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./zodToJsonSchema.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js");
12510 -
12511 -
12512 -
12513 -
12514 -
12515 -
12516 -
12517 -
12518 -
12519 -
12520 -
12521 -
12522 -
12523 -
12524 -
12525 -
12526 -
12527 -
12528 -
12529 -
12530 -
12531 -
12532 -
12533 -
12534 -
12535 -
12536 -
12537 -
12538 -
12539 -
12540 -
12541 -
12542 -
12543 -
12544 -
12545 -
12546 -
12547 -
12548 -
12549 -/* harmony default export */ __webpack_exports__["default"] = (_zodToJsonSchema_js__WEBPACK_IMPORTED_MODULE_37__.zodToJsonSchema);
12550 -
12551 -
12552 -/***/ }),
12553 -
12554 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js":
12555 -/*!*****************************************************************************************************!*\
12556 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js ***!
12557 - \*****************************************************************************************************/
12558 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12559 -
12560 -__webpack_require__.r(__webpack_exports__);
12561 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12562 -/* harmony export */ parseDef: function() { return /* binding */ parseDef; }
12563 -/* harmony export */ });
12564 -/* harmony import */ var _Options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js");
12565 -/* harmony import */ var _selectParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectParser.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js");
12566 -/* harmony import */ var _getRelativePath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getRelativePath.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");
12567 -/* harmony import */ var _parsers_any_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parsers/any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
12568 -
12569 -
12570 -
12571 -
12572 -function parseDef(def, refs, forceResolution = false) {
12573 - const seenItem = refs.seen.get(def);
12574 - if (refs.override) {
12575 - const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
12576 - if (overrideResult !== _Options_js__WEBPACK_IMPORTED_MODULE_0__.ignoreOverride) {
12577 - return overrideResult;
12578 - }
12579 - }
12580 - if (seenItem && !forceResolution) {
12581 - const seenSchema = get$ref(seenItem, refs);
12582 - if (seenSchema !== undefined) {
12583 - return seenSchema;
12584 - }
12585 - }
12586 - const newItem = { def, path: refs.currentPath, jsonSchema: undefined };
12587 - refs.seen.set(def, newItem);
12588 - const jsonSchemaOrGetter = (0,_selectParser_js__WEBPACK_IMPORTED_MODULE_1__.selectParser)(def, def.typeName, refs);
12589 - // If the return was a function, then the inner definition needs to be extracted before a call to parseDef (recursive)
12590 - const jsonSchema = typeof jsonSchemaOrGetter === "function"
12591 - ? parseDef(jsonSchemaOrGetter(), refs)
12592 - : jsonSchemaOrGetter;
12593 - if (jsonSchema) {
12594 - addMeta(def, refs, jsonSchema);
12595 - }
12596 - if (refs.postProcess) {
12597 - const postProcessResult = refs.postProcess(jsonSchema, def, refs);
12598 - newItem.jsonSchema = jsonSchema;
12599 - return postProcessResult;
12600 - }
12601 - newItem.jsonSchema = jsonSchema;
12602 - return jsonSchema;
12603 -}
12604 -const get$ref = (item, refs) => {
12605 - switch (refs.$refStrategy) {
12606 - case "root":
12607 - return { $ref: item.path.join("/") };
12608 - case "relative":
12609 - return { $ref: (0,_getRelativePath_js__WEBPACK_IMPORTED_MODULE_2__.getRelativePath)(refs.currentPath, item.path) };
12610 - case "none":
12611 - case "seen": {
12612 - if (item.path.length < refs.currentPath.length &&
12613 - item.path.every((value, index) => refs.currentPath[index] === value)) {
12614 - console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
12615 - return (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_3__.parseAnyDef)(refs);
12616 - }
12617 - return refs.$refStrategy === "seen" ? (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_3__.parseAnyDef)(refs) : undefined;
12618 - }
12619 - }
12620 -};
12621 -const addMeta = (def, refs, jsonSchema) => {
12622 - if (def.description) {
12623 - jsonSchema.description = def.description;
12624 - if (refs.markdownDescription) {
12625 - jsonSchema.markdownDescription = def.description;
12626 - }
12627 - }
12628 - return jsonSchema;
12629 -};
12630 -
12631 -
12632 -/***/ }),
12633 -
12634 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseTypes.js":
12635 -/*!*******************************************************************************************************!*\
12636 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseTypes.js ***!
12637 - \*******************************************************************************************************/
12638 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12639 -
12640 -__webpack_require__.r(__webpack_exports__);
12641 -
12642 -
12643 -
12644 -/***/ }),
12645 -
12646 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js":
12647 -/*!********************************************************************************************************!*\
12648 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js ***!
12649 - \********************************************************************************************************/
12650 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12651 -
12652 -__webpack_require__.r(__webpack_exports__);
12653 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12654 -/* harmony export */ parseAnyDef: function() { return /* binding */ parseAnyDef; }
12655 -/* harmony export */ });
12656 -/* harmony import */ var _getRelativePath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getRelativePath.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");
12657 -
12658 -function parseAnyDef(refs) {
12659 - if (refs.target !== "openAi") {
12660 - return {};
12661 - }
12662 - const anyDefinitionPath = [
12663 - ...refs.basePath,
12664 - refs.definitionPath,
12665 - refs.openAiAnyTypeName,
12666 - ];
12667 - refs.flags.hasReferencedOpenAiAnyType = true;
12668 - return {
12669 - $ref: refs.$refStrategy === "relative"
12670 - ? (0,_getRelativePath_js__WEBPACK_IMPORTED_MODULE_0__.getRelativePath)(anyDefinitionPath, refs.currentPath)
12671 - : anyDefinitionPath.join("/"),
12672 - };
12673 -}
12674 -
12675 -
12676 -/***/ }),
12677 -
12678 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js":
12679 -/*!**********************************************************************************************************!*\
12680 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js ***!
12681 - \**********************************************************************************************************/
12682 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12683 -
12684 -__webpack_require__.r(__webpack_exports__);
12685 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12686 -/* harmony export */ parseArrayDef: function() { return /* binding */ parseArrayDef; }
12687 -/* harmony export */ });
12688 -/* harmony import */ var zod_v3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod/v3 */ "./node_modules/zod/v3/types.js");
12689 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
12690 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
12691 -
12692 -
12693 -
12694 -function parseArrayDef(def, refs) {
12695 - const res = {
12696 - type: "array",
12697 - };
12698 - if (def.type?._def &&
12699 - def.type?._def?.typeName !== zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodAny) {
12700 - res.items = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_2__.parseDef)(def.type._def, {
12701 - ...refs,
12702 - currentPath: [...refs.currentPath, "items"],
12703 - });
12704 - }
12705 - if (def.minLength) {
12706 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_1__.setResponseValueAndErrors)(res, "minItems", def.minLength.value, def.minLength.message, refs);
12707 - }
12708 - if (def.maxLength) {
12709 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_1__.setResponseValueAndErrors)(res, "maxItems", def.maxLength.value, def.maxLength.message, refs);
12710 - }
12711 - if (def.exactLength) {
12712 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_1__.setResponseValueAndErrors)(res, "minItems", def.exactLength.value, def.exactLength.message, refs);
12713 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_1__.setResponseValueAndErrors)(res, "maxItems", def.exactLength.value, def.exactLength.message, refs);
12714 - }
12715 - return res;
12716 -}
12717 -
12718 -
12719 -/***/ }),
12720 -
12721 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js":
12722 -/*!***********************************************************************************************************!*\
12723 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js ***!
12724 - \***********************************************************************************************************/
12725 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12726 -
12727 -__webpack_require__.r(__webpack_exports__);
12728 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12729 -/* harmony export */ parseBigintDef: function() { return /* binding */ parseBigintDef; }
12730 -/* harmony export */ });
12731 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
12732 -
12733 -function parseBigintDef(def, refs) {
12734 - const res = {
12735 - type: "integer",
12736 - format: "int64",
12737 - };
12738 - if (!def.checks)
12739 - return res;
12740 - for (const check of def.checks) {
12741 - switch (check.kind) {
12742 - case "min":
12743 - if (refs.target === "jsonSchema7") {
12744 - if (check.inclusive) {
12745 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, check.message, refs);
12746 - }
12747 - else {
12748 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "exclusiveMinimum", check.value, check.message, refs);
12749 - }
12750 - }
12751 - else {
12752 - if (!check.inclusive) {
12753 - res.exclusiveMinimum = true;
12754 - }
12755 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, check.message, refs);
12756 - }
12757 - break;
12758 - case "max":
12759 - if (refs.target === "jsonSchema7") {
12760 - if (check.inclusive) {
12761 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, check.message, refs);
12762 - }
12763 - else {
12764 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "exclusiveMaximum", check.value, check.message, refs);
12765 - }
12766 - }
12767 - else {
12768 - if (!check.inclusive) {
12769 - res.exclusiveMaximum = true;
12770 - }
12771 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, check.message, refs);
12772 - }
12773 - break;
12774 - case "multipleOf":
12775 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "multipleOf", check.value, check.message, refs);
12776 - break;
12777 - }
12778 - }
12779 - return res;
12780 -}
12781 -
12782 -
12783 -/***/ }),
12784 -
12785 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js":
12786 -/*!************************************************************************************************************!*\
12787 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js ***!
12788 - \************************************************************************************************************/
12789 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12790 -
12791 -__webpack_require__.r(__webpack_exports__);
12792 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12793 -/* harmony export */ parseBooleanDef: function() { return /* binding */ parseBooleanDef; }
12794 -/* harmony export */ });
12795 -function parseBooleanDef() {
12796 - return {
12797 - type: "boolean",
12798 - };
12799 -}
12800 -
12801 -
12802 -/***/ }),
12803 -
12804 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js":
12805 -/*!************************************************************************************************************!*\
12806 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js ***!
12807 - \************************************************************************************************************/
12808 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12809 -
12810 -__webpack_require__.r(__webpack_exports__);
12811 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12812 -/* harmony export */ parseBrandedDef: function() { return /* binding */ parseBrandedDef; }
12813 -/* harmony export */ });
12814 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
12815 -
12816 -function parseBrandedDef(_def, refs) {
12817 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(_def.type._def, refs);
12818 -}
12819 -
12820 -
12821 -/***/ }),
12822 -
12823 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js":
12824 -/*!**********************************************************************************************************!*\
12825 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js ***!
12826 - \**********************************************************************************************************/
12827 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12828 -
12829 -__webpack_require__.r(__webpack_exports__);
12830 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12831 -/* harmony export */ parseCatchDef: function() { return /* binding */ parseCatchDef; }
12832 -/* harmony export */ });
12833 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
12834 -
12835 -const parseCatchDef = (def, refs) => {
12836 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, refs);
12837 -};
12838 -
12839 -
12840 -/***/ }),
12841 -
12842 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js":
12843 -/*!*********************************************************************************************************!*\
12844 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js ***!
12845 - \*********************************************************************************************************/
12846 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12847 -
12848 -__webpack_require__.r(__webpack_exports__);
12849 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12850 -/* harmony export */ parseDateDef: function() { return /* binding */ parseDateDef; }
12851 -/* harmony export */ });
12852 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
12853 -
12854 -function parseDateDef(def, refs, overrideDateStrategy) {
12855 - const strategy = overrideDateStrategy ?? refs.dateStrategy;
12856 - if (Array.isArray(strategy)) {
12857 - return {
12858 - anyOf: strategy.map((item, i) => parseDateDef(def, refs, item)),
12859 - };
12860 - }
12861 - switch (strategy) {
12862 - case "string":
12863 - case "format:date-time":
12864 - return {
12865 - type: "string",
12866 - format: "date-time",
12867 - };
12868 - case "format:date":
12869 - return {
12870 - type: "string",
12871 - format: "date",
12872 - };
12873 - case "integer":
12874 - return integerDateParser(def, refs);
12875 - }
12876 -}
12877 -const integerDateParser = (def, refs) => {
12878 - const res = {
12879 - type: "integer",
12880 - format: "unix-time",
12881 - };
12882 - if (refs.target === "openApi3") {
12883 - return res;
12884 - }
12885 - for (const check of def.checks) {
12886 - switch (check.kind) {
12887 - case "min":
12888 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, // This is in milliseconds
12889 - check.message, refs);
12890 - break;
12891 - case "max":
12892 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, // This is in milliseconds
12893 - check.message, refs);
12894 - break;
12895 - }
12896 - }
12897 - return res;
12898 -};
12899 -
12900 -
12901 -/***/ }),
12902 -
12903 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js":
12904 -/*!************************************************************************************************************!*\
12905 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js ***!
12906 - \************************************************************************************************************/
12907 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12908 -
12909 -__webpack_require__.r(__webpack_exports__);
12910 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12911 -/* harmony export */ parseDefaultDef: function() { return /* binding */ parseDefaultDef; }
12912 -/* harmony export */ });
12913 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
12914 -
12915 -function parseDefaultDef(_def, refs) {
12916 - return {
12917 - ...(0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(_def.innerType._def, refs),
12918 - default: _def.defaultValue(),
12919 - };
12920 -}
12921 -
12922 -
12923 -/***/ }),
12924 -
12925 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js":
12926 -/*!************************************************************************************************************!*\
12927 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js ***!
12928 - \************************************************************************************************************/
12929 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12930 -
12931 -__webpack_require__.r(__webpack_exports__);
12932 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12933 -/* harmony export */ parseEffectsDef: function() { return /* binding */ parseEffectsDef; }
12934 -/* harmony export */ });
12935 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
12936 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
12937 -
12938 -
12939 -function parseEffectsDef(_def, refs) {
12940 - return refs.effectStrategy === "input"
12941 - ? (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(_def.schema._def, refs)
12942 - : (0,_any_js__WEBPACK_IMPORTED_MODULE_1__.parseAnyDef)(refs);
12943 -}
12944 -
12945 -
12946 -/***/ }),
12947 -
12948 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js":
12949 -/*!*********************************************************************************************************!*\
12950 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js ***!
12951 - \*********************************************************************************************************/
12952 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12953 -
12954 -__webpack_require__.r(__webpack_exports__);
12955 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12956 -/* harmony export */ parseEnumDef: function() { return /* binding */ parseEnumDef; }
12957 -/* harmony export */ });
12958 -function parseEnumDef(def) {
12959 - return {
12960 - type: "string",
12961 - enum: Array.from(def.values),
12962 - };
12963 -}
12964 -
12965 -
12966 -/***/ }),
12967 -
12968 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js":
12969 -/*!*****************************************************************************************************************!*\
12970 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js ***!
12971 - \*****************************************************************************************************************/
12972 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12973 -
12974 -__webpack_require__.r(__webpack_exports__);
12975 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
12976 -/* harmony export */ parseIntersectionDef: function() { return /* binding */ parseIntersectionDef; }
12977 -/* harmony export */ });
12978 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
12979 -
12980 -const isJsonSchema7AllOfType = (type) => {
12981 - if ("type" in type && type.type === "string")
12982 - return false;
12983 - return "allOf" in type;
12984 -};
12985 -function parseIntersectionDef(def, refs) {
12986 - const allOf = [
12987 - (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.left._def, {
12988 - ...refs,
12989 - currentPath: [...refs.currentPath, "allOf", "0"],
12990 - }),
12991 - (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.right._def, {
12992 - ...refs,
12993 - currentPath: [...refs.currentPath, "allOf", "1"],
12994 - }),
12995 - ].filter((x) => !!x);
12996 - let unevaluatedProperties = refs.target === "jsonSchema2019-09"
12997 - ? { unevaluatedProperties: false }
12998 - : undefined;
12999 - const mergedAllOf = [];
13000 - // If either of the schemas is an allOf, merge them into a single allOf
13001 - allOf.forEach((schema) => {
13002 - if (isJsonSchema7AllOfType(schema)) {
13003 - mergedAllOf.push(...schema.allOf);
13004 - if (schema.unevaluatedProperties === undefined) {
13005 - // If one of the schemas has no unevaluatedProperties set,
13006 - // the merged schema should also have no unevaluatedProperties set
13007 - unevaluatedProperties = undefined;
13008 - }
13009 - }
13010 - else {
13011 - let nestedSchema = schema;
13012 - if ("additionalProperties" in schema &&
13013 - schema.additionalProperties === false) {
13014 - const { additionalProperties, ...rest } = schema;
13015 - nestedSchema = rest;
13016 - }
13017 - else {
13018 - // As soon as one of the schemas has additionalProperties set not to false, we allow unevaluatedProperties
13019 - unevaluatedProperties = undefined;
13020 - }
13021 - mergedAllOf.push(nestedSchema);
13022 - }
13023 - });
13024 - return mergedAllOf.length
13025 - ? {
13026 - allOf: mergedAllOf,
13027 - ...unevaluatedProperties,
13028 - }
13029 - : undefined;
13030 -}
13031 -
13032 -
13033 -/***/ }),
13034 -
13035 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js":
13036 -/*!************************************************************************************************************!*\
13037 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js ***!
13038 - \************************************************************************************************************/
13039 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13040 -
13041 -__webpack_require__.r(__webpack_exports__);
13042 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13043 -/* harmony export */ parseLiteralDef: function() { return /* binding */ parseLiteralDef; }
13044 -/* harmony export */ });
13045 -function parseLiteralDef(def, refs) {
13046 - const parsedType = typeof def.value;
13047 - if (parsedType !== "bigint" &&
13048 - parsedType !== "number" &&
13049 - parsedType !== "boolean" &&
13050 - parsedType !== "string") {
13051 - return {
13052 - type: Array.isArray(def.value) ? "array" : "object",
13053 - };
13054 - }
13055 - if (refs.target === "openApi3") {
13056 - return {
13057 - type: parsedType === "bigint" ? "integer" : parsedType,
13058 - enum: [def.value],
13059 - };
13060 - }
13061 - return {
13062 - type: parsedType === "bigint" ? "integer" : parsedType,
13063 - const: def.value,
13064 - };
13065 -}
13066 -
13067 -
13068 -/***/ }),
13069 -
13070 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js":
13071 -/*!********************************************************************************************************!*\
13072 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js ***!
13073 - \********************************************************************************************************/
13074 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13075 -
13076 -__webpack_require__.r(__webpack_exports__);
13077 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13078 -/* harmony export */ parseMapDef: function() { return /* binding */ parseMapDef; }
13079 -/* harmony export */ });
13080 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
13081 -/* harmony import */ var _record_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./record.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js");
13082 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
13083 -
13084 -
13085 -
13086 -function parseMapDef(def, refs) {
13087 - if (refs.mapStrategy === "record") {
13088 - return (0,_record_js__WEBPACK_IMPORTED_MODULE_1__.parseRecordDef)(def, refs);
13089 - }
13090 - const keys = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.keyType._def, {
13091 - ...refs,
13092 - currentPath: [...refs.currentPath, "items", "items", "0"],
13093 - }) || (0,_any_js__WEBPACK_IMPORTED_MODULE_2__.parseAnyDef)(refs);
13094 - const values = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.valueType._def, {
13095 - ...refs,
13096 - currentPath: [...refs.currentPath, "items", "items", "1"],
13097 - }) || (0,_any_js__WEBPACK_IMPORTED_MODULE_2__.parseAnyDef)(refs);
13098 - return {
13099 - type: "array",
13100 - maxItems: 125,
13101 - items: {
13102 - type: "array",
13103 - items: [keys, values],
13104 - minItems: 2,
13105 - maxItems: 2,
13106 - },
13107 - };
13108 -}
13109 -
13110 -
13111 -/***/ }),
13112 -
13113 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js":
13114 -/*!***************************************************************************************************************!*\
13115 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js ***!
13116 - \***************************************************************************************************************/
13117 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13118 -
13119 -__webpack_require__.r(__webpack_exports__);
13120 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13121 -/* harmony export */ parseNativeEnumDef: function() { return /* binding */ parseNativeEnumDef; }
13122 -/* harmony export */ });
13123 -function parseNativeEnumDef(def) {
13124 - const object = def.values;
13125 - const actualKeys = Object.keys(def.values).filter((key) => {
13126 - return typeof object[object[key]] !== "number";
13127 - });
13128 - const actualValues = actualKeys.map((key) => object[key]);
13129 - const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
13130 - return {
13131 - type: parsedTypes.length === 1
13132 - ? parsedTypes[0] === "string"
13133 - ? "string"
13134 - : "number"
13135 - : ["string", "number"],
13136 - enum: actualValues,
13137 - };
13138 -}
13139 -
13140 -
13141 -/***/ }),
13142 -
13143 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js":
13144 -/*!**********************************************************************************************************!*\
13145 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js ***!
13146 - \**********************************************************************************************************/
13147 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13148 -
13149 -__webpack_require__.r(__webpack_exports__);
13150 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13151 -/* harmony export */ parseNeverDef: function() { return /* binding */ parseNeverDef; }
13152 -/* harmony export */ });
13153 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
13154 -
13155 -function parseNeverDef(refs) {
13156 - return refs.target === "openAi"
13157 - ? undefined
13158 - : {
13159 - not: (0,_any_js__WEBPACK_IMPORTED_MODULE_0__.parseAnyDef)({
13160 - ...refs,
13161 - currentPath: [...refs.currentPath, "not"],
13162 - }),
13163 - };
13164 -}
13165 -
13166 -
13167 -/***/ }),
13168 -
13169 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js":
13170 -/*!*********************************************************************************************************!*\
13171 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js ***!
13172 - \*********************************************************************************************************/
13173 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13174 -
13175 -__webpack_require__.r(__webpack_exports__);
13176 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13177 -/* harmony export */ parseNullDef: function() { return /* binding */ parseNullDef; }
13178 -/* harmony export */ });
13179 -function parseNullDef(refs) {
13180 - return refs.target === "openApi3"
13181 - ? {
13182 - enum: ["null"],
13183 - nullable: true,
13184 - }
13185 - : {
13186 - type: "null",
13187 - };
13188 -}
13189 -
13190 -
13191 -/***/ }),
13192 -
13193 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js":
13194 -/*!*************************************************************************************************************!*\
13195 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js ***!
13196 - \*************************************************************************************************************/
13197 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13198 -
13199 -__webpack_require__.r(__webpack_exports__);
13200 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13201 -/* harmony export */ parseNullableDef: function() { return /* binding */ parseNullableDef; }
13202 -/* harmony export */ });
13203 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
13204 -/* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./union.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js");
13205 -
13206 -
13207 -function parseNullableDef(def, refs) {
13208 - if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) &&
13209 - (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
13210 - if (refs.target === "openApi3") {
13211 - return {
13212 - type: _union_js__WEBPACK_IMPORTED_MODULE_1__.primitiveMappings[def.innerType._def.typeName],
13213 - nullable: true,
13214 - };
13215 - }
13216 - return {
13217 - type: [
13218 - _union_js__WEBPACK_IMPORTED_MODULE_1__.primitiveMappings[def.innerType._def.typeName],
13219 - "null",
13220 - ],
13221 - };
13222 - }
13223 - if (refs.target === "openApi3") {
13224 - const base = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, {
13225 - ...refs,
13226 - currentPath: [...refs.currentPath],
13227 - });
13228 - if (base && "$ref" in base)
13229 - return { allOf: [base], nullable: true };
13230 - return base && { ...base, nullable: true };
13231 - }
13232 - const base = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, {
13233 - ...refs,
13234 - currentPath: [...refs.currentPath, "anyOf", "0"],
13235 - });
13236 - return base && { anyOf: [base, { type: "null" }] };
13237 -}
13238 -
13239 -
13240 -/***/ }),
13241 -
13242 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js":
13243 -/*!***********************************************************************************************************!*\
13244 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js ***!
13245 - \***********************************************************************************************************/
13246 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13247 -
13248 -__webpack_require__.r(__webpack_exports__);
13249 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13250 -/* harmony export */ parseNumberDef: function() { return /* binding */ parseNumberDef; }
13251 -/* harmony export */ });
13252 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
13253 -
13254 -function parseNumberDef(def, refs) {
13255 - const res = {
13256 - type: "number",
13257 - };
13258 - if (!def.checks)
13259 - return res;
13260 - for (const check of def.checks) {
13261 - switch (check.kind) {
13262 - case "int":
13263 - res.type = "integer";
13264 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.addErrorMessage)(res, "type", check.message, refs);
13265 - break;
13266 - case "min":
13267 - if (refs.target === "jsonSchema7") {
13268 - if (check.inclusive) {
13269 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, check.message, refs);
13270 - }
13271 - else {
13272 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "exclusiveMinimum", check.value, check.message, refs);
13273 - }
13274 - }
13275 - else {
13276 - if (!check.inclusive) {
13277 - res.exclusiveMinimum = true;
13278 - }
13279 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, check.message, refs);
13280 - }
13281 - break;
13282 - case "max":
13283 - if (refs.target === "jsonSchema7") {
13284 - if (check.inclusive) {
13285 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, check.message, refs);
13286 - }
13287 - else {
13288 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "exclusiveMaximum", check.value, check.message, refs);
13289 - }
13290 - }
13291 - else {
13292 - if (!check.inclusive) {
13293 - res.exclusiveMaximum = true;
13294 - }
13295 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, check.message, refs);
13296 - }
13297 - break;
13298 - case "multipleOf":
13299 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "multipleOf", check.value, check.message, refs);
13300 - break;
13301 - }
13302 - }
13303 - return res;
13304 -}
13305 -
13306 -
13307 -/***/ }),
13308 -
13309 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js":
13310 -/*!***********************************************************************************************************!*\
13311 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js ***!
13312 - \***********************************************************************************************************/
13313 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13314 -
13315 -__webpack_require__.r(__webpack_exports__);
13316 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13317 -/* harmony export */ parseObjectDef: function() { return /* binding */ parseObjectDef; }
13318 -/* harmony export */ });
13319 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
13320 -
13321 -function parseObjectDef(def, refs) {
13322 - const forceOptionalIntoNullable = refs.target === "openAi";
13323 - const result = {
13324 - type: "object",
13325 - properties: {},
13326 - };
13327 - const required = [];
13328 - const shape = def.shape();
13329 - for (const propName in shape) {
13330 - let propDef = shape[propName];
13331 - if (propDef === undefined || propDef._def === undefined) {
13332 - continue;
13333 - }
13334 - let propOptional = safeIsOptional(propDef);
13335 - if (propOptional && forceOptionalIntoNullable) {
13336 - if (propDef._def.typeName === "ZodOptional") {
13337 - propDef = propDef._def.innerType;
13338 - }
13339 - if (!propDef.isNullable()) {
13340 - propDef = propDef.nullable();
13341 - }
13342 - propOptional = false;
13343 - }
13344 - const parsedDef = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(propDef._def, {
13345 - ...refs,
13346 - currentPath: [...refs.currentPath, "properties", propName],
13347 - propertyPath: [...refs.currentPath, "properties", propName],
13348 - });
13349 - if (parsedDef === undefined) {
13350 - continue;
13351 - }
13352 - result.properties[propName] = parsedDef;
13353 - if (!propOptional) {
13354 - required.push(propName);
13355 - }
13356 - }
13357 - if (required.length) {
13358 - result.required = required;
13359 - }
13360 - const additionalProperties = decideAdditionalProperties(def, refs);
13361 - if (additionalProperties !== undefined) {
13362 - result.additionalProperties = additionalProperties;
13363 - }
13364 - return result;
13365 -}
13366 -function decideAdditionalProperties(def, refs) {
13367 - if (def.catchall._def.typeName !== "ZodNever") {
13368 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.catchall._def, {
13369 - ...refs,
13370 - currentPath: [...refs.currentPath, "additionalProperties"],
13371 - });
13372 - }
13373 - switch (def.unknownKeys) {
13374 - case "passthrough":
13375 - return refs.allowedAdditionalProperties;
13376 - case "strict":
13377 - return refs.rejectedAdditionalProperties;
13378 - case "strip":
13379 - return refs.removeAdditionalStrategy === "strict"
13380 - ? refs.allowedAdditionalProperties
13381 - : refs.rejectedAdditionalProperties;
13382 - }
13383 -}
13384 -function safeIsOptional(schema) {
13385 - try {
13386 - return schema.isOptional();
13387 - }
13388 - catch {
13389 - return true;
13390 - }
13391 -}
13392 -
13393 -
13394 -/***/ }),
13395 -
13396 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js":
13397 -/*!*************************************************************************************************************!*\
13398 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js ***!
13399 - \*************************************************************************************************************/
13400 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13401 -
13402 -__webpack_require__.r(__webpack_exports__);
13403 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13404 -/* harmony export */ parseOptionalDef: function() { return /* binding */ parseOptionalDef; }
13405 -/* harmony export */ });
13406 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
13407 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
13408 -
13409 -
13410 -const parseOptionalDef = (def, refs) => {
13411 - if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
13412 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, refs);
13413 - }
13414 - const innerSchema = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, {
13415 - ...refs,
13416 - currentPath: [...refs.currentPath, "anyOf", "1"],
13417 - });
13418 - return innerSchema
13419 - ? {
13420 - anyOf: [
13421 - {
13422 - not: (0,_any_js__WEBPACK_IMPORTED_MODULE_1__.parseAnyDef)(refs),
13423 - },
13424 - innerSchema,
13425 - ],
13426 - }
13427 - : (0,_any_js__WEBPACK_IMPORTED_MODULE_1__.parseAnyDef)(refs);
13428 -};
13429 -
13430 -
13431 -/***/ }),
13432 -
13433 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js":
13434 -/*!*************************************************************************************************************!*\
13435 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js ***!
13436 - \*************************************************************************************************************/
13437 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13438 -
13439 -__webpack_require__.r(__webpack_exports__);
13440 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13441 -/* harmony export */ parsePipelineDef: function() { return /* binding */ parsePipelineDef; }
13442 -/* harmony export */ });
13443 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
13444 -
13445 -const parsePipelineDef = (def, refs) => {
13446 - if (refs.pipeStrategy === "input") {
13447 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.in._def, refs);
13448 - }
13449 - else if (refs.pipeStrategy === "output") {
13450 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.out._def, refs);
13451 - }
13452 - const a = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.in._def, {
13453 - ...refs,
13454 - currentPath: [...refs.currentPath, "allOf", "0"],
13455 - });
13456 - const b = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.out._def, {
13457 - ...refs,
13458 - currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"],
13459 - });
13460 - return {
13461 - allOf: [a, b].filter((x) => x !== undefined),
13462 - };
13463 -};
13464 -
13465 -
13466 -/***/ }),
13467 -
13468 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js":
13469 -/*!************************************************************************************************************!*\
13470 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js ***!
13471 - \************************************************************************************************************/
13472 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13473 -
13474 -__webpack_require__.r(__webpack_exports__);
13475 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13476 -/* harmony export */ parsePromiseDef: function() { return /* binding */ parsePromiseDef; }
13477 -/* harmony export */ });
13478 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
13479 -
13480 -function parsePromiseDef(def, refs) {
13481 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.type._def, refs);
13482 -}
13483 -
13484 -
13485 -/***/ }),
13486 -
13487 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js":
13488 -/*!*************************************************************************************************************!*\
13489 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js ***!
13490 - \*************************************************************************************************************/
13491 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13492 -
13493 -__webpack_require__.r(__webpack_exports__);
13494 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13495 -/* harmony export */ parseReadonlyDef: function() { return /* binding */ parseReadonlyDef; }
13496 -/* harmony export */ });
13497 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
13498 -
13499 -const parseReadonlyDef = (def, refs) => {
13500 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, refs);
13501 -};
13502 -
13503 -
13504 -/***/ }),
13505 -
13506 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js":
13507 -/*!***********************************************************************************************************!*\
13508 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js ***!
13509 - \***********************************************************************************************************/
13510 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13511 -
13512 -__webpack_require__.r(__webpack_exports__);
13513 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13514 -/* harmony export */ parseRecordDef: function() { return /* binding */ parseRecordDef; }
13515 -/* harmony export */ });
13516 -/* harmony import */ var zod_v3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod/v3 */ "./node_modules/zod/v3/types.js");
13517 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
13518 -/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./string.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js");
13519 -/* harmony import */ var _branded_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./branded.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js");
13520 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
13521 -
13522 -
13523 -
13524 -
13525 -
13526 -function parseRecordDef(def, refs) {
13527 - if (refs.target === "openAi") {
13528 - console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
13529 - }
13530 - if (refs.target === "openApi3" &&
13531 - def.keyType?._def.typeName === zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodEnum) {
13532 - return {
13533 - type: "object",
13534 - required: def.keyType._def.values,
13535 - properties: def.keyType._def.values.reduce((acc, key) => ({
13536 - ...acc,
13537 - [key]: (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_1__.parseDef)(def.valueType._def, {
13538 - ...refs,
13539 - currentPath: [...refs.currentPath, "properties", key],
13540 - }) ?? (0,_any_js__WEBPACK_IMPORTED_MODULE_4__.parseAnyDef)(refs),
13541 - }), {}),
13542 - additionalProperties: refs.rejectedAdditionalProperties,
13543 - };
13544 - }
13545 - const schema = {
13546 - type: "object",
13547 - additionalProperties: (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_1__.parseDef)(def.valueType._def, {
13548 - ...refs,
13549 - currentPath: [...refs.currentPath, "additionalProperties"],
13550 - }) ?? refs.allowedAdditionalProperties,
13551 - };
13552 - if (refs.target === "openApi3") {
13553 - return schema;
13554 - }
13555 - if (def.keyType?._def.typeName === zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodString &&
13556 - def.keyType._def.checks?.length) {
13557 - const { type, ...keyType } = (0,_string_js__WEBPACK_IMPORTED_MODULE_2__.parseStringDef)(def.keyType._def, refs);
13558 - return {
13559 - ...schema,
13560 - propertyNames: keyType,
13561 - };
13562 - }
13563 - else if (def.keyType?._def.typeName === zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodEnum) {
13564 - return {
13565 - ...schema,
13566 - propertyNames: {
13567 - enum: def.keyType._def.values,
13568 - },
13569 - };
13570 - }
13571 - else if (def.keyType?._def.typeName === zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodBranded &&
13572 - def.keyType._def.type._def.typeName === zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodString &&
13573 - def.keyType._def.type._def.checks?.length) {
13574 - const { type, ...keyType } = (0,_branded_js__WEBPACK_IMPORTED_MODULE_3__.parseBrandedDef)(def.keyType._def, refs);
13575 - return {
13576 - ...schema,
13577 - propertyNames: keyType,
13578 - };
13579 - }
13580 - return schema;
13581 -}
13582 -
13583 -
13584 -/***/ }),
13585 -
13586 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js":
13587 -/*!********************************************************************************************************!*\
13588 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js ***!
13589 - \********************************************************************************************************/
13590 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13591 -
13592 -__webpack_require__.r(__webpack_exports__);
13593 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13594 -/* harmony export */ parseSetDef: function() { return /* binding */ parseSetDef; }
13595 -/* harmony export */ });
13596 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
13597 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
13598 -
13599 -
13600 -function parseSetDef(def, refs) {
13601 - const items = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_1__.parseDef)(def.valueType._def, {
13602 - ...refs,
13603 - currentPath: [...refs.currentPath, "items"],
13604 - });
13605 - const schema = {
13606 - type: "array",
13607 - uniqueItems: true,
13608 - items,
13609 - };
13610 - if (def.minSize) {
13611 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(schema, "minItems", def.minSize.value, def.minSize.message, refs);
13612 - }
13613 - if (def.maxSize) {
13614 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(schema, "maxItems", def.maxSize.value, def.maxSize.message, refs);
13615 - }
13616 - return schema;
13617 -}
13618 -
13619 -
13620 -/***/ }),
13621 -
13622 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js":
13623 -/*!***********************************************************************************************************!*\
13624 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js ***!
13625 - \***********************************************************************************************************/
13626 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13627 -
13628 -__webpack_require__.r(__webpack_exports__);
13629 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13630 -/* harmony export */ parseStringDef: function() { return /* binding */ parseStringDef; },
13631 -/* harmony export */ zodPatterns: function() { return /* binding */ zodPatterns; }
13632 -/* harmony export */ });
13633 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
13634 -
13635 -let emojiRegex = undefined;
13636 -/**
13637 - * Generated from the regular expressions found here as of 2024-05-22:
13638 - * https://github.com/colinhacks/zod/blob/master/src/types.ts.
13639 - *
13640 - * Expressions with /i flag have been changed accordingly.
13641 - */
13642 -const zodPatterns = {
13643 - /**
13644 - * `c` was changed to `[cC]` to replicate /i flag
13645 - */
13646 - cuid: /^[cC][^\s-]{8,}$/,
13647 - cuid2: /^[0-9a-z]+$/,
13648 - ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
13649 - /**
13650 - * `a-z` was added to replicate /i flag
13651 - */
13652 - email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
13653 - /**
13654 - * Constructed a valid Unicode RegExp
13655 - *
13656 - * Lazily instantiate since this type of regex isn't supported
13657 - * in all envs (e.g. React Native).
13658 - *
13659 - * See:
13660 - * https://github.com/colinhacks/zod/issues/2433
13661 - * Fix in Zod:
13662 - * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
13663 - */
13664 - emoji: () => {
13665 - if (emojiRegex === undefined) {
13666 - emojiRegex = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u");
13667 - }
13668 - return emojiRegex;
13669 - },
13670 - /**
13671 - * Unused
13672 - */
13673 - uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
13674 - /**
13675 - * Unused
13676 - */
13677 - ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
13678 - ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
13679 - /**
13680 - * Unused
13681 - */
13682 - ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
13683 - ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
13684 - base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
13685 - base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
13686 - nanoid: /^[a-zA-Z0-9_-]{21}$/,
13687 - jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,
13688 -};
13689 -function parseStringDef(def, refs) {
13690 - const res = {
13691 - type: "string",
13692 - };
13693 - if (def.checks) {
13694 - for (const check of def.checks) {
13695 - switch (check.kind) {
13696 - case "min":
13697 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minLength", typeof res.minLength === "number"
13698 - ? Math.max(res.minLength, check.value)
13699 - : check.value, check.message, refs);
13700 - break;
13701 - case "max":
13702 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maxLength", typeof res.maxLength === "number"
13703 - ? Math.min(res.maxLength, check.value)
13704 - : check.value, check.message, refs);
13705 - break;
13706 - case "email":
13707 - switch (refs.emailStrategy) {
13708 - case "format:email":
13709 - addFormat(res, "email", check.message, refs);
13710 - break;
13711 - case "format:idn-email":
13712 - addFormat(res, "idn-email", check.message, refs);
13713 - break;
13714 - case "pattern:zod":
13715 - addPattern(res, zodPatterns.email, check.message, refs);
13716 - break;
13717 - }
13718 - break;
13719 - case "url":
13720 - addFormat(res, "uri", check.message, refs);
13721 - break;
13722 - case "uuid":
13723 - addFormat(res, "uuid", check.message, refs);
13724 - break;
13725 - case "regex":
13726 - addPattern(res, check.regex, check.message, refs);
13727 - break;
13728 - case "cuid":
13729 - addPattern(res, zodPatterns.cuid, check.message, refs);
13730 - break;
13731 - case "cuid2":
13732 - addPattern(res, zodPatterns.cuid2, check.message, refs);
13733 - break;
13734 - case "startsWith":
13735 - addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);
13736 - break;
13737 - case "endsWith":
13738 - addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);
13739 - break;
13740 - case "datetime":
13741 - addFormat(res, "date-time", check.message, refs);
13742 - break;
13743 - case "date":
13744 - addFormat(res, "date", check.message, refs);
13745 - break;
13746 - case "time":
13747 - addFormat(res, "time", check.message, refs);
13748 - break;
13749 - case "duration":
13750 - addFormat(res, "duration", check.message, refs);
13751 - break;
13752 - case "length":
13753 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minLength", typeof res.minLength === "number"
13754 - ? Math.max(res.minLength, check.value)
13755 - : check.value, check.message, refs);
13756 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maxLength", typeof res.maxLength === "number"
13757 - ? Math.min(res.maxLength, check.value)
13758 - : check.value, check.message, refs);
13759 - break;
13760 - case "includes": {
13761 - addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);
13762 - break;
13763 - }
13764 - case "ip": {
13765 - if (check.version !== "v6") {
13766 - addFormat(res, "ipv4", check.message, refs);
13767 - }
13768 - if (check.version !== "v4") {
13769 - addFormat(res, "ipv6", check.message, refs);
13770 - }
13771 - break;
13772 - }
13773 - case "base64url":
13774 - addPattern(res, zodPatterns.base64url, check.message, refs);
13775 - break;
13776 - case "jwt":
13777 - addPattern(res, zodPatterns.jwt, check.message, refs);
13778 - break;
13779 - case "cidr": {
13780 - if (check.version !== "v6") {
13781 - addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);
13782 - }
13783 - if (check.version !== "v4") {
13784 - addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);
13785 - }
13786 - break;
13787 - }
13788 - case "emoji":
13789 - addPattern(res, zodPatterns.emoji(), check.message, refs);
13790 - break;
13791 - case "ulid": {
13792 - addPattern(res, zodPatterns.ulid, check.message, refs);
13793 - break;
13794 - }
13795 - case "base64": {
13796 - switch (refs.base64Strategy) {
13797 - case "format:binary": {
13798 - addFormat(res, "binary", check.message, refs);
13799 - break;
13800 - }
13801 - case "contentEncoding:base64": {
13802 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "contentEncoding", "base64", check.message, refs);
13803 - break;
13804 - }
13805 - case "pattern:zod": {
13806 - addPattern(res, zodPatterns.base64, check.message, refs);
13807 - break;
13808 - }
13809 - }
13810 - break;
13811 - }
13812 - case "nanoid": {
13813 - addPattern(res, zodPatterns.nanoid, check.message, refs);
13814 - }
13815 - case "toLowerCase":
13816 - case "toUpperCase":
13817 - case "trim":
13818 - break;
13819 - default:
13820 - ((_) => { })(check);
13821 - }
13822 - }
13823 - }
13824 - return res;
13825 -}
13826 -function escapeLiteralCheckValue(literal, refs) {
13827 - return refs.patternStrategy === "escape"
13828 - ? escapeNonAlphaNumeric(literal)
13829 - : literal;
13830 -}
13831 -const ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
13832 -function escapeNonAlphaNumeric(source) {
13833 - let result = "";
13834 - for (let i = 0; i < source.length; i++) {
13835 - if (!ALPHA_NUMERIC.has(source[i])) {
13836 - result += "\\";
13837 - }
13838 - result += source[i];
13839 - }
13840 - return result;
13841 -}
13842 -// Adds a "format" keyword to the schema. If a format exists, both formats will be joined in an allOf-node, along with subsequent ones.
13843 -function addFormat(schema, value, message, refs) {
13844 - if (schema.format || schema.anyOf?.some((x) => x.format)) {
13845 - if (!schema.anyOf) {
13846 - schema.anyOf = [];
13847 - }
13848 - if (schema.format) {
13849 - schema.anyOf.push({
13850 - format: schema.format,
13851 - ...(schema.errorMessage &&
13852 - refs.errorMessages && {
13853 - errorMessage: { format: schema.errorMessage.format },
13854 - }),
13855 - });
13856 - delete schema.format;
13857 - if (schema.errorMessage) {
13858 - delete schema.errorMessage.format;
13859 - if (Object.keys(schema.errorMessage).length === 0) {
13860 - delete schema.errorMessage;
13861 - }
13862 - }
13863 - }
13864 - schema.anyOf.push({
13865 - format: value,
13866 - ...(message &&
13867 - refs.errorMessages && { errorMessage: { format: message } }),
13868 - });
13869 - }
13870 - else {
13871 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(schema, "format", value, message, refs);
13872 - }
13873 -}
13874 -// Adds a "pattern" keyword to the schema. If a pattern exists, both patterns will be joined in an allOf-node, along with subsequent ones.
13875 -function addPattern(schema, regex, message, refs) {
13876 - if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
13877 - if (!schema.allOf) {
13878 - schema.allOf = [];
13879 - }
13880 - if (schema.pattern) {
13881 - schema.allOf.push({
13882 - pattern: schema.pattern,
13883 - ...(schema.errorMessage &&
13884 - refs.errorMessages && {
13885 - errorMessage: { pattern: schema.errorMessage.pattern },
13886 - }),
13887 - });
13888 - delete schema.pattern;
13889 - if (schema.errorMessage) {
13890 - delete schema.errorMessage.pattern;
13891 - if (Object.keys(schema.errorMessage).length === 0) {
13892 - delete schema.errorMessage;
13893 - }
13894 - }
13895 - }
13896 - schema.allOf.push({
13897 - pattern: stringifyRegExpWithFlags(regex, refs),
13898 - ...(message &&
13899 - refs.errorMessages && { errorMessage: { pattern: message } }),
13900 - });
13901 - }
13902 - else {
13903 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(schema, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
13904 - }
13905 -}
13906 -// Mutate z.string.regex() in a best attempt to accommodate for regex flags when applyRegexFlags is true
13907 -function stringifyRegExpWithFlags(regex, refs) {
13908 - if (!refs.applyRegexFlags || !regex.flags) {
13909 - return regex.source;
13910 - }
13911 - // Currently handled flags
13912 - const flags = {
13913 - i: regex.flags.includes("i"),
13914 - m: regex.flags.includes("m"),
13915 - s: regex.flags.includes("s"), // `.` matches newlines
13916 - };
13917 - // The general principle here is to step through each character, one at a time, applying mutations as flags require. We keep track when the current character is escaped, and when it's inside a group /like [this]/ or (also) a range like /[a-z]/. The following is fairly brittle imperative code; edit at your peril!
13918 - const source = flags.i ? regex.source.toLowerCase() : regex.source;
13919 - let pattern = "";
13920 - let isEscaped = false;
13921 - let inCharGroup = false;
13922 - let inCharRange = false;
13923 - for (let i = 0; i < source.length; i++) {
13924 - if (isEscaped) {
13925 - pattern += source[i];
13926 - isEscaped = false;
13927 - continue;
13928 - }
13929 - if (flags.i) {
13930 - if (inCharGroup) {
13931 - if (source[i].match(/[a-z]/)) {
13932 - if (inCharRange) {
13933 - pattern += source[i];
13934 - pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
13935 - inCharRange = false;
13936 - }
13937 - else if (source[i + 1] === "-" && source[i + 2]?.match(/[a-z]/)) {
13938 - pattern += source[i];
13939 - inCharRange = true;
13940 - }
13941 - else {
13942 - pattern += `${source[i]}${source[i].toUpperCase()}`;
13943 - }
13944 - continue;
13945 - }
13946 - }
13947 - else if (source[i].match(/[a-z]/)) {
13948 - pattern += `[${source[i]}${source[i].toUpperCase()}]`;
13949 - continue;
13950 - }
13951 - }
13952 - if (flags.m) {
13953 - if (source[i] === "^") {
13954 - pattern += `(^|(?<=[\r\n]))`;
13955 - continue;
13956 - }
13957 - else if (source[i] === "$") {
13958 - pattern += `($|(?=[\r\n]))`;
13959 - continue;
13960 - }
13961 - }
13962 - if (flags.s && source[i] === ".") {
13963 - pattern += inCharGroup ? `${source[i]}\r\n` : `[${source[i]}\r\n]`;
13964 - continue;
13965 - }
13966 - pattern += source[i];
13967 - if (source[i] === "\\") {
13968 - isEscaped = true;
13969 - }
13970 - else if (inCharGroup && source[i] === "]") {
13971 - inCharGroup = false;
13972 - }
13973 - else if (!inCharGroup && source[i] === "[") {
13974 - inCharGroup = true;
13975 - }
13976 - }
13977 - try {
13978 - new RegExp(pattern);
13979 - }
13980 - catch {
13981 - console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
13982 - return regex.source;
13983 - }
13984 - return pattern;
13985 -}
13986 -
13987 -
13988 -/***/ }),
13989 -
13990 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js":
13991 -/*!**********************************************************************************************************!*\
13992 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js ***!
13993 - \**********************************************************************************************************/
13994 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
13995 -
13996 -__webpack_require__.r(__webpack_exports__);
13997 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
13998 -/* harmony export */ parseTupleDef: function() { return /* binding */ parseTupleDef; }
13999 -/* harmony export */ });
14000 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
14001 -
14002 -function parseTupleDef(def, refs) {
14003 - if (def.rest) {
14004 - return {
14005 - type: "array",
14006 - minItems: def.items.length,
14007 - items: def.items
14008 - .map((x, i) => (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(x._def, {
14009 - ...refs,
14010 - currentPath: [...refs.currentPath, "items", `${i}`],
14011 - }))
14012 - .reduce((acc, x) => (x === undefined ? acc : [...acc, x]), []),
14013 - additionalItems: (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.rest._def, {
14014 - ...refs,
14015 - currentPath: [...refs.currentPath, "additionalItems"],
14016 - }),
14017 - };
14018 - }
14019 - else {
14020 - return {
14021 - type: "array",
14022 - minItems: def.items.length,
14023 - maxItems: def.items.length,
14024 - items: def.items
14025 - .map((x, i) => (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(x._def, {
14026 - ...refs,
14027 - currentPath: [...refs.currentPath, "items", `${i}`],
14028 - }))
14029 - .reduce((acc, x) => (x === undefined ? acc : [...acc, x]), []),
14030 - };
14031 - }
14032 -}
14033 -
14034 -
14035 -/***/ }),
14036 -
14037 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js":
14038 -/*!**************************************************************************************************************!*\
14039 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js ***!
14040 - \**************************************************************************************************************/
14041 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
14042 -
14043 -__webpack_require__.r(__webpack_exports__);
14044 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
14045 -/* harmony export */ parseUndefinedDef: function() { return /* binding */ parseUndefinedDef; }
14046 -/* harmony export */ });
14047 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
14048 -
14049 -function parseUndefinedDef(refs) {
14050 - return {
14051 - not: (0,_any_js__WEBPACK_IMPORTED_MODULE_0__.parseAnyDef)(refs),
14052 - };
14053 -}
14054 -
14055 -
14056 -/***/ }),
14057 -
14058 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js":
14059 -/*!**********************************************************************************************************!*\
14060 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js ***!
14061 - \**********************************************************************************************************/
14062 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
14063 -
14064 -__webpack_require__.r(__webpack_exports__);
14065 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
14066 -/* harmony export */ parseUnionDef: function() { return /* binding */ parseUnionDef; },
14067 -/* harmony export */ primitiveMappings: function() { return /* binding */ primitiveMappings; }
14068 -/* harmony export */ });
14069 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
14070 -
14071 -const primitiveMappings = {
14072 - ZodString: "string",
14073 - ZodNumber: "number",
14074 - ZodBigInt: "integer",
14075 - ZodBoolean: "boolean",
14076 - ZodNull: "null",
14077 -};
14078 -function parseUnionDef(def, refs) {
14079 - if (refs.target === "openApi3")
14080 - return asAnyOf(def, refs);
14081 - const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
14082 - // This blocks tries to look ahead a bit to produce nicer looking schemas with type array instead of anyOf.
14083 - if (options.every((x) => x._def.typeName in primitiveMappings &&
14084 - (!x._def.checks || !x._def.checks.length))) {
14085 - // all types in union are primitive and lack checks, so might as well squash into {type: [...]}
14086 - const types = options.reduce((types, x) => {
14087 - const type = primitiveMappings[x._def.typeName]; //Can be safely casted due to row 43
14088 - return type && !types.includes(type) ? [...types, type] : types;
14089 - }, []);
14090 - return {
14091 - type: types.length > 1 ? types : types[0],
14092 - };
14093 - }
14094 - else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
14095 - // all options literals
14096 - const types = options.reduce((acc, x) => {
14097 - const type = typeof x._def.value;
14098 - switch (type) {
14099 - case "string":
14100 - case "number":
14101 - case "boolean":
14102 - return [...acc, type];
14103 - case "bigint":
14104 - return [...acc, "integer"];
14105 - case "object":
14106 - if (x._def.value === null)
14107 - return [...acc, "null"];
14108 - case "symbol":
14109 - case "undefined":
14110 - case "function":
14111 - default:
14112 - return acc;
14113 - }
14114 - }, []);
14115 - if (types.length === options.length) {
14116 - // all the literals are primitive, as far as null can be considered primitive
14117 - const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
14118 - return {
14119 - type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
14120 - enum: options.reduce((acc, x) => {
14121 - return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
14122 - }, []),
14123 - };
14124 - }
14125 - }
14126 - else if (options.every((x) => x._def.typeName === "ZodEnum")) {
14127 - return {
14128 - type: "string",
14129 - enum: options.reduce((acc, x) => [
14130 - ...acc,
14131 - ...x._def.values.filter((x) => !acc.includes(x)),
14132 - ], []),
14133 - };
14134 - }
14135 - return asAnyOf(def, refs);
14136 -}
14137 -const asAnyOf = (def, refs) => {
14138 - const anyOf = (def.options instanceof Map
14139 - ? Array.from(def.options.values())
14140 - : def.options)
14141 - .map((x, i) => (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(x._def, {
14142 - ...refs,
14143 - currentPath: [...refs.currentPath, "anyOf", `${i}`],
14144 - }))
14145 - .filter((x) => !!x &&
14146 - (!refs.strictUnions ||
14147 - (typeof x === "object" && Object.keys(x).length > 0)));
14148 - return anyOf.length ? { anyOf } : undefined;
14149 -};
14150 -
14151 -
14152 -/***/ }),
14153 -
14154 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js":
14155 -/*!************************************************************************************************************!*\
14156 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js ***!
14157 - \************************************************************************************************************/
14158 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
14159 -
14160 -__webpack_require__.r(__webpack_exports__);
14161 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
14162 -/* harmony export */ parseUnknownDef: function() { return /* binding */ parseUnknownDef; }
14163 -/* harmony export */ });
14164 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
14165 -
14166 -function parseUnknownDef(refs) {
14167 - return (0,_any_js__WEBPACK_IMPORTED_MODULE_0__.parseAnyDef)(refs);
14168 -}
14169 -
14170 -
14171 -/***/ }),
14172 -
14173 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js":
14174 -/*!*********************************************************************************************************!*\
14175 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js ***!
14176 - \*********************************************************************************************************/
14177 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
14178 -
14179 -__webpack_require__.r(__webpack_exports__);
14180 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
14181 -/* harmony export */ selectParser: function() { return /* binding */ selectParser; }
14182 -/* harmony export */ });
14183 -/* harmony import */ var zod_v3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod/v3 */ "./node_modules/zod/v3/types.js");
14184 -/* harmony import */ var _parsers_any_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parsers/any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
14185 -/* harmony import */ var _parsers_array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parsers/array.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js");
14186 -/* harmony import */ var _parsers_bigint_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parsers/bigint.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js");
14187 -/* harmony import */ var _parsers_boolean_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./parsers/boolean.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js");
14188 -/* harmony import */ var _parsers_branded_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parsers/branded.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js");
14189 -/* harmony import */ var _parsers_catch_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parsers/catch.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js");
14190 -/* harmony import */ var _parsers_date_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./parsers/date.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js");
14191 -/* harmony import */ var _parsers_default_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./parsers/default.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js");
14192 -/* harmony import */ var _parsers_effects_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./parsers/effects.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js");
14193 -/* harmony import */ var _parsers_enum_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./parsers/enum.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js");
14194 -/* harmony import */ var _parsers_intersection_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./parsers/intersection.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js");
14195 -/* harmony import */ var _parsers_literal_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parsers/literal.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js");
14196 -/* harmony import */ var _parsers_map_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./parsers/map.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js");
14197 -/* harmony import */ var _parsers_nativeEnum_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./parsers/nativeEnum.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js");
14198 -/* harmony import */ var _parsers_never_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./parsers/never.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js");
14199 -/* harmony import */ var _parsers_null_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./parsers/null.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js");
14200 -/* harmony import */ var _parsers_nullable_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./parsers/nullable.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js");
14201 -/* harmony import */ var _parsers_number_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./parsers/number.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js");
14202 -/* harmony import */ var _parsers_object_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./parsers/object.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js");
14203 -/* harmony import */ var _parsers_optional_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./parsers/optional.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js");
14204 -/* harmony import */ var _parsers_pipeline_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./parsers/pipeline.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js");
14205 -/* harmony import */ var _parsers_promise_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./parsers/promise.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js");
14206 -/* harmony import */ var _parsers_record_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./parsers/record.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js");
14207 -/* harmony import */ var _parsers_set_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./parsers/set.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js");
14208 -/* harmony import */ var _parsers_string_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./parsers/string.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js");
14209 -/* harmony import */ var _parsers_tuple_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./parsers/tuple.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js");
14210 -/* harmony import */ var _parsers_undefined_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./parsers/undefined.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js");
14211 -/* harmony import */ var _parsers_union_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./parsers/union.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js");
14212 -/* harmony import */ var _parsers_unknown_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./parsers/unknown.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js");
14213 -/* harmony import */ var _parsers_readonly_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./parsers/readonly.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");
14214 -
14215 -
14216 -
14217 -
14218 -
14219 -
14220 -
14221 -
14222 -
14223 -
14224 -
14225 -
14226 -
14227 -
14228 -
14229 -
14230 -
14231 -
14232 -
14233 -
14234 -
14235 -
14236 -
14237 -
14238 -
14239 -
14240 -
14241 -
14242 -
14243 -
14244 -
14245 -const selectParser = (def, typeName, refs) => {
14246 - switch (typeName) {
14247 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodString:
14248 - return (0,_parsers_string_js__WEBPACK_IMPORTED_MODULE_25__.parseStringDef)(def, refs);
14249 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNumber:
14250 - return (0,_parsers_number_js__WEBPACK_IMPORTED_MODULE_18__.parseNumberDef)(def, refs);
14251 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodObject:
14252 - return (0,_parsers_object_js__WEBPACK_IMPORTED_MODULE_19__.parseObjectDef)(def, refs);
14253 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodBigInt:
14254 - return (0,_parsers_bigint_js__WEBPACK_IMPORTED_MODULE_3__.parseBigintDef)(def, refs);
14255 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodBoolean:
14256 - return (0,_parsers_boolean_js__WEBPACK_IMPORTED_MODULE_4__.parseBooleanDef)();
14257 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodDate:
14258 - return (0,_parsers_date_js__WEBPACK_IMPORTED_MODULE_7__.parseDateDef)(def, refs);
14259 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodUndefined:
14260 - return (0,_parsers_undefined_js__WEBPACK_IMPORTED_MODULE_27__.parseUndefinedDef)(refs);
14261 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNull:
14262 - return (0,_parsers_null_js__WEBPACK_IMPORTED_MODULE_16__.parseNullDef)(refs);
14263 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodArray:
14264 - return (0,_parsers_array_js__WEBPACK_IMPORTED_MODULE_2__.parseArrayDef)(def, refs);
14265 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodUnion:
14266 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
14267 - return (0,_parsers_union_js__WEBPACK_IMPORTED_MODULE_28__.parseUnionDef)(def, refs);
14268 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodIntersection:
14269 - return (0,_parsers_intersection_js__WEBPACK_IMPORTED_MODULE_11__.parseIntersectionDef)(def, refs);
14270 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodTuple:
14271 - return (0,_parsers_tuple_js__WEBPACK_IMPORTED_MODULE_26__.parseTupleDef)(def, refs);
14272 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodRecord:
14273 - return (0,_parsers_record_js__WEBPACK_IMPORTED_MODULE_23__.parseRecordDef)(def, refs);
14274 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodLiteral:
14275 - return (0,_parsers_literal_js__WEBPACK_IMPORTED_MODULE_12__.parseLiteralDef)(def, refs);
14276 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodEnum:
14277 - return (0,_parsers_enum_js__WEBPACK_IMPORTED_MODULE_10__.parseEnumDef)(def);
14278 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNativeEnum:
14279 - return (0,_parsers_nativeEnum_js__WEBPACK_IMPORTED_MODULE_14__.parseNativeEnumDef)(def);
14280 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNullable:
14281 - return (0,_parsers_nullable_js__WEBPACK_IMPORTED_MODULE_17__.parseNullableDef)(def, refs);
14282 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodOptional:
14283 - return (0,_parsers_optional_js__WEBPACK_IMPORTED_MODULE_20__.parseOptionalDef)(def, refs);
14284 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodMap:
14285 - return (0,_parsers_map_js__WEBPACK_IMPORTED_MODULE_13__.parseMapDef)(def, refs);
14286 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodSet:
14287 - return (0,_parsers_set_js__WEBPACK_IMPORTED_MODULE_24__.parseSetDef)(def, refs);
14288 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodLazy:
14289 - return () => def.getter()._def;
14290 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodPromise:
14291 - return (0,_parsers_promise_js__WEBPACK_IMPORTED_MODULE_22__.parsePromiseDef)(def, refs);
14292 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNaN:
14293 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNever:
14294 - return (0,_parsers_never_js__WEBPACK_IMPORTED_MODULE_15__.parseNeverDef)(refs);
14295 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodEffects:
14296 - return (0,_parsers_effects_js__WEBPACK_IMPORTED_MODULE_9__.parseEffectsDef)(def, refs);
14297 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodAny:
14298 - return (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_1__.parseAnyDef)(refs);
14299 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodUnknown:
14300 - return (0,_parsers_unknown_js__WEBPACK_IMPORTED_MODULE_29__.parseUnknownDef)(refs);
14301 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodDefault:
14302 - return (0,_parsers_default_js__WEBPACK_IMPORTED_MODULE_8__.parseDefaultDef)(def, refs);
14303 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodBranded:
14304 - return (0,_parsers_branded_js__WEBPACK_IMPORTED_MODULE_5__.parseBrandedDef)(def, refs);
14305 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodReadonly:
14306 - return (0,_parsers_readonly_js__WEBPACK_IMPORTED_MODULE_30__.parseReadonlyDef)(def, refs);
14307 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodCatch:
14308 - return (0,_parsers_catch_js__WEBPACK_IMPORTED_MODULE_6__.parseCatchDef)(def, refs);
14309 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodPipeline:
14310 - return (0,_parsers_pipeline_js__WEBPACK_IMPORTED_MODULE_21__.parsePipelineDef)(def, refs);
14311 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodFunction:
14312 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodVoid:
14313 - case zod_v3__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodSymbol:
14314 - return undefined;
14315 - default:
14316 - return ((_) => undefined)(typeName);
14317 - }
14318 -};
14319 -
14320 -
14321 -/***/ }),
14322 -
14323 -/***/ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js":
14324 -/*!************************************************************************************************************!*\
14325 - !*** ./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js ***!
14326 - \************************************************************************************************************/
14327 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
14328 -
14329 -__webpack_require__.r(__webpack_exports__);
14330 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
14331 -/* harmony export */ zodToJsonSchema: function() { return /* binding */ zodToJsonSchema; }
14332 -/* harmony export */ });
14333 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parseDef.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");
14334 -/* harmony import */ var _Refs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Refs.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js");
14335 -/* harmony import */ var _parsers_any_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parsers/any.js */ "./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
14336 -
14337 -
14338 -
14339 -const zodToJsonSchema = (schema, options) => {
14340 - const refs = (0,_Refs_js__WEBPACK_IMPORTED_MODULE_1__.getRefs)(options);
14341 - let definitions = typeof options === "object" && options.definitions
14342 - ? Object.entries(options.definitions).reduce((acc, [name, schema]) => ({
14343 - ...acc,
14344 - [name]: (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(schema._def, {
14345 - ...refs,
14346 - currentPath: [...refs.basePath, refs.definitionPath, name],
14347 - }, true) ?? (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_2__.parseAnyDef)(refs),
14348 - }), {})
14349 - : undefined;
14350 - const name = typeof options === "string"
14351 - ? options
14352 - : options?.nameStrategy === "title"
14353 - ? undefined
14354 - : options?.name;
14355 - const main = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(schema._def, name === undefined
14356 - ? refs
14357 - : {
14358 - ...refs,
14359 - currentPath: [...refs.basePath, refs.definitionPath, name],
14360 - }, false) ?? (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_2__.parseAnyDef)(refs);
14361 - const title = typeof options === "object" &&
14362 - options.name !== undefined &&
14363 - options.nameStrategy === "title"
14364 - ? options.name
14365 - : undefined;
14366 - if (title !== undefined) {
14367 - main.title = title;
14368 - }
14369 - if (refs.flags.hasReferencedOpenAiAnyType) {
14370 - if (!definitions) {
14371 - definitions = {};
14372 - }
14373 - if (!definitions[refs.openAiAnyTypeName]) {
14374 - definitions[refs.openAiAnyTypeName] = {
14375 - // Skipping "object" as no properties can be defined and additionalProperties must be "false"
14376 - type: ["string", "number", "integer", "boolean", "array", "null"],
14377 - items: {
14378 - $ref: refs.$refStrategy === "relative"
14379 - ? "1"
14380 - : [
14381 - ...refs.basePath,
14382 - refs.definitionPath,
14383 - refs.openAiAnyTypeName,
14384 - ].join("/"),
14385 - },
14386 - };
14387 - }
14388 - }
14389 - const combined = name === undefined
14390 - ? definitions
14391 - ? {
14392 - ...main,
14393 - [refs.definitionPath]: definitions,
14394 - }
14395 - : main
14396 - : {
14397 - $ref: [
14398 - ...(refs.$refStrategy === "relative" ? [] : refs.basePath),
14399 - refs.definitionPath,
14400 - name,
14401 - ].join("/"),
14402 - [refs.definitionPath]: {
14403 - ...definitions,
14404 - [name]: main,
14405 - },
14406 - };
14407 - if (refs.target === "jsonSchema7") {
14408 - combined.$schema = "http://json-schema.org/draft-07/schema#";
14409 - }
14410 - else if (refs.target === "jsonSchema2019-09" || refs.target === "openAi") {
14411 - combined.$schema = "https://json-schema.org/draft/2019-09/schema#";
14412 - }
14413 - if (refs.target === "openAi" &&
14414 - ("anyOf" in combined ||
14415 - "oneOf" in combined ||
14416 - "allOf" in combined ||
14417 - ("type" in combined && Array.isArray(combined.type)))) {
14418 - console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");
14419 - }
14420 - return combined;
14421 -};
14422 -
14423 -
14424 -
14425 -/***/ }),
14426 -
14427 -/***/ "./node_modules/fast-deep-equal/index.js":
14428 -/*!***********************************************!*\
14429 - !*** ./node_modules/fast-deep-equal/index.js ***!
14430 - \***********************************************/
14431 -/***/ (function(module) {
14432 -
14433 -
14434 -
14435 -// do not edit .js files directly - edit src/index.jst
14436 -
14437 -
14438 -
14439 -module.exports = function equal(a, b) {
14440 - if (a === b) return true;
14441 -
14442 - if (a && b && typeof a == 'object' && typeof b == 'object') {
14443 - if (a.constructor !== b.constructor) return false;
14444 -
14445 - var length, i, keys;
14446 - if (Array.isArray(a)) {
14447 - length = a.length;
14448 - if (length != b.length) return false;
14449 - for (i = length; i-- !== 0;)
14450 - if (!equal(a[i], b[i])) return false;
14451 - return true;
14452 - }
14453 -
14454 -
14455 -
14456 - if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
14457 - if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
14458 - if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
14459 -
14460 - keys = Object.keys(a);
14461 - length = keys.length;
14462 - if (length !== Object.keys(b).length) return false;
14463 -
14464 - for (i = length; i-- !== 0;)
14465 - if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
14466 -
14467 - for (i = length; i-- !== 0;) {
14468 - var key = keys[i];
14469 -
14470 - if (!equal(a[key], b[key])) return false;
14471 - }
14472 -
14473 - return true;
14474 - }
14475 -
14476 - // true if both NaN, false otherwise
14477 - return a!==a && b!==b;
14478 -};
14479 -
14480 -
14481 -/***/ }),
14482 -
14483 -/***/ "./node_modules/fast-uri/index.js":
14484 -/*!****************************************!*\
14485 - !*** ./node_modules/fast-uri/index.js ***!
14486 - \****************************************/
14487 -/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
14488 -
14489 -
14490 -
14491 -const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = __webpack_require__(/*! ./lib/utils */ "./node_modules/fast-uri/lib/utils.js")
14492 -const { SCHEMES, getSchemeHandler } = __webpack_require__(/*! ./lib/schemes */ "./node_modules/fast-uri/lib/schemes.js")
14493 -
14494 -/**
14495 - * @template {import('./types/index').URIComponent|string} T
14496 - * @param {T} uri
14497 - * @param {import('./types/index').Options} [options]
14498 - * @returns {T}
14499 - */
14500 -function normalize (uri, options) {
14501 - if (typeof uri === 'string') {
14502 - uri = /** @type {T} */ (serialize(parse(uri, options), options))
14503 - } else if (typeof uri === 'object') {
14504 - uri = /** @type {T} */ (parse(serialize(uri, options), options))
14505 - }
14506 - return uri
14507 -}
14508 -
14509 -/**
14510 - * @param {string} baseURI
14511 - * @param {string} relativeURI
14512 - * @param {import('./types/index').Options} [options]
14513 - * @returns {string}
14514 - */
14515 -function resolve (baseURI, relativeURI, options) {
14516 - const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }
14517 - const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true)
14518 - schemelessOptions.skipEscape = true
14519 - return serialize(resolved, schemelessOptions)
14520 -}
14521 -
14522 -/**
14523 - * @param {import ('./types/index').URIComponent} base
14524 - * @param {import ('./types/index').URIComponent} relative
14525 - * @param {import('./types/index').Options} [options]
14526 - * @param {boolean} [skipNormalization=false]
14527 - * @returns {import ('./types/index').URIComponent}
14528 - */
14529 -function resolveComponent (base, relative, options, skipNormalization) {
14530 - /** @type {import('./types/index').URIComponent} */
14531 - const target = {}
14532 - if (!skipNormalization) {
14533 - base = parse(serialize(base, options), options) // normalize base component
14534 - relative = parse(serialize(relative, options), options) // normalize relative component
14535 - }
14536 - options = options || {}
14537 -
14538 - if (!options.tolerant && relative.scheme) {
14539 - target.scheme = relative.scheme
14540 - // target.authority = relative.authority;
14541 - target.userinfo = relative.userinfo
14542 - target.host = relative.host
14543 - target.port = relative.port
14544 - target.path = removeDotSegments(relative.path || '')
14545 - target.query = relative.query
14546 - } else {
14547 - if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
14548 - // target.authority = relative.authority;
14549 - target.userinfo = relative.userinfo
14550 - target.host = relative.host
14551 - target.port = relative.port
14552 - target.path = removeDotSegments(relative.path || '')
14553 - target.query = relative.query
14554 - } else {
14555 - if (!relative.path) {
14556 - target.path = base.path
14557 - if (relative.query !== undefined) {
14558 - target.query = relative.query
14559 - } else {
14560 - target.query = base.query
14561 - }
14562 - } else {
14563 - if (relative.path[0] === '/') {
14564 - target.path = removeDotSegments(relative.path)
14565 - } else {
14566 - if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
14567 - target.path = '/' + relative.path
14568 - } else if (!base.path) {
14569 - target.path = relative.path
14570 - } else {
14571 - target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path
14572 - }
14573 - target.path = removeDotSegments(target.path)
14574 - }
14575 - target.query = relative.query
14576 - }
14577 - // target.authority = base.authority;
14578 - target.userinfo = base.userinfo
14579 - target.host = base.host
14580 - target.port = base.port
14581 - }
14582 - target.scheme = base.scheme
14583 - }
14584 -
14585 - target.fragment = relative.fragment
14586 -
14587 - return target
14588 -}
14589 -
14590 -/**
14591 - * @param {import ('./types/index').URIComponent|string} uriA
14592 - * @param {import ('./types/index').URIComponent|string} uriB
14593 - * @param {import ('./types/index').Options} options
14594 - * @returns {boolean}
14595 - */
14596 -function equal (uriA, uriB, options) {
14597 - if (typeof uriA === 'string') {
14598 - uriA = unescape(uriA)
14599 - uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true })
14600 - } else if (typeof uriA === 'object') {
14601 - uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true })
14602 - }
14603 -
14604 - if (typeof uriB === 'string') {
14605 - uriB = unescape(uriB)
14606 - uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true })
14607 - } else if (typeof uriB === 'object') {
14608 - uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true })
14609 - }
14610 -
14611 - return uriA.toLowerCase() === uriB.toLowerCase()
14612 -}
14613 -
14614 -/**
14615 - * @param {Readonly<import('./types/index').URIComponent>} cmpts
14616 - * @param {import('./types/index').Options} [opts]
14617 - * @returns {string}
14618 - */
14619 -function serialize (cmpts, opts) {
14620 - const component = {
14621 - host: cmpts.host,
14622 - scheme: cmpts.scheme,
14623 - userinfo: cmpts.userinfo,
14624 - port: cmpts.port,
14625 - path: cmpts.path,
14626 - query: cmpts.query,
14627 - nid: cmpts.nid,
14628 - nss: cmpts.nss,
14629 - uuid: cmpts.uuid,
14630 - fragment: cmpts.fragment,
14631 - reference: cmpts.reference,
14632 - resourceName: cmpts.resourceName,
14633 - secure: cmpts.secure,
14634 - error: ''
14635 - }
14636 - const options = Object.assign({}, opts)
14637 - const uriTokens = []
14638 -
14639 - // find scheme handler
14640 - const schemeHandler = getSchemeHandler(options.scheme || component.scheme)
14641 -
14642 - // perform scheme specific serialization
14643 - if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)
14644 -
14645 - if (component.path !== undefined) {
14646 - if (!options.skipEscape) {
14647 - component.path = escape(component.path)
14648 -
14649 - if (component.scheme !== undefined) {
14650 - component.path = component.path.split('%3A').join(':')
14651 - }
14652 - } else {
14653 - component.path = unescape(component.path)
14654 - }
14655 - }
14656 -
14657 - if (options.reference !== 'suffix' && component.scheme) {
14658 - uriTokens.push(component.scheme, ':')
14659 - }
14660 -
14661 - const authority = recomposeAuthority(component)
14662 - if (authority !== undefined) {
14663 - if (options.reference !== 'suffix') {
14664 - uriTokens.push('//')
14665 - }
14666 -
14667 - uriTokens.push(authority)
14668 -
14669 - if (component.path && component.path[0] !== '/') {
14670 - uriTokens.push('/')
14671 - }
14672 - }
14673 - if (component.path !== undefined) {
14674 - let s = component.path
14675 -
14676 - if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
14677 - s = removeDotSegments(s)
14678 - }
14679 -
14680 - if (
14681 - authority === undefined &&
14682 - s[0] === '/' &&
14683 - s[1] === '/'
14684 - ) {
14685 - // don't allow the path to start with "//"
14686 - s = '/%2F' + s.slice(2)
14687 - }
14688 -
14689 - uriTokens.push(s)
14690 - }
14691 -
14692 - if (component.query !== undefined) {
14693 - uriTokens.push('?', component.query)
14694 - }
14695 -
14696 - if (component.fragment !== undefined) {
14697 - uriTokens.push('#', component.fragment)
14698 - }
14699 - return uriTokens.join('')
14700 -}
14701 -
14702 -const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u
14703 -
14704 -/**
14705 - * @param {string} uri
14706 - * @param {import('./types/index').Options} [opts]
14707 - * @returns
14708 - */
14709 -function parse (uri, opts) {
14710 - const options = Object.assign({}, opts)
14711 - /** @type {import('./types/index').URIComponent} */
14712 - const parsed = {
14713 - scheme: undefined,
14714 - userinfo: undefined,
14715 - host: '',
14716 - port: undefined,
14717 - path: '',
14718 - query: undefined,
14719 - fragment: undefined
14720 - }
14721 -
14722 - let isIP = false
14723 - if (options.reference === 'suffix') {
14724 - if (options.scheme) {
14725 - uri = options.scheme + ':' + uri
14726 - } else {
14727 - uri = '//' + uri
14728 - }
14729 - }
14730 -
14731 - const matches = uri.match(URI_PARSE)
14732 -
14733 - if (matches) {
14734 - // store each component
14735 - parsed.scheme = matches[1]
14736 - parsed.userinfo = matches[3]
14737 - parsed.host = matches[4]
14738 - parsed.port = parseInt(matches[5], 10)
14739 - parsed.path = matches[6] || ''
14740 - parsed.query = matches[7]
14741 - parsed.fragment = matches[8]
14742 -
14743 - // fix port number
14744 - if (isNaN(parsed.port)) {
14745 - parsed.port = matches[5]
14746 - }
14747 - if (parsed.host) {
14748 - const ipv4result = isIPv4(parsed.host)
14749 - if (ipv4result === false) {
14750 - const ipv6result = normalizeIPv6(parsed.host)
14751 - parsed.host = ipv6result.host.toLowerCase()
14752 - isIP = ipv6result.isIPV6
14753 - } else {
14754 - isIP = true
14755 - }
14756 - }
14757 - if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) {
14758 - parsed.reference = 'same-document'
14759 - } else if (parsed.scheme === undefined) {
14760 - parsed.reference = 'relative'
14761 - } else if (parsed.fragment === undefined) {
14762 - parsed.reference = 'absolute'
14763 - } else {
14764 - parsed.reference = 'uri'
14765 - }
14766 -
14767 - // check for reference errors
14768 - if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) {
14769 - parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'
14770 - }
14771 -
14772 - // find scheme handler
14773 - const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme)
14774 -
14775 - // check if scheme can't handle IRIs
14776 - if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
14777 - // if host component is a domain name
14778 - if (parsed.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost)) && isIP === false && nonSimpleDomain(parsed.host)) {
14779 - // convert Unicode IDN -> ASCII IDN
14780 - try {
14781 - parsed.host = URL.domainToASCII(parsed.host.toLowerCase())
14782 - } catch (e) {
14783 - parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e
14784 - }
14785 - }
14786 - // convert IRI -> URI
14787 - }
14788 -
14789 - if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {
14790 - if (uri.indexOf('%') !== -1) {
14791 - if (parsed.scheme !== undefined) {
14792 - parsed.scheme = unescape(parsed.scheme)
14793 - }
14794 - if (parsed.host !== undefined) {
14795 - parsed.host = unescape(parsed.host)
14796 - }
14797 - }
14798 - if (parsed.path) {
14799 - parsed.path = escape(unescape(parsed.path))
14800 - }
14801 - if (parsed.fragment) {
14802 - parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment))
14803 - }
14804 - }
14805 -
14806 - // perform scheme specific parsing
14807 - if (schemeHandler && schemeHandler.parse) {
14808 - schemeHandler.parse(parsed, options)
14809 - }
14810 - } else {
14811 - parsed.error = parsed.error || 'URI can not be parsed.'
14812 - }
14813 - return parsed
14814 -}
14815 -
14816 -const fastUri = {
14817 - SCHEMES,
14818 - normalize,
14819 - resolve,
14820 - resolveComponent,
14821 - equal,
14822 - serialize,
14823 - parse
14824 -}
14825 -
14826 -module.exports = fastUri
14827 -module.exports["default"] = fastUri
14828 -module.exports.fastUri = fastUri
14829 -
14830 -
14831 -/***/ }),
14832 -
14833 -/***/ "./node_modules/fast-uri/lib/schemes.js":
14834 -/*!**********************************************!*\
14835 - !*** ./node_modules/fast-uri/lib/schemes.js ***!
14836 - \**********************************************/
14837 -/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
14838 -
14839 -
14840 -
14841 -const { isUUID } = __webpack_require__(/*! ./utils */ "./node_modules/fast-uri/lib/utils.js")
14842 -const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu
14843 -
14844 -const supportedSchemeNames = /** @type {const} */ (['http', 'https', 'ws',
14845 - 'wss', 'urn', 'urn:uuid'])
14846 -
14847 -/** @typedef {supportedSchemeNames[number]} SchemeName */
14848 -
14849 -/**
14850 - * @param {string} name
14851 - * @returns {name is SchemeName}
14852 - */
14853 -function isValidSchemeName (name) {
14854 - return supportedSchemeNames.indexOf(/** @type {*} */ (name)) !== -1
14855 -}
14856 -
14857 -/**
14858 - * @callback SchemeFn
14859 - * @param {import('../types/index').URIComponent} component
14860 - * @param {import('../types/index').Options} options
14861 - * @returns {import('../types/index').URIComponent}
14862 - */
14863 -
14864 -/**
14865 - * @typedef {Object} SchemeHandler
14866 - * @property {SchemeName} scheme - The scheme name.
14867 - * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts.
14868 - * @property {SchemeFn} parse - Function to parse the URI component for this scheme.
14869 - * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme.
14870 - * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme.
14871 - * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths.
14872 - * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode.
14873 - */
14874 -
14875 -/**
14876 - * @param {import('../types/index').URIComponent} wsComponent
14877 - * @returns {boolean}
14878 - */
14879 -function wsIsSecure (wsComponent) {
14880 - if (wsComponent.secure === true) {
14881 - return true
14882 - } else if (wsComponent.secure === false) {
14883 - return false
14884 - } else if (wsComponent.scheme) {
14885 - return (
14886 - wsComponent.scheme.length === 3 &&
14887 - (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') &&
14888 - (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') &&
14889 - (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S')
14890 - )
14891 - } else {
14892 - return false
14893 - }
14894 -}
14895 -
14896 -/** @type {SchemeFn} */
14897 -function httpParse (component) {
14898 - if (!component.host) {
14899 - component.error = component.error || 'HTTP URIs must have a host.'
14900 - }
14901 -
14902 - return component
14903 -}
14904 -
14905 -/** @type {SchemeFn} */
14906 -function httpSerialize (component) {
14907 - const secure = String(component.scheme).toLowerCase() === 'https'
14908 -
14909 - // normalize the default port
14910 - if (component.port === (secure ? 443 : 80) || component.port === '') {
14911 - component.port = undefined
14912 - }
14913 -
14914 - // normalize the empty path
14915 - if (!component.path) {
14916 - component.path = '/'
14917 - }
14918 -
14919 - // NOTE: We do not parse query strings for HTTP URIs
14920 - // as WWW Form Url Encoded query strings are part of the HTML4+ spec,
14921 - // and not the HTTP spec.
14922 -
14923 - return component
14924 -}
14925 -
14926 -/** @type {SchemeFn} */
14927 -function wsParse (wsComponent) {
14928 -// indicate if the secure flag is set
14929 - wsComponent.secure = wsIsSecure(wsComponent)
14930 -
14931 - // construct resouce name
14932 - wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : '')
14933 - wsComponent.path = undefined
14934 - wsComponent.query = undefined
14935 -
14936 - return wsComponent
14937 -}
14938 -
14939 -/** @type {SchemeFn} */
14940 -function wsSerialize (wsComponent) {
14941 -// normalize the default port
14942 - if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') {
14943 - wsComponent.port = undefined
14944 - }
14945 -
14946 - // ensure scheme matches secure flag
14947 - if (typeof wsComponent.secure === 'boolean') {
14948 - wsComponent.scheme = (wsComponent.secure ? 'wss' : 'ws')
14949 - wsComponent.secure = undefined
14950 - }
14951 -
14952 - // reconstruct path from resource name
14953 - if (wsComponent.resourceName) {
14954 - const [path, query] = wsComponent.resourceName.split('?')
14955 - wsComponent.path = (path && path !== '/' ? path : undefined)
14956 - wsComponent.query = query
14957 - wsComponent.resourceName = undefined
14958 - }
14959 -
14960 - // forbid fragment component
14961 - wsComponent.fragment = undefined
14962 -
14963 - return wsComponent
14964 -}
14965 -
14966 -/** @type {SchemeFn} */
14967 -function urnParse (urnComponent, options) {
14968 - if (!urnComponent.path) {
14969 - urnComponent.error = 'URN can not be parsed'
14970 - return urnComponent
14971 - }
14972 - const matches = urnComponent.path.match(URN_REG)
14973 - if (matches) {
14974 - const scheme = options.scheme || urnComponent.scheme || 'urn'
14975 - urnComponent.nid = matches[1].toLowerCase()
14976 - urnComponent.nss = matches[2]
14977 - const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`
14978 - const schemeHandler = getSchemeHandler(urnScheme)
14979 - urnComponent.path = undefined
14980 -
14981 - if (schemeHandler) {
14982 - urnComponent = schemeHandler.parse(urnComponent, options)
14983 - }
14984 - } else {
14985 - urnComponent.error = urnComponent.error || 'URN can not be parsed.'
14986 - }
14987 -
14988 - return urnComponent
14989 -}
14990 -
14991 -/** @type {SchemeFn} */
14992 -function urnSerialize (urnComponent, options) {
14993 - if (urnComponent.nid === undefined) {
14994 - throw new Error('URN without nid cannot be serialized')
14995 - }
14996 - const scheme = options.scheme || urnComponent.scheme || 'urn'
14997 - const nid = urnComponent.nid.toLowerCase()
14998 - const urnScheme = `${scheme}:${options.nid || nid}`
14999 - const schemeHandler = getSchemeHandler(urnScheme)
15000 -
15001 - if (schemeHandler) {
15002 - urnComponent = schemeHandler.serialize(urnComponent, options)
15003 - }
15004 -
15005 - const uriComponent = urnComponent
15006 - const nss = urnComponent.nss
15007 - uriComponent.path = `${nid || options.nid}:${nss}`
15008 -
15009 - options.skipEscape = true
15010 - return uriComponent
15011 -}
15012 -
15013 -/** @type {SchemeFn} */
15014 -function urnuuidParse (urnComponent, options) {
15015 - const uuidComponent = urnComponent
15016 - uuidComponent.uuid = uuidComponent.nss
15017 - uuidComponent.nss = undefined
15018 -
15019 - if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
15020 - uuidComponent.error = uuidComponent.error || 'UUID is not valid.'
15021 - }
15022 -
15023 - return uuidComponent
15024 -}
15025 -
15026 -/** @type {SchemeFn} */
15027 -function urnuuidSerialize (uuidComponent) {
15028 - const urnComponent = uuidComponent
15029 - // normalize UUID
15030 - urnComponent.nss = (uuidComponent.uuid || '').toLowerCase()
15031 - return urnComponent
15032 -}
15033 -
15034 -const http = /** @type {SchemeHandler} */ ({
15035 - scheme: 'http',
15036 - domainHost: true,
15037 - parse: httpParse,
15038 - serialize: httpSerialize
15039 -})
15040 -
15041 -const https = /** @type {SchemeHandler} */ ({
15042 - scheme: 'https',
15043 - domainHost: http.domainHost,
15044 - parse: httpParse,
15045 - serialize: httpSerialize
15046 -})
15047 -
15048 -const ws = /** @type {SchemeHandler} */ ({
15049 - scheme: 'ws',
15050 - domainHost: true,
15051 - parse: wsParse,
15052 - serialize: wsSerialize
15053 -})
15054 -
15055 -const wss = /** @type {SchemeHandler} */ ({
15056 - scheme: 'wss',
15057 - domainHost: ws.domainHost,
15058 - parse: ws.parse,
15059 - serialize: ws.serialize
15060 -})
15061 -
15062 -const urn = /** @type {SchemeHandler} */ ({
15063 - scheme: 'urn',
15064 - parse: urnParse,
15065 - serialize: urnSerialize,
15066 - skipNormalize: true
15067 -})
15068 -
15069 -const urnuuid = /** @type {SchemeHandler} */ ({
15070 - scheme: 'urn:uuid',
15071 - parse: urnuuidParse,
15072 - serialize: urnuuidSerialize,
15073 - skipNormalize: true
15074 -})
15075 -
15076 -const SCHEMES = /** @type {Record<SchemeName, SchemeHandler>} */ ({
15077 - http,
15078 - https,
15079 - ws,
15080 - wss,
15081 - urn,
15082 - 'urn:uuid': urnuuid
15083 -})
15084 -
15085 -Object.setPrototypeOf(SCHEMES, null)
15086 -
15087 -/**
15088 - * @param {string|undefined} scheme
15089 - * @returns {SchemeHandler|undefined}
15090 - */
15091 -function getSchemeHandler (scheme) {
15092 - return (
15093 - scheme && (
15094 - SCHEMES[/** @type {SchemeName} */ (scheme)] ||
15095 - SCHEMES[/** @type {SchemeName} */(scheme.toLowerCase())])
15096 - ) ||
15097 - undefined
15098 -}
15099 -
15100 -module.exports = {
15101 - wsIsSecure,
15102 - SCHEMES,
15103 - isValidSchemeName,
15104 - getSchemeHandler,
15105 -}
15106 -
15107 -
15108 -/***/ }),
15109 -
15110 -/***/ "./node_modules/fast-uri/lib/utils.js":
15111 -/*!********************************************!*\
15112 - !*** ./node_modules/fast-uri/lib/utils.js ***!
15113 - \********************************************/
15114 -/***/ (function(module) {
15115 -
15116 -
15117 -
15118 -/** @type {(value: string) => boolean} */
15119 -const isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu)
15120 -
15121 -/** @type {(value: string) => boolean} */
15122 -const isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u)
15123 -
15124 -/**
15125 - * @param {Array<string>} input
15126 - * @returns {string}
15127 - */
15128 -function stringArrayToHexStripped (input) {
15129 - let acc = ''
15130 - let code = 0
15131 - let i = 0
15132 -
15133 - for (i = 0; i < input.length; i++) {
15134 - code = input[i].charCodeAt(0)
15135 - if (code === 48) {
15136 - continue
15137 - }
15138 - if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {
15139 - return ''
15140 - }
15141 - acc += input[i]
15142 - break
15143 - }
15144 -
15145 - for (i += 1; i < input.length; i++) {
15146 - code = input[i].charCodeAt(0)
15147 - if (!((code >= 48 && code <= 57) || (code >= 65 && code <= 70) || (code >= 97 && code <= 102))) {
15148 - return ''
15149 - }
15150 - acc += input[i]
15151 - }
15152 - return acc
15153 -}
15154 -
15155 -/**
15156 - * @typedef {Object} GetIPV6Result
15157 - * @property {boolean} error - Indicates if there was an error parsing the IPv6 address.
15158 - * @property {string} address - The parsed IPv6 address.
15159 - * @property {string} [zone] - The zone identifier, if present.
15160 - */
15161 -
15162 -/**
15163 - * @param {string} value
15164 - * @returns {boolean}
15165 - */
15166 -const nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u)
15167 -
15168 -/**
15169 - * @param {Array<string>} buffer
15170 - * @returns {boolean}
15171 - */
15172 -function consumeIsZone (buffer) {
15173 - buffer.length = 0
15174 - return true
15175 -}
15176 -
15177 -/**
15178 - * @param {Array<string>} buffer
15179 - * @param {Array<string>} address
15180 - * @param {GetIPV6Result} output
15181 - * @returns {boolean}
15182 - */
15183 -function consumeHextets (buffer, address, output) {
15184 - if (buffer.length) {
15185 - const hex = stringArrayToHexStripped(buffer)
15186 - if (hex !== '') {
15187 - address.push(hex)
15188 - } else {
15189 - output.error = true
15190 - return false
15191 - }
15192 - buffer.length = 0
15193 - }
15194 - return true
15195 -}
15196 -
15197 -/**
15198 - * @param {string} input
15199 - * @returns {GetIPV6Result}
15200 - */
15201 -function getIPV6 (input) {
15202 - let tokenCount = 0
15203 - const output = { error: false, address: '', zone: '' }
15204 - /** @type {Array<string>} */
15205 - const address = []
15206 - /** @type {Array<string>} */
15207 - const buffer = []
15208 - let endipv6Encountered = false
15209 - let endIpv6 = false
15210 -
15211 - let consume = consumeHextets
15212 -
15213 - for (let i = 0; i < input.length; i++) {
15214 - const cursor = input[i]
15215 - if (cursor === '[' || cursor === ']') { continue }
15216 - if (cursor === ':') {
15217 - if (endipv6Encountered === true) {
15218 - endIpv6 = true
15219 - }
15220 - if (!consume(buffer, address, output)) { break }
15221 - if (++tokenCount > 7) {
15222 - // not valid
15223 - output.error = true
15224 - break
15225 - }
15226 - if (i > 0 && input[i - 1] === ':') {
15227 - endipv6Encountered = true
15228 - }
15229 - address.push(':')
15230 - continue
15231 - } else if (cursor === '%') {
15232 - if (!consume(buffer, address, output)) { break }
15233 - // switch to zone detection
15234 - consume = consumeIsZone
15235 - } else {
15236 - buffer.push(cursor)
15237 - continue
15238 - }
15239 - }
15240 - if (buffer.length) {
15241 - if (consume === consumeIsZone) {
15242 - output.zone = buffer.join('')
15243 - } else if (endIpv6) {
15244 - address.push(buffer.join(''))
15245 - } else {
15246 - address.push(stringArrayToHexStripped(buffer))
15247 - }
15248 - }
15249 - output.address = address.join('')
15250 - return output
15251 -}
15252 -
15253 -/**
15254 - * @typedef {Object} NormalizeIPv6Result
15255 - * @property {string} host - The normalized host.
15256 - * @property {string} [escapedHost] - The escaped host.
15257 - * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address.
15258 - */
15259 -
15260 -/**
15261 - * @param {string} host
15262 - * @returns {NormalizeIPv6Result}
15263 - */
15264 -function normalizeIPv6 (host) {
15265 - if (findToken(host, ':') < 2) { return { host, isIPV6: false } }
15266 - const ipv6 = getIPV6(host)
15267 -
15268 - if (!ipv6.error) {
15269 - let newHost = ipv6.address
15270 - let escapedHost = ipv6.address
15271 - if (ipv6.zone) {
15272 - newHost += '%' + ipv6.zone
15273 - escapedHost += '%25' + ipv6.zone
15274 - }
15275 - return { host: newHost, isIPV6: true, escapedHost }
15276 - } else {
15277 - return { host, isIPV6: false }
15278 - }
15279 -}
15280 -
15281 -/**
15282 - * @param {string} str
15283 - * @param {string} token
15284 - * @returns {number}
15285 - */
15286 -function findToken (str, token) {
15287 - let ind = 0
15288 - for (let i = 0; i < str.length; i++) {
15289 - if (str[i] === token) ind++
15290 - }
15291 - return ind
15292 -}
15293 -
15294 -/**
15295 - * @param {string} path
15296 - * @returns {string}
15297 - *
15298 - * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4
15299 - */
15300 -function removeDotSegments (path) {
15301 - let input = path
15302 - const output = []
15303 - let nextSlash = -1
15304 - let len = 0
15305 -
15306 - // eslint-disable-next-line no-cond-assign
15307 - while (len = input.length) {
15308 - if (len === 1) {
15309 - if (input === '.') {
15310 - break
15311 - } else if (input === '/') {
15312 - output.push('/')
15313 - break
15314 - } else {
15315 - output.push(input)
15316 - break
15317 - }
15318 - } else if (len === 2) {
15319 - if (input[0] === '.') {
15320 - if (input[1] === '.') {
15321 - break
15322 - } else if (input[1] === '/') {
15323 - input = input.slice(2)
15324 - continue
15325 - }
15326 - } else if (input[0] === '/') {
15327 - if (input[1] === '.' || input[1] === '/') {
15328 - output.push('/')
15329 - break
15330 - }
15331 - }
15332 - } else if (len === 3) {
15333 - if (input === '/..') {
15334 - if (output.length !== 0) {
15335 - output.pop()
15336 - }
15337 - output.push('/')
15338 - break
15339 - }
15340 - }
15341 - if (input[0] === '.') {
15342 - if (input[1] === '.') {
15343 - if (input[2] === '/') {
15344 - input = input.slice(3)
15345 - continue
15346 - }
15347 - } else if (input[1] === '/') {
15348 - input = input.slice(2)
15349 - continue
15350 - }
15351 - } else if (input[0] === '/') {
15352 - if (input[1] === '.') {
15353 - if (input[2] === '/') {
15354 - input = input.slice(2)
15355 - continue
15356 - } else if (input[2] === '.') {
15357 - if (input[3] === '/') {
15358 - input = input.slice(3)
15359 - if (output.length !== 0) {
15360 - output.pop()
15361 - }
15362 - continue
15363 - }
15364 - }
15365 - }
15366 - }
15367 -
15368 - // Rule 2E: Move normal path segment to output
15369 - if ((nextSlash = input.indexOf('/', 1)) === -1) {
15370 - output.push(input)
15371 - break
15372 - } else {
15373 - output.push(input.slice(0, nextSlash))
15374 - input = input.slice(nextSlash)
15375 - }
15376 - }
15377 -
15378 - return output.join('')
15379 -}
15380 -
15381 -/**
15382 - * @param {import('../types/index').URIComponent} component
15383 - * @param {boolean} esc
15384 - * @returns {import('../types/index').URIComponent}
15385 - */
15386 -function normalizeComponentEncoding (component, esc) {
15387 - const func = esc !== true ? escape : unescape
15388 - if (component.scheme !== undefined) {
15389 - component.scheme = func(component.scheme)
15390 - }
15391 - if (component.userinfo !== undefined) {
15392 - component.userinfo = func(component.userinfo)
15393 - }
15394 - if (component.host !== undefined) {
15395 - component.host = func(component.host)
15396 - }
15397 - if (component.path !== undefined) {
15398 - component.path = func(component.path)
15399 - }
15400 - if (component.query !== undefined) {
15401 - component.query = func(component.query)
15402 - }
15403 - if (component.fragment !== undefined) {
15404 - component.fragment = func(component.fragment)
15405 - }
15406 - return component
15407 -}
15408 -
15409 -/**
15410 - * @param {import('../types/index').URIComponent} component
15411 - * @returns {string|undefined}
15412 - */
15413 -function recomposeAuthority (component) {
15414 - const uriTokens = []
15415 -
15416 - if (component.userinfo !== undefined) {
15417 - uriTokens.push(component.userinfo)
15418 - uriTokens.push('@')
15419 - }
15420 -
15421 - if (component.host !== undefined) {
15422 - let host = unescape(component.host)
15423 - if (!isIPv4(host)) {
15424 - const ipV6res = normalizeIPv6(host)
15425 - if (ipV6res.isIPV6 === true) {
15426 - host = `[${ipV6res.escapedHost}]`
15427 - } else {
15428 - host = component.host
15429 - }
15430 - }
15431 - uriTokens.push(host)
15432 - }
15433 -
15434 - if (typeof component.port === 'number' || typeof component.port === 'string') {
15435 - uriTokens.push(':')
15436 - uriTokens.push(String(component.port))
15437 - }
15438 -
15439 - return uriTokens.length ? uriTokens.join('') : undefined
15440 -};
15441 -
15442 -module.exports = {
15443 - nonSimpleDomain,
15444 - recomposeAuthority,
15445 - normalizeComponentEncoding,
15446 - removeDotSegments,
15447 - isIPv4,
15448 - isUUID,
15449 - normalizeIPv6,
15450 - stringArrayToHexStripped
15451 -}
15452 -
15453 -
15454 -/***/ }),
15455 -
15456 -/***/ "./node_modules/zod-to-json-schema/dist/esm/Options.js":
15457 -/*!*************************************************************!*\
15458 - !*** ./node_modules/zod-to-json-schema/dist/esm/Options.js ***!
15459 - \*************************************************************/
15460 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15461 -
15462 -__webpack_require__.r(__webpack_exports__);
15463 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15464 -/* harmony export */ defaultOptions: function() { return /* binding */ defaultOptions; },
15465 -/* harmony export */ getDefaultOptions: function() { return /* binding */ getDefaultOptions; },
15466 -/* harmony export */ ignoreOverride: function() { return /* binding */ ignoreOverride; },
15467 -/* harmony export */ jsonDescription: function() { return /* binding */ jsonDescription; }
15468 -/* harmony export */ });
15469 -const ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
15470 -const jsonDescription = (jsonSchema, def) => {
15471 - if (def.description) {
15472 - try {
15473 - return {
15474 - ...jsonSchema,
15475 - ...JSON.parse(def.description),
15476 - };
15477 - }
15478 - catch { }
15479 - }
15480 - return jsonSchema;
15481 -};
15482 -const defaultOptions = {
15483 - name: undefined,
15484 - $refStrategy: "root",
15485 - basePath: ["#"],
15486 - effectStrategy: "input",
15487 - pipeStrategy: "all",
15488 - dateStrategy: "format:date-time",
15489 - mapStrategy: "entries",
15490 - removeAdditionalStrategy: "passthrough",
15491 - allowedAdditionalProperties: true,
15492 - rejectedAdditionalProperties: false,
15493 - definitionPath: "definitions",
15494 - target: "jsonSchema7",
15495 - strictUnions: false,
15496 - definitions: {},
15497 - errorMessages: false,
15498 - markdownDescription: false,
15499 - patternStrategy: "escape",
15500 - applyRegexFlags: false,
15501 - emailStrategy: "format:email",
15502 - base64Strategy: "contentEncoding:base64",
15503 - nameStrategy: "ref",
15504 - openAiAnyTypeName: "OpenAiAnyType"
15505 -};
15506 -const getDefaultOptions = (options) => (typeof options === "string"
15507 - ? {
15508 - ...defaultOptions,
15509 - name: options,
15510 - }
15511 - : {
15512 - ...defaultOptions,
15513 - ...options,
15514 - });
15515 -
15516 -
15517 -/***/ }),
15518 -
15519 -/***/ "./node_modules/zod-to-json-schema/dist/esm/Refs.js":
15520 -/*!**********************************************************!*\
15521 - !*** ./node_modules/zod-to-json-schema/dist/esm/Refs.js ***!
15522 - \**********************************************************/
15523 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15524 -
15525 -__webpack_require__.r(__webpack_exports__);
15526 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15527 -/* harmony export */ getRefs: function() { return /* binding */ getRefs; }
15528 -/* harmony export */ });
15529 -/* harmony import */ var _Options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options.js */ "./node_modules/zod-to-json-schema/dist/esm/Options.js");
15530 -
15531 -const getRefs = (options) => {
15532 - const _options = (0,_Options_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions)(options);
15533 - const currentPath = _options.name !== undefined
15534 - ? [..._options.basePath, _options.definitionPath, _options.name]
15535 - : _options.basePath;
15536 - return {
15537 - ..._options,
15538 - flags: { hasReferencedOpenAiAnyType: false },
15539 - currentPath: currentPath,
15540 - propertyPath: undefined,
15541 - seen: new Map(Object.entries(_options.definitions).map(([name, def]) => [
15542 - def._def,
15543 - {
15544 - def: def._def,
15545 - path: [..._options.basePath, _options.definitionPath, name],
15546 - // Resolution of references will be forced even though seen, so it's ok that the schema is undefined here for now.
15547 - jsonSchema: undefined,
15548 - },
15549 - ])),
15550 - };
15551 -};
15552 -
15553 -
15554 -/***/ }),
15555 -
15556 -/***/ "./node_modules/zod-to-json-schema/dist/esm/errorMessages.js":
15557 -/*!*******************************************************************!*\
15558 - !*** ./node_modules/zod-to-json-schema/dist/esm/errorMessages.js ***!
15559 - \*******************************************************************/
15560 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15561 -
15562 -__webpack_require__.r(__webpack_exports__);
15563 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15564 -/* harmony export */ addErrorMessage: function() { return /* binding */ addErrorMessage; },
15565 -/* harmony export */ setResponseValueAndErrors: function() { return /* binding */ setResponseValueAndErrors; }
15566 -/* harmony export */ });
15567 -function addErrorMessage(res, key, errorMessage, refs) {
15568 - if (!refs?.errorMessages)
15569 - return;
15570 - if (errorMessage) {
15571 - res.errorMessage = {
15572 - ...res.errorMessage,
15573 - [key]: errorMessage,
15574 - };
15575 - }
15576 -}
15577 -function setResponseValueAndErrors(res, key, value, errorMessage, refs) {
15578 - res[key] = value;
15579 - addErrorMessage(res, key, errorMessage, refs);
15580 -}
15581 -
15582 -
15583 -/***/ }),
15584 -
15585 -/***/ "./node_modules/zod-to-json-schema/dist/esm/getRelativePath.js":
15586 -/*!*********************************************************************!*\
15587 - !*** ./node_modules/zod-to-json-schema/dist/esm/getRelativePath.js ***!
15588 - \*********************************************************************/
15589 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15590 -
15591 -__webpack_require__.r(__webpack_exports__);
15592 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15593 -/* harmony export */ getRelativePath: function() { return /* binding */ getRelativePath; }
15594 -/* harmony export */ });
15595 -const getRelativePath = (pathA, pathB) => {
15596 - let i = 0;
15597 - for (; i < pathA.length && i < pathB.length; i++) {
15598 - if (pathA[i] !== pathB[i])
15599 - break;
15600 - }
15601 - return [(pathA.length - i).toString(), ...pathB.slice(i)].join("/");
15602 -};
15603 -
15604 -
15605 -/***/ }),
15606 -
15607 -/***/ "./node_modules/zod-to-json-schema/dist/esm/index.js":
15608 -/*!***********************************************************!*\
15609 - !*** ./node_modules/zod-to-json-schema/dist/esm/index.js ***!
15610 - \***********************************************************/
15611 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15612 -
15613 -__webpack_require__.r(__webpack_exports__);
15614 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15615 -/* harmony export */ addErrorMessage: function() { return /* reexport safe */ _errorMessages_js__WEBPACK_IMPORTED_MODULE_2__.addErrorMessage; },
15616 -/* harmony export */ defaultOptions: function() { return /* reexport safe */ _Options_js__WEBPACK_IMPORTED_MODULE_0__.defaultOptions; },
15617 -/* harmony export */ getDefaultOptions: function() { return /* reexport safe */ _Options_js__WEBPACK_IMPORTED_MODULE_0__.getDefaultOptions; },
15618 -/* harmony export */ getRefs: function() { return /* reexport safe */ _Refs_js__WEBPACK_IMPORTED_MODULE_1__.getRefs; },
15619 -/* harmony export */ getRelativePath: function() { return /* reexport safe */ _getRelativePath_js__WEBPACK_IMPORTED_MODULE_3__.getRelativePath; },
15620 -/* harmony export */ ignoreOverride: function() { return /* reexport safe */ _Options_js__WEBPACK_IMPORTED_MODULE_0__.ignoreOverride; },
15621 -/* harmony export */ jsonDescription: function() { return /* reexport safe */ _Options_js__WEBPACK_IMPORTED_MODULE_0__.jsonDescription; },
15622 -/* harmony export */ parseAnyDef: function() { return /* reexport safe */ _parsers_any_js__WEBPACK_IMPORTED_MODULE_6__.parseAnyDef; },
15623 -/* harmony export */ parseArrayDef: function() { return /* reexport safe */ _parsers_array_js__WEBPACK_IMPORTED_MODULE_7__.parseArrayDef; },
15624 -/* harmony export */ parseBigintDef: function() { return /* reexport safe */ _parsers_bigint_js__WEBPACK_IMPORTED_MODULE_8__.parseBigintDef; },
15625 -/* harmony export */ parseBooleanDef: function() { return /* reexport safe */ _parsers_boolean_js__WEBPACK_IMPORTED_MODULE_9__.parseBooleanDef; },
15626 -/* harmony export */ parseBrandedDef: function() { return /* reexport safe */ _parsers_branded_js__WEBPACK_IMPORTED_MODULE_10__.parseBrandedDef; },
15627 -/* harmony export */ parseCatchDef: function() { return /* reexport safe */ _parsers_catch_js__WEBPACK_IMPORTED_MODULE_11__.parseCatchDef; },
15628 -/* harmony export */ parseDateDef: function() { return /* reexport safe */ _parsers_date_js__WEBPACK_IMPORTED_MODULE_12__.parseDateDef; },
15629 -/* harmony export */ parseDef: function() { return /* reexport safe */ _parseDef_js__WEBPACK_IMPORTED_MODULE_4__.parseDef; },
15630 -/* harmony export */ parseDefaultDef: function() { return /* reexport safe */ _parsers_default_js__WEBPACK_IMPORTED_MODULE_13__.parseDefaultDef; },
15631 -/* harmony export */ parseEffectsDef: function() { return /* reexport safe */ _parsers_effects_js__WEBPACK_IMPORTED_MODULE_14__.parseEffectsDef; },
15632 -/* harmony export */ parseEnumDef: function() { return /* reexport safe */ _parsers_enum_js__WEBPACK_IMPORTED_MODULE_15__.parseEnumDef; },
15633 -/* harmony export */ parseIntersectionDef: function() { return /* reexport safe */ _parsers_intersection_js__WEBPACK_IMPORTED_MODULE_16__.parseIntersectionDef; },
15634 -/* harmony export */ parseLiteralDef: function() { return /* reexport safe */ _parsers_literal_js__WEBPACK_IMPORTED_MODULE_17__.parseLiteralDef; },
15635 -/* harmony export */ parseMapDef: function() { return /* reexport safe */ _parsers_map_js__WEBPACK_IMPORTED_MODULE_18__.parseMapDef; },
15636 -/* harmony export */ parseNativeEnumDef: function() { return /* reexport safe */ _parsers_nativeEnum_js__WEBPACK_IMPORTED_MODULE_19__.parseNativeEnumDef; },
15637 -/* harmony export */ parseNeverDef: function() { return /* reexport safe */ _parsers_never_js__WEBPACK_IMPORTED_MODULE_20__.parseNeverDef; },
15638 -/* harmony export */ parseNullDef: function() { return /* reexport safe */ _parsers_null_js__WEBPACK_IMPORTED_MODULE_21__.parseNullDef; },
15639 -/* harmony export */ parseNullableDef: function() { return /* reexport safe */ _parsers_nullable_js__WEBPACK_IMPORTED_MODULE_22__.parseNullableDef; },
15640 -/* harmony export */ parseNumberDef: function() { return /* reexport safe */ _parsers_number_js__WEBPACK_IMPORTED_MODULE_23__.parseNumberDef; },
15641 -/* harmony export */ parseObjectDef: function() { return /* reexport safe */ _parsers_object_js__WEBPACK_IMPORTED_MODULE_24__.parseObjectDef; },
15642 -/* harmony export */ parseOptionalDef: function() { return /* reexport safe */ _parsers_optional_js__WEBPACK_IMPORTED_MODULE_25__.parseOptionalDef; },
15643 -/* harmony export */ parsePipelineDef: function() { return /* reexport safe */ _parsers_pipeline_js__WEBPACK_IMPORTED_MODULE_26__.parsePipelineDef; },
15644 -/* harmony export */ parsePromiseDef: function() { return /* reexport safe */ _parsers_promise_js__WEBPACK_IMPORTED_MODULE_27__.parsePromiseDef; },
15645 -/* harmony export */ parseReadonlyDef: function() { return /* reexport safe */ _parsers_readonly_js__WEBPACK_IMPORTED_MODULE_28__.parseReadonlyDef; },
15646 -/* harmony export */ parseRecordDef: function() { return /* reexport safe */ _parsers_record_js__WEBPACK_IMPORTED_MODULE_29__.parseRecordDef; },
15647 -/* harmony export */ parseSetDef: function() { return /* reexport safe */ _parsers_set_js__WEBPACK_IMPORTED_MODULE_30__.parseSetDef; },
15648 -/* harmony export */ parseStringDef: function() { return /* reexport safe */ _parsers_string_js__WEBPACK_IMPORTED_MODULE_31__.parseStringDef; },
15649 -/* harmony export */ parseTupleDef: function() { return /* reexport safe */ _parsers_tuple_js__WEBPACK_IMPORTED_MODULE_32__.parseTupleDef; },
15650 -/* harmony export */ parseUndefinedDef: function() { return /* reexport safe */ _parsers_undefined_js__WEBPACK_IMPORTED_MODULE_33__.parseUndefinedDef; },
15651 -/* harmony export */ parseUnionDef: function() { return /* reexport safe */ _parsers_union_js__WEBPACK_IMPORTED_MODULE_34__.parseUnionDef; },
15652 -/* harmony export */ parseUnknownDef: function() { return /* reexport safe */ _parsers_unknown_js__WEBPACK_IMPORTED_MODULE_35__.parseUnknownDef; },
15653 -/* harmony export */ primitiveMappings: function() { return /* reexport safe */ _parsers_union_js__WEBPACK_IMPORTED_MODULE_34__.primitiveMappings; },
15654 -/* harmony export */ selectParser: function() { return /* reexport safe */ _selectParser_js__WEBPACK_IMPORTED_MODULE_36__.selectParser; },
15655 -/* harmony export */ setResponseValueAndErrors: function() { return /* reexport safe */ _errorMessages_js__WEBPACK_IMPORTED_MODULE_2__.setResponseValueAndErrors; },
15656 -/* harmony export */ zodPatterns: function() { return /* reexport safe */ _parsers_string_js__WEBPACK_IMPORTED_MODULE_31__.zodPatterns; },
15657 -/* harmony export */ zodToJsonSchema: function() { return /* reexport safe */ _zodToJsonSchema_js__WEBPACK_IMPORTED_MODULE_37__.zodToJsonSchema; }
15658 -/* harmony export */ });
15659 -/* harmony import */ var _Options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options.js */ "./node_modules/zod-to-json-schema/dist/esm/Options.js");
15660 -/* harmony import */ var _Refs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Refs.js */ "./node_modules/zod-to-json-schema/dist/esm/Refs.js");
15661 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./errorMessages.js */ "./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
15662 -/* harmony import */ var _getRelativePath_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getRelativePath.js */ "./node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");
15663 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
15664 -/* harmony import */ var _parseTypes_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parseTypes.js */ "./node_modules/zod-to-json-schema/dist/esm/parseTypes.js");
15665 -/* harmony import */ var _parsers_any_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parsers/any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
15666 -/* harmony import */ var _parsers_array_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./parsers/array.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/array.js");
15667 -/* harmony import */ var _parsers_bigint_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./parsers/bigint.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js");
15668 -/* harmony import */ var _parsers_boolean_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./parsers/boolean.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js");
15669 -/* harmony import */ var _parsers_branded_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./parsers/branded.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/branded.js");
15670 -/* harmony import */ var _parsers_catch_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./parsers/catch.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/catch.js");
15671 -/* harmony import */ var _parsers_date_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parsers/date.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/date.js");
15672 -/* harmony import */ var _parsers_default_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./parsers/default.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/default.js");
15673 -/* harmony import */ var _parsers_effects_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./parsers/effects.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/effects.js");
15674 -/* harmony import */ var _parsers_enum_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./parsers/enum.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/enum.js");
15675 -/* harmony import */ var _parsers_intersection_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./parsers/intersection.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js");
15676 -/* harmony import */ var _parsers_literal_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./parsers/literal.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/literal.js");
15677 -/* harmony import */ var _parsers_map_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./parsers/map.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/map.js");
15678 -/* harmony import */ var _parsers_nativeEnum_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./parsers/nativeEnum.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js");
15679 -/* harmony import */ var _parsers_never_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./parsers/never.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/never.js");
15680 -/* harmony import */ var _parsers_null_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./parsers/null.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/null.js");
15681 -/* harmony import */ var _parsers_nullable_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./parsers/nullable.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js");
15682 -/* harmony import */ var _parsers_number_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./parsers/number.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/number.js");
15683 -/* harmony import */ var _parsers_object_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./parsers/object.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/object.js");
15684 -/* harmony import */ var _parsers_optional_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./parsers/optional.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/optional.js");
15685 -/* harmony import */ var _parsers_pipeline_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./parsers/pipeline.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js");
15686 -/* harmony import */ var _parsers_promise_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./parsers/promise.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/promise.js");
15687 -/* harmony import */ var _parsers_readonly_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./parsers/readonly.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");
15688 -/* harmony import */ var _parsers_record_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./parsers/record.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/record.js");
15689 -/* harmony import */ var _parsers_set_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./parsers/set.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/set.js");
15690 -/* harmony import */ var _parsers_string_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./parsers/string.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/string.js");
15691 -/* harmony import */ var _parsers_tuple_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./parsers/tuple.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js");
15692 -/* harmony import */ var _parsers_undefined_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./parsers/undefined.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js");
15693 -/* harmony import */ var _parsers_union_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./parsers/union.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/union.js");
15694 -/* harmony import */ var _parsers_unknown_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./parsers/unknown.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js");
15695 -/* harmony import */ var _selectParser_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./selectParser.js */ "./node_modules/zod-to-json-schema/dist/esm/selectParser.js");
15696 -/* harmony import */ var _zodToJsonSchema_js__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./zodToJsonSchema.js */ "./node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js");
15697 -
15698 -
15699 -
15700 -
15701 -
15702 -
15703 -
15704 -
15705 -
15706 -
15707 -
15708 -
15709 -
15710 -
15711 -
15712 -
15713 -
15714 -
15715 -
15716 -
15717 -
15718 -
15719 -
15720 -
15721 -
15722 -
15723 -
15724 -
15725 -
15726 -
15727 -
15728 -
15729 -
15730 -
15731 -
15732 -
15733 -
15734 -
15735 -
15736 -/* harmony default export */ __webpack_exports__["default"] = (_zodToJsonSchema_js__WEBPACK_IMPORTED_MODULE_37__.zodToJsonSchema);
15737 -
15738 -
15739 -/***/ }),
15740 -
15741 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js":
15742 -/*!**************************************************************!*\
15743 - !*** ./node_modules/zod-to-json-schema/dist/esm/parseDef.js ***!
15744 - \**************************************************************/
15745 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15746 -
15747 -__webpack_require__.r(__webpack_exports__);
15748 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15749 -/* harmony export */ parseDef: function() { return /* binding */ parseDef; }
15750 -/* harmony export */ });
15751 -/* harmony import */ var _Options_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options.js */ "./node_modules/zod-to-json-schema/dist/esm/Options.js");
15752 -/* harmony import */ var _selectParser_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./selectParser.js */ "./node_modules/zod-to-json-schema/dist/esm/selectParser.js");
15753 -/* harmony import */ var _getRelativePath_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getRelativePath.js */ "./node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");
15754 -/* harmony import */ var _parsers_any_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parsers/any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
15755 -
15756 -
15757 -
15758 -
15759 -function parseDef(def, refs, forceResolution = false) {
15760 - const seenItem = refs.seen.get(def);
15761 - if (refs.override) {
15762 - const overrideResult = refs.override?.(def, refs, seenItem, forceResolution);
15763 - if (overrideResult !== _Options_js__WEBPACK_IMPORTED_MODULE_0__.ignoreOverride) {
15764 - return overrideResult;
15765 - }
15766 - }
15767 - if (seenItem && !forceResolution) {
15768 - const seenSchema = get$ref(seenItem, refs);
15769 - if (seenSchema !== undefined) {
15770 - return seenSchema;
15771 - }
15772 - }
15773 - const newItem = { def, path: refs.currentPath, jsonSchema: undefined };
15774 - refs.seen.set(def, newItem);
15775 - const jsonSchemaOrGetter = (0,_selectParser_js__WEBPACK_IMPORTED_MODULE_1__.selectParser)(def, def.typeName, refs);
15776 - // If the return was a function, then the inner definition needs to be extracted before a call to parseDef (recursive)
15777 - const jsonSchema = typeof jsonSchemaOrGetter === "function"
15778 - ? parseDef(jsonSchemaOrGetter(), refs)
15779 - : jsonSchemaOrGetter;
15780 - if (jsonSchema) {
15781 - addMeta(def, refs, jsonSchema);
15782 - }
15783 - if (refs.postProcess) {
15784 - const postProcessResult = refs.postProcess(jsonSchema, def, refs);
15785 - newItem.jsonSchema = jsonSchema;
15786 - return postProcessResult;
15787 - }
15788 - newItem.jsonSchema = jsonSchema;
15789 - return jsonSchema;
15790 -}
15791 -const get$ref = (item, refs) => {
15792 - switch (refs.$refStrategy) {
15793 - case "root":
15794 - return { $ref: item.path.join("/") };
15795 - case "relative":
15796 - return { $ref: (0,_getRelativePath_js__WEBPACK_IMPORTED_MODULE_2__.getRelativePath)(refs.currentPath, item.path) };
15797 - case "none":
15798 - case "seen": {
15799 - if (item.path.length < refs.currentPath.length &&
15800 - item.path.every((value, index) => refs.currentPath[index] === value)) {
15801 - console.warn(`Recursive reference detected at ${refs.currentPath.join("/")}! Defaulting to any`);
15802 - return (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_3__.parseAnyDef)(refs);
15803 - }
15804 - return refs.$refStrategy === "seen" ? (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_3__.parseAnyDef)(refs) : undefined;
15805 - }
15806 - }
15807 -};
15808 -const addMeta = (def, refs, jsonSchema) => {
15809 - if (def.description) {
15810 - jsonSchema.description = def.description;
15811 - if (refs.markdownDescription) {
15812 - jsonSchema.markdownDescription = def.description;
15813 - }
15814 - }
15815 - return jsonSchema;
15816 -};
15817 -
15818 -
15819 -/***/ }),
15820 -
15821 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parseTypes.js":
15822 -/*!****************************************************************!*\
15823 - !*** ./node_modules/zod-to-json-schema/dist/esm/parseTypes.js ***!
15824 - \****************************************************************/
15825 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15826 -
15827 -__webpack_require__.r(__webpack_exports__);
15828 -
15829 -
15830 -
15831 -/***/ }),
15832 -
15833 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js":
15834 -/*!*****************************************************************!*\
15835 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/any.js ***!
15836 - \*****************************************************************/
15837 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15838 -
15839 -__webpack_require__.r(__webpack_exports__);
15840 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15841 -/* harmony export */ parseAnyDef: function() { return /* binding */ parseAnyDef; }
15842 -/* harmony export */ });
15843 -/* harmony import */ var _getRelativePath_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getRelativePath.js */ "./node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");
15844 -
15845 -function parseAnyDef(refs) {
15846 - if (refs.target !== "openAi") {
15847 - return {};
15848 - }
15849 - const anyDefinitionPath = [
15850 - ...refs.basePath,
15851 - refs.definitionPath,
15852 - refs.openAiAnyTypeName,
15853 - ];
15854 - refs.flags.hasReferencedOpenAiAnyType = true;
15855 - return {
15856 - $ref: refs.$refStrategy === "relative"
15857 - ? (0,_getRelativePath_js__WEBPACK_IMPORTED_MODULE_0__.getRelativePath)(anyDefinitionPath, refs.currentPath)
15858 - : anyDefinitionPath.join("/"),
15859 - };
15860 -}
15861 -
15862 -
15863 -/***/ }),
15864 -
15865 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/array.js":
15866 -/*!*******************************************************************!*\
15867 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/array.js ***!
15868 - \*******************************************************************/
15869 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15870 -
15871 -__webpack_require__.r(__webpack_exports__);
15872 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15873 -/* harmony export */ parseArrayDef: function() { return /* binding */ parseArrayDef; }
15874 -/* harmony export */ });
15875 -/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod */ "./node_modules/zod/v3/types.js");
15876 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
15877 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
15878 -
15879 -
15880 -
15881 -function parseArrayDef(def, refs) {
15882 - const res = {
15883 - type: "array",
15884 - };
15885 - if (def.type?._def &&
15886 - def.type?._def?.typeName !== zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodAny) {
15887 - res.items = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_2__.parseDef)(def.type._def, {
15888 - ...refs,
15889 - currentPath: [...refs.currentPath, "items"],
15890 - });
15891 - }
15892 - if (def.minLength) {
15893 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_1__.setResponseValueAndErrors)(res, "minItems", def.minLength.value, def.minLength.message, refs);
15894 - }
15895 - if (def.maxLength) {
15896 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_1__.setResponseValueAndErrors)(res, "maxItems", def.maxLength.value, def.maxLength.message, refs);
15897 - }
15898 - if (def.exactLength) {
15899 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_1__.setResponseValueAndErrors)(res, "minItems", def.exactLength.value, def.exactLength.message, refs);
15900 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_1__.setResponseValueAndErrors)(res, "maxItems", def.exactLength.value, def.exactLength.message, refs);
15901 - }
15902 - return res;
15903 -}
15904 -
15905 -
15906 -/***/ }),
15907 -
15908 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js":
15909 -/*!********************************************************************!*\
15910 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js ***!
15911 - \********************************************************************/
15912 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15913 -
15914 -__webpack_require__.r(__webpack_exports__);
15915 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15916 -/* harmony export */ parseBigintDef: function() { return /* binding */ parseBigintDef; }
15917 -/* harmony export */ });
15918 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
15919 -
15920 -function parseBigintDef(def, refs) {
15921 - const res = {
15922 - type: "integer",
15923 - format: "int64",
15924 - };
15925 - if (!def.checks)
15926 - return res;
15927 - for (const check of def.checks) {
15928 - switch (check.kind) {
15929 - case "min":
15930 - if (refs.target === "jsonSchema7") {
15931 - if (check.inclusive) {
15932 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, check.message, refs);
15933 - }
15934 - else {
15935 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "exclusiveMinimum", check.value, check.message, refs);
15936 - }
15937 - }
15938 - else {
15939 - if (!check.inclusive) {
15940 - res.exclusiveMinimum = true;
15941 - }
15942 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, check.message, refs);
15943 - }
15944 - break;
15945 - case "max":
15946 - if (refs.target === "jsonSchema7") {
15947 - if (check.inclusive) {
15948 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, check.message, refs);
15949 - }
15950 - else {
15951 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "exclusiveMaximum", check.value, check.message, refs);
15952 - }
15953 - }
15954 - else {
15955 - if (!check.inclusive) {
15956 - res.exclusiveMaximum = true;
15957 - }
15958 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, check.message, refs);
15959 - }
15960 - break;
15961 - case "multipleOf":
15962 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "multipleOf", check.value, check.message, refs);
15963 - break;
15964 - }
15965 - }
15966 - return res;
15967 -}
15968 -
15969 -
15970 -/***/ }),
15971 -
15972 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js":
15973 -/*!*********************************************************************!*\
15974 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js ***!
15975 - \*********************************************************************/
15976 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15977 -
15978 -__webpack_require__.r(__webpack_exports__);
15979 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15980 -/* harmony export */ parseBooleanDef: function() { return /* binding */ parseBooleanDef; }
15981 -/* harmony export */ });
15982 -function parseBooleanDef() {
15983 - return {
15984 - type: "boolean",
15985 - };
15986 -}
15987 -
15988 -
15989 -/***/ }),
15990 -
15991 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/branded.js":
15992 -/*!*********************************************************************!*\
15993 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/branded.js ***!
15994 - \*********************************************************************/
15995 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
15996 -
15997 -__webpack_require__.r(__webpack_exports__);
15998 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
15999 -/* harmony export */ parseBrandedDef: function() { return /* binding */ parseBrandedDef; }
16000 -/* harmony export */ });
16001 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16002 -
16003 -function parseBrandedDef(_def, refs) {
16004 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(_def.type._def, refs);
16005 -}
16006 -
16007 -
16008 -/***/ }),
16009 -
16010 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/catch.js":
16011 -/*!*******************************************************************!*\
16012 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/catch.js ***!
16013 - \*******************************************************************/
16014 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16015 -
16016 -__webpack_require__.r(__webpack_exports__);
16017 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16018 -/* harmony export */ parseCatchDef: function() { return /* binding */ parseCatchDef; }
16019 -/* harmony export */ });
16020 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16021 -
16022 -const parseCatchDef = (def, refs) => {
16023 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, refs);
16024 -};
16025 -
16026 -
16027 -/***/ }),
16028 -
16029 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/date.js":
16030 -/*!******************************************************************!*\
16031 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/date.js ***!
16032 - \******************************************************************/
16033 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16034 -
16035 -__webpack_require__.r(__webpack_exports__);
16036 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16037 -/* harmony export */ parseDateDef: function() { return /* binding */ parseDateDef; }
16038 -/* harmony export */ });
16039 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
16040 -
16041 -function parseDateDef(def, refs, overrideDateStrategy) {
16042 - const strategy = overrideDateStrategy ?? refs.dateStrategy;
16043 - if (Array.isArray(strategy)) {
16044 - return {
16045 - anyOf: strategy.map((item, i) => parseDateDef(def, refs, item)),
16046 - };
16047 - }
16048 - switch (strategy) {
16049 - case "string":
16050 - case "format:date-time":
16051 - return {
16052 - type: "string",
16053 - format: "date-time",
16054 - };
16055 - case "format:date":
16056 - return {
16057 - type: "string",
16058 - format: "date",
16059 - };
16060 - case "integer":
16061 - return integerDateParser(def, refs);
16062 - }
16063 -}
16064 -const integerDateParser = (def, refs) => {
16065 - const res = {
16066 - type: "integer",
16067 - format: "unix-time",
16068 - };
16069 - if (refs.target === "openApi3") {
16070 - return res;
16071 - }
16072 - for (const check of def.checks) {
16073 - switch (check.kind) {
16074 - case "min":
16075 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, // This is in milliseconds
16076 - check.message, refs);
16077 - break;
16078 - case "max":
16079 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, // This is in milliseconds
16080 - check.message, refs);
16081 - break;
16082 - }
16083 - }
16084 - return res;
16085 -};
16086 -
16087 -
16088 -/***/ }),
16089 -
16090 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/default.js":
16091 -/*!*********************************************************************!*\
16092 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/default.js ***!
16093 - \*********************************************************************/
16094 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16095 -
16096 -__webpack_require__.r(__webpack_exports__);
16097 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16098 -/* harmony export */ parseDefaultDef: function() { return /* binding */ parseDefaultDef; }
16099 -/* harmony export */ });
16100 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16101 -
16102 -function parseDefaultDef(_def, refs) {
16103 - return {
16104 - ...(0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(_def.innerType._def, refs),
16105 - default: _def.defaultValue(),
16106 - };
16107 -}
16108 -
16109 -
16110 -/***/ }),
16111 -
16112 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/effects.js":
16113 -/*!*********************************************************************!*\
16114 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/effects.js ***!
16115 - \*********************************************************************/
16116 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16117 -
16118 -__webpack_require__.r(__webpack_exports__);
16119 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16120 -/* harmony export */ parseEffectsDef: function() { return /* binding */ parseEffectsDef; }
16121 -/* harmony export */ });
16122 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16123 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
16124 -
16125 -
16126 -function parseEffectsDef(_def, refs) {
16127 - return refs.effectStrategy === "input"
16128 - ? (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(_def.schema._def, refs)
16129 - : (0,_any_js__WEBPACK_IMPORTED_MODULE_1__.parseAnyDef)(refs);
16130 -}
16131 -
16132 -
16133 -/***/ }),
16134 -
16135 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/enum.js":
16136 -/*!******************************************************************!*\
16137 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/enum.js ***!
16138 - \******************************************************************/
16139 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16140 -
16141 -__webpack_require__.r(__webpack_exports__);
16142 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16143 -/* harmony export */ parseEnumDef: function() { return /* binding */ parseEnumDef; }
16144 -/* harmony export */ });
16145 -function parseEnumDef(def) {
16146 - return {
16147 - type: "string",
16148 - enum: Array.from(def.values),
16149 - };
16150 -}
16151 -
16152 -
16153 -/***/ }),
16154 -
16155 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js":
16156 -/*!**************************************************************************!*\
16157 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js ***!
16158 - \**************************************************************************/
16159 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16160 -
16161 -__webpack_require__.r(__webpack_exports__);
16162 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16163 -/* harmony export */ parseIntersectionDef: function() { return /* binding */ parseIntersectionDef; }
16164 -/* harmony export */ });
16165 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16166 -
16167 -const isJsonSchema7AllOfType = (type) => {
16168 - if ("type" in type && type.type === "string")
16169 - return false;
16170 - return "allOf" in type;
16171 -};
16172 -function parseIntersectionDef(def, refs) {
16173 - const allOf = [
16174 - (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.left._def, {
16175 - ...refs,
16176 - currentPath: [...refs.currentPath, "allOf", "0"],
16177 - }),
16178 - (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.right._def, {
16179 - ...refs,
16180 - currentPath: [...refs.currentPath, "allOf", "1"],
16181 - }),
16182 - ].filter((x) => !!x);
16183 - let unevaluatedProperties = refs.target === "jsonSchema2019-09"
16184 - ? { unevaluatedProperties: false }
16185 - : undefined;
16186 - const mergedAllOf = [];
16187 - // If either of the schemas is an allOf, merge them into a single allOf
16188 - allOf.forEach((schema) => {
16189 - if (isJsonSchema7AllOfType(schema)) {
16190 - mergedAllOf.push(...schema.allOf);
16191 - if (schema.unevaluatedProperties === undefined) {
16192 - // If one of the schemas has no unevaluatedProperties set,
16193 - // the merged schema should also have no unevaluatedProperties set
16194 - unevaluatedProperties = undefined;
16195 - }
16196 - }
16197 - else {
16198 - let nestedSchema = schema;
16199 - if ("additionalProperties" in schema &&
16200 - schema.additionalProperties === false) {
16201 - const { additionalProperties, ...rest } = schema;
16202 - nestedSchema = rest;
16203 - }
16204 - else {
16205 - // As soon as one of the schemas has additionalProperties set not to false, we allow unevaluatedProperties
16206 - unevaluatedProperties = undefined;
16207 - }
16208 - mergedAllOf.push(nestedSchema);
16209 - }
16210 - });
16211 - return mergedAllOf.length
16212 - ? {
16213 - allOf: mergedAllOf,
16214 - ...unevaluatedProperties,
16215 - }
16216 - : undefined;
16217 -}
16218 -
16219 -
16220 -/***/ }),
16221 -
16222 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/literal.js":
16223 -/*!*********************************************************************!*\
16224 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/literal.js ***!
16225 - \*********************************************************************/
16226 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16227 -
16228 -__webpack_require__.r(__webpack_exports__);
16229 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16230 -/* harmony export */ parseLiteralDef: function() { return /* binding */ parseLiteralDef; }
16231 -/* harmony export */ });
16232 -function parseLiteralDef(def, refs) {
16233 - const parsedType = typeof def.value;
16234 - if (parsedType !== "bigint" &&
16235 - parsedType !== "number" &&
16236 - parsedType !== "boolean" &&
16237 - parsedType !== "string") {
16238 - return {
16239 - type: Array.isArray(def.value) ? "array" : "object",
16240 - };
16241 - }
16242 - if (refs.target === "openApi3") {
16243 - return {
16244 - type: parsedType === "bigint" ? "integer" : parsedType,
16245 - enum: [def.value],
16246 - };
16247 - }
16248 - return {
16249 - type: parsedType === "bigint" ? "integer" : parsedType,
16250 - const: def.value,
16251 - };
16252 -}
16253 -
16254 -
16255 -/***/ }),
16256 -
16257 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/map.js":
16258 -/*!*****************************************************************!*\
16259 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/map.js ***!
16260 - \*****************************************************************/
16261 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16262 -
16263 -__webpack_require__.r(__webpack_exports__);
16264 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16265 -/* harmony export */ parseMapDef: function() { return /* binding */ parseMapDef; }
16266 -/* harmony export */ });
16267 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16268 -/* harmony import */ var _record_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./record.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/record.js");
16269 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
16270 -
16271 -
16272 -
16273 -function parseMapDef(def, refs) {
16274 - if (refs.mapStrategy === "record") {
16275 - return (0,_record_js__WEBPACK_IMPORTED_MODULE_1__.parseRecordDef)(def, refs);
16276 - }
16277 - const keys = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.keyType._def, {
16278 - ...refs,
16279 - currentPath: [...refs.currentPath, "items", "items", "0"],
16280 - }) || (0,_any_js__WEBPACK_IMPORTED_MODULE_2__.parseAnyDef)(refs);
16281 - const values = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.valueType._def, {
16282 - ...refs,
16283 - currentPath: [...refs.currentPath, "items", "items", "1"],
16284 - }) || (0,_any_js__WEBPACK_IMPORTED_MODULE_2__.parseAnyDef)(refs);
16285 - return {
16286 - type: "array",
16287 - maxItems: 125,
16288 - items: {
16289 - type: "array",
16290 - items: [keys, values],
16291 - minItems: 2,
16292 - maxItems: 2,
16293 - },
16294 - };
16295 -}
16296 -
16297 -
16298 -/***/ }),
16299 -
16300 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js":
16301 -/*!************************************************************************!*\
16302 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js ***!
16303 - \************************************************************************/
16304 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16305 -
16306 -__webpack_require__.r(__webpack_exports__);
16307 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16308 -/* harmony export */ parseNativeEnumDef: function() { return /* binding */ parseNativeEnumDef; }
16309 -/* harmony export */ });
16310 -function parseNativeEnumDef(def) {
16311 - const object = def.values;
16312 - const actualKeys = Object.keys(def.values).filter((key) => {
16313 - return typeof object[object[key]] !== "number";
16314 - });
16315 - const actualValues = actualKeys.map((key) => object[key]);
16316 - const parsedTypes = Array.from(new Set(actualValues.map((values) => typeof values)));
16317 - return {
16318 - type: parsedTypes.length === 1
16319 - ? parsedTypes[0] === "string"
16320 - ? "string"
16321 - : "number"
16322 - : ["string", "number"],
16323 - enum: actualValues,
16324 - };
16325 -}
16326 -
16327 -
16328 -/***/ }),
16329 -
16330 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/never.js":
16331 -/*!*******************************************************************!*\
16332 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/never.js ***!
16333 - \*******************************************************************/
16334 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16335 -
16336 -__webpack_require__.r(__webpack_exports__);
16337 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16338 -/* harmony export */ parseNeverDef: function() { return /* binding */ parseNeverDef; }
16339 -/* harmony export */ });
16340 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
16341 -
16342 -function parseNeverDef(refs) {
16343 - return refs.target === "openAi"
16344 - ? undefined
16345 - : {
16346 - not: (0,_any_js__WEBPACK_IMPORTED_MODULE_0__.parseAnyDef)({
16347 - ...refs,
16348 - currentPath: [...refs.currentPath, "not"],
16349 - }),
16350 - };
16351 -}
16352 -
16353 -
16354 -/***/ }),
16355 -
16356 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/null.js":
16357 -/*!******************************************************************!*\
16358 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/null.js ***!
16359 - \******************************************************************/
16360 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16361 -
16362 -__webpack_require__.r(__webpack_exports__);
16363 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16364 -/* harmony export */ parseNullDef: function() { return /* binding */ parseNullDef; }
16365 -/* harmony export */ });
16366 -function parseNullDef(refs) {
16367 - return refs.target === "openApi3"
16368 - ? {
16369 - enum: ["null"],
16370 - nullable: true,
16371 - }
16372 - : {
16373 - type: "null",
16374 - };
16375 -}
16376 -
16377 -
16378 -/***/ }),
16379 -
16380 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js":
16381 -/*!**********************************************************************!*\
16382 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js ***!
16383 - \**********************************************************************/
16384 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16385 -
16386 -__webpack_require__.r(__webpack_exports__);
16387 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16388 -/* harmony export */ parseNullableDef: function() { return /* binding */ parseNullableDef; }
16389 -/* harmony export */ });
16390 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16391 -/* harmony import */ var _union_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./union.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/union.js");
16392 -
16393 -
16394 -function parseNullableDef(def, refs) {
16395 - if (["ZodString", "ZodNumber", "ZodBigInt", "ZodBoolean", "ZodNull"].includes(def.innerType._def.typeName) &&
16396 - (!def.innerType._def.checks || !def.innerType._def.checks.length)) {
16397 - if (refs.target === "openApi3") {
16398 - return {
16399 - type: _union_js__WEBPACK_IMPORTED_MODULE_1__.primitiveMappings[def.innerType._def.typeName],
16400 - nullable: true,
16401 - };
16402 - }
16403 - return {
16404 - type: [
16405 - _union_js__WEBPACK_IMPORTED_MODULE_1__.primitiveMappings[def.innerType._def.typeName],
16406 - "null",
16407 - ],
16408 - };
16409 - }
16410 - if (refs.target === "openApi3") {
16411 - const base = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, {
16412 - ...refs,
16413 - currentPath: [...refs.currentPath],
16414 - });
16415 - if (base && "$ref" in base)
16416 - return { allOf: [base], nullable: true };
16417 - return base && { ...base, nullable: true };
16418 - }
16419 - const base = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, {
16420 - ...refs,
16421 - currentPath: [...refs.currentPath, "anyOf", "0"],
16422 - });
16423 - return base && { anyOf: [base, { type: "null" }] };
16424 -}
16425 -
16426 -
16427 -/***/ }),
16428 -
16429 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/number.js":
16430 -/*!********************************************************************!*\
16431 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/number.js ***!
16432 - \********************************************************************/
16433 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16434 -
16435 -__webpack_require__.r(__webpack_exports__);
16436 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16437 -/* harmony export */ parseNumberDef: function() { return /* binding */ parseNumberDef; }
16438 -/* harmony export */ });
16439 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
16440 -
16441 -function parseNumberDef(def, refs) {
16442 - const res = {
16443 - type: "number",
16444 - };
16445 - if (!def.checks)
16446 - return res;
16447 - for (const check of def.checks) {
16448 - switch (check.kind) {
16449 - case "int":
16450 - res.type = "integer";
16451 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.addErrorMessage)(res, "type", check.message, refs);
16452 - break;
16453 - case "min":
16454 - if (refs.target === "jsonSchema7") {
16455 - if (check.inclusive) {
16456 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, check.message, refs);
16457 - }
16458 - else {
16459 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "exclusiveMinimum", check.value, check.message, refs);
16460 - }
16461 - }
16462 - else {
16463 - if (!check.inclusive) {
16464 - res.exclusiveMinimum = true;
16465 - }
16466 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minimum", check.value, check.message, refs);
16467 - }
16468 - break;
16469 - case "max":
16470 - if (refs.target === "jsonSchema7") {
16471 - if (check.inclusive) {
16472 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, check.message, refs);
16473 - }
16474 - else {
16475 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "exclusiveMaximum", check.value, check.message, refs);
16476 - }
16477 - }
16478 - else {
16479 - if (!check.inclusive) {
16480 - res.exclusiveMaximum = true;
16481 - }
16482 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maximum", check.value, check.message, refs);
16483 - }
16484 - break;
16485 - case "multipleOf":
16486 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "multipleOf", check.value, check.message, refs);
16487 - break;
16488 - }
16489 - }
16490 - return res;
16491 -}
16492 -
16493 -
16494 -/***/ }),
16495 -
16496 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/object.js":
16497 -/*!********************************************************************!*\
16498 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/object.js ***!
16499 - \********************************************************************/
16500 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16501 -
16502 -__webpack_require__.r(__webpack_exports__);
16503 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16504 -/* harmony export */ parseObjectDef: function() { return /* binding */ parseObjectDef; }
16505 -/* harmony export */ });
16506 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16507 -
16508 -function parseObjectDef(def, refs) {
16509 - const forceOptionalIntoNullable = refs.target === "openAi";
16510 - const result = {
16511 - type: "object",
16512 - properties: {},
16513 - };
16514 - const required = [];
16515 - const shape = def.shape();
16516 - for (const propName in shape) {
16517 - let propDef = shape[propName];
16518 - if (propDef === undefined || propDef._def === undefined) {
16519 - continue;
16520 - }
16521 - let propOptional = safeIsOptional(propDef);
16522 - if (propOptional && forceOptionalIntoNullable) {
16523 - if (propDef._def.typeName === "ZodOptional") {
16524 - propDef = propDef._def.innerType;
16525 - }
16526 - if (!propDef.isNullable()) {
16527 - propDef = propDef.nullable();
16528 - }
16529 - propOptional = false;
16530 - }
16531 - const parsedDef = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(propDef._def, {
16532 - ...refs,
16533 - currentPath: [...refs.currentPath, "properties", propName],
16534 - propertyPath: [...refs.currentPath, "properties", propName],
16535 - });
16536 - if (parsedDef === undefined) {
16537 - continue;
16538 - }
16539 - result.properties[propName] = parsedDef;
16540 - if (!propOptional) {
16541 - required.push(propName);
16542 - }
16543 - }
16544 - if (required.length) {
16545 - result.required = required;
16546 - }
16547 - const additionalProperties = decideAdditionalProperties(def, refs);
16548 - if (additionalProperties !== undefined) {
16549 - result.additionalProperties = additionalProperties;
16550 - }
16551 - return result;
16552 -}
16553 -function decideAdditionalProperties(def, refs) {
16554 - if (def.catchall._def.typeName !== "ZodNever") {
16555 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.catchall._def, {
16556 - ...refs,
16557 - currentPath: [...refs.currentPath, "additionalProperties"],
16558 - });
16559 - }
16560 - switch (def.unknownKeys) {
16561 - case "passthrough":
16562 - return refs.allowedAdditionalProperties;
16563 - case "strict":
16564 - return refs.rejectedAdditionalProperties;
16565 - case "strip":
16566 - return refs.removeAdditionalStrategy === "strict"
16567 - ? refs.allowedAdditionalProperties
16568 - : refs.rejectedAdditionalProperties;
16569 - }
16570 -}
16571 -function safeIsOptional(schema) {
16572 - try {
16573 - return schema.isOptional();
16574 - }
16575 - catch {
16576 - return true;
16577 - }
16578 -}
16579 -
16580 -
16581 -/***/ }),
16582 -
16583 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/optional.js":
16584 -/*!**********************************************************************!*\
16585 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/optional.js ***!
16586 - \**********************************************************************/
16587 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16588 -
16589 -__webpack_require__.r(__webpack_exports__);
16590 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16591 -/* harmony export */ parseOptionalDef: function() { return /* binding */ parseOptionalDef; }
16592 -/* harmony export */ });
16593 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16594 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
16595 -
16596 -
16597 -const parseOptionalDef = (def, refs) => {
16598 - if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
16599 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, refs);
16600 - }
16601 - const innerSchema = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, {
16602 - ...refs,
16603 - currentPath: [...refs.currentPath, "anyOf", "1"],
16604 - });
16605 - return innerSchema
16606 - ? {
16607 - anyOf: [
16608 - {
16609 - not: (0,_any_js__WEBPACK_IMPORTED_MODULE_1__.parseAnyDef)(refs),
16610 - },
16611 - innerSchema,
16612 - ],
16613 - }
16614 - : (0,_any_js__WEBPACK_IMPORTED_MODULE_1__.parseAnyDef)(refs);
16615 -};
16616 -
16617 -
16618 -/***/ }),
16619 -
16620 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js":
16621 -/*!**********************************************************************!*\
16622 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js ***!
16623 - \**********************************************************************/
16624 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16625 -
16626 -__webpack_require__.r(__webpack_exports__);
16627 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16628 -/* harmony export */ parsePipelineDef: function() { return /* binding */ parsePipelineDef; }
16629 -/* harmony export */ });
16630 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16631 -
16632 -const parsePipelineDef = (def, refs) => {
16633 - if (refs.pipeStrategy === "input") {
16634 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.in._def, refs);
16635 - }
16636 - else if (refs.pipeStrategy === "output") {
16637 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.out._def, refs);
16638 - }
16639 - const a = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.in._def, {
16640 - ...refs,
16641 - currentPath: [...refs.currentPath, "allOf", "0"],
16642 - });
16643 - const b = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.out._def, {
16644 - ...refs,
16645 - currentPath: [...refs.currentPath, "allOf", a ? "1" : "0"],
16646 - });
16647 - return {
16648 - allOf: [a, b].filter((x) => x !== undefined),
16649 - };
16650 -};
16651 -
16652 -
16653 -/***/ }),
16654 -
16655 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/promise.js":
16656 -/*!*********************************************************************!*\
16657 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/promise.js ***!
16658 - \*********************************************************************/
16659 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16660 -
16661 -__webpack_require__.r(__webpack_exports__);
16662 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16663 -/* harmony export */ parsePromiseDef: function() { return /* binding */ parsePromiseDef; }
16664 -/* harmony export */ });
16665 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16666 -
16667 -function parsePromiseDef(def, refs) {
16668 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.type._def, refs);
16669 -}
16670 -
16671 -
16672 -/***/ }),
16673 -
16674 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js":
16675 -/*!**********************************************************************!*\
16676 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js ***!
16677 - \**********************************************************************/
16678 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16679 -
16680 -__webpack_require__.r(__webpack_exports__);
16681 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16682 -/* harmony export */ parseReadonlyDef: function() { return /* binding */ parseReadonlyDef; }
16683 -/* harmony export */ });
16684 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16685 -
16686 -const parseReadonlyDef = (def, refs) => {
16687 - return (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.innerType._def, refs);
16688 -};
16689 -
16690 -
16691 -/***/ }),
16692 -
16693 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/record.js":
16694 -/*!********************************************************************!*\
16695 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/record.js ***!
16696 - \********************************************************************/
16697 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16698 -
16699 -__webpack_require__.r(__webpack_exports__);
16700 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16701 -/* harmony export */ parseRecordDef: function() { return /* binding */ parseRecordDef; }
16702 -/* harmony export */ });
16703 -/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod */ "./node_modules/zod/v3/types.js");
16704 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16705 -/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./string.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/string.js");
16706 -/* harmony import */ var _branded_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./branded.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/branded.js");
16707 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
16708 -
16709 -
16710 -
16711 -
16712 -
16713 -function parseRecordDef(def, refs) {
16714 - if (refs.target === "openAi") {
16715 - console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");
16716 - }
16717 - if (refs.target === "openApi3" &&
16718 - def.keyType?._def.typeName === zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodEnum) {
16719 - return {
16720 - type: "object",
16721 - required: def.keyType._def.values,
16722 - properties: def.keyType._def.values.reduce((acc, key) => ({
16723 - ...acc,
16724 - [key]: (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_1__.parseDef)(def.valueType._def, {
16725 - ...refs,
16726 - currentPath: [...refs.currentPath, "properties", key],
16727 - }) ?? (0,_any_js__WEBPACK_IMPORTED_MODULE_4__.parseAnyDef)(refs),
16728 - }), {}),
16729 - additionalProperties: refs.rejectedAdditionalProperties,
16730 - };
16731 - }
16732 - const schema = {
16733 - type: "object",
16734 - additionalProperties: (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_1__.parseDef)(def.valueType._def, {
16735 - ...refs,
16736 - currentPath: [...refs.currentPath, "additionalProperties"],
16737 - }) ?? refs.allowedAdditionalProperties,
16738 - };
16739 - if (refs.target === "openApi3") {
16740 - return schema;
16741 - }
16742 - if (def.keyType?._def.typeName === zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodString &&
16743 - def.keyType._def.checks?.length) {
16744 - const { type, ...keyType } = (0,_string_js__WEBPACK_IMPORTED_MODULE_2__.parseStringDef)(def.keyType._def, refs);
16745 - return {
16746 - ...schema,
16747 - propertyNames: keyType,
16748 - };
16749 - }
16750 - else if (def.keyType?._def.typeName === zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodEnum) {
16751 - return {
16752 - ...schema,
16753 - propertyNames: {
16754 - enum: def.keyType._def.values,
16755 - },
16756 - };
16757 - }
16758 - else if (def.keyType?._def.typeName === zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodBranded &&
16759 - def.keyType._def.type._def.typeName === zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodString &&
16760 - def.keyType._def.type._def.checks?.length) {
16761 - const { type, ...keyType } = (0,_branded_js__WEBPACK_IMPORTED_MODULE_3__.parseBrandedDef)(def.keyType._def, refs);
16762 - return {
16763 - ...schema,
16764 - propertyNames: keyType,
16765 - };
16766 - }
16767 - return schema;
16768 -}
16769 -
16770 -
16771 -/***/ }),
16772 -
16773 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/set.js":
16774 -/*!*****************************************************************!*\
16775 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/set.js ***!
16776 - \*****************************************************************/
16777 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16778 -
16779 -__webpack_require__.r(__webpack_exports__);
16780 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16781 -/* harmony export */ parseSetDef: function() { return /* binding */ parseSetDef; }
16782 -/* harmony export */ });
16783 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
16784 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
16785 -
16786 -
16787 -function parseSetDef(def, refs) {
16788 - const items = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_1__.parseDef)(def.valueType._def, {
16789 - ...refs,
16790 - currentPath: [...refs.currentPath, "items"],
16791 - });
16792 - const schema = {
16793 - type: "array",
16794 - uniqueItems: true,
16795 - items,
16796 - };
16797 - if (def.minSize) {
16798 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(schema, "minItems", def.minSize.value, def.minSize.message, refs);
16799 - }
16800 - if (def.maxSize) {
16801 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(schema, "maxItems", def.maxSize.value, def.maxSize.message, refs);
16802 - }
16803 - return schema;
16804 -}
16805 -
16806 -
16807 -/***/ }),
16808 -
16809 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/string.js":
16810 -/*!********************************************************************!*\
16811 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/string.js ***!
16812 - \********************************************************************/
16813 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
16814 -
16815 -__webpack_require__.r(__webpack_exports__);
16816 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
16817 -/* harmony export */ parseStringDef: function() { return /* binding */ parseStringDef; },
16818 -/* harmony export */ zodPatterns: function() { return /* binding */ zodPatterns; }
16819 -/* harmony export */ });
16820 -/* harmony import */ var _errorMessages_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errorMessages.js */ "./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");
16821 -
16822 -let emojiRegex = undefined;
16823 -/**
16824 - * Generated from the regular expressions found here as of 2024-05-22:
16825 - * https://github.com/colinhacks/zod/blob/master/src/types.ts.
16826 - *
16827 - * Expressions with /i flag have been changed accordingly.
16828 - */
16829 -const zodPatterns = {
16830 - /**
16831 - * `c` was changed to `[cC]` to replicate /i flag
16832 - */
16833 - cuid: /^[cC][^\s-]{8,}$/,
16834 - cuid2: /^[0-9a-z]+$/,
16835 - ulid: /^[0-9A-HJKMNP-TV-Z]{26}$/,
16836 - /**
16837 - * `a-z` was added to replicate /i flag
16838 - */
16839 - email: /^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,
16840 - /**
16841 - * Constructed a valid Unicode RegExp
16842 - *
16843 - * Lazily instantiate since this type of regex isn't supported
16844 - * in all envs (e.g. React Native).
16845 - *
16846 - * See:
16847 - * https://github.com/colinhacks/zod/issues/2433
16848 - * Fix in Zod:
16849 - * https://github.com/colinhacks/zod/commit/9340fd51e48576a75adc919bff65dbc4a5d4c99b
16850 - */
16851 - emoji: () => {
16852 - if (emojiRegex === undefined) {
16853 - emojiRegex = RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$", "u");
16854 - }
16855 - return emojiRegex;
16856 - },
16857 - /**
16858 - * Unused
16859 - */
16860 - uuid: /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,
16861 - /**
16862 - * Unused
16863 - */
16864 - ipv4: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,
16865 - ipv4Cidr: /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,
16866 - /**
16867 - * Unused
16868 - */
16869 - ipv6: /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
16870 - ipv6Cidr: /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
16871 - base64: /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,
16872 - base64url: /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,
16873 - nanoid: /^[a-zA-Z0-9_-]{21}$/,
16874 - jwt: /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,
16875 -};
16876 -function parseStringDef(def, refs) {
16877 - const res = {
16878 - type: "string",
16879 - };
16880 - if (def.checks) {
16881 - for (const check of def.checks) {
16882 - switch (check.kind) {
16883 - case "min":
16884 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minLength", typeof res.minLength === "number"
16885 - ? Math.max(res.minLength, check.value)
16886 - : check.value, check.message, refs);
16887 - break;
16888 - case "max":
16889 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maxLength", typeof res.maxLength === "number"
16890 - ? Math.min(res.maxLength, check.value)
16891 - : check.value, check.message, refs);
16892 - break;
16893 - case "email":
16894 - switch (refs.emailStrategy) {
16895 - case "format:email":
16896 - addFormat(res, "email", check.message, refs);
16897 - break;
16898 - case "format:idn-email":
16899 - addFormat(res, "idn-email", check.message, refs);
16900 - break;
16901 - case "pattern:zod":
16902 - addPattern(res, zodPatterns.email, check.message, refs);
16903 - break;
16904 - }
16905 - break;
16906 - case "url":
16907 - addFormat(res, "uri", check.message, refs);
16908 - break;
16909 - case "uuid":
16910 - addFormat(res, "uuid", check.message, refs);
16911 - break;
16912 - case "regex":
16913 - addPattern(res, check.regex, check.message, refs);
16914 - break;
16915 - case "cuid":
16916 - addPattern(res, zodPatterns.cuid, check.message, refs);
16917 - break;
16918 - case "cuid2":
16919 - addPattern(res, zodPatterns.cuid2, check.message, refs);
16920 - break;
16921 - case "startsWith":
16922 - addPattern(res, RegExp(`^${escapeLiteralCheckValue(check.value, refs)}`), check.message, refs);
16923 - break;
16924 - case "endsWith":
16925 - addPattern(res, RegExp(`${escapeLiteralCheckValue(check.value, refs)}$`), check.message, refs);
16926 - break;
16927 - case "datetime":
16928 - addFormat(res, "date-time", check.message, refs);
16929 - break;
16930 - case "date":
16931 - addFormat(res, "date", check.message, refs);
16932 - break;
16933 - case "time":
16934 - addFormat(res, "time", check.message, refs);
16935 - break;
16936 - case "duration":
16937 - addFormat(res, "duration", check.message, refs);
16938 - break;
16939 - case "length":
16940 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "minLength", typeof res.minLength === "number"
16941 - ? Math.max(res.minLength, check.value)
16942 - : check.value, check.message, refs);
16943 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "maxLength", typeof res.maxLength === "number"
16944 - ? Math.min(res.maxLength, check.value)
16945 - : check.value, check.message, refs);
16946 - break;
16947 - case "includes": {
16948 - addPattern(res, RegExp(escapeLiteralCheckValue(check.value, refs)), check.message, refs);
16949 - break;
16950 - }
16951 - case "ip": {
16952 - if (check.version !== "v6") {
16953 - addFormat(res, "ipv4", check.message, refs);
16954 - }
16955 - if (check.version !== "v4") {
16956 - addFormat(res, "ipv6", check.message, refs);
16957 - }
16958 - break;
16959 - }
16960 - case "base64url":
16961 - addPattern(res, zodPatterns.base64url, check.message, refs);
16962 - break;
16963 - case "jwt":
16964 - addPattern(res, zodPatterns.jwt, check.message, refs);
16965 - break;
16966 - case "cidr": {
16967 - if (check.version !== "v6") {
16968 - addPattern(res, zodPatterns.ipv4Cidr, check.message, refs);
16969 - }
16970 - if (check.version !== "v4") {
16971 - addPattern(res, zodPatterns.ipv6Cidr, check.message, refs);
16972 - }
16973 - break;
16974 - }
16975 - case "emoji":
16976 - addPattern(res, zodPatterns.emoji(), check.message, refs);
16977 - break;
16978 - case "ulid": {
16979 - addPattern(res, zodPatterns.ulid, check.message, refs);
16980 - break;
16981 - }
16982 - case "base64": {
16983 - switch (refs.base64Strategy) {
16984 - case "format:binary": {
16985 - addFormat(res, "binary", check.message, refs);
16986 - break;
16987 - }
16988 - case "contentEncoding:base64": {
16989 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(res, "contentEncoding", "base64", check.message, refs);
16990 - break;
16991 - }
16992 - case "pattern:zod": {
16993 - addPattern(res, zodPatterns.base64, check.message, refs);
16994 - break;
16995 - }
16996 - }
16997 - break;
16998 - }
16999 - case "nanoid": {
17000 - addPattern(res, zodPatterns.nanoid, check.message, refs);
17001 - }
17002 - case "toLowerCase":
17003 - case "toUpperCase":
17004 - case "trim":
17005 - break;
17006 - default:
17007 - /* c8 ignore next */
17008 - ((_) => { })(check);
17009 - }
17010 - }
17011 - }
17012 - return res;
17013 -}
17014 -function escapeLiteralCheckValue(literal, refs) {
17015 - return refs.patternStrategy === "escape"
17016 - ? escapeNonAlphaNumeric(literal)
17017 - : literal;
17018 -}
17019 -const ALPHA_NUMERIC = new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");
17020 -function escapeNonAlphaNumeric(source) {
17021 - let result = "";
17022 - for (let i = 0; i < source.length; i++) {
17023 - if (!ALPHA_NUMERIC.has(source[i])) {
17024 - result += "\\";
17025 - }
17026 - result += source[i];
17027 - }
17028 - return result;
17029 -}
17030 -// Adds a "format" keyword to the schema. If a format exists, both formats will be joined in an allOf-node, along with subsequent ones.
17031 -function addFormat(schema, value, message, refs) {
17032 - if (schema.format || schema.anyOf?.some((x) => x.format)) {
17033 - if (!schema.anyOf) {
17034 - schema.anyOf = [];
17035 - }
17036 - if (schema.format) {
17037 - schema.anyOf.push({
17038 - format: schema.format,
17039 - ...(schema.errorMessage &&
17040 - refs.errorMessages && {
17041 - errorMessage: { format: schema.errorMessage.format },
17042 - }),
17043 - });
17044 - delete schema.format;
17045 - if (schema.errorMessage) {
17046 - delete schema.errorMessage.format;
17047 - if (Object.keys(schema.errorMessage).length === 0) {
17048 - delete schema.errorMessage;
17049 - }
17050 - }
17051 - }
17052 - schema.anyOf.push({
17053 - format: value,
17054 - ...(message &&
17055 - refs.errorMessages && { errorMessage: { format: message } }),
17056 - });
17057 - }
17058 - else {
17059 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(schema, "format", value, message, refs);
17060 - }
17061 -}
17062 -// Adds a "pattern" keyword to the schema. If a pattern exists, both patterns will be joined in an allOf-node, along with subsequent ones.
17063 -function addPattern(schema, regex, message, refs) {
17064 - if (schema.pattern || schema.allOf?.some((x) => x.pattern)) {
17065 - if (!schema.allOf) {
17066 - schema.allOf = [];
17067 - }
17068 - if (schema.pattern) {
17069 - schema.allOf.push({
17070 - pattern: schema.pattern,
17071 - ...(schema.errorMessage &&
17072 - refs.errorMessages && {
17073 - errorMessage: { pattern: schema.errorMessage.pattern },
17074 - }),
17075 - });
17076 - delete schema.pattern;
17077 - if (schema.errorMessage) {
17078 - delete schema.errorMessage.pattern;
17079 - if (Object.keys(schema.errorMessage).length === 0) {
17080 - delete schema.errorMessage;
17081 - }
17082 - }
17083 - }
17084 - schema.allOf.push({
17085 - pattern: stringifyRegExpWithFlags(regex, refs),
17086 - ...(message &&
17087 - refs.errorMessages && { errorMessage: { pattern: message } }),
17088 - });
17089 - }
17090 - else {
17091 - (0,_errorMessages_js__WEBPACK_IMPORTED_MODULE_0__.setResponseValueAndErrors)(schema, "pattern", stringifyRegExpWithFlags(regex, refs), message, refs);
17092 - }
17093 -}
17094 -// Mutate z.string.regex() in a best attempt to accommodate for regex flags when applyRegexFlags is true
17095 -function stringifyRegExpWithFlags(regex, refs) {
17096 - if (!refs.applyRegexFlags || !regex.flags) {
17097 - return regex.source;
17098 - }
17099 - // Currently handled flags
17100 - const flags = {
17101 - i: regex.flags.includes("i"),
17102 - m: regex.flags.includes("m"),
17103 - s: regex.flags.includes("s"), // `.` matches newlines
17104 - };
17105 - // The general principle here is to step through each character, one at a time, applying mutations as flags require. We keep track when the current character is escaped, and when it's inside a group /like [this]/ or (also) a range like /[a-z]/. The following is fairly brittle imperative code; edit at your peril!
17106 - const source = flags.i ? regex.source.toLowerCase() : regex.source;
17107 - let pattern = "";
17108 - let isEscaped = false;
17109 - let inCharGroup = false;
17110 - let inCharRange = false;
17111 - for (let i = 0; i < source.length; i++) {
17112 - if (isEscaped) {
17113 - pattern += source[i];
17114 - isEscaped = false;
17115 - continue;
17116 - }
17117 - if (flags.i) {
17118 - if (inCharGroup) {
17119 - if (source[i].match(/[a-z]/)) {
17120 - if (inCharRange) {
17121 - pattern += source[i];
17122 - pattern += `${source[i - 2]}-${source[i]}`.toUpperCase();
17123 - inCharRange = false;
17124 - }
17125 - else if (source[i + 1] === "-" && source[i + 2]?.match(/[a-z]/)) {
17126 - pattern += source[i];
17127 - inCharRange = true;
17128 - }
17129 - else {
17130 - pattern += `${source[i]}${source[i].toUpperCase()}`;
17131 - }
17132 - continue;
17133 - }
17134 - }
17135 - else if (source[i].match(/[a-z]/)) {
17136 - pattern += `[${source[i]}${source[i].toUpperCase()}]`;
17137 - continue;
17138 - }
17139 - }
17140 - if (flags.m) {
17141 - if (source[i] === "^") {
17142 - pattern += `(^|(?<=[\r\n]))`;
17143 - continue;
17144 - }
17145 - else if (source[i] === "$") {
17146 - pattern += `($|(?=[\r\n]))`;
17147 - continue;
17148 - }
17149 - }
17150 - if (flags.s && source[i] === ".") {
17151 - pattern += inCharGroup ? `${source[i]}\r\n` : `[${source[i]}\r\n]`;
17152 - continue;
17153 - }
17154 - pattern += source[i];
17155 - if (source[i] === "\\") {
17156 - isEscaped = true;
17157 - }
17158 - else if (inCharGroup && source[i] === "]") {
17159 - inCharGroup = false;
17160 - }
17161 - else if (!inCharGroup && source[i] === "[") {
17162 - inCharGroup = true;
17163 - }
17164 - }
17165 - try {
17166 - new RegExp(pattern);
17167 - }
17168 - catch {
17169 - console.warn(`Could not convert regex pattern at ${refs.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`);
17170 - return regex.source;
17171 - }
17172 - return pattern;
17173 -}
17174 -
17175 -
17176 -/***/ }),
17177 -
17178 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js":
17179 -/*!*******************************************************************!*\
17180 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js ***!
17181 - \*******************************************************************/
17182 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17183 -
17184 -__webpack_require__.r(__webpack_exports__);
17185 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17186 -/* harmony export */ parseTupleDef: function() { return /* binding */ parseTupleDef; }
17187 -/* harmony export */ });
17188 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
17189 -
17190 -function parseTupleDef(def, refs) {
17191 - if (def.rest) {
17192 - return {
17193 - type: "array",
17194 - minItems: def.items.length,
17195 - items: def.items
17196 - .map((x, i) => (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(x._def, {
17197 - ...refs,
17198 - currentPath: [...refs.currentPath, "items", `${i}`],
17199 - }))
17200 - .reduce((acc, x) => (x === undefined ? acc : [...acc, x]), []),
17201 - additionalItems: (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(def.rest._def, {
17202 - ...refs,
17203 - currentPath: [...refs.currentPath, "additionalItems"],
17204 - }),
17205 - };
17206 - }
17207 - else {
17208 - return {
17209 - type: "array",
17210 - minItems: def.items.length,
17211 - maxItems: def.items.length,
17212 - items: def.items
17213 - .map((x, i) => (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(x._def, {
17214 - ...refs,
17215 - currentPath: [...refs.currentPath, "items", `${i}`],
17216 - }))
17217 - .reduce((acc, x) => (x === undefined ? acc : [...acc, x]), []),
17218 - };
17219 - }
17220 -}
17221 -
17222 -
17223 -/***/ }),
17224 -
17225 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js":
17226 -/*!***********************************************************************!*\
17227 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js ***!
17228 - \***********************************************************************/
17229 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17230 -
17231 -__webpack_require__.r(__webpack_exports__);
17232 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17233 -/* harmony export */ parseUndefinedDef: function() { return /* binding */ parseUndefinedDef; }
17234 -/* harmony export */ });
17235 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
17236 -
17237 -function parseUndefinedDef(refs) {
17238 - return {
17239 - not: (0,_any_js__WEBPACK_IMPORTED_MODULE_0__.parseAnyDef)(refs),
17240 - };
17241 -}
17242 -
17243 -
17244 -/***/ }),
17245 -
17246 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/union.js":
17247 -/*!*******************************************************************!*\
17248 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/union.js ***!
17249 - \*******************************************************************/
17250 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17251 -
17252 -__webpack_require__.r(__webpack_exports__);
17253 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17254 -/* harmony export */ parseUnionDef: function() { return /* binding */ parseUnionDef; },
17255 -/* harmony export */ primitiveMappings: function() { return /* binding */ primitiveMappings; }
17256 -/* harmony export */ });
17257 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
17258 -
17259 -const primitiveMappings = {
17260 - ZodString: "string",
17261 - ZodNumber: "number",
17262 - ZodBigInt: "integer",
17263 - ZodBoolean: "boolean",
17264 - ZodNull: "null",
17265 -};
17266 -function parseUnionDef(def, refs) {
17267 - if (refs.target === "openApi3")
17268 - return asAnyOf(def, refs);
17269 - const options = def.options instanceof Map ? Array.from(def.options.values()) : def.options;
17270 - // This blocks tries to look ahead a bit to produce nicer looking schemas with type array instead of anyOf.
17271 - if (options.every((x) => x._def.typeName in primitiveMappings &&
17272 - (!x._def.checks || !x._def.checks.length))) {
17273 - // all types in union are primitive and lack checks, so might as well squash into {type: [...]}
17274 - const types = options.reduce((types, x) => {
17275 - const type = primitiveMappings[x._def.typeName]; //Can be safely casted due to row 43
17276 - return type && !types.includes(type) ? [...types, type] : types;
17277 - }, []);
17278 - return {
17279 - type: types.length > 1 ? types : types[0],
17280 - };
17281 - }
17282 - else if (options.every((x) => x._def.typeName === "ZodLiteral" && !x.description)) {
17283 - // all options literals
17284 - const types = options.reduce((acc, x) => {
17285 - const type = typeof x._def.value;
17286 - switch (type) {
17287 - case "string":
17288 - case "number":
17289 - case "boolean":
17290 - return [...acc, type];
17291 - case "bigint":
17292 - return [...acc, "integer"];
17293 - case "object":
17294 - if (x._def.value === null)
17295 - return [...acc, "null"];
17296 - case "symbol":
17297 - case "undefined":
17298 - case "function":
17299 - default:
17300 - return acc;
17301 - }
17302 - }, []);
17303 - if (types.length === options.length) {
17304 - // all the literals are primitive, as far as null can be considered primitive
17305 - const uniqueTypes = types.filter((x, i, a) => a.indexOf(x) === i);
17306 - return {
17307 - type: uniqueTypes.length > 1 ? uniqueTypes : uniqueTypes[0],
17308 - enum: options.reduce((acc, x) => {
17309 - return acc.includes(x._def.value) ? acc : [...acc, x._def.value];
17310 - }, []),
17311 - };
17312 - }
17313 - }
17314 - else if (options.every((x) => x._def.typeName === "ZodEnum")) {
17315 - return {
17316 - type: "string",
17317 - enum: options.reduce((acc, x) => [
17318 - ...acc,
17319 - ...x._def.values.filter((x) => !acc.includes(x)),
17320 - ], []),
17321 - };
17322 - }
17323 - return asAnyOf(def, refs);
17324 -}
17325 -const asAnyOf = (def, refs) => {
17326 - const anyOf = (def.options instanceof Map
17327 - ? Array.from(def.options.values())
17328 - : def.options)
17329 - .map((x, i) => (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(x._def, {
17330 - ...refs,
17331 - currentPath: [...refs.currentPath, "anyOf", `${i}`],
17332 - }))
17333 - .filter((x) => !!x &&
17334 - (!refs.strictUnions ||
17335 - (typeof x === "object" && Object.keys(x).length > 0)));
17336 - return anyOf.length ? { anyOf } : undefined;
17337 -};
17338 -
17339 -
17340 -/***/ }),
17341 -
17342 -/***/ "./node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js":
17343 -/*!*********************************************************************!*\
17344 - !*** ./node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js ***!
17345 - \*********************************************************************/
17346 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17347 -
17348 -__webpack_require__.r(__webpack_exports__);
17349 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17350 -/* harmony export */ parseUnknownDef: function() { return /* binding */ parseUnknownDef; }
17351 -/* harmony export */ });
17352 -/* harmony import */ var _any_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
17353 -
17354 -function parseUnknownDef(refs) {
17355 - return (0,_any_js__WEBPACK_IMPORTED_MODULE_0__.parseAnyDef)(refs);
17356 -}
17357 -
17358 -
17359 -/***/ }),
17360 -
17361 -/***/ "./node_modules/zod-to-json-schema/dist/esm/selectParser.js":
17362 -/*!******************************************************************!*\
17363 - !*** ./node_modules/zod-to-json-schema/dist/esm/selectParser.js ***!
17364 - \******************************************************************/
17365 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17366 -
17367 -__webpack_require__.r(__webpack_exports__);
17368 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17369 -/* harmony export */ selectParser: function() { return /* binding */ selectParser; }
17370 -/* harmony export */ });
17371 -/* harmony import */ var zod__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod */ "./node_modules/zod/v3/types.js");
17372 -/* harmony import */ var _parsers_any_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parsers/any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
17373 -/* harmony import */ var _parsers_array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parsers/array.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/array.js");
17374 -/* harmony import */ var _parsers_bigint_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parsers/bigint.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js");
17375 -/* harmony import */ var _parsers_boolean_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./parsers/boolean.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js");
17376 -/* harmony import */ var _parsers_branded_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parsers/branded.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/branded.js");
17377 -/* harmony import */ var _parsers_catch_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parsers/catch.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/catch.js");
17378 -/* harmony import */ var _parsers_date_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./parsers/date.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/date.js");
17379 -/* harmony import */ var _parsers_default_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./parsers/default.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/default.js");
17380 -/* harmony import */ var _parsers_effects_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./parsers/effects.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/effects.js");
17381 -/* harmony import */ var _parsers_enum_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./parsers/enum.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/enum.js");
17382 -/* harmony import */ var _parsers_intersection_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./parsers/intersection.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js");
17383 -/* harmony import */ var _parsers_literal_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./parsers/literal.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/literal.js");
17384 -/* harmony import */ var _parsers_map_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./parsers/map.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/map.js");
17385 -/* harmony import */ var _parsers_nativeEnum_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./parsers/nativeEnum.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js");
17386 -/* harmony import */ var _parsers_never_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./parsers/never.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/never.js");
17387 -/* harmony import */ var _parsers_null_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./parsers/null.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/null.js");
17388 -/* harmony import */ var _parsers_nullable_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./parsers/nullable.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js");
17389 -/* harmony import */ var _parsers_number_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./parsers/number.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/number.js");
17390 -/* harmony import */ var _parsers_object_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./parsers/object.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/object.js");
17391 -/* harmony import */ var _parsers_optional_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./parsers/optional.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/optional.js");
17392 -/* harmony import */ var _parsers_pipeline_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./parsers/pipeline.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js");
17393 -/* harmony import */ var _parsers_promise_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./parsers/promise.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/promise.js");
17394 -/* harmony import */ var _parsers_record_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./parsers/record.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/record.js");
17395 -/* harmony import */ var _parsers_set_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./parsers/set.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/set.js");
17396 -/* harmony import */ var _parsers_string_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./parsers/string.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/string.js");
17397 -/* harmony import */ var _parsers_tuple_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./parsers/tuple.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js");
17398 -/* harmony import */ var _parsers_undefined_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./parsers/undefined.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js");
17399 -/* harmony import */ var _parsers_union_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./parsers/union.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/union.js");
17400 -/* harmony import */ var _parsers_unknown_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./parsers/unknown.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js");
17401 -/* harmony import */ var _parsers_readonly_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./parsers/readonly.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");
17402 -
17403 -
17404 -
17405 -
17406 -
17407 -
17408 -
17409 -
17410 -
17411 -
17412 -
17413 -
17414 -
17415 -
17416 -
17417 -
17418 -
17419 -
17420 -
17421 -
17422 -
17423 -
17424 -
17425 -
17426 -
17427 -
17428 -
17429 -
17430 -
17431 -
17432 -
17433 -const selectParser = (def, typeName, refs) => {
17434 - switch (typeName) {
17435 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodString:
17436 - return (0,_parsers_string_js__WEBPACK_IMPORTED_MODULE_25__.parseStringDef)(def, refs);
17437 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNumber:
17438 - return (0,_parsers_number_js__WEBPACK_IMPORTED_MODULE_18__.parseNumberDef)(def, refs);
17439 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodObject:
17440 - return (0,_parsers_object_js__WEBPACK_IMPORTED_MODULE_19__.parseObjectDef)(def, refs);
17441 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodBigInt:
17442 - return (0,_parsers_bigint_js__WEBPACK_IMPORTED_MODULE_3__.parseBigintDef)(def, refs);
17443 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodBoolean:
17444 - return (0,_parsers_boolean_js__WEBPACK_IMPORTED_MODULE_4__.parseBooleanDef)();
17445 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodDate:
17446 - return (0,_parsers_date_js__WEBPACK_IMPORTED_MODULE_7__.parseDateDef)(def, refs);
17447 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodUndefined:
17448 - return (0,_parsers_undefined_js__WEBPACK_IMPORTED_MODULE_27__.parseUndefinedDef)(refs);
17449 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNull:
17450 - return (0,_parsers_null_js__WEBPACK_IMPORTED_MODULE_16__.parseNullDef)(refs);
17451 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodArray:
17452 - return (0,_parsers_array_js__WEBPACK_IMPORTED_MODULE_2__.parseArrayDef)(def, refs);
17453 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodUnion:
17454 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:
17455 - return (0,_parsers_union_js__WEBPACK_IMPORTED_MODULE_28__.parseUnionDef)(def, refs);
17456 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodIntersection:
17457 - return (0,_parsers_intersection_js__WEBPACK_IMPORTED_MODULE_11__.parseIntersectionDef)(def, refs);
17458 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodTuple:
17459 - return (0,_parsers_tuple_js__WEBPACK_IMPORTED_MODULE_26__.parseTupleDef)(def, refs);
17460 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodRecord:
17461 - return (0,_parsers_record_js__WEBPACK_IMPORTED_MODULE_23__.parseRecordDef)(def, refs);
17462 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodLiteral:
17463 - return (0,_parsers_literal_js__WEBPACK_IMPORTED_MODULE_12__.parseLiteralDef)(def, refs);
17464 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodEnum:
17465 - return (0,_parsers_enum_js__WEBPACK_IMPORTED_MODULE_10__.parseEnumDef)(def);
17466 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNativeEnum:
17467 - return (0,_parsers_nativeEnum_js__WEBPACK_IMPORTED_MODULE_14__.parseNativeEnumDef)(def);
17468 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNullable:
17469 - return (0,_parsers_nullable_js__WEBPACK_IMPORTED_MODULE_17__.parseNullableDef)(def, refs);
17470 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodOptional:
17471 - return (0,_parsers_optional_js__WEBPACK_IMPORTED_MODULE_20__.parseOptionalDef)(def, refs);
17472 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodMap:
17473 - return (0,_parsers_map_js__WEBPACK_IMPORTED_MODULE_13__.parseMapDef)(def, refs);
17474 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodSet:
17475 - return (0,_parsers_set_js__WEBPACK_IMPORTED_MODULE_24__.parseSetDef)(def, refs);
17476 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodLazy:
17477 - return () => def.getter()._def;
17478 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodPromise:
17479 - return (0,_parsers_promise_js__WEBPACK_IMPORTED_MODULE_22__.parsePromiseDef)(def, refs);
17480 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNaN:
17481 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodNever:
17482 - return (0,_parsers_never_js__WEBPACK_IMPORTED_MODULE_15__.parseNeverDef)(refs);
17483 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodEffects:
17484 - return (0,_parsers_effects_js__WEBPACK_IMPORTED_MODULE_9__.parseEffectsDef)(def, refs);
17485 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodAny:
17486 - return (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_1__.parseAnyDef)(refs);
17487 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodUnknown:
17488 - return (0,_parsers_unknown_js__WEBPACK_IMPORTED_MODULE_29__.parseUnknownDef)(refs);
17489 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodDefault:
17490 - return (0,_parsers_default_js__WEBPACK_IMPORTED_MODULE_8__.parseDefaultDef)(def, refs);
17491 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodBranded:
17492 - return (0,_parsers_branded_js__WEBPACK_IMPORTED_MODULE_5__.parseBrandedDef)(def, refs);
17493 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodReadonly:
17494 - return (0,_parsers_readonly_js__WEBPACK_IMPORTED_MODULE_30__.parseReadonlyDef)(def, refs);
17495 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodCatch:
17496 - return (0,_parsers_catch_js__WEBPACK_IMPORTED_MODULE_6__.parseCatchDef)(def, refs);
17497 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodPipeline:
17498 - return (0,_parsers_pipeline_js__WEBPACK_IMPORTED_MODULE_21__.parsePipelineDef)(def, refs);
17499 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodFunction:
17500 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodVoid:
17501 - case zod__WEBPACK_IMPORTED_MODULE_0__.ZodFirstPartyTypeKind.ZodSymbol:
17502 - return undefined;
17503 - default:
17504 - /* c8 ignore next */
17505 - return ((_) => undefined)(typeName);
17506 - }
17507 -};
17508 -
17509 -
17510 -/***/ }),
17511 -
17512 -/***/ "./node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js":
17513 -/*!*********************************************************************!*\
17514 - !*** ./node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js ***!
17515 - \*********************************************************************/
17516 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17517 -
17518 -__webpack_require__.r(__webpack_exports__);
17519 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17520 -/* harmony export */ zodToJsonSchema: function() { return /* binding */ zodToJsonSchema; }
17521 -/* harmony export */ });
17522 -/* harmony import */ var _parseDef_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parseDef.js */ "./node_modules/zod-to-json-schema/dist/esm/parseDef.js");
17523 -/* harmony import */ var _Refs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Refs.js */ "./node_modules/zod-to-json-schema/dist/esm/Refs.js");
17524 -/* harmony import */ var _parsers_any_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parsers/any.js */ "./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");
17525 -
17526 -
17527 -
17528 -const zodToJsonSchema = (schema, options) => {
17529 - const refs = (0,_Refs_js__WEBPACK_IMPORTED_MODULE_1__.getRefs)(options);
17530 - let definitions = typeof options === "object" && options.definitions
17531 - ? Object.entries(options.definitions).reduce((acc, [name, schema]) => ({
17532 - ...acc,
17533 - [name]: (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(schema._def, {
17534 - ...refs,
17535 - currentPath: [...refs.basePath, refs.definitionPath, name],
17536 - }, true) ?? (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_2__.parseAnyDef)(refs),
17537 - }), {})
17538 - : undefined;
17539 - const name = typeof options === "string"
17540 - ? options
17541 - : options?.nameStrategy === "title"
17542 - ? undefined
17543 - : options?.name;
17544 - const main = (0,_parseDef_js__WEBPACK_IMPORTED_MODULE_0__.parseDef)(schema._def, name === undefined
17545 - ? refs
17546 - : {
17547 - ...refs,
17548 - currentPath: [...refs.basePath, refs.definitionPath, name],
17549 - }, false) ?? (0,_parsers_any_js__WEBPACK_IMPORTED_MODULE_2__.parseAnyDef)(refs);
17550 - const title = typeof options === "object" &&
17551 - options.name !== undefined &&
17552 - options.nameStrategy === "title"
17553 - ? options.name
17554 - : undefined;
17555 - if (title !== undefined) {
17556 - main.title = title;
17557 - }
17558 - if (refs.flags.hasReferencedOpenAiAnyType) {
17559 - if (!definitions) {
17560 - definitions = {};
17561 - }
17562 - if (!definitions[refs.openAiAnyTypeName]) {
17563 - definitions[refs.openAiAnyTypeName] = {
17564 - // Skipping "object" as no properties can be defined and additionalProperties must be "false"
17565 - type: ["string", "number", "integer", "boolean", "array", "null"],
17566 - items: {
17567 - $ref: refs.$refStrategy === "relative"
17568 - ? "1"
17569 - : [
17570 - ...refs.basePath,
17571 - refs.definitionPath,
17572 - refs.openAiAnyTypeName,
17573 - ].join("/"),
17574 - },
17575 - };
17576 - }
17577 - }
17578 - const combined = name === undefined
17579 - ? definitions
17580 - ? {
17581 - ...main,
17582 - [refs.definitionPath]: definitions,
17583 - }
17584 - : main
17585 - : {
17586 - $ref: [
17587 - ...(refs.$refStrategy === "relative" ? [] : refs.basePath),
17588 - refs.definitionPath,
17589 - name,
17590 - ].join("/"),
17591 - [refs.definitionPath]: {
17592 - ...definitions,
17593 - [name]: main,
17594 - },
17595 - };
17596 - if (refs.target === "jsonSchema7") {
17597 - combined.$schema = "http://json-schema.org/draft-07/schema#";
17598 - }
17599 - else if (refs.target === "jsonSchema2019-09" || refs.target === "openAi") {
17600 - combined.$schema = "https://json-schema.org/draft/2019-09/schema#";
17601 - }
17602 - if (refs.target === "openAi" &&
17603 - ("anyOf" in combined ||
17604 - "oneOf" in combined ||
17605 - "allOf" in combined ||
17606 - ("type" in combined && Array.isArray(combined.type)))) {
17607 - console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");
17608 - }
17609 - return combined;
17610 -};
17611 -
17612 -
17613 -
17614 -/***/ }),
17615 -
17616 -/***/ "./node_modules/zod/v3/ZodError.js":
17617 -/*!*****************************************!*\
17618 - !*** ./node_modules/zod/v3/ZodError.js ***!
17619 - \*****************************************/
17620 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17621 -
17622 -__webpack_require__.r(__webpack_exports__);
17623 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17624 -/* harmony export */ ZodError: function() { return /* binding */ ZodError; },
17625 -/* harmony export */ ZodIssueCode: function() { return /* binding */ ZodIssueCode; },
17626 -/* harmony export */ quotelessJson: function() { return /* binding */ quotelessJson; }
17627 -/* harmony export */ });
17628 -/* harmony import */ var _helpers_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers/util.js */ "./node_modules/zod/v3/helpers/util.js");
17629 -
17630 -const ZodIssueCode = _helpers_util_js__WEBPACK_IMPORTED_MODULE_0__.util.arrayToEnum([
17631 - "invalid_type",
17632 - "invalid_literal",
17633 - "custom",
17634 - "invalid_union",
17635 - "invalid_union_discriminator",
17636 - "invalid_enum_value",
17637 - "unrecognized_keys",
17638 - "invalid_arguments",
17639 - "invalid_return_type",
17640 - "invalid_date",
17641 - "invalid_string",
17642 - "too_small",
17643 - "too_big",
17644 - "invalid_intersection_types",
17645 - "not_multiple_of",
17646 - "not_finite",
17647 -]);
17648 -const quotelessJson = (obj) => {
17649 - const json = JSON.stringify(obj, null, 2);
17650 - return json.replace(/"([^"]+)":/g, "$1:");
17651 -};
17652 -class ZodError extends Error {
17653 - get errors() {
17654 - return this.issues;
17655 - }
17656 - constructor(issues) {
17657 - super();
17658 - this.issues = [];
17659 - this.addIssue = (sub) => {
17660 - this.issues = [...this.issues, sub];
17661 - };
17662 - this.addIssues = (subs = []) => {
17663 - this.issues = [...this.issues, ...subs];
17664 - };
17665 - const actualProto = new.target.prototype;
17666 - if (Object.setPrototypeOf) {
17667 - // eslint-disable-next-line ban/ban
17668 - Object.setPrototypeOf(this, actualProto);
17669 - }
17670 - else {
17671 - this.__proto__ = actualProto;
17672 - }
17673 - this.name = "ZodError";
17674 - this.issues = issues;
17675 - }
17676 - format(_mapper) {
17677 - const mapper = _mapper ||
17678 - function (issue) {
17679 - return issue.message;
17680 - };
17681 - const fieldErrors = { _errors: [] };
17682 - const processError = (error) => {
17683 - for (const issue of error.issues) {
17684 - if (issue.code === "invalid_union") {
17685 - issue.unionErrors.map(processError);
17686 - }
17687 - else if (issue.code === "invalid_return_type") {
17688 - processError(issue.returnTypeError);
17689 - }
17690 - else if (issue.code === "invalid_arguments") {
17691 - processError(issue.argumentsError);
17692 - }
17693 - else if (issue.path.length === 0) {
17694 - fieldErrors._errors.push(mapper(issue));
17695 - }
17696 - else {
17697 - let curr = fieldErrors;
17698 - let i = 0;
17699 - while (i < issue.path.length) {
17700 - const el = issue.path[i];
17701 - const terminal = i === issue.path.length - 1;
17702 - if (!terminal) {
17703 - curr[el] = curr[el] || { _errors: [] };
17704 - // if (typeof el === "string") {
17705 - // curr[el] = curr[el] || { _errors: [] };
17706 - // } else if (typeof el === "number") {
17707 - // const errorArray: any = [];
17708 - // errorArray._errors = [];
17709 - // curr[el] = curr[el] || errorArray;
17710 - // }
17711 - }
17712 - else {
17713 - curr[el] = curr[el] || { _errors: [] };
17714 - curr[el]._errors.push(mapper(issue));
17715 - }
17716 - curr = curr[el];
17717 - i++;
17718 - }
17719 - }
17720 - }
17721 - };
17722 - processError(this);
17723 - return fieldErrors;
17724 - }
17725 - static assert(value) {
17726 - if (!(value instanceof ZodError)) {
17727 - throw new Error(`Not a ZodError: ${value}`);
17728 - }
17729 - }
17730 - toString() {
17731 - return this.message;
17732 - }
17733 - get message() {
17734 - return JSON.stringify(this.issues, _helpers_util_js__WEBPACK_IMPORTED_MODULE_0__.util.jsonStringifyReplacer, 2);
17735 - }
17736 - get isEmpty() {
17737 - return this.issues.length === 0;
17738 - }
17739 - flatten(mapper = (issue) => issue.message) {
17740 - const fieldErrors = {};
17741 - const formErrors = [];
17742 - for (const sub of this.issues) {
17743 - if (sub.path.length > 0) {
17744 - const firstEl = sub.path[0];
17745 - fieldErrors[firstEl] = fieldErrors[firstEl] || [];
17746 - fieldErrors[firstEl].push(mapper(sub));
17747 - }
17748 - else {
17749 - formErrors.push(mapper(sub));
17750 - }
17751 - }
17752 - return { formErrors, fieldErrors };
17753 - }
17754 - get formErrors() {
17755 - return this.flatten();
17756 - }
17757 -}
17758 -ZodError.create = (issues) => {
17759 - const error = new ZodError(issues);
17760 - return error;
17761 -};
17762 -
17763 -
17764 -/***/ }),
17765 -
17766 -/***/ "./node_modules/zod/v3/errors.js":
17767 -/*!***************************************!*\
17768 - !*** ./node_modules/zod/v3/errors.js ***!
17769 - \***************************************/
17770 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17771 -
17772 -__webpack_require__.r(__webpack_exports__);
17773 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17774 -/* harmony export */ defaultErrorMap: function() { return /* reexport safe */ _locales_en_js__WEBPACK_IMPORTED_MODULE_0__["default"]; },
17775 -/* harmony export */ getErrorMap: function() { return /* binding */ getErrorMap; },
17776 -/* harmony export */ setErrorMap: function() { return /* binding */ setErrorMap; }
17777 -/* harmony export */ });
17778 -/* harmony import */ var _locales_en_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./locales/en.js */ "./node_modules/zod/v3/locales/en.js");
17779 -
17780 -let overrideErrorMap = _locales_en_js__WEBPACK_IMPORTED_MODULE_0__["default"];
17781 -
17782 -function setErrorMap(map) {
17783 - overrideErrorMap = map;
17784 -}
17785 -function getErrorMap() {
17786 - return overrideErrorMap;
17787 -}
17788 -
17789 -
17790 -/***/ }),
17791 -
17792 -/***/ "./node_modules/zod/v3/helpers/errorUtil.js":
17793 -/*!**************************************************!*\
17794 - !*** ./node_modules/zod/v3/helpers/errorUtil.js ***!
17795 - \**************************************************/
17796 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17797 -
17798 -__webpack_require__.r(__webpack_exports__);
17799 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17800 -/* harmony export */ errorUtil: function() { return /* binding */ errorUtil; }
17801 -/* harmony export */ });
17802 -var errorUtil;
17803 -(function (errorUtil) {
17804 - errorUtil.errToObj = (message) => typeof message === "string" ? { message } : message || {};
17805 - // biome-ignore lint:
17806 - errorUtil.toString = (message) => typeof message === "string" ? message : message?.message;
17807 -})(errorUtil || (errorUtil = {}));
17808 -
17809 -
17810 -/***/ }),
17811 -
17812 -/***/ "./node_modules/zod/v3/helpers/parseUtil.js":
17813 -/*!**************************************************!*\
17814 - !*** ./node_modules/zod/v3/helpers/parseUtil.js ***!
17815 - \**************************************************/
17816 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17817 -
17818 -__webpack_require__.r(__webpack_exports__);
17819 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17820 -/* harmony export */ DIRTY: function() { return /* binding */ DIRTY; },
17821 -/* harmony export */ EMPTY_PATH: function() { return /* binding */ EMPTY_PATH; },
17822 -/* harmony export */ INVALID: function() { return /* binding */ INVALID; },
17823 -/* harmony export */ OK: function() { return /* binding */ OK; },
17824 -/* harmony export */ ParseStatus: function() { return /* binding */ ParseStatus; },
17825 -/* harmony export */ addIssueToContext: function() { return /* binding */ addIssueToContext; },
17826 -/* harmony export */ isAborted: function() { return /* binding */ isAborted; },
17827 -/* harmony export */ isAsync: function() { return /* binding */ isAsync; },
17828 -/* harmony export */ isDirty: function() { return /* binding */ isDirty; },
17829 -/* harmony export */ isValid: function() { return /* binding */ isValid; },
17830 -/* harmony export */ makeIssue: function() { return /* binding */ makeIssue; }
17831 -/* harmony export */ });
17832 -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../errors.js */ "./node_modules/zod/v3/errors.js");
17833 -/* harmony import */ var _locales_en_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../locales/en.js */ "./node_modules/zod/v3/locales/en.js");
17834 -
17835 -
17836 -const makeIssue = (params) => {
17837 - const { data, path, errorMaps, issueData } = params;
17838 - const fullPath = [...path, ...(issueData.path || [])];
17839 - const fullIssue = {
17840 - ...issueData,
17841 - path: fullPath,
17842 - };
17843 - if (issueData.message !== undefined) {
17844 - return {
17845 - ...issueData,
17846 - path: fullPath,
17847 - message: issueData.message,
17848 - };
17849 - }
17850 - let errorMessage = "";
17851 - const maps = errorMaps
17852 - .filter((m) => !!m)
17853 - .slice()
17854 - .reverse();
17855 - for (const map of maps) {
17856 - errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;
17857 - }
17858 - return {
17859 - ...issueData,
17860 - path: fullPath,
17861 - message: errorMessage,
17862 - };
17863 -};
17864 -const EMPTY_PATH = [];
17865 -function addIssueToContext(ctx, issueData) {
17866 - const overrideMap = (0,_errors_js__WEBPACK_IMPORTED_MODULE_0__.getErrorMap)();
17867 - const issue = makeIssue({
17868 - issueData: issueData,
17869 - data: ctx.data,
17870 - path: ctx.path,
17871 - errorMaps: [
17872 - ctx.common.contextualErrorMap, // contextual error map is first priority
17873 - ctx.schemaErrorMap, // then schema-bound map if available
17874 - overrideMap, // then global override map
17875 - overrideMap === _locales_en_js__WEBPACK_IMPORTED_MODULE_1__["default"] ? undefined : _locales_en_js__WEBPACK_IMPORTED_MODULE_1__["default"], // then global default map
17876 - ].filter((x) => !!x),
17877 - });
17878 - ctx.common.issues.push(issue);
17879 -}
17880 -class ParseStatus {
17881 - constructor() {
17882 - this.value = "valid";
17883 - }
17884 - dirty() {
17885 - if (this.value === "valid")
17886 - this.value = "dirty";
17887 - }
17888 - abort() {
17889 - if (this.value !== "aborted")
17890 - this.value = "aborted";
17891 - }
17892 - static mergeArray(status, results) {
17893 - const arrayValue = [];
17894 - for (const s of results) {
17895 - if (s.status === "aborted")
17896 - return INVALID;
17897 - if (s.status === "dirty")
17898 - status.dirty();
17899 - arrayValue.push(s.value);
17900 - }
17901 - return { status: status.value, value: arrayValue };
17902 - }
17903 - static async mergeObjectAsync(status, pairs) {
17904 - const syncPairs = [];
17905 - for (const pair of pairs) {
17906 - const key = await pair.key;
17907 - const value = await pair.value;
17908 - syncPairs.push({
17909 - key,
17910 - value,
17911 - });
17912 - }
17913 - return ParseStatus.mergeObjectSync(status, syncPairs);
17914 - }
17915 - static mergeObjectSync(status, pairs) {
17916 - const finalObject = {};
17917 - for (const pair of pairs) {
17918 - const { key, value } = pair;
17919 - if (key.status === "aborted")
17920 - return INVALID;
17921 - if (value.status === "aborted")
17922 - return INVALID;
17923 - if (key.status === "dirty")
17924 - status.dirty();
17925 - if (value.status === "dirty")
17926 - status.dirty();
17927 - if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
17928 - finalObject[key.value] = value.value;
17929 - }
17930 - }
17931 - return { status: status.value, value: finalObject };
17932 - }
17933 -}
17934 -const INVALID = Object.freeze({
17935 - status: "aborted",
17936 -});
17937 -const DIRTY = (value) => ({ status: "dirty", value });
17938 -const OK = (value) => ({ status: "valid", value });
17939 -const isAborted = (x) => x.status === "aborted";
17940 -const isDirty = (x) => x.status === "dirty";
17941 -const isValid = (x) => x.status === "valid";
17942 -const isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
17943 -
17944 -
17945 -/***/ }),
17946 -
17947 -/***/ "./node_modules/zod/v3/helpers/util.js":
17948 -/*!*********************************************!*\
17949 - !*** ./node_modules/zod/v3/helpers/util.js ***!
17950 - \*********************************************/
17951 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17952 -
17953 -__webpack_require__.r(__webpack_exports__);
17954 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
17955 -/* harmony export */ ZodParsedType: function() { return /* binding */ ZodParsedType; },
17956 -/* harmony export */ getParsedType: function() { return /* binding */ getParsedType; },
17957 -/* harmony export */ objectUtil: function() { return /* binding */ objectUtil; },
17958 -/* harmony export */ util: function() { return /* binding */ util; }
17959 -/* harmony export */ });
17960 -var util;
17961 -(function (util) {
17962 - util.assertEqual = (_) => { };
17963 - function assertIs(_arg) { }
17964 - util.assertIs = assertIs;
17965 - function assertNever(_x) {
17966 - throw new Error();
17967 - }
17968 - util.assertNever = assertNever;
17969 - util.arrayToEnum = (items) => {
17970 - const obj = {};
17971 - for (const item of items) {
17972 - obj[item] = item;
17973 - }
17974 - return obj;
17975 - };
17976 - util.getValidEnumValues = (obj) => {
17977 - const validKeys = util.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number");
17978 - const filtered = {};
17979 - for (const k of validKeys) {
17980 - filtered[k] = obj[k];
17981 - }
17982 - return util.objectValues(filtered);
17983 - };
17984 - util.objectValues = (obj) => {
17985 - return util.objectKeys(obj).map(function (e) {
17986 - return obj[e];
17987 - });
17988 - };
17989 - util.objectKeys = typeof Object.keys === "function" // eslint-disable-line ban/ban
17990 - ? (obj) => Object.keys(obj) // eslint-disable-line ban/ban
17991 - : (object) => {
17992 - const keys = [];
17993 - for (const key in object) {
17994 - if (Object.prototype.hasOwnProperty.call(object, key)) {
17995 - keys.push(key);
17996 - }
17997 - }
17998 - return keys;
17999 - };
18000 - util.find = (arr, checker) => {
18001 - for (const item of arr) {
18002 - if (checker(item))
18003 - return item;
18004 - }
18005 - return undefined;
18006 - };
18007 - util.isInteger = typeof Number.isInteger === "function"
18008 - ? (val) => Number.isInteger(val) // eslint-disable-line ban/ban
18009 - : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val;
18010 - function joinValues(array, separator = " | ") {
18011 - return array.map((val) => (typeof val === "string" ? `'${val}'` : val)).join(separator);
18012 - }
18013 - util.joinValues = joinValues;
18014 - util.jsonStringifyReplacer = (_, value) => {
18015 - if (typeof value === "bigint") {
18016 - return value.toString();
18017 - }
18018 - return value;
18019 - };
18020 -})(util || (util = {}));
18021 -var objectUtil;
18022 -(function (objectUtil) {
18023 - objectUtil.mergeShapes = (first, second) => {
18024 - return {
18025 - ...first,
18026 - ...second, // second overwrites first
18027 - };
18028 - };
18029 -})(objectUtil || (objectUtil = {}));
18030 -const ZodParsedType = util.arrayToEnum([
18031 - "string",
18032 - "nan",
18033 - "number",
18034 - "integer",
18035 - "float",
18036 - "boolean",
18037 - "date",
18038 - "bigint",
18039 - "symbol",
18040 - "function",
18041 - "undefined",
18042 - "null",
18043 - "array",
18044 - "object",
18045 - "unknown",
18046 - "promise",
18047 - "void",
18048 - "never",
18049 - "map",
18050 - "set",
18051 -]);
18052 -const getParsedType = (data) => {
18053 - const t = typeof data;
18054 - switch (t) {
18055 - case "undefined":
18056 - return ZodParsedType.undefined;
18057 - case "string":
18058 - return ZodParsedType.string;
18059 - case "number":
18060 - return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;
18061 - case "boolean":
18062 - return ZodParsedType.boolean;
18063 - case "function":
18064 - return ZodParsedType.function;
18065 - case "bigint":
18066 - return ZodParsedType.bigint;
18067 - case "symbol":
18068 - return ZodParsedType.symbol;
18069 - case "object":
18070 - if (Array.isArray(data)) {
18071 - return ZodParsedType.array;
18072 - }
18073 - if (data === null) {
18074 - return ZodParsedType.null;
18075 - }
18076 - if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
18077 - return ZodParsedType.promise;
18078 - }
18079 - if (typeof Map !== "undefined" && data instanceof Map) {
18080 - return ZodParsedType.map;
18081 - }
18082 - if (typeof Set !== "undefined" && data instanceof Set) {
18083 - return ZodParsedType.set;
18084 - }
18085 - if (typeof Date !== "undefined" && data instanceof Date) {
18086 - return ZodParsedType.date;
18087 - }
18088 - return ZodParsedType.object;
18089 - default:
18090 - return ZodParsedType.unknown;
18091 - }
18092 -};
18093 -
18094 -
18095 -/***/ }),
18096 -
18097 -/***/ "./node_modules/zod/v3/locales/en.js":
18098 -/*!*******************************************!*\
18099 - !*** ./node_modules/zod/v3/locales/en.js ***!
18100 - \*******************************************/
18101 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
18102 -
18103 -__webpack_require__.r(__webpack_exports__);
18104 -/* harmony import */ var _ZodError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ZodError.js */ "./node_modules/zod/v3/ZodError.js");
18105 -/* harmony import */ var _helpers_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../helpers/util.js */ "./node_modules/zod/v3/helpers/util.js");
18106 -
18107 -
18108 -const errorMap = (issue, _ctx) => {
18109 - let message;
18110 - switch (issue.code) {
18111 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type:
18112 - if (issue.received === _helpers_util_js__WEBPACK_IMPORTED_MODULE_1__.ZodParsedType.undefined) {
18113 - message = "Required";
18114 - }
18115 - else {
18116 - message = `Expected ${issue.expected}, received ${issue.received}`;
18117 - }
18118 - break;
18119 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_literal:
18120 - message = `Invalid literal value, expected ${JSON.stringify(issue.expected, _helpers_util_js__WEBPACK_IMPORTED_MODULE_1__.util.jsonStringifyReplacer)}`;
18121 - break;
18122 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.unrecognized_keys:
18123 - message = `Unrecognized key(s) in object: ${_helpers_util_js__WEBPACK_IMPORTED_MODULE_1__.util.joinValues(issue.keys, ", ")}`;
18124 - break;
18125 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_union:
18126 - message = `Invalid input`;
18127 - break;
18128 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_union_discriminator:
18129 - message = `Invalid discriminator value. Expected ${_helpers_util_js__WEBPACK_IMPORTED_MODULE_1__.util.joinValues(issue.options)}`;
18130 - break;
18131 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_enum_value:
18132 - message = `Invalid enum value. Expected ${_helpers_util_js__WEBPACK_IMPORTED_MODULE_1__.util.joinValues(issue.options)}, received '${issue.received}'`;
18133 - break;
18134 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_arguments:
18135 - message = `Invalid function arguments`;
18136 - break;
18137 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_return_type:
18138 - message = `Invalid function return type`;
18139 - break;
18140 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_date:
18141 - message = `Invalid date`;
18142 - break;
18143 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string:
18144 - if (typeof issue.validation === "object") {
18145 - if ("includes" in issue.validation) {
18146 - message = `Invalid input: must include "${issue.validation.includes}"`;
18147 - if (typeof issue.validation.position === "number") {
18148 - message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;
18149 - }
18150 - }
18151 - else if ("startsWith" in issue.validation) {
18152 - message = `Invalid input: must start with "${issue.validation.startsWith}"`;
18153 - }
18154 - else if ("endsWith" in issue.validation) {
18155 - message = `Invalid input: must end with "${issue.validation.endsWith}"`;
18156 - }
18157 - else {
18158 - _helpers_util_js__WEBPACK_IMPORTED_MODULE_1__.util.assertNever(issue.validation);
18159 - }
18160 - }
18161 - else if (issue.validation !== "regex") {
18162 - message = `Invalid ${issue.validation}`;
18163 - }
18164 - else {
18165 - message = "Invalid";
18166 - }
18167 - break;
18168 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small:
18169 - if (issue.type === "array")
18170 - message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;
18171 - else if (issue.type === "string")
18172 - message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;
18173 - else if (issue.type === "number")
18174 - message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
18175 - else if (issue.type === "bigint")
18176 - message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;
18177 - else if (issue.type === "date")
18178 - message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;
18179 - else
18180 - message = "Invalid input";
18181 - break;
18182 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big:
18183 - if (issue.type === "array")
18184 - message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;
18185 - else if (issue.type === "string")
18186 - message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;
18187 - else if (issue.type === "number")
18188 - message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
18189 - else if (issue.type === "bigint")
18190 - message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;
18191 - else if (issue.type === "date")
18192 - message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;
18193 - else
18194 - message = "Invalid input";
18195 - break;
18196 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.custom:
18197 - message = `Invalid input`;
18198 - break;
18199 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_intersection_types:
18200 - message = `Intersection results could not be merged`;
18201 - break;
18202 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.not_multiple_of:
18203 - message = `Number must be a multiple of ${issue.multipleOf}`;
18204 - break;
18205 - case _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.not_finite:
18206 - message = "Number must be finite";
18207 - break;
18208 - default:
18209 - message = _ctx.defaultError;
18210 - _helpers_util_js__WEBPACK_IMPORTED_MODULE_1__.util.assertNever(issue);
18211 - }
18212 - return { message };
18213 -};
18214 -/* harmony default export */ __webpack_exports__["default"] = (errorMap);
18215 -
18216 -
18217 -/***/ }),
18218 -
18219 -/***/ "./node_modules/zod/v3/types.js":
18220 -/*!**************************************!*\
18221 - !*** ./node_modules/zod/v3/types.js ***!
18222 - \**************************************/
18223 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
18224 -
18225 -__webpack_require__.r(__webpack_exports__);
18226 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
18227 -/* harmony export */ BRAND: function() { return /* binding */ BRAND; },
18228 -/* harmony export */ NEVER: function() { return /* binding */ NEVER; },
18229 -/* harmony export */ Schema: function() { return /* binding */ ZodType; },
18230 -/* harmony export */ ZodAny: function() { return /* binding */ ZodAny; },
18231 -/* harmony export */ ZodArray: function() { return /* binding */ ZodArray; },
18232 -/* harmony export */ ZodBigInt: function() { return /* binding */ ZodBigInt; },
18233 -/* harmony export */ ZodBoolean: function() { return /* binding */ ZodBoolean; },
18234 -/* harmony export */ ZodBranded: function() { return /* binding */ ZodBranded; },
18235 -/* harmony export */ ZodCatch: function() { return /* binding */ ZodCatch; },
18236 -/* harmony export */ ZodDate: function() { return /* binding */ ZodDate; },
18237 -/* harmony export */ ZodDefault: function() { return /* binding */ ZodDefault; },
18238 -/* harmony export */ ZodDiscriminatedUnion: function() { return /* binding */ ZodDiscriminatedUnion; },
18239 -/* harmony export */ ZodEffects: function() { return /* binding */ ZodEffects; },
18240 -/* harmony export */ ZodEnum: function() { return /* binding */ ZodEnum; },
18241 -/* harmony export */ ZodFirstPartyTypeKind: function() { return /* binding */ ZodFirstPartyTypeKind; },
18242 -/* harmony export */ ZodFunction: function() { return /* binding */ ZodFunction; },
18243 -/* harmony export */ ZodIntersection: function() { return /* binding */ ZodIntersection; },
18244 -/* harmony export */ ZodLazy: function() { return /* binding */ ZodLazy; },
18245 -/* harmony export */ ZodLiteral: function() { return /* binding */ ZodLiteral; },
18246 -/* harmony export */ ZodMap: function() { return /* binding */ ZodMap; },
18247 -/* harmony export */ ZodNaN: function() { return /* binding */ ZodNaN; },
18248 -/* harmony export */ ZodNativeEnum: function() { return /* binding */ ZodNativeEnum; },
18249 -/* harmony export */ ZodNever: function() { return /* binding */ ZodNever; },
18250 -/* harmony export */ ZodNull: function() { return /* binding */ ZodNull; },
18251 -/* harmony export */ ZodNullable: function() { return /* binding */ ZodNullable; },
18252 -/* harmony export */ ZodNumber: function() { return /* binding */ ZodNumber; },
18253 -/* harmony export */ ZodObject: function() { return /* binding */ ZodObject; },
18254 -/* harmony export */ ZodOptional: function() { return /* binding */ ZodOptional; },
18255 -/* harmony export */ ZodPipeline: function() { return /* binding */ ZodPipeline; },
18256 -/* harmony export */ ZodPromise: function() { return /* binding */ ZodPromise; },
18257 -/* harmony export */ ZodReadonly: function() { return /* binding */ ZodReadonly; },
18258 -/* harmony export */ ZodRecord: function() { return /* binding */ ZodRecord; },
18259 -/* harmony export */ ZodSchema: function() { return /* binding */ ZodType; },
18260 -/* harmony export */ ZodSet: function() { return /* binding */ ZodSet; },
18261 -/* harmony export */ ZodString: function() { return /* binding */ ZodString; },
18262 -/* harmony export */ ZodSymbol: function() { return /* binding */ ZodSymbol; },
18263 -/* harmony export */ ZodTransformer: function() { return /* binding */ ZodEffects; },
18264 -/* harmony export */ ZodTuple: function() { return /* binding */ ZodTuple; },
18265 -/* harmony export */ ZodType: function() { return /* binding */ ZodType; },
18266 -/* harmony export */ ZodUndefined: function() { return /* binding */ ZodUndefined; },
18267 -/* harmony export */ ZodUnion: function() { return /* binding */ ZodUnion; },
18268 -/* harmony export */ ZodUnknown: function() { return /* binding */ ZodUnknown; },
18269 -/* harmony export */ ZodVoid: function() { return /* binding */ ZodVoid; },
18270 -/* harmony export */ any: function() { return /* binding */ anyType; },
18271 -/* harmony export */ array: function() { return /* binding */ arrayType; },
18272 -/* harmony export */ bigint: function() { return /* binding */ bigIntType; },
18273 -/* harmony export */ boolean: function() { return /* binding */ booleanType; },
18274 -/* harmony export */ coerce: function() { return /* binding */ coerce; },
18275 -/* harmony export */ custom: function() { return /* binding */ custom; },
18276 -/* harmony export */ date: function() { return /* binding */ dateType; },
18277 -/* harmony export */ datetimeRegex: function() { return /* binding */ datetimeRegex; },
18278 -/* harmony export */ discriminatedUnion: function() { return /* binding */ discriminatedUnionType; },
18279 -/* harmony export */ effect: function() { return /* binding */ effectsType; },
18280 -/* harmony export */ "enum": function() { return /* binding */ enumType; },
18281 -/* harmony export */ "function": function() { return /* binding */ functionType; },
18282 -/* harmony export */ "instanceof": function() { return /* binding */ instanceOfType; },
18283 -/* harmony export */ intersection: function() { return /* binding */ intersectionType; },
18284 -/* harmony export */ late: function() { return /* binding */ late; },
18285 -/* harmony export */ lazy: function() { return /* binding */ lazyType; },
18286 -/* harmony export */ literal: function() { return /* binding */ literalType; },
18287 -/* harmony export */ map: function() { return /* binding */ mapType; },
18288 -/* harmony export */ nan: function() { return /* binding */ nanType; },
18289 -/* harmony export */ nativeEnum: function() { return /* binding */ nativeEnumType; },
18290 -/* harmony export */ never: function() { return /* binding */ neverType; },
18291 -/* harmony export */ "null": function() { return /* binding */ nullType; },
18292 -/* harmony export */ nullable: function() { return /* binding */ nullableType; },
18293 -/* harmony export */ number: function() { return /* binding */ numberType; },
18294 -/* harmony export */ object: function() { return /* binding */ objectType; },
18295 -/* harmony export */ oboolean: function() { return /* binding */ oboolean; },
18296 -/* harmony export */ onumber: function() { return /* binding */ onumber; },
18297 -/* harmony export */ optional: function() { return /* binding */ optionalType; },
18298 -/* harmony export */ ostring: function() { return /* binding */ ostring; },
18299 -/* harmony export */ pipeline: function() { return /* binding */ pipelineType; },
18300 -/* harmony export */ preprocess: function() { return /* binding */ preprocessType; },
18301 -/* harmony export */ promise: function() { return /* binding */ promiseType; },
18302 -/* harmony export */ record: function() { return /* binding */ recordType; },
18303 -/* harmony export */ set: function() { return /* binding */ setType; },
18304 -/* harmony export */ strictObject: function() { return /* binding */ strictObjectType; },
18305 -/* harmony export */ string: function() { return /* binding */ stringType; },
18306 -/* harmony export */ symbol: function() { return /* binding */ symbolType; },
18307 -/* harmony export */ transformer: function() { return /* binding */ effectsType; },
18308 -/* harmony export */ tuple: function() { return /* binding */ tupleType; },
18309 -/* harmony export */ undefined: function() { return /* binding */ undefinedType; },
18310 -/* harmony export */ union: function() { return /* binding */ unionType; },
18311 -/* harmony export */ unknown: function() { return /* binding */ unknownType; },
18312 -/* harmony export */ "void": function() { return /* binding */ voidType; }
18313 -/* harmony export */ });
18314 -/* harmony import */ var _ZodError_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ZodError.js */ "./node_modules/zod/v3/ZodError.js");
18315 -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./errors.js */ "./node_modules/zod/v3/errors.js");
18316 -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./errors.js */ "./node_modules/zod/v3/locales/en.js");
18317 -/* harmony import */ var _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/errorUtil.js */ "./node_modules/zod/v3/helpers/errorUtil.js");
18318 -/* harmony import */ var _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/parseUtil.js */ "./node_modules/zod/v3/helpers/parseUtil.js");
18319 -/* harmony import */ var _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./helpers/util.js */ "./node_modules/zod/v3/helpers/util.js");
18320 -
18321 -
18322 -
18323 -
18324 -
18325 -class ParseInputLazyPath {
18326 - constructor(parent, value, path, key) {
18327 - this._cachedPath = [];
18328 - this.parent = parent;
18329 - this.data = value;
18330 - this._path = path;
18331 - this._key = key;
18332 - }
18333 - get path() {
18334 - if (!this._cachedPath.length) {
18335 - if (Array.isArray(this._key)) {
18336 - this._cachedPath.push(...this._path, ...this._key);
18337 - }
18338 - else {
18339 - this._cachedPath.push(...this._path, this._key);
18340 - }
18341 - }
18342 - return this._cachedPath;
18343 - }
18344 -}
18345 -const handleResult = (ctx, result) => {
18346 - if ((0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isValid)(result)) {
18347 - return { success: true, data: result.value };
18348 - }
18349 - else {
18350 - if (!ctx.common.issues.length) {
18351 - throw new Error("Validation failed but no issues detected.");
18352 - }
18353 - return {
18354 - success: false,
18355 - get error() {
18356 - if (this._error)
18357 - return this._error;
18358 - const error = new _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodError(ctx.common.issues);
18359 - this._error = error;
18360 - return this._error;
18361 - },
18362 - };
18363 - }
18364 -};
18365 -function processCreateParams(params) {
18366 - if (!params)
18367 - return {};
18368 - const { errorMap, invalid_type_error, required_error, description } = params;
18369 - if (errorMap && (invalid_type_error || required_error)) {
18370 - throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
18371 - }
18372 - if (errorMap)
18373 - return { errorMap: errorMap, description };
18374 - const customMap = (iss, ctx) => {
18375 - const { message } = params;
18376 - if (iss.code === "invalid_enum_value") {
18377 - return { message: message ?? ctx.defaultError };
18378 - }
18379 - if (typeof ctx.data === "undefined") {
18380 - return { message: message ?? required_error ?? ctx.defaultError };
18381 - }
18382 - if (iss.code !== "invalid_type")
18383 - return { message: ctx.defaultError };
18384 - return { message: message ?? invalid_type_error ?? ctx.defaultError };
18385 - };
18386 - return { errorMap: customMap, description };
18387 -}
18388 -class ZodType {
18389 - get description() {
18390 - return this._def.description;
18391 - }
18392 - _getType(input) {
18393 - return (0,_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.getParsedType)(input.data);
18394 - }
18395 - _getOrReturnCtx(input, ctx) {
18396 - return (ctx || {
18397 - common: input.parent.common,
18398 - data: input.data,
18399 - parsedType: (0,_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.getParsedType)(input.data),
18400 - schemaErrorMap: this._def.errorMap,
18401 - path: input.path,
18402 - parent: input.parent,
18403 - });
18404 - }
18405 - _processInputParams(input) {
18406 - return {
18407 - status: new _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus(),
18408 - ctx: {
18409 - common: input.parent.common,
18410 - data: input.data,
18411 - parsedType: (0,_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.getParsedType)(input.data),
18412 - schemaErrorMap: this._def.errorMap,
18413 - path: input.path,
18414 - parent: input.parent,
18415 - },
18416 - };
18417 - }
18418 - _parseSync(input) {
18419 - const result = this._parse(input);
18420 - if ((0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isAsync)(result)) {
18421 - throw new Error("Synchronous parse encountered promise.");
18422 - }
18423 - return result;
18424 - }
18425 - _parseAsync(input) {
18426 - const result = this._parse(input);
18427 - return Promise.resolve(result);
18428 - }
18429 - parse(data, params) {
18430 - const result = this.safeParse(data, params);
18431 - if (result.success)
18432 - return result.data;
18433 - throw result.error;
18434 - }
18435 - safeParse(data, params) {
18436 - const ctx = {
18437 - common: {
18438 - issues: [],
18439 - async: params?.async ?? false,
18440 - contextualErrorMap: params?.errorMap,
18441 - },
18442 - path: params?.path || [],
18443 - schemaErrorMap: this._def.errorMap,
18444 - parent: null,
18445 - data,
18446 - parsedType: (0,_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.getParsedType)(data),
18447 - };
18448 - const result = this._parseSync({ data, path: ctx.path, parent: ctx });
18449 - return handleResult(ctx, result);
18450 - }
18451 - "~validate"(data) {
18452 - const ctx = {
18453 - common: {
18454 - issues: [],
18455 - async: !!this["~standard"].async,
18456 - },
18457 - path: [],
18458 - schemaErrorMap: this._def.errorMap,
18459 - parent: null,
18460 - data,
18461 - parsedType: (0,_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.getParsedType)(data),
18462 - };
18463 - if (!this["~standard"].async) {
18464 - try {
18465 - const result = this._parseSync({ data, path: [], parent: ctx });
18466 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isValid)(result)
18467 - ? {
18468 - value: result.value,
18469 - }
18470 - : {
18471 - issues: ctx.common.issues,
18472 - };
18473 - }
18474 - catch (err) {
18475 - if (err?.message?.toLowerCase()?.includes("encountered")) {
18476 - this["~standard"].async = true;
18477 - }
18478 - ctx.common = {
18479 - issues: [],
18480 - async: true,
18481 - };
18482 - }
18483 - }
18484 - return this._parseAsync({ data, path: [], parent: ctx }).then((result) => (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isValid)(result)
18485 - ? {
18486 - value: result.value,
18487 - }
18488 - : {
18489 - issues: ctx.common.issues,
18490 - });
18491 - }
18492 - async parseAsync(data, params) {
18493 - const result = await this.safeParseAsync(data, params);
18494 - if (result.success)
18495 - return result.data;
18496 - throw result.error;
18497 - }
18498 - async safeParseAsync(data, params) {
18499 - const ctx = {
18500 - common: {
18501 - issues: [],
18502 - contextualErrorMap: params?.errorMap,
18503 - async: true,
18504 - },
18505 - path: params?.path || [],
18506 - schemaErrorMap: this._def.errorMap,
18507 - parent: null,
18508 - data,
18509 - parsedType: (0,_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.getParsedType)(data),
18510 - };
18511 - const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
18512 - const result = await ((0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isAsync)(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
18513 - return handleResult(ctx, result);
18514 - }
18515 - refine(check, message) {
18516 - const getIssueProperties = (val) => {
18517 - if (typeof message === "string" || typeof message === "undefined") {
18518 - return { message };
18519 - }
18520 - else if (typeof message === "function") {
18521 - return message(val);
18522 - }
18523 - else {
18524 - return message;
18525 - }
18526 - };
18527 - return this._refinement((val, ctx) => {
18528 - const result = check(val);
18529 - const setError = () => ctx.addIssue({
18530 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.custom,
18531 - ...getIssueProperties(val),
18532 - });
18533 - if (typeof Promise !== "undefined" && result instanceof Promise) {
18534 - return result.then((data) => {
18535 - if (!data) {
18536 - setError();
18537 - return false;
18538 - }
18539 - else {
18540 - return true;
18541 - }
18542 - });
18543 - }
18544 - if (!result) {
18545 - setError();
18546 - return false;
18547 - }
18548 - else {
18549 - return true;
18550 - }
18551 - });
18552 - }
18553 - refinement(check, refinementData) {
18554 - return this._refinement((val, ctx) => {
18555 - if (!check(val)) {
18556 - ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
18557 - return false;
18558 - }
18559 - else {
18560 - return true;
18561 - }
18562 - });
18563 - }
18564 - _refinement(refinement) {
18565 - return new ZodEffects({
18566 - schema: this,
18567 - typeName: ZodFirstPartyTypeKind.ZodEffects,
18568 - effect: { type: "refinement", refinement },
18569 - });
18570 - }
18571 - superRefine(refinement) {
18572 - return this._refinement(refinement);
18573 - }
18574 - constructor(def) {
18575 - /** Alias of safeParseAsync */
18576 - this.spa = this.safeParseAsync;
18577 - this._def = def;
18578 - this.parse = this.parse.bind(this);
18579 - this.safeParse = this.safeParse.bind(this);
18580 - this.parseAsync = this.parseAsync.bind(this);
18581 - this.safeParseAsync = this.safeParseAsync.bind(this);
18582 - this.spa = this.spa.bind(this);
18583 - this.refine = this.refine.bind(this);
18584 - this.refinement = this.refinement.bind(this);
18585 - this.superRefine = this.superRefine.bind(this);
18586 - this.optional = this.optional.bind(this);
18587 - this.nullable = this.nullable.bind(this);
18588 - this.nullish = this.nullish.bind(this);
18589 - this.array = this.array.bind(this);
18590 - this.promise = this.promise.bind(this);
18591 - this.or = this.or.bind(this);
18592 - this.and = this.and.bind(this);
18593 - this.transform = this.transform.bind(this);
18594 - this.brand = this.brand.bind(this);
18595 - this.default = this.default.bind(this);
18596 - this.catch = this.catch.bind(this);
18597 - this.describe = this.describe.bind(this);
18598 - this.pipe = this.pipe.bind(this);
18599 - this.readonly = this.readonly.bind(this);
18600 - this.isNullable = this.isNullable.bind(this);
18601 - this.isOptional = this.isOptional.bind(this);
18602 - this["~standard"] = {
18603 - version: 1,
18604 - vendor: "zod",
18605 - validate: (data) => this["~validate"](data),
18606 - };
18607 - }
18608 - optional() {
18609 - return ZodOptional.create(this, this._def);
18610 - }
18611 - nullable() {
18612 - return ZodNullable.create(this, this._def);
18613 - }
18614 - nullish() {
18615 - return this.nullable().optional();
18616 - }
18617 - array() {
18618 - return ZodArray.create(this);
18619 - }
18620 - promise() {
18621 - return ZodPromise.create(this, this._def);
18622 - }
18623 - or(option) {
18624 - return ZodUnion.create([this, option], this._def);
18625 - }
18626 - and(incoming) {
18627 - return ZodIntersection.create(this, incoming, this._def);
18628 - }
18629 - transform(transform) {
18630 - return new ZodEffects({
18631 - ...processCreateParams(this._def),
18632 - schema: this,
18633 - typeName: ZodFirstPartyTypeKind.ZodEffects,
18634 - effect: { type: "transform", transform },
18635 - });
18636 - }
18637 - default(def) {
18638 - const defaultValueFunc = typeof def === "function" ? def : () => def;
18639 - return new ZodDefault({
18640 - ...processCreateParams(this._def),
18641 - innerType: this,
18642 - defaultValue: defaultValueFunc,
18643 - typeName: ZodFirstPartyTypeKind.ZodDefault,
18644 - });
18645 - }
18646 - brand() {
18647 - return new ZodBranded({
18648 - typeName: ZodFirstPartyTypeKind.ZodBranded,
18649 - type: this,
18650 - ...processCreateParams(this._def),
18651 - });
18652 - }
18653 - catch(def) {
18654 - const catchValueFunc = typeof def === "function" ? def : () => def;
18655 - return new ZodCatch({
18656 - ...processCreateParams(this._def),
18657 - innerType: this,
18658 - catchValue: catchValueFunc,
18659 - typeName: ZodFirstPartyTypeKind.ZodCatch,
18660 - });
18661 - }
18662 - describe(description) {
18663 - const This = this.constructor;
18664 - return new This({
18665 - ...this._def,
18666 - description,
18667 - });
18668 - }
18669 - pipe(target) {
18670 - return ZodPipeline.create(this, target);
18671 - }
18672 - readonly() {
18673 - return ZodReadonly.create(this);
18674 - }
18675 - isOptional() {
18676 - return this.safeParse(undefined).success;
18677 - }
18678 - isNullable() {
18679 - return this.safeParse(null).success;
18680 - }
18681 -}
18682 -const cuidRegex = /^c[^\s-]{8,}$/i;
18683 -const cuid2Regex = /^[0-9a-z]+$/;
18684 -const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
18685 -// const uuidRegex =
18686 -// /^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i;
18687 -const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
18688 -const nanoidRegex = /^[a-z0-9_-]{21}$/i;
18689 -const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
18690 -const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
18691 -// from https://stackoverflow.com/a/46181/1550155
18692 -// old version: too slow, didn't support unicode
18693 -// const emailRegex = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i;
18694 -//old email regex
18695 -// const emailRegex = /^(([^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*)|(".+"))@((?!-)([^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{1,})[^-<>()[\].,;:\s@"]$/i;
18696 -// eslint-disable-next-line
18697 -// const emailRegex =
18698 -// /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\])|(\[IPv6:(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))\])|([A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])*(\.[A-Za-z]{2,})+))$/;
18699 -// const emailRegex =
18700 -// /^[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])?)*$/;
18701 -// const emailRegex =
18702 -// /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?: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]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;
18703 -const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
18704 -// const emailRegex =
18705 -// /^[a-z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-z0-9-]+(?:\.[a-z0-9\-]+)*$/i;
18706 -// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
18707 -const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
18708 -let emojiRegex;
18709 -// faster, simpler, safer
18710 -const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
18711 -const ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
18712 -// const ipv6Regex =
18713 -// /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;
18714 -const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
18715 -const ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
18716 -// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
18717 -const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
18718 -// https://base64.guru/standards/base64url
18719 -const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
18720 -// simple
18721 -// const dateRegexSource = `\\d{4}-\\d{2}-\\d{2}`;
18722 -// no leap year validation
18723 -// const dateRegexSource = `\\d{4}-((0[13578]|10|12)-31|(0[13-9]|1[0-2])-30|(0[1-9]|1[0-2])-(0[1-9]|1\\d|2\\d))`;
18724 -// with leap year validation
18725 -const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
18726 -const dateRegex = new RegExp(`^${dateRegexSource}$`);
18727 -function timeRegexSource(args) {
18728 - let secondsRegexSource = `[0-5]\\d`;
18729 - if (args.precision) {
18730 - secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
18731 - }
18732 - else if (args.precision == null) {
18733 - secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
18734 - }
18735 - const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
18736 - return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
18737 -}
18738 -function timeRegex(args) {
18739 - return new RegExp(`^${timeRegexSource(args)}$`);
18740 -}
18741 -// Adapted from https://stackoverflow.com/a/3143231
18742 -function datetimeRegex(args) {
18743 - let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
18744 - const opts = [];
18745 - opts.push(args.local ? `Z?` : `Z`);
18746 - if (args.offset)
18747 - opts.push(`([+-]\\d{2}:?\\d{2})`);
18748 - regex = `${regex}(${opts.join("|")})`;
18749 - return new RegExp(`^${regex}$`);
18750 -}
18751 -function isValidIP(ip, version) {
18752 - if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
18753 - return true;
18754 - }
18755 - if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
18756 - return true;
18757 - }
18758 - return false;
18759 -}
18760 -function isValidJWT(jwt, alg) {
18761 - if (!jwtRegex.test(jwt))
18762 - return false;
18763 - try {
18764 - const [header] = jwt.split(".");
18765 - if (!header)
18766 - return false;
18767 - // Convert base64url to base64
18768 - const base64 = header
18769 - .replace(/-/g, "+")
18770 - .replace(/_/g, "/")
18771 - .padEnd(header.length + ((4 - (header.length % 4)) % 4), "=");
18772 - const decoded = JSON.parse(atob(base64));
18773 - if (typeof decoded !== "object" || decoded === null)
18774 - return false;
18775 - if ("typ" in decoded && decoded?.typ !== "JWT")
18776 - return false;
18777 - if (!decoded.alg)
18778 - return false;
18779 - if (alg && decoded.alg !== alg)
18780 - return false;
18781 - return true;
18782 - }
18783 - catch {
18784 - return false;
18785 - }
18786 -}
18787 -function isValidCidr(ip, version) {
18788 - if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
18789 - return true;
18790 - }
18791 - if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
18792 - return true;
18793 - }
18794 - return false;
18795 -}
18796 -class ZodString extends ZodType {
18797 - _parse(input) {
18798 - if (this._def.coerce) {
18799 - input.data = String(input.data);
18800 - }
18801 - const parsedType = this._getType(input);
18802 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.string) {
18803 - const ctx = this._getOrReturnCtx(input);
18804 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18805 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
18806 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.string,
18807 - received: ctx.parsedType,
18808 - });
18809 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
18810 - }
18811 - const status = new _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus();
18812 - let ctx = undefined;
18813 - for (const check of this._def.checks) {
18814 - if (check.kind === "min") {
18815 - if (input.data.length < check.value) {
18816 - ctx = this._getOrReturnCtx(input, ctx);
18817 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18818 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small,
18819 - minimum: check.value,
18820 - type: "string",
18821 - inclusive: true,
18822 - exact: false,
18823 - message: check.message,
18824 - });
18825 - status.dirty();
18826 - }
18827 - }
18828 - else if (check.kind === "max") {
18829 - if (input.data.length > check.value) {
18830 - ctx = this._getOrReturnCtx(input, ctx);
18831 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18832 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big,
18833 - maximum: check.value,
18834 - type: "string",
18835 - inclusive: true,
18836 - exact: false,
18837 - message: check.message,
18838 - });
18839 - status.dirty();
18840 - }
18841 - }
18842 - else if (check.kind === "length") {
18843 - const tooBig = input.data.length > check.value;
18844 - const tooSmall = input.data.length < check.value;
18845 - if (tooBig || tooSmall) {
18846 - ctx = this._getOrReturnCtx(input, ctx);
18847 - if (tooBig) {
18848 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18849 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big,
18850 - maximum: check.value,
18851 - type: "string",
18852 - inclusive: true,
18853 - exact: true,
18854 - message: check.message,
18855 - });
18856 - }
18857 - else if (tooSmall) {
18858 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18859 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small,
18860 - minimum: check.value,
18861 - type: "string",
18862 - inclusive: true,
18863 - exact: true,
18864 - message: check.message,
18865 - });
18866 - }
18867 - status.dirty();
18868 - }
18869 - }
18870 - else if (check.kind === "email") {
18871 - if (!emailRegex.test(input.data)) {
18872 - ctx = this._getOrReturnCtx(input, ctx);
18873 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18874 - validation: "email",
18875 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18876 - message: check.message,
18877 - });
18878 - status.dirty();
18879 - }
18880 - }
18881 - else if (check.kind === "emoji") {
18882 - if (!emojiRegex) {
18883 - emojiRegex = new RegExp(_emojiRegex, "u");
18884 - }
18885 - if (!emojiRegex.test(input.data)) {
18886 - ctx = this._getOrReturnCtx(input, ctx);
18887 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18888 - validation: "emoji",
18889 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18890 - message: check.message,
18891 - });
18892 - status.dirty();
18893 - }
18894 - }
18895 - else if (check.kind === "uuid") {
18896 - if (!uuidRegex.test(input.data)) {
18897 - ctx = this._getOrReturnCtx(input, ctx);
18898 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18899 - validation: "uuid",
18900 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18901 - message: check.message,
18902 - });
18903 - status.dirty();
18904 - }
18905 - }
18906 - else if (check.kind === "nanoid") {
18907 - if (!nanoidRegex.test(input.data)) {
18908 - ctx = this._getOrReturnCtx(input, ctx);
18909 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18910 - validation: "nanoid",
18911 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18912 - message: check.message,
18913 - });
18914 - status.dirty();
18915 - }
18916 - }
18917 - else if (check.kind === "cuid") {
18918 - if (!cuidRegex.test(input.data)) {
18919 - ctx = this._getOrReturnCtx(input, ctx);
18920 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18921 - validation: "cuid",
18922 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18923 - message: check.message,
18924 - });
18925 - status.dirty();
18926 - }
18927 - }
18928 - else if (check.kind === "cuid2") {
18929 - if (!cuid2Regex.test(input.data)) {
18930 - ctx = this._getOrReturnCtx(input, ctx);
18931 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18932 - validation: "cuid2",
18933 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18934 - message: check.message,
18935 - });
18936 - status.dirty();
18937 - }
18938 - }
18939 - else if (check.kind === "ulid") {
18940 - if (!ulidRegex.test(input.data)) {
18941 - ctx = this._getOrReturnCtx(input, ctx);
18942 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18943 - validation: "ulid",
18944 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18945 - message: check.message,
18946 - });
18947 - status.dirty();
18948 - }
18949 - }
18950 - else if (check.kind === "url") {
18951 - try {
18952 - new URL(input.data);
18953 - }
18954 - catch {
18955 - ctx = this._getOrReturnCtx(input, ctx);
18956 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18957 - validation: "url",
18958 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18959 - message: check.message,
18960 - });
18961 - status.dirty();
18962 - }
18963 - }
18964 - else if (check.kind === "regex") {
18965 - check.regex.lastIndex = 0;
18966 - const testResult = check.regex.test(input.data);
18967 - if (!testResult) {
18968 - ctx = this._getOrReturnCtx(input, ctx);
18969 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18970 - validation: "regex",
18971 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18972 - message: check.message,
18973 - });
18974 - status.dirty();
18975 - }
18976 - }
18977 - else if (check.kind === "trim") {
18978 - input.data = input.data.trim();
18979 - }
18980 - else if (check.kind === "includes") {
18981 - if (!input.data.includes(check.value, check.position)) {
18982 - ctx = this._getOrReturnCtx(input, ctx);
18983 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
18984 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
18985 - validation: { includes: check.value, position: check.position },
18986 - message: check.message,
18987 - });
18988 - status.dirty();
18989 - }
18990 - }
18991 - else if (check.kind === "toLowerCase") {
18992 - input.data = input.data.toLowerCase();
18993 - }
18994 - else if (check.kind === "toUpperCase") {
18995 - input.data = input.data.toUpperCase();
18996 - }
18997 - else if (check.kind === "startsWith") {
18998 - if (!input.data.startsWith(check.value)) {
18999 - ctx = this._getOrReturnCtx(input, ctx);
19000 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19001 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19002 - validation: { startsWith: check.value },
19003 - message: check.message,
19004 - });
19005 - status.dirty();
19006 - }
19007 - }
19008 - else if (check.kind === "endsWith") {
19009 - if (!input.data.endsWith(check.value)) {
19010 - ctx = this._getOrReturnCtx(input, ctx);
19011 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19012 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19013 - validation: { endsWith: check.value },
19014 - message: check.message,
19015 - });
19016 - status.dirty();
19017 - }
19018 - }
19019 - else if (check.kind === "datetime") {
19020 - const regex = datetimeRegex(check);
19021 - if (!regex.test(input.data)) {
19022 - ctx = this._getOrReturnCtx(input, ctx);
19023 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19024 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19025 - validation: "datetime",
19026 - message: check.message,
19027 - });
19028 - status.dirty();
19029 - }
19030 - }
19031 - else if (check.kind === "date") {
19032 - const regex = dateRegex;
19033 - if (!regex.test(input.data)) {
19034 - ctx = this._getOrReturnCtx(input, ctx);
19035 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19036 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19037 - validation: "date",
19038 - message: check.message,
19039 - });
19040 - status.dirty();
19041 - }
19042 - }
19043 - else if (check.kind === "time") {
19044 - const regex = timeRegex(check);
19045 - if (!regex.test(input.data)) {
19046 - ctx = this._getOrReturnCtx(input, ctx);
19047 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19048 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19049 - validation: "time",
19050 - message: check.message,
19051 - });
19052 - status.dirty();
19053 - }
19054 - }
19055 - else if (check.kind === "duration") {
19056 - if (!durationRegex.test(input.data)) {
19057 - ctx = this._getOrReturnCtx(input, ctx);
19058 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19059 - validation: "duration",
19060 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19061 - message: check.message,
19062 - });
19063 - status.dirty();
19064 - }
19065 - }
19066 - else if (check.kind === "ip") {
19067 - if (!isValidIP(input.data, check.version)) {
19068 - ctx = this._getOrReturnCtx(input, ctx);
19069 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19070 - validation: "ip",
19071 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19072 - message: check.message,
19073 - });
19074 - status.dirty();
19075 - }
19076 - }
19077 - else if (check.kind === "jwt") {
19078 - if (!isValidJWT(input.data, check.alg)) {
19079 - ctx = this._getOrReturnCtx(input, ctx);
19080 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19081 - validation: "jwt",
19082 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19083 - message: check.message,
19084 - });
19085 - status.dirty();
19086 - }
19087 - }
19088 - else if (check.kind === "cidr") {
19089 - if (!isValidCidr(input.data, check.version)) {
19090 - ctx = this._getOrReturnCtx(input, ctx);
19091 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19092 - validation: "cidr",
19093 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19094 - message: check.message,
19095 - });
19096 - status.dirty();
19097 - }
19098 - }
19099 - else if (check.kind === "base64") {
19100 - if (!base64Regex.test(input.data)) {
19101 - ctx = this._getOrReturnCtx(input, ctx);
19102 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19103 - validation: "base64",
19104 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19105 - message: check.message,
19106 - });
19107 - status.dirty();
19108 - }
19109 - }
19110 - else if (check.kind === "base64url") {
19111 - if (!base64urlRegex.test(input.data)) {
19112 - ctx = this._getOrReturnCtx(input, ctx);
19113 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19114 - validation: "base64url",
19115 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19116 - message: check.message,
19117 - });
19118 - status.dirty();
19119 - }
19120 - }
19121 - else {
19122 - _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.assertNever(check);
19123 - }
19124 - }
19125 - return { status: status.value, value: input.data };
19126 - }
19127 - _regex(regex, validation, message) {
19128 - return this.refinement((data) => regex.test(data), {
19129 - validation,
19130 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_string,
19131 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message),
19132 - });
19133 - }
19134 - _addCheck(check) {
19135 - return new ZodString({
19136 - ...this._def,
19137 - checks: [...this._def.checks, check],
19138 - });
19139 - }
19140 - email(message) {
19141 - return this._addCheck({ kind: "email", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19142 - }
19143 - url(message) {
19144 - return this._addCheck({ kind: "url", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19145 - }
19146 - emoji(message) {
19147 - return this._addCheck({ kind: "emoji", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19148 - }
19149 - uuid(message) {
19150 - return this._addCheck({ kind: "uuid", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19151 - }
19152 - nanoid(message) {
19153 - return this._addCheck({ kind: "nanoid", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19154 - }
19155 - cuid(message) {
19156 - return this._addCheck({ kind: "cuid", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19157 - }
19158 - cuid2(message) {
19159 - return this._addCheck({ kind: "cuid2", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19160 - }
19161 - ulid(message) {
19162 - return this._addCheck({ kind: "ulid", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19163 - }
19164 - base64(message) {
19165 - return this._addCheck({ kind: "base64", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19166 - }
19167 - base64url(message) {
19168 - // base64url encoding is a modification of base64 that can safely be used in URLs and filenames
19169 - return this._addCheck({
19170 - kind: "base64url",
19171 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message),
19172 - });
19173 - }
19174 - jwt(options) {
19175 - return this._addCheck({ kind: "jwt", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(options) });
19176 - }
19177 - ip(options) {
19178 - return this._addCheck({ kind: "ip", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(options) });
19179 - }
19180 - cidr(options) {
19181 - return this._addCheck({ kind: "cidr", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(options) });
19182 - }
19183 - datetime(options) {
19184 - if (typeof options === "string") {
19185 - return this._addCheck({
19186 - kind: "datetime",
19187 - precision: null,
19188 - offset: false,
19189 - local: false,
19190 - message: options,
19191 - });
19192 - }
19193 - return this._addCheck({
19194 - kind: "datetime",
19195 - precision: typeof options?.precision === "undefined" ? null : options?.precision,
19196 - offset: options?.offset ?? false,
19197 - local: options?.local ?? false,
19198 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(options?.message),
19199 - });
19200 - }
19201 - date(message) {
19202 - return this._addCheck({ kind: "date", message });
19203 - }
19204 - time(options) {
19205 - if (typeof options === "string") {
19206 - return this._addCheck({
19207 - kind: "time",
19208 - precision: null,
19209 - message: options,
19210 - });
19211 - }
19212 - return this._addCheck({
19213 - kind: "time",
19214 - precision: typeof options?.precision === "undefined" ? null : options?.precision,
19215 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(options?.message),
19216 - });
19217 - }
19218 - duration(message) {
19219 - return this._addCheck({ kind: "duration", ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message) });
19220 - }
19221 - regex(regex, message) {
19222 - return this._addCheck({
19223 - kind: "regex",
19224 - regex: regex,
19225 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message),
19226 - });
19227 - }
19228 - includes(value, options) {
19229 - return this._addCheck({
19230 - kind: "includes",
19231 - value: value,
19232 - position: options?.position,
19233 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(options?.message),
19234 - });
19235 - }
19236 - startsWith(value, message) {
19237 - return this._addCheck({
19238 - kind: "startsWith",
19239 - value: value,
19240 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message),
19241 - });
19242 - }
19243 - endsWith(value, message) {
19244 - return this._addCheck({
19245 - kind: "endsWith",
19246 - value: value,
19247 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message),
19248 - });
19249 - }
19250 - min(minLength, message) {
19251 - return this._addCheck({
19252 - kind: "min",
19253 - value: minLength,
19254 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message),
19255 - });
19256 - }
19257 - max(maxLength, message) {
19258 - return this._addCheck({
19259 - kind: "max",
19260 - value: maxLength,
19261 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message),
19262 - });
19263 - }
19264 - length(len, message) {
19265 - return this._addCheck({
19266 - kind: "length",
19267 - value: len,
19268 - ..._helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message),
19269 - });
19270 - }
19271 - /**
19272 - * Equivalent to `.min(1)`
19273 - */
19274 - nonempty(message) {
19275 - return this.min(1, _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message));
19276 - }
19277 - trim() {
19278 - return new ZodString({
19279 - ...this._def,
19280 - checks: [...this._def.checks, { kind: "trim" }],
19281 - });
19282 - }
19283 - toLowerCase() {
19284 - return new ZodString({
19285 - ...this._def,
19286 - checks: [...this._def.checks, { kind: "toLowerCase" }],
19287 - });
19288 - }
19289 - toUpperCase() {
19290 - return new ZodString({
19291 - ...this._def,
19292 - checks: [...this._def.checks, { kind: "toUpperCase" }],
19293 - });
19294 - }
19295 - get isDatetime() {
19296 - return !!this._def.checks.find((ch) => ch.kind === "datetime");
19297 - }
19298 - get isDate() {
19299 - return !!this._def.checks.find((ch) => ch.kind === "date");
19300 - }
19301 - get isTime() {
19302 - return !!this._def.checks.find((ch) => ch.kind === "time");
19303 - }
19304 - get isDuration() {
19305 - return !!this._def.checks.find((ch) => ch.kind === "duration");
19306 - }
19307 - get isEmail() {
19308 - return !!this._def.checks.find((ch) => ch.kind === "email");
19309 - }
19310 - get isURL() {
19311 - return !!this._def.checks.find((ch) => ch.kind === "url");
19312 - }
19313 - get isEmoji() {
19314 - return !!this._def.checks.find((ch) => ch.kind === "emoji");
19315 - }
19316 - get isUUID() {
19317 - return !!this._def.checks.find((ch) => ch.kind === "uuid");
19318 - }
19319 - get isNANOID() {
19320 - return !!this._def.checks.find((ch) => ch.kind === "nanoid");
19321 - }
19322 - get isCUID() {
19323 - return !!this._def.checks.find((ch) => ch.kind === "cuid");
19324 - }
19325 - get isCUID2() {
19326 - return !!this._def.checks.find((ch) => ch.kind === "cuid2");
19327 - }
19328 - get isULID() {
19329 - return !!this._def.checks.find((ch) => ch.kind === "ulid");
19330 - }
19331 - get isIP() {
19332 - return !!this._def.checks.find((ch) => ch.kind === "ip");
19333 - }
19334 - get isCIDR() {
19335 - return !!this._def.checks.find((ch) => ch.kind === "cidr");
19336 - }
19337 - get isBase64() {
19338 - return !!this._def.checks.find((ch) => ch.kind === "base64");
19339 - }
19340 - get isBase64url() {
19341 - // base64url encoding is a modification of base64 that can safely be used in URLs and filenames
19342 - return !!this._def.checks.find((ch) => ch.kind === "base64url");
19343 - }
19344 - get minLength() {
19345 - let min = null;
19346 - for (const ch of this._def.checks) {
19347 - if (ch.kind === "min") {
19348 - if (min === null || ch.value > min)
19349 - min = ch.value;
19350 - }
19351 - }
19352 - return min;
19353 - }
19354 - get maxLength() {
19355 - let max = null;
19356 - for (const ch of this._def.checks) {
19357 - if (ch.kind === "max") {
19358 - if (max === null || ch.value < max)
19359 - max = ch.value;
19360 - }
19361 - }
19362 - return max;
19363 - }
19364 -}
19365 -ZodString.create = (params) => {
19366 - return new ZodString({
19367 - checks: [],
19368 - typeName: ZodFirstPartyTypeKind.ZodString,
19369 - coerce: params?.coerce ?? false,
19370 - ...processCreateParams(params),
19371 - });
19372 -};
19373 -// https://stackoverflow.com/questions/3966484/why-does-modulus-operator-return-fractional-number-in-javascript/31711034#31711034
19374 -function floatSafeRemainder(val, step) {
19375 - const valDecCount = (val.toString().split(".")[1] || "").length;
19376 - const stepDecCount = (step.toString().split(".")[1] || "").length;
19377 - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
19378 - const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
19379 - const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
19380 - return (valInt % stepInt) / 10 ** decCount;
19381 -}
19382 -class ZodNumber extends ZodType {
19383 - constructor() {
19384 - super(...arguments);
19385 - this.min = this.gte;
19386 - this.max = this.lte;
19387 - this.step = this.multipleOf;
19388 - }
19389 - _parse(input) {
19390 - if (this._def.coerce) {
19391 - input.data = Number(input.data);
19392 - }
19393 - const parsedType = this._getType(input);
19394 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.number) {
19395 - const ctx = this._getOrReturnCtx(input);
19396 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19397 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
19398 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.number,
19399 - received: ctx.parsedType,
19400 - });
19401 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
19402 - }
19403 - let ctx = undefined;
19404 - const status = new _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus();
19405 - for (const check of this._def.checks) {
19406 - if (check.kind === "int") {
19407 - if (!_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.isInteger(input.data)) {
19408 - ctx = this._getOrReturnCtx(input, ctx);
19409 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19410 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
19411 - expected: "integer",
19412 - received: "float",
19413 - message: check.message,
19414 - });
19415 - status.dirty();
19416 - }
19417 - }
19418 - else if (check.kind === "min") {
19419 - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
19420 - if (tooSmall) {
19421 - ctx = this._getOrReturnCtx(input, ctx);
19422 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19423 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small,
19424 - minimum: check.value,
19425 - type: "number",
19426 - inclusive: check.inclusive,
19427 - exact: false,
19428 - message: check.message,
19429 - });
19430 - status.dirty();
19431 - }
19432 - }
19433 - else if (check.kind === "max") {
19434 - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
19435 - if (tooBig) {
19436 - ctx = this._getOrReturnCtx(input, ctx);
19437 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19438 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big,
19439 - maximum: check.value,
19440 - type: "number",
19441 - inclusive: check.inclusive,
19442 - exact: false,
19443 - message: check.message,
19444 - });
19445 - status.dirty();
19446 - }
19447 - }
19448 - else if (check.kind === "multipleOf") {
19449 - if (floatSafeRemainder(input.data, check.value) !== 0) {
19450 - ctx = this._getOrReturnCtx(input, ctx);
19451 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19452 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.not_multiple_of,
19453 - multipleOf: check.value,
19454 - message: check.message,
19455 - });
19456 - status.dirty();
19457 - }
19458 - }
19459 - else if (check.kind === "finite") {
19460 - if (!Number.isFinite(input.data)) {
19461 - ctx = this._getOrReturnCtx(input, ctx);
19462 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19463 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.not_finite,
19464 - message: check.message,
19465 - });
19466 - status.dirty();
19467 - }
19468 - }
19469 - else {
19470 - _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.assertNever(check);
19471 - }
19472 - }
19473 - return { status: status.value, value: input.data };
19474 - }
19475 - gte(value, message) {
19476 - return this.setLimit("min", value, true, _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message));
19477 - }
19478 - gt(value, message) {
19479 - return this.setLimit("min", value, false, _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message));
19480 - }
19481 - lte(value, message) {
19482 - return this.setLimit("max", value, true, _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message));
19483 - }
19484 - lt(value, message) {
19485 - return this.setLimit("max", value, false, _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message));
19486 - }
19487 - setLimit(kind, value, inclusive, message) {
19488 - return new ZodNumber({
19489 - ...this._def,
19490 - checks: [
19491 - ...this._def.checks,
19492 - {
19493 - kind,
19494 - value,
19495 - inclusive,
19496 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19497 - },
19498 - ],
19499 - });
19500 - }
19501 - _addCheck(check) {
19502 - return new ZodNumber({
19503 - ...this._def,
19504 - checks: [...this._def.checks, check],
19505 - });
19506 - }
19507 - int(message) {
19508 - return this._addCheck({
19509 - kind: "int",
19510 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19511 - });
19512 - }
19513 - positive(message) {
19514 - return this._addCheck({
19515 - kind: "min",
19516 - value: 0,
19517 - inclusive: false,
19518 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19519 - });
19520 - }
19521 - negative(message) {
19522 - return this._addCheck({
19523 - kind: "max",
19524 - value: 0,
19525 - inclusive: false,
19526 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19527 - });
19528 - }
19529 - nonpositive(message) {
19530 - return this._addCheck({
19531 - kind: "max",
19532 - value: 0,
19533 - inclusive: true,
19534 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19535 - });
19536 - }
19537 - nonnegative(message) {
19538 - return this._addCheck({
19539 - kind: "min",
19540 - value: 0,
19541 - inclusive: true,
19542 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19543 - });
19544 - }
19545 - multipleOf(value, message) {
19546 - return this._addCheck({
19547 - kind: "multipleOf",
19548 - value: value,
19549 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19550 - });
19551 - }
19552 - finite(message) {
19553 - return this._addCheck({
19554 - kind: "finite",
19555 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19556 - });
19557 - }
19558 - safe(message) {
19559 - return this._addCheck({
19560 - kind: "min",
19561 - inclusive: true,
19562 - value: Number.MIN_SAFE_INTEGER,
19563 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19564 - })._addCheck({
19565 - kind: "max",
19566 - inclusive: true,
19567 - value: Number.MAX_SAFE_INTEGER,
19568 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19569 - });
19570 - }
19571 - get minValue() {
19572 - let min = null;
19573 - for (const ch of this._def.checks) {
19574 - if (ch.kind === "min") {
19575 - if (min === null || ch.value > min)
19576 - min = ch.value;
19577 - }
19578 - }
19579 - return min;
19580 - }
19581 - get maxValue() {
19582 - let max = null;
19583 - for (const ch of this._def.checks) {
19584 - if (ch.kind === "max") {
19585 - if (max === null || ch.value < max)
19586 - max = ch.value;
19587 - }
19588 - }
19589 - return max;
19590 - }
19591 - get isInt() {
19592 - return !!this._def.checks.find((ch) => ch.kind === "int" || (ch.kind === "multipleOf" && _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.isInteger(ch.value)));
19593 - }
19594 - get isFinite() {
19595 - let max = null;
19596 - let min = null;
19597 - for (const ch of this._def.checks) {
19598 - if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
19599 - return true;
19600 - }
19601 - else if (ch.kind === "min") {
19602 - if (min === null || ch.value > min)
19603 - min = ch.value;
19604 - }
19605 - else if (ch.kind === "max") {
19606 - if (max === null || ch.value < max)
19607 - max = ch.value;
19608 - }
19609 - }
19610 - return Number.isFinite(min) && Number.isFinite(max);
19611 - }
19612 -}
19613 -ZodNumber.create = (params) => {
19614 - return new ZodNumber({
19615 - checks: [],
19616 - typeName: ZodFirstPartyTypeKind.ZodNumber,
19617 - coerce: params?.coerce || false,
19618 - ...processCreateParams(params),
19619 - });
19620 -};
19621 -class ZodBigInt extends ZodType {
19622 - constructor() {
19623 - super(...arguments);
19624 - this.min = this.gte;
19625 - this.max = this.lte;
19626 - }
19627 - _parse(input) {
19628 - if (this._def.coerce) {
19629 - try {
19630 - input.data = BigInt(input.data);
19631 - }
19632 - catch {
19633 - return this._getInvalidInput(input);
19634 - }
19635 - }
19636 - const parsedType = this._getType(input);
19637 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.bigint) {
19638 - return this._getInvalidInput(input);
19639 - }
19640 - let ctx = undefined;
19641 - const status = new _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus();
19642 - for (const check of this._def.checks) {
19643 - if (check.kind === "min") {
19644 - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
19645 - if (tooSmall) {
19646 - ctx = this._getOrReturnCtx(input, ctx);
19647 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19648 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small,
19649 - type: "bigint",
19650 - minimum: check.value,
19651 - inclusive: check.inclusive,
19652 - message: check.message,
19653 - });
19654 - status.dirty();
19655 - }
19656 - }
19657 - else if (check.kind === "max") {
19658 - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
19659 - if (tooBig) {
19660 - ctx = this._getOrReturnCtx(input, ctx);
19661 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19662 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big,
19663 - type: "bigint",
19664 - maximum: check.value,
19665 - inclusive: check.inclusive,
19666 - message: check.message,
19667 - });
19668 - status.dirty();
19669 - }
19670 - }
19671 - else if (check.kind === "multipleOf") {
19672 - if (input.data % check.value !== BigInt(0)) {
19673 - ctx = this._getOrReturnCtx(input, ctx);
19674 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19675 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.not_multiple_of,
19676 - multipleOf: check.value,
19677 - message: check.message,
19678 - });
19679 - status.dirty();
19680 - }
19681 - }
19682 - else {
19683 - _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.assertNever(check);
19684 - }
19685 - }
19686 - return { status: status.value, value: input.data };
19687 - }
19688 - _getInvalidInput(input) {
19689 - const ctx = this._getOrReturnCtx(input);
19690 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19691 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
19692 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.bigint,
19693 - received: ctx.parsedType,
19694 - });
19695 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
19696 - }
19697 - gte(value, message) {
19698 - return this.setLimit("min", value, true, _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message));
19699 - }
19700 - gt(value, message) {
19701 - return this.setLimit("min", value, false, _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message));
19702 - }
19703 - lte(value, message) {
19704 - return this.setLimit("max", value, true, _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message));
19705 - }
19706 - lt(value, message) {
19707 - return this.setLimit("max", value, false, _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message));
19708 - }
19709 - setLimit(kind, value, inclusive, message) {
19710 - return new ZodBigInt({
19711 - ...this._def,
19712 - checks: [
19713 - ...this._def.checks,
19714 - {
19715 - kind,
19716 - value,
19717 - inclusive,
19718 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19719 - },
19720 - ],
19721 - });
19722 - }
19723 - _addCheck(check) {
19724 - return new ZodBigInt({
19725 - ...this._def,
19726 - checks: [...this._def.checks, check],
19727 - });
19728 - }
19729 - positive(message) {
19730 - return this._addCheck({
19731 - kind: "min",
19732 - value: BigInt(0),
19733 - inclusive: false,
19734 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19735 - });
19736 - }
19737 - negative(message) {
19738 - return this._addCheck({
19739 - kind: "max",
19740 - value: BigInt(0),
19741 - inclusive: false,
19742 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19743 - });
19744 - }
19745 - nonpositive(message) {
19746 - return this._addCheck({
19747 - kind: "max",
19748 - value: BigInt(0),
19749 - inclusive: true,
19750 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19751 - });
19752 - }
19753 - nonnegative(message) {
19754 - return this._addCheck({
19755 - kind: "min",
19756 - value: BigInt(0),
19757 - inclusive: true,
19758 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19759 - });
19760 - }
19761 - multipleOf(value, message) {
19762 - return this._addCheck({
19763 - kind: "multipleOf",
19764 - value,
19765 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19766 - });
19767 - }
19768 - get minValue() {
19769 - let min = null;
19770 - for (const ch of this._def.checks) {
19771 - if (ch.kind === "min") {
19772 - if (min === null || ch.value > min)
19773 - min = ch.value;
19774 - }
19775 - }
19776 - return min;
19777 - }
19778 - get maxValue() {
19779 - let max = null;
19780 - for (const ch of this._def.checks) {
19781 - if (ch.kind === "max") {
19782 - if (max === null || ch.value < max)
19783 - max = ch.value;
19784 - }
19785 - }
19786 - return max;
19787 - }
19788 -}
19789 -ZodBigInt.create = (params) => {
19790 - return new ZodBigInt({
19791 - checks: [],
19792 - typeName: ZodFirstPartyTypeKind.ZodBigInt,
19793 - coerce: params?.coerce ?? false,
19794 - ...processCreateParams(params),
19795 - });
19796 -};
19797 -class ZodBoolean extends ZodType {
19798 - _parse(input) {
19799 - if (this._def.coerce) {
19800 - input.data = Boolean(input.data);
19801 - }
19802 - const parsedType = this._getType(input);
19803 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.boolean) {
19804 - const ctx = this._getOrReturnCtx(input);
19805 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19806 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
19807 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.boolean,
19808 - received: ctx.parsedType,
19809 - });
19810 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
19811 - }
19812 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(input.data);
19813 - }
19814 -}
19815 -ZodBoolean.create = (params) => {
19816 - return new ZodBoolean({
19817 - typeName: ZodFirstPartyTypeKind.ZodBoolean,
19818 - coerce: params?.coerce || false,
19819 - ...processCreateParams(params),
19820 - });
19821 -};
19822 -class ZodDate extends ZodType {
19823 - _parse(input) {
19824 - if (this._def.coerce) {
19825 - input.data = new Date(input.data);
19826 - }
19827 - const parsedType = this._getType(input);
19828 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.date) {
19829 - const ctx = this._getOrReturnCtx(input);
19830 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19831 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
19832 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.date,
19833 - received: ctx.parsedType,
19834 - });
19835 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
19836 - }
19837 - if (Number.isNaN(input.data.getTime())) {
19838 - const ctx = this._getOrReturnCtx(input);
19839 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19840 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_date,
19841 - });
19842 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
19843 - }
19844 - const status = new _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus();
19845 - let ctx = undefined;
19846 - for (const check of this._def.checks) {
19847 - if (check.kind === "min") {
19848 - if (input.data.getTime() < check.value) {
19849 - ctx = this._getOrReturnCtx(input, ctx);
19850 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19851 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small,
19852 - message: check.message,
19853 - inclusive: true,
19854 - exact: false,
19855 - minimum: check.value,
19856 - type: "date",
19857 - });
19858 - status.dirty();
19859 - }
19860 - }
19861 - else if (check.kind === "max") {
19862 - if (input.data.getTime() > check.value) {
19863 - ctx = this._getOrReturnCtx(input, ctx);
19864 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19865 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big,
19866 - message: check.message,
19867 - inclusive: true,
19868 - exact: false,
19869 - maximum: check.value,
19870 - type: "date",
19871 - });
19872 - status.dirty();
19873 - }
19874 - }
19875 - else {
19876 - _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.assertNever(check);
19877 - }
19878 - }
19879 - return {
19880 - status: status.value,
19881 - value: new Date(input.data.getTime()),
19882 - };
19883 - }
19884 - _addCheck(check) {
19885 - return new ZodDate({
19886 - ...this._def,
19887 - checks: [...this._def.checks, check],
19888 - });
19889 - }
19890 - min(minDate, message) {
19891 - return this._addCheck({
19892 - kind: "min",
19893 - value: minDate.getTime(),
19894 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19895 - });
19896 - }
19897 - max(maxDate, message) {
19898 - return this._addCheck({
19899 - kind: "max",
19900 - value: maxDate.getTime(),
19901 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message),
19902 - });
19903 - }
19904 - get minDate() {
19905 - let min = null;
19906 - for (const ch of this._def.checks) {
19907 - if (ch.kind === "min") {
19908 - if (min === null || ch.value > min)
19909 - min = ch.value;
19910 - }
19911 - }
19912 - return min != null ? new Date(min) : null;
19913 - }
19914 - get maxDate() {
19915 - let max = null;
19916 - for (const ch of this._def.checks) {
19917 - if (ch.kind === "max") {
19918 - if (max === null || ch.value < max)
19919 - max = ch.value;
19920 - }
19921 - }
19922 - return max != null ? new Date(max) : null;
19923 - }
19924 -}
19925 -ZodDate.create = (params) => {
19926 - return new ZodDate({
19927 - checks: [],
19928 - coerce: params?.coerce || false,
19929 - typeName: ZodFirstPartyTypeKind.ZodDate,
19930 - ...processCreateParams(params),
19931 - });
19932 -};
19933 -class ZodSymbol extends ZodType {
19934 - _parse(input) {
19935 - const parsedType = this._getType(input);
19936 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.symbol) {
19937 - const ctx = this._getOrReturnCtx(input);
19938 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19939 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
19940 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.symbol,
19941 - received: ctx.parsedType,
19942 - });
19943 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
19944 - }
19945 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(input.data);
19946 - }
19947 -}
19948 -ZodSymbol.create = (params) => {
19949 - return new ZodSymbol({
19950 - typeName: ZodFirstPartyTypeKind.ZodSymbol,
19951 - ...processCreateParams(params),
19952 - });
19953 -};
19954 -class ZodUndefined extends ZodType {
19955 - _parse(input) {
19956 - const parsedType = this._getType(input);
19957 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.undefined) {
19958 - const ctx = this._getOrReturnCtx(input);
19959 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19960 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
19961 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.undefined,
19962 - received: ctx.parsedType,
19963 - });
19964 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
19965 - }
19966 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(input.data);
19967 - }
19968 -}
19969 -ZodUndefined.create = (params) => {
19970 - return new ZodUndefined({
19971 - typeName: ZodFirstPartyTypeKind.ZodUndefined,
19972 - ...processCreateParams(params),
19973 - });
19974 -};
19975 -class ZodNull extends ZodType {
19976 - _parse(input) {
19977 - const parsedType = this._getType(input);
19978 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.null) {
19979 - const ctx = this._getOrReturnCtx(input);
19980 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
19981 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
19982 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.null,
19983 - received: ctx.parsedType,
19984 - });
19985 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
19986 - }
19987 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(input.data);
19988 - }
19989 -}
19990 -ZodNull.create = (params) => {
19991 - return new ZodNull({
19992 - typeName: ZodFirstPartyTypeKind.ZodNull,
19993 - ...processCreateParams(params),
19994 - });
19995 -};
19996 -class ZodAny extends ZodType {
19997 - constructor() {
19998 - super(...arguments);
19999 - // to prevent instances of other classes from extending ZodAny. this causes issues with catchall in ZodObject.
20000 - this._any = true;
20001 - }
20002 - _parse(input) {
20003 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(input.data);
20004 - }
20005 -}
20006 -ZodAny.create = (params) => {
20007 - return new ZodAny({
20008 - typeName: ZodFirstPartyTypeKind.ZodAny,
20009 - ...processCreateParams(params),
20010 - });
20011 -};
20012 -class ZodUnknown extends ZodType {
20013 - constructor() {
20014 - super(...arguments);
20015 - // required
20016 - this._unknown = true;
20017 - }
20018 - _parse(input) {
20019 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(input.data);
20020 - }
20021 -}
20022 -ZodUnknown.create = (params) => {
20023 - return new ZodUnknown({
20024 - typeName: ZodFirstPartyTypeKind.ZodUnknown,
20025 - ...processCreateParams(params),
20026 - });
20027 -};
20028 -class ZodNever extends ZodType {
20029 - _parse(input) {
20030 - const ctx = this._getOrReturnCtx(input);
20031 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20032 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
20033 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.never,
20034 - received: ctx.parsedType,
20035 - });
20036 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20037 - }
20038 -}
20039 -ZodNever.create = (params) => {
20040 - return new ZodNever({
20041 - typeName: ZodFirstPartyTypeKind.ZodNever,
20042 - ...processCreateParams(params),
20043 - });
20044 -};
20045 -class ZodVoid extends ZodType {
20046 - _parse(input) {
20047 - const parsedType = this._getType(input);
20048 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.undefined) {
20049 - const ctx = this._getOrReturnCtx(input);
20050 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20051 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
20052 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.void,
20053 - received: ctx.parsedType,
20054 - });
20055 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20056 - }
20057 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(input.data);
20058 - }
20059 -}
20060 -ZodVoid.create = (params) => {
20061 - return new ZodVoid({
20062 - typeName: ZodFirstPartyTypeKind.ZodVoid,
20063 - ...processCreateParams(params),
20064 - });
20065 -};
20066 -class ZodArray extends ZodType {
20067 - _parse(input) {
20068 - const { ctx, status } = this._processInputParams(input);
20069 - const def = this._def;
20070 - if (ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.array) {
20071 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20072 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
20073 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.array,
20074 - received: ctx.parsedType,
20075 - });
20076 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20077 - }
20078 - if (def.exactLength !== null) {
20079 - const tooBig = ctx.data.length > def.exactLength.value;
20080 - const tooSmall = ctx.data.length < def.exactLength.value;
20081 - if (tooBig || tooSmall) {
20082 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20083 - code: tooBig ? _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big : _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small,
20084 - minimum: (tooSmall ? def.exactLength.value : undefined),
20085 - maximum: (tooBig ? def.exactLength.value : undefined),
20086 - type: "array",
20087 - inclusive: true,
20088 - exact: true,
20089 - message: def.exactLength.message,
20090 - });
20091 - status.dirty();
20092 - }
20093 - }
20094 - if (def.minLength !== null) {
20095 - if (ctx.data.length < def.minLength.value) {
20096 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20097 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small,
20098 - minimum: def.minLength.value,
20099 - type: "array",
20100 - inclusive: true,
20101 - exact: false,
20102 - message: def.minLength.message,
20103 - });
20104 - status.dirty();
20105 - }
20106 - }
20107 - if (def.maxLength !== null) {
20108 - if (ctx.data.length > def.maxLength.value) {
20109 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20110 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big,
20111 - maximum: def.maxLength.value,
20112 - type: "array",
20113 - inclusive: true,
20114 - exact: false,
20115 - message: def.maxLength.message,
20116 - });
20117 - status.dirty();
20118 - }
20119 - }
20120 - if (ctx.common.async) {
20121 - return Promise.all([...ctx.data].map((item, i) => {
20122 - return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
20123 - })).then((result) => {
20124 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus.mergeArray(status, result);
20125 - });
20126 - }
20127 - const result = [...ctx.data].map((item, i) => {
20128 - return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
20129 - });
20130 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus.mergeArray(status, result);
20131 - }
20132 - get element() {
20133 - return this._def.type;
20134 - }
20135 - min(minLength, message) {
20136 - return new ZodArray({
20137 - ...this._def,
20138 - minLength: { value: minLength, message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message) },
20139 - });
20140 - }
20141 - max(maxLength, message) {
20142 - return new ZodArray({
20143 - ...this._def,
20144 - maxLength: { value: maxLength, message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message) },
20145 - });
20146 - }
20147 - length(len, message) {
20148 - return new ZodArray({
20149 - ...this._def,
20150 - exactLength: { value: len, message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message) },
20151 - });
20152 - }
20153 - nonempty(message) {
20154 - return this.min(1, message);
20155 - }
20156 -}
20157 -ZodArray.create = (schema, params) => {
20158 - return new ZodArray({
20159 - type: schema,
20160 - minLength: null,
20161 - maxLength: null,
20162 - exactLength: null,
20163 - typeName: ZodFirstPartyTypeKind.ZodArray,
20164 - ...processCreateParams(params),
20165 - });
20166 -};
20167 -function deepPartialify(schema) {
20168 - if (schema instanceof ZodObject) {
20169 - const newShape = {};
20170 - for (const key in schema.shape) {
20171 - const fieldSchema = schema.shape[key];
20172 - newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
20173 - }
20174 - return new ZodObject({
20175 - ...schema._def,
20176 - shape: () => newShape,
20177 - });
20178 - }
20179 - else if (schema instanceof ZodArray) {
20180 - return new ZodArray({
20181 - ...schema._def,
20182 - type: deepPartialify(schema.element),
20183 - });
20184 - }
20185 - else if (schema instanceof ZodOptional) {
20186 - return ZodOptional.create(deepPartialify(schema.unwrap()));
20187 - }
20188 - else if (schema instanceof ZodNullable) {
20189 - return ZodNullable.create(deepPartialify(schema.unwrap()));
20190 - }
20191 - else if (schema instanceof ZodTuple) {
20192 - return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
20193 - }
20194 - else {
20195 - return schema;
20196 - }
20197 -}
20198 -class ZodObject extends ZodType {
20199 - constructor() {
20200 - super(...arguments);
20201 - this._cached = null;
20202 - /**
20203 - * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped.
20204 - * If you want to pass through unknown properties, use `.passthrough()` instead.
20205 - */
20206 - this.nonstrict = this.passthrough;
20207 - // extend<
20208 - // Augmentation extends ZodRawShape,
20209 - // NewOutput extends util.flatten<{
20210 - // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
20211 - // ? Augmentation[k]["_output"]
20212 - // : k extends keyof Output
20213 - // ? Output[k]
20214 - // : never;
20215 - // }>,
20216 - // NewInput extends util.flatten<{
20217 - // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
20218 - // ? Augmentation[k]["_input"]
20219 - // : k extends keyof Input
20220 - // ? Input[k]
20221 - // : never;
20222 - // }>
20223 - // >(
20224 - // augmentation: Augmentation
20225 - // ): ZodObject<
20226 - // extendShape<T, Augmentation>,
20227 - // UnknownKeys,
20228 - // Catchall,
20229 - // NewOutput,
20230 - // NewInput
20231 - // > {
20232 - // return new ZodObject({
20233 - // ...this._def,
20234 - // shape: () => ({
20235 - // ...this._def.shape(),
20236 - // ...augmentation,
20237 - // }),
20238 - // }) as any;
20239 - // }
20240 - /**
20241 - * @deprecated Use `.extend` instead
20242 - * */
20243 - this.augment = this.extend;
20244 - }
20245 - _getCached() {
20246 - if (this._cached !== null)
20247 - return this._cached;
20248 - const shape = this._def.shape();
20249 - const keys = _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectKeys(shape);
20250 - this._cached = { shape, keys };
20251 - return this._cached;
20252 - }
20253 - _parse(input) {
20254 - const parsedType = this._getType(input);
20255 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.object) {
20256 - const ctx = this._getOrReturnCtx(input);
20257 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20258 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
20259 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.object,
20260 - received: ctx.parsedType,
20261 - });
20262 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20263 - }
20264 - const { status, ctx } = this._processInputParams(input);
20265 - const { shape, keys: shapeKeys } = this._getCached();
20266 - const extraKeys = [];
20267 - if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
20268 - for (const key in ctx.data) {
20269 - if (!shapeKeys.includes(key)) {
20270 - extraKeys.push(key);
20271 - }
20272 - }
20273 - }
20274 - const pairs = [];
20275 - for (const key of shapeKeys) {
20276 - const keyValidator = shape[key];
20277 - const value = ctx.data[key];
20278 - pairs.push({
20279 - key: { status: "valid", value: key },
20280 - value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
20281 - alwaysSet: key in ctx.data,
20282 - });
20283 - }
20284 - if (this._def.catchall instanceof ZodNever) {
20285 - const unknownKeys = this._def.unknownKeys;
20286 - if (unknownKeys === "passthrough") {
20287 - for (const key of extraKeys) {
20288 - pairs.push({
20289 - key: { status: "valid", value: key },
20290 - value: { status: "valid", value: ctx.data[key] },
20291 - });
20292 - }
20293 - }
20294 - else if (unknownKeys === "strict") {
20295 - if (extraKeys.length > 0) {
20296 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20297 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.unrecognized_keys,
20298 - keys: extraKeys,
20299 - });
20300 - status.dirty();
20301 - }
20302 - }
20303 - else if (unknownKeys === "strip") {
20304 - }
20305 - else {
20306 - throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
20307 - }
20308 - }
20309 - else {
20310 - // run catchall validation
20311 - const catchall = this._def.catchall;
20312 - for (const key of extraKeys) {
20313 - const value = ctx.data[key];
20314 - pairs.push({
20315 - key: { status: "valid", value: key },
20316 - value: catchall._parse(new ParseInputLazyPath(ctx, value, ctx.path, key) //, ctx.child(key), value, getParsedType(value)
20317 - ),
20318 - alwaysSet: key in ctx.data,
20319 - });
20320 - }
20321 - }
20322 - if (ctx.common.async) {
20323 - return Promise.resolve()
20324 - .then(async () => {
20325 - const syncPairs = [];
20326 - for (const pair of pairs) {
20327 - const key = await pair.key;
20328 - const value = await pair.value;
20329 - syncPairs.push({
20330 - key,
20331 - value,
20332 - alwaysSet: pair.alwaysSet,
20333 - });
20334 - }
20335 - return syncPairs;
20336 - })
20337 - .then((syncPairs) => {
20338 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus.mergeObjectSync(status, syncPairs);
20339 - });
20340 - }
20341 - else {
20342 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus.mergeObjectSync(status, pairs);
20343 - }
20344 - }
20345 - get shape() {
20346 - return this._def.shape();
20347 - }
20348 - strict(message) {
20349 - _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj;
20350 - return new ZodObject({
20351 - ...this._def,
20352 - unknownKeys: "strict",
20353 - ...(message !== undefined
20354 - ? {
20355 - errorMap: (issue, ctx) => {
20356 - const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
20357 - if (issue.code === "unrecognized_keys")
20358 - return {
20359 - message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.errToObj(message).message ?? defaultError,
20360 - };
20361 - return {
20362 - message: defaultError,
20363 - };
20364 - },
20365 - }
20366 - : {}),
20367 - });
20368 - }
20369 - strip() {
20370 - return new ZodObject({
20371 - ...this._def,
20372 - unknownKeys: "strip",
20373 - });
20374 - }
20375 - passthrough() {
20376 - return new ZodObject({
20377 - ...this._def,
20378 - unknownKeys: "passthrough",
20379 - });
20380 - }
20381 - // const AugmentFactory =
20382 - // <Def extends ZodObjectDef>(def: Def) =>
20383 - // <Augmentation extends ZodRawShape>(
20384 - // augmentation: Augmentation
20385 - // ): ZodObject<
20386 - // extendShape<ReturnType<Def["shape"]>, Augmentation>,
20387 - // Def["unknownKeys"],
20388 - // Def["catchall"]
20389 - // > => {
20390 - // return new ZodObject({
20391 - // ...def,
20392 - // shape: () => ({
20393 - // ...def.shape(),
20394 - // ...augmentation,
20395 - // }),
20396 - // }) as any;
20397 - // };
20398 - extend(augmentation) {
20399 - return new ZodObject({
20400 - ...this._def,
20401 - shape: () => ({
20402 - ...this._def.shape(),
20403 - ...augmentation,
20404 - }),
20405 - });
20406 - }
20407 - /**
20408 - * Prior to [email protected] there was a bug in the
20409 - * inferred type of merged objects. Please
20410 - * upgrade if you are experiencing issues.
20411 - */
20412 - merge(merging) {
20413 - const merged = new ZodObject({
20414 - unknownKeys: merging._def.unknownKeys,
20415 - catchall: merging._def.catchall,
20416 - shape: () => ({
20417 - ...this._def.shape(),
20418 - ...merging._def.shape(),
20419 - }),
20420 - typeName: ZodFirstPartyTypeKind.ZodObject,
20421 - });
20422 - return merged;
20423 - }
20424 - // merge<
20425 - // Incoming extends AnyZodObject,
20426 - // Augmentation extends Incoming["shape"],
20427 - // NewOutput extends {
20428 - // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
20429 - // ? Augmentation[k]["_output"]
20430 - // : k extends keyof Output
20431 - // ? Output[k]
20432 - // : never;
20433 - // },
20434 - // NewInput extends {
20435 - // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
20436 - // ? Augmentation[k]["_input"]
20437 - // : k extends keyof Input
20438 - // ? Input[k]
20439 - // : never;
20440 - // }
20441 - // >(
20442 - // merging: Incoming
20443 - // ): ZodObject<
20444 - // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
20445 - // Incoming["_def"]["unknownKeys"],
20446 - // Incoming["_def"]["catchall"],
20447 - // NewOutput,
20448 - // NewInput
20449 - // > {
20450 - // const merged: any = new ZodObject({
20451 - // unknownKeys: merging._def.unknownKeys,
20452 - // catchall: merging._def.catchall,
20453 - // shape: () =>
20454 - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
20455 - // typeName: ZodFirstPartyTypeKind.ZodObject,
20456 - // }) as any;
20457 - // return merged;
20458 - // }
20459 - setKey(key, schema) {
20460 - return this.augment({ [key]: schema });
20461 - }
20462 - // merge<Incoming extends AnyZodObject>(
20463 - // merging: Incoming
20464 - // ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
20465 - // ZodObject<
20466 - // extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
20467 - // Incoming["_def"]["unknownKeys"],
20468 - // Incoming["_def"]["catchall"]
20469 - // > {
20470 - // // const mergedShape = objectUtil.mergeShapes(
20471 - // // this._def.shape(),
20472 - // // merging._def.shape()
20473 - // // );
20474 - // const merged: any = new ZodObject({
20475 - // unknownKeys: merging._def.unknownKeys,
20476 - // catchall: merging._def.catchall,
20477 - // shape: () =>
20478 - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
20479 - // typeName: ZodFirstPartyTypeKind.ZodObject,
20480 - // }) as any;
20481 - // return merged;
20482 - // }
20483 - catchall(index) {
20484 - return new ZodObject({
20485 - ...this._def,
20486 - catchall: index,
20487 - });
20488 - }
20489 - pick(mask) {
20490 - const shape = {};
20491 - for (const key of _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectKeys(mask)) {
20492 - if (mask[key] && this.shape[key]) {
20493 - shape[key] = this.shape[key];
20494 - }
20495 - }
20496 - return new ZodObject({
20497 - ...this._def,
20498 - shape: () => shape,
20499 - });
20500 - }
20501 - omit(mask) {
20502 - const shape = {};
20503 - for (const key of _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectKeys(this.shape)) {
20504 - if (!mask[key]) {
20505 - shape[key] = this.shape[key];
20506 - }
20507 - }
20508 - return new ZodObject({
20509 - ...this._def,
20510 - shape: () => shape,
20511 - });
20512 - }
20513 - /**
20514 - * @deprecated
20515 - */
20516 - deepPartial() {
20517 - return deepPartialify(this);
20518 - }
20519 - partial(mask) {
20520 - const newShape = {};
20521 - for (const key of _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectKeys(this.shape)) {
20522 - const fieldSchema = this.shape[key];
20523 - if (mask && !mask[key]) {
20524 - newShape[key] = fieldSchema;
20525 - }
20526 - else {
20527 - newShape[key] = fieldSchema.optional();
20528 - }
20529 - }
20530 - return new ZodObject({
20531 - ...this._def,
20532 - shape: () => newShape,
20533 - });
20534 - }
20535 - required(mask) {
20536 - const newShape = {};
20537 - for (const key of _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectKeys(this.shape)) {
20538 - if (mask && !mask[key]) {
20539 - newShape[key] = this.shape[key];
20540 - }
20541 - else {
20542 - const fieldSchema = this.shape[key];
20543 - let newField = fieldSchema;
20544 - while (newField instanceof ZodOptional) {
20545 - newField = newField._def.innerType;
20546 - }
20547 - newShape[key] = newField;
20548 - }
20549 - }
20550 - return new ZodObject({
20551 - ...this._def,
20552 - shape: () => newShape,
20553 - });
20554 - }
20555 - keyof() {
20556 - return createZodEnum(_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectKeys(this.shape));
20557 - }
20558 -}
20559 -ZodObject.create = (shape, params) => {
20560 - return new ZodObject({
20561 - shape: () => shape,
20562 - unknownKeys: "strip",
20563 - catchall: ZodNever.create(),
20564 - typeName: ZodFirstPartyTypeKind.ZodObject,
20565 - ...processCreateParams(params),
20566 - });
20567 -};
20568 -ZodObject.strictCreate = (shape, params) => {
20569 - return new ZodObject({
20570 - shape: () => shape,
20571 - unknownKeys: "strict",
20572 - catchall: ZodNever.create(),
20573 - typeName: ZodFirstPartyTypeKind.ZodObject,
20574 - ...processCreateParams(params),
20575 - });
20576 -};
20577 -ZodObject.lazycreate = (shape, params) => {
20578 - return new ZodObject({
20579 - shape,
20580 - unknownKeys: "strip",
20581 - catchall: ZodNever.create(),
20582 - typeName: ZodFirstPartyTypeKind.ZodObject,
20583 - ...processCreateParams(params),
20584 - });
20585 -};
20586 -class ZodUnion extends ZodType {
20587 - _parse(input) {
20588 - const { ctx } = this._processInputParams(input);
20589 - const options = this._def.options;
20590 - function handleResults(results) {
20591 - // return first issue-free validation if it exists
20592 - for (const result of results) {
20593 - if (result.result.status === "valid") {
20594 - return result.result;
20595 - }
20596 - }
20597 - for (const result of results) {
20598 - if (result.result.status === "dirty") {
20599 - // add issues from dirty option
20600 - ctx.common.issues.push(...result.ctx.common.issues);
20601 - return result.result;
20602 - }
20603 - }
20604 - // return invalid
20605 - const unionErrors = results.map((result) => new _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodError(result.ctx.common.issues));
20606 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20607 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_union,
20608 - unionErrors,
20609 - });
20610 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20611 - }
20612 - if (ctx.common.async) {
20613 - return Promise.all(options.map(async (option) => {
20614 - const childCtx = {
20615 - ...ctx,
20616 - common: {
20617 - ...ctx.common,
20618 - issues: [],
20619 - },
20620 - parent: null,
20621 - };
20622 - return {
20623 - result: await option._parseAsync({
20624 - data: ctx.data,
20625 - path: ctx.path,
20626 - parent: childCtx,
20627 - }),
20628 - ctx: childCtx,
20629 - };
20630 - })).then(handleResults);
20631 - }
20632 - else {
20633 - let dirty = undefined;
20634 - const issues = [];
20635 - for (const option of options) {
20636 - const childCtx = {
20637 - ...ctx,
20638 - common: {
20639 - ...ctx.common,
20640 - issues: [],
20641 - },
20642 - parent: null,
20643 - };
20644 - const result = option._parseSync({
20645 - data: ctx.data,
20646 - path: ctx.path,
20647 - parent: childCtx,
20648 - });
20649 - if (result.status === "valid") {
20650 - return result;
20651 - }
20652 - else if (result.status === "dirty" && !dirty) {
20653 - dirty = { result, ctx: childCtx };
20654 - }
20655 - if (childCtx.common.issues.length) {
20656 - issues.push(childCtx.common.issues);
20657 - }
20658 - }
20659 - if (dirty) {
20660 - ctx.common.issues.push(...dirty.ctx.common.issues);
20661 - return dirty.result;
20662 - }
20663 - const unionErrors = issues.map((issues) => new _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodError(issues));
20664 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20665 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_union,
20666 - unionErrors,
20667 - });
20668 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20669 - }
20670 - }
20671 - get options() {
20672 - return this._def.options;
20673 - }
20674 -}
20675 -ZodUnion.create = (types, params) => {
20676 - return new ZodUnion({
20677 - options: types,
20678 - typeName: ZodFirstPartyTypeKind.ZodUnion,
20679 - ...processCreateParams(params),
20680 - });
20681 -};
20682 -/////////////////////////////////////////////////////
20683 -/////////////////////////////////////////////////////
20684 -////////// //////////
20685 -////////// ZodDiscriminatedUnion //////////
20686 -////////// //////////
20687 -/////////////////////////////////////////////////////
20688 -/////////////////////////////////////////////////////
20689 -const getDiscriminator = (type) => {
20690 - if (type instanceof ZodLazy) {
20691 - return getDiscriminator(type.schema);
20692 - }
20693 - else if (type instanceof ZodEffects) {
20694 - return getDiscriminator(type.innerType());
20695 - }
20696 - else if (type instanceof ZodLiteral) {
20697 - return [type.value];
20698 - }
20699 - else if (type instanceof ZodEnum) {
20700 - return type.options;
20701 - }
20702 - else if (type instanceof ZodNativeEnum) {
20703 - // eslint-disable-next-line ban/ban
20704 - return _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectValues(type.enum);
20705 - }
20706 - else if (type instanceof ZodDefault) {
20707 - return getDiscriminator(type._def.innerType);
20708 - }
20709 - else if (type instanceof ZodUndefined) {
20710 - return [undefined];
20711 - }
20712 - else if (type instanceof ZodNull) {
20713 - return [null];
20714 - }
20715 - else if (type instanceof ZodOptional) {
20716 - return [undefined, ...getDiscriminator(type.unwrap())];
20717 - }
20718 - else if (type instanceof ZodNullable) {
20719 - return [null, ...getDiscriminator(type.unwrap())];
20720 - }
20721 - else if (type instanceof ZodBranded) {
20722 - return getDiscriminator(type.unwrap());
20723 - }
20724 - else if (type instanceof ZodReadonly) {
20725 - return getDiscriminator(type.unwrap());
20726 - }
20727 - else if (type instanceof ZodCatch) {
20728 - return getDiscriminator(type._def.innerType);
20729 - }
20730 - else {
20731 - return [];
20732 - }
20733 -};
20734 -class ZodDiscriminatedUnion extends ZodType {
20735 - _parse(input) {
20736 - const { ctx } = this._processInputParams(input);
20737 - if (ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.object) {
20738 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20739 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
20740 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.object,
20741 - received: ctx.parsedType,
20742 - });
20743 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20744 - }
20745 - const discriminator = this.discriminator;
20746 - const discriminatorValue = ctx.data[discriminator];
20747 - const option = this.optionsMap.get(discriminatorValue);
20748 - if (!option) {
20749 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20750 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_union_discriminator,
20751 - options: Array.from(this.optionsMap.keys()),
20752 - path: [discriminator],
20753 - });
20754 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20755 - }
20756 - if (ctx.common.async) {
20757 - return option._parseAsync({
20758 - data: ctx.data,
20759 - path: ctx.path,
20760 - parent: ctx,
20761 - });
20762 - }
20763 - else {
20764 - return option._parseSync({
20765 - data: ctx.data,
20766 - path: ctx.path,
20767 - parent: ctx,
20768 - });
20769 - }
20770 - }
20771 - get discriminator() {
20772 - return this._def.discriminator;
20773 - }
20774 - get options() {
20775 - return this._def.options;
20776 - }
20777 - get optionsMap() {
20778 - return this._def.optionsMap;
20779 - }
20780 - /**
20781 - * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.
20782 - * However, it only allows a union of objects, all of which need to share a discriminator property. This property must
20783 - * have a different value for each object in the union.
20784 - * @param discriminator the name of the discriminator property
20785 - * @param types an array of object schemas
20786 - * @param params
20787 - */
20788 - static create(discriminator, options, params) {
20789 - // Get all the valid discriminator values
20790 - const optionsMap = new Map();
20791 - // try {
20792 - for (const type of options) {
20793 - const discriminatorValues = getDiscriminator(type.shape[discriminator]);
20794 - if (!discriminatorValues.length) {
20795 - throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`);
20796 - }
20797 - for (const value of discriminatorValues) {
20798 - if (optionsMap.has(value)) {
20799 - throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);
20800 - }
20801 - optionsMap.set(value, type);
20802 - }
20803 - }
20804 - return new ZodDiscriminatedUnion({
20805 - typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
20806 - discriminator,
20807 - options,
20808 - optionsMap,
20809 - ...processCreateParams(params),
20810 - });
20811 - }
20812 -}
20813 -function mergeValues(a, b) {
20814 - const aType = (0,_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.getParsedType)(a);
20815 - const bType = (0,_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.getParsedType)(b);
20816 - if (a === b) {
20817 - return { valid: true, data: a };
20818 - }
20819 - else if (aType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.object && bType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.object) {
20820 - const bKeys = _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectKeys(b);
20821 - const sharedKeys = _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
20822 - const newObj = { ...a, ...b };
20823 - for (const key of sharedKeys) {
20824 - const sharedValue = mergeValues(a[key], b[key]);
20825 - if (!sharedValue.valid) {
20826 - return { valid: false };
20827 - }
20828 - newObj[key] = sharedValue.data;
20829 - }
20830 - return { valid: true, data: newObj };
20831 - }
20832 - else if (aType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.array && bType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.array) {
20833 - if (a.length !== b.length) {
20834 - return { valid: false };
20835 - }
20836 - const newArray = [];
20837 - for (let index = 0; index < a.length; index++) {
20838 - const itemA = a[index];
20839 - const itemB = b[index];
20840 - const sharedValue = mergeValues(itemA, itemB);
20841 - if (!sharedValue.valid) {
20842 - return { valid: false };
20843 - }
20844 - newArray.push(sharedValue.data);
20845 - }
20846 - return { valid: true, data: newArray };
20847 - }
20848 - else if (aType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.date && bType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.date && +a === +b) {
20849 - return { valid: true, data: a };
20850 - }
20851 - else {
20852 - return { valid: false };
20853 - }
20854 -}
20855 -class ZodIntersection extends ZodType {
20856 - _parse(input) {
20857 - const { status, ctx } = this._processInputParams(input);
20858 - const handleParsed = (parsedLeft, parsedRight) => {
20859 - if ((0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isAborted)(parsedLeft) || (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isAborted)(parsedRight)) {
20860 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20861 - }
20862 - const merged = mergeValues(parsedLeft.value, parsedRight.value);
20863 - if (!merged.valid) {
20864 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20865 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_intersection_types,
20866 - });
20867 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20868 - }
20869 - if ((0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isDirty)(parsedLeft) || (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isDirty)(parsedRight)) {
20870 - status.dirty();
20871 - }
20872 - return { status: status.value, value: merged.data };
20873 - };
20874 - if (ctx.common.async) {
20875 - return Promise.all([
20876 - this._def.left._parseAsync({
20877 - data: ctx.data,
20878 - path: ctx.path,
20879 - parent: ctx,
20880 - }),
20881 - this._def.right._parseAsync({
20882 - data: ctx.data,
20883 - path: ctx.path,
20884 - parent: ctx,
20885 - }),
20886 - ]).then(([left, right]) => handleParsed(left, right));
20887 - }
20888 - else {
20889 - return handleParsed(this._def.left._parseSync({
20890 - data: ctx.data,
20891 - path: ctx.path,
20892 - parent: ctx,
20893 - }), this._def.right._parseSync({
20894 - data: ctx.data,
20895 - path: ctx.path,
20896 - parent: ctx,
20897 - }));
20898 - }
20899 - }
20900 -}
20901 -ZodIntersection.create = (left, right, params) => {
20902 - return new ZodIntersection({
20903 - left: left,
20904 - right: right,
20905 - typeName: ZodFirstPartyTypeKind.ZodIntersection,
20906 - ...processCreateParams(params),
20907 - });
20908 -};
20909 -// type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]];
20910 -class ZodTuple extends ZodType {
20911 - _parse(input) {
20912 - const { status, ctx } = this._processInputParams(input);
20913 - if (ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.array) {
20914 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20915 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
20916 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.array,
20917 - received: ctx.parsedType,
20918 - });
20919 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20920 - }
20921 - if (ctx.data.length < this._def.items.length) {
20922 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20923 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small,
20924 - minimum: this._def.items.length,
20925 - inclusive: true,
20926 - exact: false,
20927 - type: "array",
20928 - });
20929 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20930 - }
20931 - const rest = this._def.rest;
20932 - if (!rest && ctx.data.length > this._def.items.length) {
20933 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20934 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big,
20935 - maximum: this._def.items.length,
20936 - inclusive: true,
20937 - exact: false,
20938 - type: "array",
20939 - });
20940 - status.dirty();
20941 - }
20942 - const items = [...ctx.data]
20943 - .map((item, itemIndex) => {
20944 - const schema = this._def.items[itemIndex] || this._def.rest;
20945 - if (!schema)
20946 - return null;
20947 - return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
20948 - })
20949 - .filter((x) => !!x); // filter nulls
20950 - if (ctx.common.async) {
20951 - return Promise.all(items).then((results) => {
20952 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus.mergeArray(status, results);
20953 - });
20954 - }
20955 - else {
20956 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus.mergeArray(status, items);
20957 - }
20958 - }
20959 - get items() {
20960 - return this._def.items;
20961 - }
20962 - rest(rest) {
20963 - return new ZodTuple({
20964 - ...this._def,
20965 - rest,
20966 - });
20967 - }
20968 -}
20969 -ZodTuple.create = (schemas, params) => {
20970 - if (!Array.isArray(schemas)) {
20971 - throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
20972 - }
20973 - return new ZodTuple({
20974 - items: schemas,
20975 - typeName: ZodFirstPartyTypeKind.ZodTuple,
20976 - rest: null,
20977 - ...processCreateParams(params),
20978 - });
20979 -};
20980 -class ZodRecord extends ZodType {
20981 - get keySchema() {
20982 - return this._def.keyType;
20983 - }
20984 - get valueSchema() {
20985 - return this._def.valueType;
20986 - }
20987 - _parse(input) {
20988 - const { status, ctx } = this._processInputParams(input);
20989 - if (ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.object) {
20990 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
20991 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
20992 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.object,
20993 - received: ctx.parsedType,
20994 - });
20995 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
20996 - }
20997 - const pairs = [];
20998 - const keyType = this._def.keyType;
20999 - const valueType = this._def.valueType;
21000 - for (const key in ctx.data) {
21001 - pairs.push({
21002 - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),
21003 - value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)),
21004 - alwaysSet: key in ctx.data,
21005 - });
21006 - }
21007 - if (ctx.common.async) {
21008 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus.mergeObjectAsync(status, pairs);
21009 - }
21010 - else {
21011 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.ParseStatus.mergeObjectSync(status, pairs);
21012 - }
21013 - }
21014 - get element() {
21015 - return this._def.valueType;
21016 - }
21017 - static create(first, second, third) {
21018 - if (second instanceof ZodType) {
21019 - return new ZodRecord({
21020 - keyType: first,
21021 - valueType: second,
21022 - typeName: ZodFirstPartyTypeKind.ZodRecord,
21023 - ...processCreateParams(third),
21024 - });
21025 - }
21026 - return new ZodRecord({
21027 - keyType: ZodString.create(),
21028 - valueType: first,
21029 - typeName: ZodFirstPartyTypeKind.ZodRecord,
21030 - ...processCreateParams(second),
21031 - });
21032 - }
21033 -}
21034 -class ZodMap extends ZodType {
21035 - get keySchema() {
21036 - return this._def.keyType;
21037 - }
21038 - get valueSchema() {
21039 - return this._def.valueType;
21040 - }
21041 - _parse(input) {
21042 - const { status, ctx } = this._processInputParams(input);
21043 - if (ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.map) {
21044 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21045 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
21046 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.map,
21047 - received: ctx.parsedType,
21048 - });
21049 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21050 - }
21051 - const keyType = this._def.keyType;
21052 - const valueType = this._def.valueType;
21053 - const pairs = [...ctx.data.entries()].map(([key, value], index) => {
21054 - return {
21055 - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
21056 - value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])),
21057 - };
21058 - });
21059 - if (ctx.common.async) {
21060 - const finalMap = new Map();
21061 - return Promise.resolve().then(async () => {
21062 - for (const pair of pairs) {
21063 - const key = await pair.key;
21064 - const value = await pair.value;
21065 - if (key.status === "aborted" || value.status === "aborted") {
21066 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21067 - }
21068 - if (key.status === "dirty" || value.status === "dirty") {
21069 - status.dirty();
21070 - }
21071 - finalMap.set(key.value, value.value);
21072 - }
21073 - return { status: status.value, value: finalMap };
21074 - });
21075 - }
21076 - else {
21077 - const finalMap = new Map();
21078 - for (const pair of pairs) {
21079 - const key = pair.key;
21080 - const value = pair.value;
21081 - if (key.status === "aborted" || value.status === "aborted") {
21082 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21083 - }
21084 - if (key.status === "dirty" || value.status === "dirty") {
21085 - status.dirty();
21086 - }
21087 - finalMap.set(key.value, value.value);
21088 - }
21089 - return { status: status.value, value: finalMap };
21090 - }
21091 - }
21092 -}
21093 -ZodMap.create = (keyType, valueType, params) => {
21094 - return new ZodMap({
21095 - valueType,
21096 - keyType,
21097 - typeName: ZodFirstPartyTypeKind.ZodMap,
21098 - ...processCreateParams(params),
21099 - });
21100 -};
21101 -class ZodSet extends ZodType {
21102 - _parse(input) {
21103 - const { status, ctx } = this._processInputParams(input);
21104 - if (ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.set) {
21105 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21106 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
21107 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.set,
21108 - received: ctx.parsedType,
21109 - });
21110 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21111 - }
21112 - const def = this._def;
21113 - if (def.minSize !== null) {
21114 - if (ctx.data.size < def.minSize.value) {
21115 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21116 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_small,
21117 - minimum: def.minSize.value,
21118 - type: "set",
21119 - inclusive: true,
21120 - exact: false,
21121 - message: def.minSize.message,
21122 - });
21123 - status.dirty();
21124 - }
21125 - }
21126 - if (def.maxSize !== null) {
21127 - if (ctx.data.size > def.maxSize.value) {
21128 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21129 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.too_big,
21130 - maximum: def.maxSize.value,
21131 - type: "set",
21132 - inclusive: true,
21133 - exact: false,
21134 - message: def.maxSize.message,
21135 - });
21136 - status.dirty();
21137 - }
21138 - }
21139 - const valueType = this._def.valueType;
21140 - function finalizeSet(elements) {
21141 - const parsedSet = new Set();
21142 - for (const element of elements) {
21143 - if (element.status === "aborted")
21144 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21145 - if (element.status === "dirty")
21146 - status.dirty();
21147 - parsedSet.add(element.value);
21148 - }
21149 - return { status: status.value, value: parsedSet };
21150 - }
21151 - const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
21152 - if (ctx.common.async) {
21153 - return Promise.all(elements).then((elements) => finalizeSet(elements));
21154 - }
21155 - else {
21156 - return finalizeSet(elements);
21157 - }
21158 - }
21159 - min(minSize, message) {
21160 - return new ZodSet({
21161 - ...this._def,
21162 - minSize: { value: minSize, message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message) },
21163 - });
21164 - }
21165 - max(maxSize, message) {
21166 - return new ZodSet({
21167 - ...this._def,
21168 - maxSize: { value: maxSize, message: _helpers_errorUtil_js__WEBPACK_IMPORTED_MODULE_3__.errorUtil.toString(message) },
21169 - });
21170 - }
21171 - size(size, message) {
21172 - return this.min(size, message).max(size, message);
21173 - }
21174 - nonempty(message) {
21175 - return this.min(1, message);
21176 - }
21177 -}
21178 -ZodSet.create = (valueType, params) => {
21179 - return new ZodSet({
21180 - valueType,
21181 - minSize: null,
21182 - maxSize: null,
21183 - typeName: ZodFirstPartyTypeKind.ZodSet,
21184 - ...processCreateParams(params),
21185 - });
21186 -};
21187 -class ZodFunction extends ZodType {
21188 - constructor() {
21189 - super(...arguments);
21190 - this.validate = this.implement;
21191 - }
21192 - _parse(input) {
21193 - const { ctx } = this._processInputParams(input);
21194 - if (ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.function) {
21195 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21196 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
21197 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.function,
21198 - received: ctx.parsedType,
21199 - });
21200 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21201 - }
21202 - function makeArgsIssue(args, error) {
21203 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.makeIssue)({
21204 - data: args,
21205 - path: ctx.path,
21206 - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0,_errors_js__WEBPACK_IMPORTED_MODULE_1__.getErrorMap)(), _errors_js__WEBPACK_IMPORTED_MODULE_2__["default"]].filter((x) => !!x),
21207 - issueData: {
21208 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_arguments,
21209 - argumentsError: error,
21210 - },
21211 - });
21212 - }
21213 - function makeReturnsIssue(returns, error) {
21214 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.makeIssue)({
21215 - data: returns,
21216 - path: ctx.path,
21217 - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, (0,_errors_js__WEBPACK_IMPORTED_MODULE_1__.getErrorMap)(), _errors_js__WEBPACK_IMPORTED_MODULE_2__["default"]].filter((x) => !!x),
21218 - issueData: {
21219 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_return_type,
21220 - returnTypeError: error,
21221 - },
21222 - });
21223 - }
21224 - const params = { errorMap: ctx.common.contextualErrorMap };
21225 - const fn = ctx.data;
21226 - if (this._def.returns instanceof ZodPromise) {
21227 - // Would love a way to avoid disabling this rule, but we need
21228 - // an alias (using an arrow function was what caused 2651).
21229 - // eslint-disable-next-line @typescript-eslint/no-this-alias
21230 - const me = this;
21231 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(async function (...args) {
21232 - const error = new _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodError([]);
21233 - const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
21234 - error.addIssue(makeArgsIssue(args, e));
21235 - throw error;
21236 - });
21237 - const result = await Reflect.apply(fn, this, parsedArgs);
21238 - const parsedReturns = await me._def.returns._def.type
21239 - .parseAsync(result, params)
21240 - .catch((e) => {
21241 - error.addIssue(makeReturnsIssue(result, e));
21242 - throw error;
21243 - });
21244 - return parsedReturns;
21245 - });
21246 - }
21247 - else {
21248 - // Would love a way to avoid disabling this rule, but we need
21249 - // an alias (using an arrow function was what caused 2651).
21250 - // eslint-disable-next-line @typescript-eslint/no-this-alias
21251 - const me = this;
21252 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(function (...args) {
21253 - const parsedArgs = me._def.args.safeParse(args, params);
21254 - if (!parsedArgs.success) {
21255 - throw new _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodError([makeArgsIssue(args, parsedArgs.error)]);
21256 - }
21257 - const result = Reflect.apply(fn, this, parsedArgs.data);
21258 - const parsedReturns = me._def.returns.safeParse(result, params);
21259 - if (!parsedReturns.success) {
21260 - throw new _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodError([makeReturnsIssue(result, parsedReturns.error)]);
21261 - }
21262 - return parsedReturns.data;
21263 - });
21264 - }
21265 - }
21266 - parameters() {
21267 - return this._def.args;
21268 - }
21269 - returnType() {
21270 - return this._def.returns;
21271 - }
21272 - args(...items) {
21273 - return new ZodFunction({
21274 - ...this._def,
21275 - args: ZodTuple.create(items).rest(ZodUnknown.create()),
21276 - });
21277 - }
21278 - returns(returnType) {
21279 - return new ZodFunction({
21280 - ...this._def,
21281 - returns: returnType,
21282 - });
21283 - }
21284 - implement(func) {
21285 - const validatedFunc = this.parse(func);
21286 - return validatedFunc;
21287 - }
21288 - strictImplement(func) {
21289 - const validatedFunc = this.parse(func);
21290 - return validatedFunc;
21291 - }
21292 - static create(args, returns, params) {
21293 - return new ZodFunction({
21294 - args: (args ? args : ZodTuple.create([]).rest(ZodUnknown.create())),
21295 - returns: returns || ZodUnknown.create(),
21296 - typeName: ZodFirstPartyTypeKind.ZodFunction,
21297 - ...processCreateParams(params),
21298 - });
21299 - }
21300 -}
21301 -class ZodLazy extends ZodType {
21302 - get schema() {
21303 - return this._def.getter();
21304 - }
21305 - _parse(input) {
21306 - const { ctx } = this._processInputParams(input);
21307 - const lazySchema = this._def.getter();
21308 - return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
21309 - }
21310 -}
21311 -ZodLazy.create = (getter, params) => {
21312 - return new ZodLazy({
21313 - getter: getter,
21314 - typeName: ZodFirstPartyTypeKind.ZodLazy,
21315 - ...processCreateParams(params),
21316 - });
21317 -};
21318 -class ZodLiteral extends ZodType {
21319 - _parse(input) {
21320 - if (input.data !== this._def.value) {
21321 - const ctx = this._getOrReturnCtx(input);
21322 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21323 - received: ctx.data,
21324 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_literal,
21325 - expected: this._def.value,
21326 - });
21327 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21328 - }
21329 - return { status: "valid", value: input.data };
21330 - }
21331 - get value() {
21332 - return this._def.value;
21333 - }
21334 -}
21335 -ZodLiteral.create = (value, params) => {
21336 - return new ZodLiteral({
21337 - value: value,
21338 - typeName: ZodFirstPartyTypeKind.ZodLiteral,
21339 - ...processCreateParams(params),
21340 - });
21341 -};
21342 -function createZodEnum(values, params) {
21343 - return new ZodEnum({
21344 - values,
21345 - typeName: ZodFirstPartyTypeKind.ZodEnum,
21346 - ...processCreateParams(params),
21347 - });
21348 -}
21349 -class ZodEnum extends ZodType {
21350 - _parse(input) {
21351 - if (typeof input.data !== "string") {
21352 - const ctx = this._getOrReturnCtx(input);
21353 - const expectedValues = this._def.values;
21354 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21355 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.joinValues(expectedValues),
21356 - received: ctx.parsedType,
21357 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
21358 - });
21359 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21360 - }
21361 - if (!this._cache) {
21362 - this._cache = new Set(this._def.values);
21363 - }
21364 - if (!this._cache.has(input.data)) {
21365 - const ctx = this._getOrReturnCtx(input);
21366 - const expectedValues = this._def.values;
21367 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21368 - received: ctx.data,
21369 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_enum_value,
21370 - options: expectedValues,
21371 - });
21372 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21373 - }
21374 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(input.data);
21375 - }
21376 - get options() {
21377 - return this._def.values;
21378 - }
21379 - get enum() {
21380 - const enumValues = {};
21381 - for (const val of this._def.values) {
21382 - enumValues[val] = val;
21383 - }
21384 - return enumValues;
21385 - }
21386 - get Values() {
21387 - const enumValues = {};
21388 - for (const val of this._def.values) {
21389 - enumValues[val] = val;
21390 - }
21391 - return enumValues;
21392 - }
21393 - get Enum() {
21394 - const enumValues = {};
21395 - for (const val of this._def.values) {
21396 - enumValues[val] = val;
21397 - }
21398 - return enumValues;
21399 - }
21400 - extract(values, newDef = this._def) {
21401 - return ZodEnum.create(values, {
21402 - ...this._def,
21403 - ...newDef,
21404 - });
21405 - }
21406 - exclude(values, newDef = this._def) {
21407 - return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
21408 - ...this._def,
21409 - ...newDef,
21410 - });
21411 - }
21412 -}
21413 -ZodEnum.create = createZodEnum;
21414 -class ZodNativeEnum extends ZodType {
21415 - _parse(input) {
21416 - const nativeEnumValues = _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.getValidEnumValues(this._def.values);
21417 - const ctx = this._getOrReturnCtx(input);
21418 - if (ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.string && ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.number) {
21419 - const expectedValues = _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectValues(nativeEnumValues);
21420 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21421 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.joinValues(expectedValues),
21422 - received: ctx.parsedType,
21423 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
21424 - });
21425 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21426 - }
21427 - if (!this._cache) {
21428 - this._cache = new Set(_helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.getValidEnumValues(this._def.values));
21429 - }
21430 - if (!this._cache.has(input.data)) {
21431 - const expectedValues = _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.objectValues(nativeEnumValues);
21432 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21433 - received: ctx.data,
21434 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_enum_value,
21435 - options: expectedValues,
21436 - });
21437 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21438 - }
21439 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(input.data);
21440 - }
21441 - get enum() {
21442 - return this._def.values;
21443 - }
21444 -}
21445 -ZodNativeEnum.create = (values, params) => {
21446 - return new ZodNativeEnum({
21447 - values: values,
21448 - typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
21449 - ...processCreateParams(params),
21450 - });
21451 -};
21452 -class ZodPromise extends ZodType {
21453 - unwrap() {
21454 - return this._def.type;
21455 - }
21456 - _parse(input) {
21457 - const { ctx } = this._processInputParams(input);
21458 - if (ctx.parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.promise && ctx.common.async === false) {
21459 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21460 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
21461 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.promise,
21462 - received: ctx.parsedType,
21463 - });
21464 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21465 - }
21466 - const promisified = ctx.parsedType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
21467 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(promisified.then((data) => {
21468 - return this._def.type.parseAsync(data, {
21469 - path: ctx.path,
21470 - errorMap: ctx.common.contextualErrorMap,
21471 - });
21472 - }));
21473 - }
21474 -}
21475 -ZodPromise.create = (schema, params) => {
21476 - return new ZodPromise({
21477 - type: schema,
21478 - typeName: ZodFirstPartyTypeKind.ZodPromise,
21479 - ...processCreateParams(params),
21480 - });
21481 -};
21482 -class ZodEffects extends ZodType {
21483 - innerType() {
21484 - return this._def.schema;
21485 - }
21486 - sourceType() {
21487 - return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects
21488 - ? this._def.schema.sourceType()
21489 - : this._def.schema;
21490 - }
21491 - _parse(input) {
21492 - const { status, ctx } = this._processInputParams(input);
21493 - const effect = this._def.effect || null;
21494 - const checkCtx = {
21495 - addIssue: (arg) => {
21496 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, arg);
21497 - if (arg.fatal) {
21498 - status.abort();
21499 - }
21500 - else {
21501 - status.dirty();
21502 - }
21503 - },
21504 - get path() {
21505 - return ctx.path;
21506 - },
21507 - };
21508 - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
21509 - if (effect.type === "preprocess") {
21510 - const processed = effect.transform(ctx.data, checkCtx);
21511 - if (ctx.common.async) {
21512 - return Promise.resolve(processed).then(async (processed) => {
21513 - if (status.value === "aborted")
21514 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21515 - const result = await this._def.schema._parseAsync({
21516 - data: processed,
21517 - path: ctx.path,
21518 - parent: ctx,
21519 - });
21520 - if (result.status === "aborted")
21521 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21522 - if (result.status === "dirty")
21523 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.DIRTY)(result.value);
21524 - if (status.value === "dirty")
21525 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.DIRTY)(result.value);
21526 - return result;
21527 - });
21528 - }
21529 - else {
21530 - if (status.value === "aborted")
21531 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21532 - const result = this._def.schema._parseSync({
21533 - data: processed,
21534 - path: ctx.path,
21535 - parent: ctx,
21536 - });
21537 - if (result.status === "aborted")
21538 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21539 - if (result.status === "dirty")
21540 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.DIRTY)(result.value);
21541 - if (status.value === "dirty")
21542 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.DIRTY)(result.value);
21543 - return result;
21544 - }
21545 - }
21546 - if (effect.type === "refinement") {
21547 - const executeRefinement = (acc) => {
21548 - const result = effect.refinement(acc, checkCtx);
21549 - if (ctx.common.async) {
21550 - return Promise.resolve(result);
21551 - }
21552 - if (result instanceof Promise) {
21553 - throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
21554 - }
21555 - return acc;
21556 - };
21557 - if (ctx.common.async === false) {
21558 - const inner = this._def.schema._parseSync({
21559 - data: ctx.data,
21560 - path: ctx.path,
21561 - parent: ctx,
21562 - });
21563 - if (inner.status === "aborted")
21564 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21565 - if (inner.status === "dirty")
21566 - status.dirty();
21567 - // return value is ignored
21568 - executeRefinement(inner.value);
21569 - return { status: status.value, value: inner.value };
21570 - }
21571 - else {
21572 - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
21573 - if (inner.status === "aborted")
21574 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21575 - if (inner.status === "dirty")
21576 - status.dirty();
21577 - return executeRefinement(inner.value).then(() => {
21578 - return { status: status.value, value: inner.value };
21579 - });
21580 - });
21581 - }
21582 - }
21583 - if (effect.type === "transform") {
21584 - if (ctx.common.async === false) {
21585 - const base = this._def.schema._parseSync({
21586 - data: ctx.data,
21587 - path: ctx.path,
21588 - parent: ctx,
21589 - });
21590 - if (!(0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isValid)(base))
21591 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21592 - const result = effect.transform(base.value, checkCtx);
21593 - if (result instanceof Promise) {
21594 - throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
21595 - }
21596 - return { status: status.value, value: result };
21597 - }
21598 - else {
21599 - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
21600 - if (!(0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isValid)(base))
21601 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21602 - return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
21603 - status: status.value,
21604 - value: result,
21605 - }));
21606 - });
21607 - }
21608 - }
21609 - _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.util.assertNever(effect);
21610 - }
21611 -}
21612 -ZodEffects.create = (schema, effect, params) => {
21613 - return new ZodEffects({
21614 - schema,
21615 - typeName: ZodFirstPartyTypeKind.ZodEffects,
21616 - effect,
21617 - ...processCreateParams(params),
21618 - });
21619 -};
21620 -ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
21621 - return new ZodEffects({
21622 - schema,
21623 - effect: { type: "preprocess", transform: preprocess },
21624 - typeName: ZodFirstPartyTypeKind.ZodEffects,
21625 - ...processCreateParams(params),
21626 - });
21627 -};
21628 -
21629 -class ZodOptional extends ZodType {
21630 - _parse(input) {
21631 - const parsedType = this._getType(input);
21632 - if (parsedType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.undefined) {
21633 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(undefined);
21634 - }
21635 - return this._def.innerType._parse(input);
21636 - }
21637 - unwrap() {
21638 - return this._def.innerType;
21639 - }
21640 -}
21641 -ZodOptional.create = (type, params) => {
21642 - return new ZodOptional({
21643 - innerType: type,
21644 - typeName: ZodFirstPartyTypeKind.ZodOptional,
21645 - ...processCreateParams(params),
21646 - });
21647 -};
21648 -class ZodNullable extends ZodType {
21649 - _parse(input) {
21650 - const parsedType = this._getType(input);
21651 - if (parsedType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.null) {
21652 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.OK)(null);
21653 - }
21654 - return this._def.innerType._parse(input);
21655 - }
21656 - unwrap() {
21657 - return this._def.innerType;
21658 - }
21659 -}
21660 -ZodNullable.create = (type, params) => {
21661 - return new ZodNullable({
21662 - innerType: type,
21663 - typeName: ZodFirstPartyTypeKind.ZodNullable,
21664 - ...processCreateParams(params),
21665 - });
21666 -};
21667 -class ZodDefault extends ZodType {
21668 - _parse(input) {
21669 - const { ctx } = this._processInputParams(input);
21670 - let data = ctx.data;
21671 - if (ctx.parsedType === _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.undefined) {
21672 - data = this._def.defaultValue();
21673 - }
21674 - return this._def.innerType._parse({
21675 - data,
21676 - path: ctx.path,
21677 - parent: ctx,
21678 - });
21679 - }
21680 - removeDefault() {
21681 - return this._def.innerType;
21682 - }
21683 -}
21684 -ZodDefault.create = (type, params) => {
21685 - return new ZodDefault({
21686 - innerType: type,
21687 - typeName: ZodFirstPartyTypeKind.ZodDefault,
21688 - defaultValue: typeof params.default === "function" ? params.default : () => params.default,
21689 - ...processCreateParams(params),
21690 - });
21691 -};
21692 -class ZodCatch extends ZodType {
21693 - _parse(input) {
21694 - const { ctx } = this._processInputParams(input);
21695 - // newCtx is used to not collect issues from inner types in ctx
21696 - const newCtx = {
21697 - ...ctx,
21698 - common: {
21699 - ...ctx.common,
21700 - issues: [],
21701 - },
21702 - };
21703 - const result = this._def.innerType._parse({
21704 - data: newCtx.data,
21705 - path: newCtx.path,
21706 - parent: {
21707 - ...newCtx,
21708 - },
21709 - });
21710 - if ((0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isAsync)(result)) {
21711 - return result.then((result) => {
21712 - return {
21713 - status: "valid",
21714 - value: result.status === "valid"
21715 - ? result.value
21716 - : this._def.catchValue({
21717 - get error() {
21718 - return new _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodError(newCtx.common.issues);
21719 - },
21720 - input: newCtx.data,
21721 - }),
21722 - };
21723 - });
21724 - }
21725 - else {
21726 - return {
21727 - status: "valid",
21728 - value: result.status === "valid"
21729 - ? result.value
21730 - : this._def.catchValue({
21731 - get error() {
21732 - return new _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodError(newCtx.common.issues);
21733 - },
21734 - input: newCtx.data,
21735 - }),
21736 - };
21737 - }
21738 - }
21739 - removeCatch() {
21740 - return this._def.innerType;
21741 - }
21742 -}
21743 -ZodCatch.create = (type, params) => {
21744 - return new ZodCatch({
21745 - innerType: type,
21746 - typeName: ZodFirstPartyTypeKind.ZodCatch,
21747 - catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
21748 - ...processCreateParams(params),
21749 - });
21750 -};
21751 -class ZodNaN extends ZodType {
21752 - _parse(input) {
21753 - const parsedType = this._getType(input);
21754 - if (parsedType !== _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.nan) {
21755 - const ctx = this._getOrReturnCtx(input);
21756 - (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.addIssueToContext)(ctx, {
21757 - code: _ZodError_js__WEBPACK_IMPORTED_MODULE_0__.ZodIssueCode.invalid_type,
21758 - expected: _helpers_util_js__WEBPACK_IMPORTED_MODULE_5__.ZodParsedType.nan,
21759 - received: ctx.parsedType,
21760 - });
21761 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21762 - }
21763 - return { status: "valid", value: input.data };
21764 - }
21765 -}
21766 -ZodNaN.create = (params) => {
21767 - return new ZodNaN({
21768 - typeName: ZodFirstPartyTypeKind.ZodNaN,
21769 - ...processCreateParams(params),
21770 - });
21771 -};
21772 -const BRAND = Symbol("zod_brand");
21773 -class ZodBranded extends ZodType {
21774 - _parse(input) {
21775 - const { ctx } = this._processInputParams(input);
21776 - const data = ctx.data;
21777 - return this._def.type._parse({
21778 - data,
21779 - path: ctx.path,
21780 - parent: ctx,
21781 - });
21782 - }
21783 - unwrap() {
21784 - return this._def.type;
21785 - }
21786 -}
21787 -class ZodPipeline extends ZodType {
21788 - _parse(input) {
21789 - const { status, ctx } = this._processInputParams(input);
21790 - if (ctx.common.async) {
21791 - const handleAsync = async () => {
21792 - const inResult = await this._def.in._parseAsync({
21793 - data: ctx.data,
21794 - path: ctx.path,
21795 - parent: ctx,
21796 - });
21797 - if (inResult.status === "aborted")
21798 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21799 - if (inResult.status === "dirty") {
21800 - status.dirty();
21801 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.DIRTY)(inResult.value);
21802 - }
21803 - else {
21804 - return this._def.out._parseAsync({
21805 - data: inResult.value,
21806 - path: ctx.path,
21807 - parent: ctx,
21808 - });
21809 - }
21810 - };
21811 - return handleAsync();
21812 - }
21813 - else {
21814 - const inResult = this._def.in._parseSync({
21815 - data: ctx.data,
21816 - path: ctx.path,
21817 - parent: ctx,
21818 - });
21819 - if (inResult.status === "aborted")
21820 - return _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
21821 - if (inResult.status === "dirty") {
21822 - status.dirty();
21823 - return {
21824 - status: "dirty",
21825 - value: inResult.value,
21826 - };
21827 - }
21828 - else {
21829 - return this._def.out._parseSync({
21830 - data: inResult.value,
21831 - path: ctx.path,
21832 - parent: ctx,
21833 - });
21834 - }
21835 - }
21836 - }
21837 - static create(a, b) {
21838 - return new ZodPipeline({
21839 - in: a,
21840 - out: b,
21841 - typeName: ZodFirstPartyTypeKind.ZodPipeline,
21842 - });
21843 - }
21844 -}
21845 -class ZodReadonly extends ZodType {
21846 - _parse(input) {
21847 - const result = this._def.innerType._parse(input);
21848 - const freeze = (data) => {
21849 - if ((0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isValid)(data)) {
21850 - data.value = Object.freeze(data.value);
21851 - }
21852 - return data;
21853 - };
21854 - return (0,_helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.isAsync)(result) ? result.then((data) => freeze(data)) : freeze(result);
21855 - }
21856 - unwrap() {
21857 - return this._def.innerType;
21858 - }
21859 -}
21860 -ZodReadonly.create = (type, params) => {
21861 - return new ZodReadonly({
21862 - innerType: type,
21863 - typeName: ZodFirstPartyTypeKind.ZodReadonly,
21864 - ...processCreateParams(params),
21865 - });
21866 -};
21867 -////////////////////////////////////////
21868 -////////////////////////////////////////
21869 -////////// //////////
21870 -////////// z.custom //////////
21871 -////////// //////////
21872 -////////////////////////////////////////
21873 -////////////////////////////////////////
21874 -function cleanParams(params, data) {
21875 - const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
21876 - const p2 = typeof p === "string" ? { message: p } : p;
21877 - return p2;
21878 -}
21879 -function custom(check, _params = {},
21880 -/**
21881 - * @deprecated
21882 - *
21883 - * Pass `fatal` into the params object instead:
21884 - *
21885 - * ```ts
21886 - * z.string().custom((val) => val.length > 5, { fatal: false })
21887 - * ```
21888 - *
21889 - */
21890 -fatal) {
21891 - if (check)
21892 - return ZodAny.create().superRefine((data, ctx) => {
21893 - const r = check(data);
21894 - if (r instanceof Promise) {
21895 - return r.then((r) => {
21896 - if (!r) {
21897 - const params = cleanParams(_params, data);
21898 - const _fatal = params.fatal ?? fatal ?? true;
21899 - ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
21900 - }
21901 - });
21902 - }
21903 - if (!r) {
21904 - const params = cleanParams(_params, data);
21905 - const _fatal = params.fatal ?? fatal ?? true;
21906 - ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
21907 - }
21908 - return;
21909 - });
21910 - return ZodAny.create();
21911 -}
21912 -
21913 -const late = {
21914 - object: ZodObject.lazycreate,
21915 -};
21916 -var ZodFirstPartyTypeKind;
21917 -(function (ZodFirstPartyTypeKind) {
21918 - ZodFirstPartyTypeKind["ZodString"] = "ZodString";
21919 - ZodFirstPartyTypeKind["ZodNumber"] = "ZodNumber";
21920 - ZodFirstPartyTypeKind["ZodNaN"] = "ZodNaN";
21921 - ZodFirstPartyTypeKind["ZodBigInt"] = "ZodBigInt";
21922 - ZodFirstPartyTypeKind["ZodBoolean"] = "ZodBoolean";
21923 - ZodFirstPartyTypeKind["ZodDate"] = "ZodDate";
21924 - ZodFirstPartyTypeKind["ZodSymbol"] = "ZodSymbol";
21925 - ZodFirstPartyTypeKind["ZodUndefined"] = "ZodUndefined";
21926 - ZodFirstPartyTypeKind["ZodNull"] = "ZodNull";
21927 - ZodFirstPartyTypeKind["ZodAny"] = "ZodAny";
21928 - ZodFirstPartyTypeKind["ZodUnknown"] = "ZodUnknown";
21929 - ZodFirstPartyTypeKind["ZodNever"] = "ZodNever";
21930 - ZodFirstPartyTypeKind["ZodVoid"] = "ZodVoid";
21931 - ZodFirstPartyTypeKind["ZodArray"] = "ZodArray";
21932 - ZodFirstPartyTypeKind["ZodObject"] = "ZodObject";
21933 - ZodFirstPartyTypeKind["ZodUnion"] = "ZodUnion";
21934 - ZodFirstPartyTypeKind["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
21935 - ZodFirstPartyTypeKind["ZodIntersection"] = "ZodIntersection";
21936 - ZodFirstPartyTypeKind["ZodTuple"] = "ZodTuple";
21937 - ZodFirstPartyTypeKind["ZodRecord"] = "ZodRecord";
21938 - ZodFirstPartyTypeKind["ZodMap"] = "ZodMap";
21939 - ZodFirstPartyTypeKind["ZodSet"] = "ZodSet";
21940 - ZodFirstPartyTypeKind["ZodFunction"] = "ZodFunction";
21941 - ZodFirstPartyTypeKind["ZodLazy"] = "ZodLazy";
21942 - ZodFirstPartyTypeKind["ZodLiteral"] = "ZodLiteral";
21943 - ZodFirstPartyTypeKind["ZodEnum"] = "ZodEnum";
21944 - ZodFirstPartyTypeKind["ZodEffects"] = "ZodEffects";
21945 - ZodFirstPartyTypeKind["ZodNativeEnum"] = "ZodNativeEnum";
21946 - ZodFirstPartyTypeKind["ZodOptional"] = "ZodOptional";
21947 - ZodFirstPartyTypeKind["ZodNullable"] = "ZodNullable";
21948 - ZodFirstPartyTypeKind["ZodDefault"] = "ZodDefault";
21949 - ZodFirstPartyTypeKind["ZodCatch"] = "ZodCatch";
21950 - ZodFirstPartyTypeKind["ZodPromise"] = "ZodPromise";
21951 - ZodFirstPartyTypeKind["ZodBranded"] = "ZodBranded";
21952 - ZodFirstPartyTypeKind["ZodPipeline"] = "ZodPipeline";
21953 - ZodFirstPartyTypeKind["ZodReadonly"] = "ZodReadonly";
21954 -})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
21955 -// requires TS 4.4+
21956 -class Class {
21957 - constructor(..._) { }
21958 -}
21959 -const instanceOfType = (
21960 -// const instanceOfType = <T extends new (...args: any[]) => any>(
21961 -cls, params = {
21962 - message: `Input not instance of ${cls.name}`,
21963 -}) => custom((data) => data instanceof cls, params);
21964 -const stringType = ZodString.create;
21965 -const numberType = ZodNumber.create;
21966 -const nanType = ZodNaN.create;
21967 -const bigIntType = ZodBigInt.create;
21968 -const booleanType = ZodBoolean.create;
21969 -const dateType = ZodDate.create;
21970 -const symbolType = ZodSymbol.create;
21971 -const undefinedType = ZodUndefined.create;
21972 -const nullType = ZodNull.create;
21973 -const anyType = ZodAny.create;
21974 -const unknownType = ZodUnknown.create;
21975 -const neverType = ZodNever.create;
21976 -const voidType = ZodVoid.create;
21977 -const arrayType = ZodArray.create;
21978 -const objectType = ZodObject.create;
21979 -const strictObjectType = ZodObject.strictCreate;
21980 -const unionType = ZodUnion.create;
21981 -const discriminatedUnionType = ZodDiscriminatedUnion.create;
21982 -const intersectionType = ZodIntersection.create;
21983 -const tupleType = ZodTuple.create;
21984 -const recordType = ZodRecord.create;
21985 -const mapType = ZodMap.create;
21986 -const setType = ZodSet.create;
21987 -const functionType = ZodFunction.create;
21988 -const lazyType = ZodLazy.create;
21989 -const literalType = ZodLiteral.create;
21990 -const enumType = ZodEnum.create;
21991 -const nativeEnumType = ZodNativeEnum.create;
21992 -const promiseType = ZodPromise.create;
21993 -const effectsType = ZodEffects.create;
21994 -const optionalType = ZodOptional.create;
21995 -const nullableType = ZodNullable.create;
21996 -const preprocessType = ZodEffects.createWithPreprocess;
21997 -const pipelineType = ZodPipeline.create;
21998 -const ostring = () => stringType().optional();
21999 -const onumber = () => numberType().optional();
22000 -const oboolean = () => booleanType().optional();
22001 -const coerce = {
22002 - string: ((arg) => ZodString.create({ ...arg, coerce: true })),
22003 - number: ((arg) => ZodNumber.create({ ...arg, coerce: true })),
22004 - boolean: ((arg) => ZodBoolean.create({
22005 - ...arg,
22006 - coerce: true,
22007 - })),
22008 - bigint: ((arg) => ZodBigInt.create({ ...arg, coerce: true })),
22009 - date: ((arg) => ZodDate.create({ ...arg, coerce: true })),
22010 -};
22011 -
22012 -const NEVER = _helpers_parseUtil_js__WEBPACK_IMPORTED_MODULE_4__.INVALID;
22013 -
22014 -
22015 -/***/ }),
22016 -
22017 -/***/ "./node_modules/zod/v4/classic/errors.js":
22018 -/*!***********************************************!*\
22019 - !*** ./node_modules/zod/v4/classic/errors.js ***!
22020 - \***********************************************/
22021 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
22022 -
22023 -__webpack_require__.r(__webpack_exports__);
22024 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
22025 -/* harmony export */ ZodError: function() { return /* binding */ ZodError; },
22026 -/* harmony export */ ZodRealError: function() { return /* binding */ ZodRealError; }
22027 -/* harmony export */ });
22028 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/core.js");
22029 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/errors.js");
22030 -
22031 -
22032 -const initializer = (inst, issues) => {
22033 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodError.init(inst, issues);
22034 - inst.name = "ZodError";
22035 - Object.defineProperties(inst, {
22036 - format: {
22037 - value: (mapper) => _core_index_js__WEBPACK_IMPORTED_MODULE_1__.formatError(inst, mapper),
22038 - // enumerable: false,
22039 - },
22040 - flatten: {
22041 - value: (mapper) => _core_index_js__WEBPACK_IMPORTED_MODULE_1__.flattenError(inst, mapper),
22042 - // enumerable: false,
22043 - },
22044 - addIssue: {
22045 - value: (issue) => inst.issues.push(issue),
22046 - // enumerable: false,
22047 - },
22048 - addIssues: {
22049 - value: (issues) => inst.issues.push(...issues),
22050 - // enumerable: false,
22051 - },
22052 - isEmpty: {
22053 - get() {
22054 - return inst.issues.length === 0;
22055 - },
22056 - // enumerable: false,
22057 - },
22058 - });
22059 - // Object.defineProperty(inst, "isEmpty", {
22060 - // get() {
22061 - // return inst.issues.length === 0;
22062 - // },
22063 - // });
22064 -};
22065 -const ZodError = _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodError", initializer);
22066 -const ZodRealError = _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodError", initializer, {
22067 - Parent: Error,
22068 -});
22069 -// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */
22070 -// export type ErrorMapCtx = core.$ZodErrorMapCtx;
22071 -
22072 -
22073 -/***/ }),
22074 -
22075 -/***/ "./node_modules/zod/v4/classic/iso.js":
22076 -/*!********************************************!*\
22077 - !*** ./node_modules/zod/v4/classic/iso.js ***!
22078 - \********************************************/
22079 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
22080 -
22081 -__webpack_require__.r(__webpack_exports__);
22082 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
22083 -/* harmony export */ ZodISODate: function() { return /* binding */ ZodISODate; },
22084 -/* harmony export */ ZodISODateTime: function() { return /* binding */ ZodISODateTime; },
22085 -/* harmony export */ ZodISODuration: function() { return /* binding */ ZodISODuration; },
22086 -/* harmony export */ ZodISOTime: function() { return /* binding */ ZodISOTime; },
22087 -/* harmony export */ date: function() { return /* binding */ date; },
22088 -/* harmony export */ datetime: function() { return /* binding */ datetime; },
22089 -/* harmony export */ duration: function() { return /* binding */ duration; },
22090 -/* harmony export */ time: function() { return /* binding */ time; }
22091 -/* harmony export */ });
22092 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/core.js");
22093 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/schemas.js");
22094 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/api.js");
22095 -/* harmony import */ var _schemas_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./schemas.js */ "./node_modules/zod/v4/classic/schemas.js");
22096 -
22097 -
22098 -const ZodISODateTime = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodISODateTime", (inst, def) => {
22099 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodISODateTime.init(inst, def);
22100 - _schemas_js__WEBPACK_IMPORTED_MODULE_3__.ZodStringFormat.init(inst, def);
22101 -});
22102 -function datetime(params) {
22103 - return _core_index_js__WEBPACK_IMPORTED_MODULE_2__._isoDateTime(ZodISODateTime, params);
22104 -}
22105 -const ZodISODate = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodISODate", (inst, def) => {
22106 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodISODate.init(inst, def);
22107 - _schemas_js__WEBPACK_IMPORTED_MODULE_3__.ZodStringFormat.init(inst, def);
22108 -});
22109 -function date(params) {
22110 - return _core_index_js__WEBPACK_IMPORTED_MODULE_2__._isoDate(ZodISODate, params);
22111 -}
22112 -const ZodISOTime = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodISOTime", (inst, def) => {
22113 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodISOTime.init(inst, def);
22114 - _schemas_js__WEBPACK_IMPORTED_MODULE_3__.ZodStringFormat.init(inst, def);
22115 -});
22116 -function time(params) {
22117 - return _core_index_js__WEBPACK_IMPORTED_MODULE_2__._isoTime(ZodISOTime, params);
22118 -}
22119 -const ZodISODuration = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodISODuration", (inst, def) => {
22120 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodISODuration.init(inst, def);
22121 - _schemas_js__WEBPACK_IMPORTED_MODULE_3__.ZodStringFormat.init(inst, def);
22122 -});
22123 -function duration(params) {
22124 - return _core_index_js__WEBPACK_IMPORTED_MODULE_2__._isoDuration(ZodISODuration, params);
22125 -}
22126 -
22127 -
22128 -/***/ }),
22129 -
22130 -/***/ "./node_modules/zod/v4/classic/parse.js":
22131 -/*!**********************************************!*\
22132 - !*** ./node_modules/zod/v4/classic/parse.js ***!
22133 - \**********************************************/
22134 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
22135 -
22136 -__webpack_require__.r(__webpack_exports__);
22137 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
22138 -/* harmony export */ parse: function() { return /* binding */ parse; },
22139 -/* harmony export */ parseAsync: function() { return /* binding */ parseAsync; },
22140 -/* harmony export */ safeParse: function() { return /* binding */ safeParse; },
22141 -/* harmony export */ safeParseAsync: function() { return /* binding */ safeParseAsync; }
22142 -/* harmony export */ });
22143 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/parse.js");
22144 -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./errors.js */ "./node_modules/zod/v4/classic/errors.js");
22145 -
22146 -
22147 -const parse = /* @__PURE__ */ _core_index_js__WEBPACK_IMPORTED_MODULE_0__._parse(_errors_js__WEBPACK_IMPORTED_MODULE_1__.ZodRealError);
22148 -const parseAsync = /* @__PURE__ */ _core_index_js__WEBPACK_IMPORTED_MODULE_0__._parseAsync(_errors_js__WEBPACK_IMPORTED_MODULE_1__.ZodRealError);
22149 -const safeParse = /* @__PURE__ */ _core_index_js__WEBPACK_IMPORTED_MODULE_0__._safeParse(_errors_js__WEBPACK_IMPORTED_MODULE_1__.ZodRealError);
22150 -const safeParseAsync = /* @__PURE__ */ _core_index_js__WEBPACK_IMPORTED_MODULE_0__._safeParseAsync(_errors_js__WEBPACK_IMPORTED_MODULE_1__.ZodRealError);
22151 -
22152 -
22153 -/***/ }),
22154 -
22155 -/***/ "./node_modules/zod/v4/classic/schemas.js":
22156 -/*!************************************************!*\
22157 - !*** ./node_modules/zod/v4/classic/schemas.js ***!
22158 - \************************************************/
22159 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
22160 -
22161 -__webpack_require__.r(__webpack_exports__);
22162 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
22163 -/* harmony export */ ZodAny: function() { return /* binding */ ZodAny; },
22164 -/* harmony export */ ZodArray: function() { return /* binding */ ZodArray; },
22165 -/* harmony export */ ZodBase64: function() { return /* binding */ ZodBase64; },
22166 -/* harmony export */ ZodBase64URL: function() { return /* binding */ ZodBase64URL; },
22167 -/* harmony export */ ZodBigInt: function() { return /* binding */ ZodBigInt; },
22168 -/* harmony export */ ZodBigIntFormat: function() { return /* binding */ ZodBigIntFormat; },
22169 -/* harmony export */ ZodBoolean: function() { return /* binding */ ZodBoolean; },
22170 -/* harmony export */ ZodCIDRv4: function() { return /* binding */ ZodCIDRv4; },
22171 -/* harmony export */ ZodCIDRv6: function() { return /* binding */ ZodCIDRv6; },
22172 -/* harmony export */ ZodCUID: function() { return /* binding */ ZodCUID; },
22173 -/* harmony export */ ZodCUID2: function() { return /* binding */ ZodCUID2; },
22174 -/* harmony export */ ZodCatch: function() { return /* binding */ ZodCatch; },
22175 -/* harmony export */ ZodCustom: function() { return /* binding */ ZodCustom; },
22176 -/* harmony export */ ZodCustomStringFormat: function() { return /* binding */ ZodCustomStringFormat; },
22177 -/* harmony export */ ZodDate: function() { return /* binding */ ZodDate; },
22178 -/* harmony export */ ZodDefault: function() { return /* binding */ ZodDefault; },
22179 -/* harmony export */ ZodDiscriminatedUnion: function() { return /* binding */ ZodDiscriminatedUnion; },
22180 -/* harmony export */ ZodE164: function() { return /* binding */ ZodE164; },
22181 -/* harmony export */ ZodEmail: function() { return /* binding */ ZodEmail; },
22182 -/* harmony export */ ZodEmoji: function() { return /* binding */ ZodEmoji; },
22183 -/* harmony export */ ZodEnum: function() { return /* binding */ ZodEnum; },
22184 -/* harmony export */ ZodFile: function() { return /* binding */ ZodFile; },
22185 -/* harmony export */ ZodGUID: function() { return /* binding */ ZodGUID; },
22186 -/* harmony export */ ZodIPv4: function() { return /* binding */ ZodIPv4; },
22187 -/* harmony export */ ZodIPv6: function() { return /* binding */ ZodIPv6; },
22188 -/* harmony export */ ZodIntersection: function() { return /* binding */ ZodIntersection; },
22189 -/* harmony export */ ZodJWT: function() { return /* binding */ ZodJWT; },
22190 -/* harmony export */ ZodKSUID: function() { return /* binding */ ZodKSUID; },
22191 -/* harmony export */ ZodLazy: function() { return /* binding */ ZodLazy; },
22192 -/* harmony export */ ZodLiteral: function() { return /* binding */ ZodLiteral; },
22193 -/* harmony export */ ZodMap: function() { return /* binding */ ZodMap; },
22194 -/* harmony export */ ZodNaN: function() { return /* binding */ ZodNaN; },
22195 -/* harmony export */ ZodNanoID: function() { return /* binding */ ZodNanoID; },
22196 -/* harmony export */ ZodNever: function() { return /* binding */ ZodNever; },
22197 -/* harmony export */ ZodNonOptional: function() { return /* binding */ ZodNonOptional; },
22198 -/* harmony export */ ZodNull: function() { return /* binding */ ZodNull; },
22199 -/* harmony export */ ZodNullable: function() { return /* binding */ ZodNullable; },
22200 -/* harmony export */ ZodNumber: function() { return /* binding */ ZodNumber; },
22201 -/* harmony export */ ZodNumberFormat: function() { return /* binding */ ZodNumberFormat; },
22202 -/* harmony export */ ZodObject: function() { return /* binding */ ZodObject; },
22203 -/* harmony export */ ZodOptional: function() { return /* binding */ ZodOptional; },
22204 -/* harmony export */ ZodPipe: function() { return /* binding */ ZodPipe; },
22205 -/* harmony export */ ZodPrefault: function() { return /* binding */ ZodPrefault; },
22206 -/* harmony export */ ZodPromise: function() { return /* binding */ ZodPromise; },
22207 -/* harmony export */ ZodReadonly: function() { return /* binding */ ZodReadonly; },
22208 -/* harmony export */ ZodRecord: function() { return /* binding */ ZodRecord; },
22209 -/* harmony export */ ZodSet: function() { return /* binding */ ZodSet; },
22210 -/* harmony export */ ZodString: function() { return /* binding */ ZodString; },
22211 -/* harmony export */ ZodStringFormat: function() { return /* binding */ ZodStringFormat; },
22212 -/* harmony export */ ZodSuccess: function() { return /* binding */ ZodSuccess; },
22213 -/* harmony export */ ZodSymbol: function() { return /* binding */ ZodSymbol; },
22214 -/* harmony export */ ZodTemplateLiteral: function() { return /* binding */ ZodTemplateLiteral; },
22215 -/* harmony export */ ZodTransform: function() { return /* binding */ ZodTransform; },
22216 -/* harmony export */ ZodTuple: function() { return /* binding */ ZodTuple; },
22217 -/* harmony export */ ZodType: function() { return /* binding */ ZodType; },
22218 -/* harmony export */ ZodULID: function() { return /* binding */ ZodULID; },
22219 -/* harmony export */ ZodURL: function() { return /* binding */ ZodURL; },
22220 -/* harmony export */ ZodUUID: function() { return /* binding */ ZodUUID; },
22221 -/* harmony export */ ZodUndefined: function() { return /* binding */ ZodUndefined; },
22222 -/* harmony export */ ZodUnion: function() { return /* binding */ ZodUnion; },
22223 -/* harmony export */ ZodUnknown: function() { return /* binding */ ZodUnknown; },
22224 -/* harmony export */ ZodVoid: function() { return /* binding */ ZodVoid; },
22225 -/* harmony export */ ZodXID: function() { return /* binding */ ZodXID; },
22226 -/* harmony export */ _ZodString: function() { return /* binding */ _ZodString; },
22227 -/* harmony export */ _default: function() { return /* binding */ _default; },
22228 -/* harmony export */ any: function() { return /* binding */ any; },
22229 -/* harmony export */ array: function() { return /* binding */ array; },
22230 -/* harmony export */ base64: function() { return /* binding */ base64; },
22231 -/* harmony export */ base64url: function() { return /* binding */ base64url; },
22232 -/* harmony export */ bigint: function() { return /* binding */ bigint; },
22233 -/* harmony export */ boolean: function() { return /* binding */ boolean; },
22234 -/* harmony export */ "catch": function() { return /* binding */ _catch; },
22235 -/* harmony export */ check: function() { return /* binding */ check; },
22236 -/* harmony export */ cidrv4: function() { return /* binding */ cidrv4; },
22237 -/* harmony export */ cidrv6: function() { return /* binding */ cidrv6; },
22238 -/* harmony export */ cuid: function() { return /* binding */ cuid; },
22239 -/* harmony export */ cuid2: function() { return /* binding */ cuid2; },
22240 -/* harmony export */ custom: function() { return /* binding */ custom; },
22241 -/* harmony export */ date: function() { return /* binding */ date; },
22242 -/* harmony export */ discriminatedUnion: function() { return /* binding */ discriminatedUnion; },
22243 -/* harmony export */ e164: function() { return /* binding */ e164; },
22244 -/* harmony export */ email: function() { return /* binding */ email; },
22245 -/* harmony export */ emoji: function() { return /* binding */ emoji; },
22246 -/* harmony export */ "enum": function() { return /* binding */ _enum; },
22247 -/* harmony export */ file: function() { return /* binding */ file; },
22248 -/* harmony export */ float32: function() { return /* binding */ float32; },
22249 -/* harmony export */ float64: function() { return /* binding */ float64; },
22250 -/* harmony export */ guid: function() { return /* binding */ guid; },
22251 -/* harmony export */ "instanceof": function() { return /* binding */ _instanceof; },
22252 -/* harmony export */ int: function() { return /* binding */ int; },
22253 -/* harmony export */ int32: function() { return /* binding */ int32; },
22254 -/* harmony export */ int64: function() { return /* binding */ int64; },
22255 -/* harmony export */ intersection: function() { return /* binding */ intersection; },
22256 -/* harmony export */ ipv4: function() { return /* binding */ ipv4; },
22257 -/* harmony export */ ipv6: function() { return /* binding */ ipv6; },
22258 -/* harmony export */ json: function() { return /* binding */ json; },
22259 -/* harmony export */ jwt: function() { return /* binding */ jwt; },
22260 -/* harmony export */ keyof: function() { return /* binding */ keyof; },
22261 -/* harmony export */ ksuid: function() { return /* binding */ ksuid; },
22262 -/* harmony export */ lazy: function() { return /* binding */ lazy; },
22263 -/* harmony export */ literal: function() { return /* binding */ literal; },
22264 -/* harmony export */ looseObject: function() { return /* binding */ looseObject; },
22265 -/* harmony export */ map: function() { return /* binding */ map; },
22266 -/* harmony export */ nan: function() { return /* binding */ nan; },
22267 -/* harmony export */ nanoid: function() { return /* binding */ nanoid; },
22268 -/* harmony export */ nativeEnum: function() { return /* binding */ nativeEnum; },
22269 -/* harmony export */ never: function() { return /* binding */ never; },
22270 -/* harmony export */ nonoptional: function() { return /* binding */ nonoptional; },
22271 -/* harmony export */ "null": function() { return /* binding */ _null; },
22272 -/* harmony export */ nullable: function() { return /* binding */ nullable; },
22273 -/* harmony export */ nullish: function() { return /* binding */ nullish; },
22274 -/* harmony export */ number: function() { return /* binding */ number; },
22275 -/* harmony export */ object: function() { return /* binding */ object; },
22276 -/* harmony export */ optional: function() { return /* binding */ optional; },
22277 -/* harmony export */ partialRecord: function() { return /* binding */ partialRecord; },
22278 -/* harmony export */ pipe: function() { return /* binding */ pipe; },
22279 -/* harmony export */ prefault: function() { return /* binding */ prefault; },
22280 -/* harmony export */ preprocess: function() { return /* binding */ preprocess; },
22281 -/* harmony export */ promise: function() { return /* binding */ promise; },
22282 -/* harmony export */ readonly: function() { return /* binding */ readonly; },
22283 -/* harmony export */ record: function() { return /* binding */ record; },
22284 -/* harmony export */ refine: function() { return /* binding */ refine; },
22285 -/* harmony export */ set: function() { return /* binding */ set; },
22286 -/* harmony export */ strictObject: function() { return /* binding */ strictObject; },
22287 -/* harmony export */ string: function() { return /* binding */ string; },
22288 -/* harmony export */ stringFormat: function() { return /* binding */ stringFormat; },
22289 -/* harmony export */ stringbool: function() { return /* binding */ stringbool; },
22290 -/* harmony export */ success: function() { return /* binding */ success; },
22291 -/* harmony export */ superRefine: function() { return /* binding */ superRefine; },
22292 -/* harmony export */ symbol: function() { return /* binding */ symbol; },
22293 -/* harmony export */ templateLiteral: function() { return /* binding */ templateLiteral; },
22294 -/* harmony export */ transform: function() { return /* binding */ transform; },
22295 -/* harmony export */ tuple: function() { return /* binding */ tuple; },
22296 -/* harmony export */ uint32: function() { return /* binding */ uint32; },
22297 -/* harmony export */ uint64: function() { return /* binding */ uint64; },
22298 -/* harmony export */ ulid: function() { return /* binding */ ulid; },
22299 -/* harmony export */ undefined: function() { return /* binding */ _undefined; },
22300 -/* harmony export */ union: function() { return /* binding */ union; },
22301 -/* harmony export */ unknown: function() { return /* binding */ unknown; },
22302 -/* harmony export */ url: function() { return /* binding */ url; },
22303 -/* harmony export */ uuid: function() { return /* binding */ uuid; },
22304 -/* harmony export */ uuidv4: function() { return /* binding */ uuidv4; },
22305 -/* harmony export */ uuidv6: function() { return /* binding */ uuidv6; },
22306 -/* harmony export */ uuidv7: function() { return /* binding */ uuidv7; },
22307 -/* harmony export */ "void": function() { return /* binding */ _void; },
22308 -/* harmony export */ xid: function() { return /* binding */ xid; }
22309 -/* harmony export */ });
22310 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/core.js");
22311 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/schemas.js");
22312 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/checks.js");
22313 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/util.js");
22314 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/registries.js");
22315 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./checks.js */ "./node_modules/zod/v4/core/api.js");
22316 -/* harmony import */ var _iso_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./iso.js */ "./node_modules/zod/v4/classic/iso.js");
22317 -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./parse.js */ "./node_modules/zod/v4/classic/parse.js");
22318 -
22319 -
22320 -
22321 -
22322 -
22323 -const ZodType = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodType", (inst, def) => {
22324 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodType.init(inst, def);
22325 - inst.def = def;
22326 - Object.defineProperty(inst, "_def", { value: def });
22327 - // base methods
22328 - inst.check = (...checks) => {
22329 - return inst.clone({
22330 - ...def,
22331 - checks: [
22332 - ...(def.checks ?? []),
22333 - ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
22334 - ],
22335 - }
22336 - // { parent: true }
22337 - );
22338 - };
22339 - inst.clone = (def, params) => _core_index_js__WEBPACK_IMPORTED_MODULE_3__.clone(inst, def, params);
22340 - inst.brand = () => inst;
22341 - inst.register = ((reg, meta) => {
22342 - reg.add(inst, meta);
22343 - return inst;
22344 - });
22345 - // parsing
22346 - inst.parse = (data, params) => _parse_js__WEBPACK_IMPORTED_MODULE_7__.parse(inst, data, params, { callee: inst.parse });
22347 - inst.safeParse = (data, params) => _parse_js__WEBPACK_IMPORTED_MODULE_7__.safeParse(inst, data, params);
22348 - inst.parseAsync = async (data, params) => _parse_js__WEBPACK_IMPORTED_MODULE_7__.parseAsync(inst, data, params, { callee: inst.parseAsync });
22349 - inst.safeParseAsync = async (data, params) => _parse_js__WEBPACK_IMPORTED_MODULE_7__.safeParseAsync(inst, data, params);
22350 - inst.spa = inst.safeParseAsync;
22351 - // refinements
22352 - inst.refine = (check, params) => inst.check(refine(check, params));
22353 - inst.superRefine = (refinement) => inst.check(superRefine(refinement));
22354 - inst.overwrite = (fn) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._overwrite(fn));
22355 - // wrappers
22356 - inst.optional = () => optional(inst);
22357 - inst.nullable = () => nullable(inst);
22358 - inst.nullish = () => optional(nullable(inst));
22359 - inst.nonoptional = (params) => nonoptional(inst, params);
22360 - inst.array = () => array(inst);
22361 - inst.or = (arg) => union([inst, arg]);
22362 - inst.and = (arg) => intersection(inst, arg);
22363 - inst.transform = (tx) => pipe(inst, transform(tx));
22364 - inst.default = (def) => _default(inst, def);
22365 - inst.prefault = (def) => prefault(inst, def);
22366 - // inst.coalesce = (def, params) => coalesce(inst, def, params);
22367 - inst.catch = (params) => _catch(inst, params);
22368 - inst.pipe = (target) => pipe(inst, target);
22369 - inst.readonly = () => readonly(inst);
22370 - // meta
22371 - inst.describe = (description) => {
22372 - const cl = inst.clone();
22373 - _core_index_js__WEBPACK_IMPORTED_MODULE_4__.globalRegistry.add(cl, { description });
22374 - return cl;
22375 - };
22376 - Object.defineProperty(inst, "description", {
22377 - get() {
22378 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__.globalRegistry.get(inst)?.description;
22379 - },
22380 - configurable: true,
22381 - });
22382 - inst.meta = (...args) => {
22383 - if (args.length === 0) {
22384 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__.globalRegistry.get(inst);
22385 - }
22386 - const cl = inst.clone();
22387 - _core_index_js__WEBPACK_IMPORTED_MODULE_4__.globalRegistry.add(cl, args[0]);
22388 - return cl;
22389 - };
22390 - // helpers
22391 - inst.isOptional = () => inst.safeParse(undefined).success;
22392 - inst.isNullable = () => inst.safeParse(null).success;
22393 - return inst;
22394 -});
22395 -/** @internal */
22396 -const _ZodString = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("_ZodString", (inst, def) => {
22397 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodString.init(inst, def);
22398 - ZodType.init(inst, def);
22399 - const bag = inst._zod.bag;
22400 - inst.format = bag.format ?? null;
22401 - inst.minLength = bag.minimum ?? null;
22402 - inst.maxLength = bag.maximum ?? null;
22403 - // validations
22404 - inst.regex = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._regex(...args));
22405 - inst.includes = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._includes(...args));
22406 - inst.startsWith = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._startsWith(...args));
22407 - inst.endsWith = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._endsWith(...args));
22408 - inst.min = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._minLength(...args));
22409 - inst.max = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._maxLength(...args));
22410 - inst.length = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._length(...args));
22411 - inst.nonempty = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._minLength(1, ...args));
22412 - inst.lowercase = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lowercase(params));
22413 - inst.uppercase = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._uppercase(params));
22414 - // transforms
22415 - inst.trim = () => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._trim());
22416 - inst.normalize = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._normalize(...args));
22417 - inst.toLowerCase = () => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._toLowerCase());
22418 - inst.toUpperCase = () => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._toUpperCase());
22419 -});
22420 -const ZodString = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodString", (inst, def) => {
22421 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodString.init(inst, def);
22422 - _ZodString.init(inst, def);
22423 - inst.email = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._email(ZodEmail, params));
22424 - inst.url = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._url(ZodURL, params));
22425 - inst.jwt = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._jwt(ZodJWT, params));
22426 - inst.emoji = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._emoji(ZodEmoji, params));
22427 - inst.guid = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._guid(ZodGUID, params));
22428 - inst.uuid = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._uuid(ZodUUID, params));
22429 - inst.uuidv4 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._uuidv4(ZodUUID, params));
22430 - inst.uuidv6 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._uuidv6(ZodUUID, params));
22431 - inst.uuidv7 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._uuidv7(ZodUUID, params));
22432 - inst.nanoid = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._nanoid(ZodNanoID, params));
22433 - inst.guid = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._guid(ZodGUID, params));
22434 - inst.cuid = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._cuid(ZodCUID, params));
22435 - inst.cuid2 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._cuid2(ZodCUID2, params));
22436 - inst.ulid = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._ulid(ZodULID, params));
22437 - inst.base64 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._base64(ZodBase64, params));
22438 - inst.base64url = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._base64url(ZodBase64URL, params));
22439 - inst.xid = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._xid(ZodXID, params));
22440 - inst.ksuid = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._ksuid(ZodKSUID, params));
22441 - inst.ipv4 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._ipv4(ZodIPv4, params));
22442 - inst.ipv6 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._ipv6(ZodIPv6, params));
22443 - inst.cidrv4 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._cidrv4(ZodCIDRv4, params));
22444 - inst.cidrv6 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._cidrv6(ZodCIDRv6, params));
22445 - inst.e164 = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._e164(ZodE164, params));
22446 - // iso
22447 - inst.datetime = (params) => inst.check(_iso_js__WEBPACK_IMPORTED_MODULE_6__.datetime(params));
22448 - inst.date = (params) => inst.check(_iso_js__WEBPACK_IMPORTED_MODULE_6__.date(params));
22449 - inst.time = (params) => inst.check(_iso_js__WEBPACK_IMPORTED_MODULE_6__.time(params));
22450 - inst.duration = (params) => inst.check(_iso_js__WEBPACK_IMPORTED_MODULE_6__.duration(params));
22451 -});
22452 -function string(params) {
22453 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._string(ZodString, params);
22454 -}
22455 -const ZodStringFormat = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodStringFormat", (inst, def) => {
22456 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodStringFormat.init(inst, def);
22457 - _ZodString.init(inst, def);
22458 -});
22459 -const ZodEmail = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodEmail", (inst, def) => {
22460 - // ZodStringFormat.init(inst, def);
22461 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodEmail.init(inst, def);
22462 - ZodStringFormat.init(inst, def);
22463 -});
22464 -function email(params) {
22465 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._email(ZodEmail, params);
22466 -}
22467 -const ZodGUID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodGUID", (inst, def) => {
22468 - // ZodStringFormat.init(inst, def);
22469 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodGUID.init(inst, def);
22470 - ZodStringFormat.init(inst, def);
22471 -});
22472 -function guid(params) {
22473 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._guid(ZodGUID, params);
22474 -}
22475 -const ZodUUID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodUUID", (inst, def) => {
22476 - // ZodStringFormat.init(inst, def);
22477 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodUUID.init(inst, def);
22478 - ZodStringFormat.init(inst, def);
22479 -});
22480 -function uuid(params) {
22481 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._uuid(ZodUUID, params);
22482 -}
22483 -function uuidv4(params) {
22484 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._uuidv4(ZodUUID, params);
22485 -}
22486 -// ZodUUIDv6
22487 -function uuidv6(params) {
22488 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._uuidv6(ZodUUID, params);
22489 -}
22490 -// ZodUUIDv7
22491 -function uuidv7(params) {
22492 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._uuidv7(ZodUUID, params);
22493 -}
22494 -const ZodURL = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodURL", (inst, def) => {
22495 - // ZodStringFormat.init(inst, def);
22496 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodURL.init(inst, def);
22497 - ZodStringFormat.init(inst, def);
22498 -});
22499 -function url(params) {
22500 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._url(ZodURL, params);
22501 -}
22502 -const ZodEmoji = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodEmoji", (inst, def) => {
22503 - // ZodStringFormat.init(inst, def);
22504 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodEmoji.init(inst, def);
22505 - ZodStringFormat.init(inst, def);
22506 -});
22507 -function emoji(params) {
22508 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._emoji(ZodEmoji, params);
22509 -}
22510 -const ZodNanoID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodNanoID", (inst, def) => {
22511 - // ZodStringFormat.init(inst, def);
22512 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNanoID.init(inst, def);
22513 - ZodStringFormat.init(inst, def);
22514 -});
22515 -function nanoid(params) {
22516 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._nanoid(ZodNanoID, params);
22517 -}
22518 -const ZodCUID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodCUID", (inst, def) => {
22519 - // ZodStringFormat.init(inst, def);
22520 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCUID.init(inst, def);
22521 - ZodStringFormat.init(inst, def);
22522 -});
22523 -function cuid(params) {
22524 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._cuid(ZodCUID, params);
22525 -}
22526 -const ZodCUID2 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodCUID2", (inst, def) => {
22527 - // ZodStringFormat.init(inst, def);
22528 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCUID2.init(inst, def);
22529 - ZodStringFormat.init(inst, def);
22530 -});
22531 -function cuid2(params) {
22532 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._cuid2(ZodCUID2, params);
22533 -}
22534 -const ZodULID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodULID", (inst, def) => {
22535 - // ZodStringFormat.init(inst, def);
22536 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodULID.init(inst, def);
22537 - ZodStringFormat.init(inst, def);
22538 -});
22539 -function ulid(params) {
22540 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._ulid(ZodULID, params);
22541 -}
22542 -const ZodXID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodXID", (inst, def) => {
22543 - // ZodStringFormat.init(inst, def);
22544 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodXID.init(inst, def);
22545 - ZodStringFormat.init(inst, def);
22546 -});
22547 -function xid(params) {
22548 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._xid(ZodXID, params);
22549 -}
22550 -const ZodKSUID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodKSUID", (inst, def) => {
22551 - // ZodStringFormat.init(inst, def);
22552 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodKSUID.init(inst, def);
22553 - ZodStringFormat.init(inst, def);
22554 -});
22555 -function ksuid(params) {
22556 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._ksuid(ZodKSUID, params);
22557 -}
22558 -const ZodIPv4 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodIPv4", (inst, def) => {
22559 - // ZodStringFormat.init(inst, def);
22560 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodIPv4.init(inst, def);
22561 - ZodStringFormat.init(inst, def);
22562 -});
22563 -function ipv4(params) {
22564 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._ipv4(ZodIPv4, params);
22565 -}
22566 -const ZodIPv6 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodIPv6", (inst, def) => {
22567 - // ZodStringFormat.init(inst, def);
22568 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodIPv6.init(inst, def);
22569 - ZodStringFormat.init(inst, def);
22570 -});
22571 -function ipv6(params) {
22572 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._ipv6(ZodIPv6, params);
22573 -}
22574 -const ZodCIDRv4 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodCIDRv4", (inst, def) => {
22575 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCIDRv4.init(inst, def);
22576 - ZodStringFormat.init(inst, def);
22577 -});
22578 -function cidrv4(params) {
22579 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._cidrv4(ZodCIDRv4, params);
22580 -}
22581 -const ZodCIDRv6 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodCIDRv6", (inst, def) => {
22582 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCIDRv6.init(inst, def);
22583 - ZodStringFormat.init(inst, def);
22584 -});
22585 -function cidrv6(params) {
22586 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._cidrv6(ZodCIDRv6, params);
22587 -}
22588 -const ZodBase64 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodBase64", (inst, def) => {
22589 - // ZodStringFormat.init(inst, def);
22590 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBase64.init(inst, def);
22591 - ZodStringFormat.init(inst, def);
22592 -});
22593 -function base64(params) {
22594 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._base64(ZodBase64, params);
22595 -}
22596 -const ZodBase64URL = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodBase64URL", (inst, def) => {
22597 - // ZodStringFormat.init(inst, def);
22598 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBase64URL.init(inst, def);
22599 - ZodStringFormat.init(inst, def);
22600 -});
22601 -function base64url(params) {
22602 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._base64url(ZodBase64URL, params);
22603 -}
22604 -const ZodE164 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodE164", (inst, def) => {
22605 - // ZodStringFormat.init(inst, def);
22606 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodE164.init(inst, def);
22607 - ZodStringFormat.init(inst, def);
22608 -});
22609 -function e164(params) {
22610 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._e164(ZodE164, params);
22611 -}
22612 -const ZodJWT = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodJWT", (inst, def) => {
22613 - // ZodStringFormat.init(inst, def);
22614 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodJWT.init(inst, def);
22615 - ZodStringFormat.init(inst, def);
22616 -});
22617 -function jwt(params) {
22618 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._jwt(ZodJWT, params);
22619 -}
22620 -const ZodCustomStringFormat = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodCustomStringFormat", (inst, def) => {
22621 - // ZodStringFormat.init(inst, def);
22622 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCustomStringFormat.init(inst, def);
22623 - ZodStringFormat.init(inst, def);
22624 -});
22625 -function stringFormat(format, fnOrRegex, _params = {}) {
22626 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
22627 -}
22628 -const ZodNumber = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodNumber", (inst, def) => {
22629 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNumber.init(inst, def);
22630 - ZodType.init(inst, def);
22631 - inst.gt = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gt(value, params));
22632 - inst.gte = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gte(value, params));
22633 - inst.min = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gte(value, params));
22634 - inst.lt = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lt(value, params));
22635 - inst.lte = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lte(value, params));
22636 - inst.max = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lte(value, params));
22637 - inst.int = (params) => inst.check(int(params));
22638 - inst.safe = (params) => inst.check(int(params));
22639 - inst.positive = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gt(0, params));
22640 - inst.nonnegative = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gte(0, params));
22641 - inst.negative = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lt(0, params));
22642 - inst.nonpositive = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lte(0, params));
22643 - inst.multipleOf = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._multipleOf(value, params));
22644 - inst.step = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._multipleOf(value, params));
22645 - // inst.finite = (params) => inst.check(core.finite(params));
22646 - inst.finite = () => inst;
22647 - const bag = inst._zod.bag;
22648 - inst.minValue =
22649 - Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
22650 - inst.maxValue =
22651 - Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
22652 - inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? 0.5);
22653 - inst.isFinite = true;
22654 - inst.format = bag.format ?? null;
22655 -});
22656 -function number(params) {
22657 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._number(ZodNumber, params);
22658 -}
22659 -const ZodNumberFormat = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodNumberFormat", (inst, def) => {
22660 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNumberFormat.init(inst, def);
22661 - ZodNumber.init(inst, def);
22662 -});
22663 -function int(params) {
22664 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._int(ZodNumberFormat, params);
22665 -}
22666 -function float32(params) {
22667 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._float32(ZodNumberFormat, params);
22668 -}
22669 -function float64(params) {
22670 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._float64(ZodNumberFormat, params);
22671 -}
22672 -function int32(params) {
22673 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._int32(ZodNumberFormat, params);
22674 -}
22675 -function uint32(params) {
22676 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._uint32(ZodNumberFormat, params);
22677 -}
22678 -const ZodBoolean = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodBoolean", (inst, def) => {
22679 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBoolean.init(inst, def);
22680 - ZodType.init(inst, def);
22681 -});
22682 -function boolean(params) {
22683 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._boolean(ZodBoolean, params);
22684 -}
22685 -const ZodBigInt = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodBigInt", (inst, def) => {
22686 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBigInt.init(inst, def);
22687 - ZodType.init(inst, def);
22688 - inst.gte = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gte(value, params));
22689 - inst.min = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gte(value, params));
22690 - inst.gt = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gt(value, params));
22691 - inst.gte = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gte(value, params));
22692 - inst.min = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gte(value, params));
22693 - inst.lt = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lt(value, params));
22694 - inst.lte = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lte(value, params));
22695 - inst.max = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lte(value, params));
22696 - inst.positive = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gt(BigInt(0), params));
22697 - inst.negative = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lt(BigInt(0), params));
22698 - inst.nonpositive = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lte(BigInt(0), params));
22699 - inst.nonnegative = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gte(BigInt(0), params));
22700 - inst.multipleOf = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._multipleOf(value, params));
22701 - const bag = inst._zod.bag;
22702 - inst.minValue = bag.minimum ?? null;
22703 - inst.maxValue = bag.maximum ?? null;
22704 - inst.format = bag.format ?? null;
22705 -});
22706 -function bigint(params) {
22707 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._bigint(ZodBigInt, params);
22708 -}
22709 -const ZodBigIntFormat = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodBigIntFormat", (inst, def) => {
22710 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBigIntFormat.init(inst, def);
22711 - ZodBigInt.init(inst, def);
22712 -});
22713 -// int64
22714 -function int64(params) {
22715 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._int64(ZodBigIntFormat, params);
22716 -}
22717 -// uint64
22718 -function uint64(params) {
22719 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._uint64(ZodBigIntFormat, params);
22720 -}
22721 -const ZodSymbol = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodSymbol", (inst, def) => {
22722 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodSymbol.init(inst, def);
22723 - ZodType.init(inst, def);
22724 -});
22725 -function symbol(params) {
22726 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._symbol(ZodSymbol, params);
22727 -}
22728 -const ZodUndefined = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodUndefined", (inst, def) => {
22729 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodUndefined.init(inst, def);
22730 - ZodType.init(inst, def);
22731 -});
22732 -function _undefined(params) {
22733 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._undefined(ZodUndefined, params);
22734 -}
22735 -
22736 -const ZodNull = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodNull", (inst, def) => {
22737 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNull.init(inst, def);
22738 - ZodType.init(inst, def);
22739 -});
22740 -function _null(params) {
22741 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._null(ZodNull, params);
22742 -}
22743 -
22744 -const ZodAny = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodAny", (inst, def) => {
22745 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodAny.init(inst, def);
22746 - ZodType.init(inst, def);
22747 -});
22748 -function any() {
22749 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._any(ZodAny);
22750 -}
22751 -const ZodUnknown = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodUnknown", (inst, def) => {
22752 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodUnknown.init(inst, def);
22753 - ZodType.init(inst, def);
22754 -});
22755 -function unknown() {
22756 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._unknown(ZodUnknown);
22757 -}
22758 -const ZodNever = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodNever", (inst, def) => {
22759 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNever.init(inst, def);
22760 - ZodType.init(inst, def);
22761 -});
22762 -function never(params) {
22763 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._never(ZodNever, params);
22764 -}
22765 -const ZodVoid = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodVoid", (inst, def) => {
22766 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodVoid.init(inst, def);
22767 - ZodType.init(inst, def);
22768 -});
22769 -function _void(params) {
22770 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._void(ZodVoid, params);
22771 -}
22772 -
22773 -const ZodDate = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodDate", (inst, def) => {
22774 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodDate.init(inst, def);
22775 - ZodType.init(inst, def);
22776 - inst.min = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._gte(value, params));
22777 - inst.max = (value, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._lte(value, params));
22778 - const c = inst._zod.bag;
22779 - inst.minDate = c.minimum ? new Date(c.minimum) : null;
22780 - inst.maxDate = c.maximum ? new Date(c.maximum) : null;
22781 -});
22782 -function date(params) {
22783 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._date(ZodDate, params);
22784 -}
22785 -const ZodArray = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodArray", (inst, def) => {
22786 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodArray.init(inst, def);
22787 - ZodType.init(inst, def);
22788 - inst.element = def.element;
22789 - inst.min = (minLength, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._minLength(minLength, params));
22790 - inst.nonempty = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._minLength(1, params));
22791 - inst.max = (maxLength, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._maxLength(maxLength, params));
22792 - inst.length = (len, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._length(len, params));
22793 - inst.unwrap = () => inst.element;
22794 -});
22795 -function array(element, params) {
22796 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._array(ZodArray, element, params);
22797 -}
22798 -// .keyof
22799 -function keyof(schema) {
22800 - const shape = schema._zod.def.shape;
22801 - return literal(Object.keys(shape));
22802 -}
22803 -const ZodObject = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodObject", (inst, def) => {
22804 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodObject.init(inst, def);
22805 - ZodType.init(inst, def);
22806 - _core_index_js__WEBPACK_IMPORTED_MODULE_3__.defineLazy(inst, "shape", () => def.shape);
22807 - inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
22808 - inst.catchall = (catchall) => inst.clone({ ...inst._zod.def, catchall: catchall });
22809 - inst.passthrough = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
22810 - // inst.nonstrict = () => inst.clone({ ...inst._zod.def, catchall: api.unknown() });
22811 - inst.loose = () => inst.clone({ ...inst._zod.def, catchall: unknown() });
22812 - inst.strict = () => inst.clone({ ...inst._zod.def, catchall: never() });
22813 - inst.strip = () => inst.clone({ ...inst._zod.def, catchall: undefined });
22814 - inst.extend = (incoming) => {
22815 - return _core_index_js__WEBPACK_IMPORTED_MODULE_3__.extend(inst, incoming);
22816 - };
22817 - inst.merge = (other) => _core_index_js__WEBPACK_IMPORTED_MODULE_3__.merge(inst, other);
22818 - inst.pick = (mask) => _core_index_js__WEBPACK_IMPORTED_MODULE_3__.pick(inst, mask);
22819 - inst.omit = (mask) => _core_index_js__WEBPACK_IMPORTED_MODULE_3__.omit(inst, mask);
22820 - inst.partial = (...args) => _core_index_js__WEBPACK_IMPORTED_MODULE_3__.partial(ZodOptional, inst, args[0]);
22821 - inst.required = (...args) => _core_index_js__WEBPACK_IMPORTED_MODULE_3__.required(ZodNonOptional, inst, args[0]);
22822 -});
22823 -function object(shape, params) {
22824 - const def = {
22825 - type: "object",
22826 - get shape() {
22827 - _core_index_js__WEBPACK_IMPORTED_MODULE_3__.assignProp(this, "shape", { ...shape });
22828 - return this.shape;
22829 - },
22830 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22831 - };
22832 - return new ZodObject(def);
22833 -}
22834 -// strictObject
22835 -function strictObject(shape, params) {
22836 - return new ZodObject({
22837 - type: "object",
22838 - get shape() {
22839 - _core_index_js__WEBPACK_IMPORTED_MODULE_3__.assignProp(this, "shape", { ...shape });
22840 - return this.shape;
22841 - },
22842 - catchall: never(),
22843 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22844 - });
22845 -}
22846 -// looseObject
22847 -function looseObject(shape, params) {
22848 - return new ZodObject({
22849 - type: "object",
22850 - get shape() {
22851 - _core_index_js__WEBPACK_IMPORTED_MODULE_3__.assignProp(this, "shape", { ...shape });
22852 - return this.shape;
22853 - },
22854 - catchall: unknown(),
22855 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22856 - });
22857 -}
22858 -const ZodUnion = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodUnion", (inst, def) => {
22859 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodUnion.init(inst, def);
22860 - ZodType.init(inst, def);
22861 - inst.options = def.options;
22862 -});
22863 -function union(options, params) {
22864 - return new ZodUnion({
22865 - type: "union",
22866 - options: options,
22867 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22868 - });
22869 -}
22870 -const ZodDiscriminatedUnion = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodDiscriminatedUnion", (inst, def) => {
22871 - ZodUnion.init(inst, def);
22872 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodDiscriminatedUnion.init(inst, def);
22873 -});
22874 -function discriminatedUnion(discriminator, options, params) {
22875 - // const [options, params] = args;
22876 - return new ZodDiscriminatedUnion({
22877 - type: "union",
22878 - options,
22879 - discriminator,
22880 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22881 - });
22882 -}
22883 -const ZodIntersection = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodIntersection", (inst, def) => {
22884 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodIntersection.init(inst, def);
22885 - ZodType.init(inst, def);
22886 -});
22887 -function intersection(left, right) {
22888 - return new ZodIntersection({
22889 - type: "intersection",
22890 - left: left,
22891 - right: right,
22892 - });
22893 -}
22894 -const ZodTuple = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodTuple", (inst, def) => {
22895 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodTuple.init(inst, def);
22896 - ZodType.init(inst, def);
22897 - inst.rest = (rest) => inst.clone({
22898 - ...inst._zod.def,
22899 - rest: rest,
22900 - });
22901 -});
22902 -function tuple(items, _paramsOrRest, _params) {
22903 - const hasRest = _paramsOrRest instanceof _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodType;
22904 - const params = hasRest ? _params : _paramsOrRest;
22905 - const rest = hasRest ? _paramsOrRest : null;
22906 - return new ZodTuple({
22907 - type: "tuple",
22908 - items: items,
22909 - rest,
22910 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22911 - });
22912 -}
22913 -const ZodRecord = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodRecord", (inst, def) => {
22914 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodRecord.init(inst, def);
22915 - ZodType.init(inst, def);
22916 - inst.keyType = def.keyType;
22917 - inst.valueType = def.valueType;
22918 -});
22919 -function record(keyType, valueType, params) {
22920 - return new ZodRecord({
22921 - type: "record",
22922 - keyType,
22923 - valueType: valueType,
22924 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22925 - });
22926 -}
22927 -// type alksjf = core.output<core.$ZodRecordKey>;
22928 -function partialRecord(keyType, valueType, params) {
22929 - return new ZodRecord({
22930 - type: "record",
22931 - keyType: union([keyType, never()]),
22932 - valueType: valueType,
22933 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22934 - });
22935 -}
22936 -const ZodMap = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMap", (inst, def) => {
22937 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodMap.init(inst, def);
22938 - ZodType.init(inst, def);
22939 - inst.keyType = def.keyType;
22940 - inst.valueType = def.valueType;
22941 -});
22942 -function map(keyType, valueType, params) {
22943 - return new ZodMap({
22944 - type: "map",
22945 - keyType: keyType,
22946 - valueType: valueType,
22947 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22948 - });
22949 -}
22950 -const ZodSet = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodSet", (inst, def) => {
22951 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodSet.init(inst, def);
22952 - ZodType.init(inst, def);
22953 - inst.min = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._minSize(...args));
22954 - inst.nonempty = (params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._minSize(1, params));
22955 - inst.max = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._maxSize(...args));
22956 - inst.size = (...args) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._size(...args));
22957 -});
22958 -function set(valueType, params) {
22959 - return new ZodSet({
22960 - type: "set",
22961 - valueType: valueType,
22962 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22963 - });
22964 -}
22965 -const ZodEnum = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodEnum", (inst, def) => {
22966 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodEnum.init(inst, def);
22967 - ZodType.init(inst, def);
22968 - inst.enum = def.entries;
22969 - inst.options = Object.values(def.entries);
22970 - const keys = new Set(Object.keys(def.entries));
22971 - inst.extract = (values, params) => {
22972 - const newEntries = {};
22973 - for (const value of values) {
22974 - if (keys.has(value)) {
22975 - newEntries[value] = def.entries[value];
22976 - }
22977 - else
22978 - throw new Error(`Key ${value} not found in enum`);
22979 - }
22980 - return new ZodEnum({
22981 - ...def,
22982 - checks: [],
22983 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
22984 - entries: newEntries,
22985 - });
22986 - };
22987 - inst.exclude = (values, params) => {
22988 - const newEntries = { ...def.entries };
22989 - for (const value of values) {
22990 - if (keys.has(value)) {
22991 - delete newEntries[value];
22992 - }
22993 - else
22994 - throw new Error(`Key ${value} not found in enum`);
22995 - }
22996 - return new ZodEnum({
22997 - ...def,
22998 - checks: [],
22999 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
23000 - entries: newEntries,
23001 - });
23002 - };
23003 -});
23004 -function _enum(values, params) {
23005 - const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
23006 - return new ZodEnum({
23007 - type: "enum",
23008 - entries,
23009 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
23010 - });
23011 -}
23012 -
23013 -/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
23014 - *
23015 - * ```ts
23016 - * enum Colors { red, green, blue }
23017 - * z.enum(Colors);
23018 - * ```
23019 - */
23020 -function nativeEnum(entries, params) {
23021 - return new ZodEnum({
23022 - type: "enum",
23023 - entries,
23024 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
23025 - });
23026 -}
23027 -const ZodLiteral = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodLiteral", (inst, def) => {
23028 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodLiteral.init(inst, def);
23029 - ZodType.init(inst, def);
23030 - inst.values = new Set(def.values);
23031 - Object.defineProperty(inst, "value", {
23032 - get() {
23033 - if (def.values.length > 1) {
23034 - throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
23035 - }
23036 - return def.values[0];
23037 - },
23038 - });
23039 -});
23040 -function literal(value, params) {
23041 - return new ZodLiteral({
23042 - type: "literal",
23043 - values: Array.isArray(value) ? value : [value],
23044 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
23045 - });
23046 -}
23047 -const ZodFile = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodFile", (inst, def) => {
23048 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodFile.init(inst, def);
23049 - ZodType.init(inst, def);
23050 - inst.min = (size, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._minSize(size, params));
23051 - inst.max = (size, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._maxSize(size, params));
23052 - inst.mime = (types, params) => inst.check(_core_index_js__WEBPACK_IMPORTED_MODULE_5__._mime(Array.isArray(types) ? types : [types], params));
23053 -});
23054 -function file(params) {
23055 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._file(ZodFile, params);
23056 -}
23057 -const ZodTransform = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodTransform", (inst, def) => {
23058 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodTransform.init(inst, def);
23059 - ZodType.init(inst, def);
23060 - inst._zod.parse = (payload, _ctx) => {
23061 - payload.addIssue = (issue) => {
23062 - if (typeof issue === "string") {
23063 - payload.issues.push(_core_index_js__WEBPACK_IMPORTED_MODULE_3__.issue(issue, payload.value, def));
23064 - }
23065 - else {
23066 - // for Zod 3 backwards compatibility
23067 - const _issue = issue;
23068 - if (_issue.fatal)
23069 - _issue.continue = false;
23070 - _issue.code ?? (_issue.code = "custom");
23071 - _issue.input ?? (_issue.input = payload.value);
23072 - _issue.inst ?? (_issue.inst = inst);
23073 - _issue.continue ?? (_issue.continue = true);
23074 - payload.issues.push(_core_index_js__WEBPACK_IMPORTED_MODULE_3__.issue(_issue));
23075 - }
23076 - };
23077 - const output = def.transform(payload.value, payload);
23078 - if (output instanceof Promise) {
23079 - return output.then((output) => {
23080 - payload.value = output;
23081 - return payload;
23082 - });
23083 - }
23084 - payload.value = output;
23085 - return payload;
23086 - };
23087 -});
23088 -function transform(fn) {
23089 - return new ZodTransform({
23090 - type: "transform",
23091 - transform: fn,
23092 - });
23093 -}
23094 -const ZodOptional = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodOptional", (inst, def) => {
23095 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodOptional.init(inst, def);
23096 - ZodType.init(inst, def);
23097 - inst.unwrap = () => inst._zod.def.innerType;
23098 -});
23099 -function optional(innerType) {
23100 - return new ZodOptional({
23101 - type: "optional",
23102 - innerType: innerType,
23103 - });
23104 -}
23105 -const ZodNullable = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodNullable", (inst, def) => {
23106 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNullable.init(inst, def);
23107 - ZodType.init(inst, def);
23108 - inst.unwrap = () => inst._zod.def.innerType;
23109 -});
23110 -function nullable(innerType) {
23111 - return new ZodNullable({
23112 - type: "nullable",
23113 - innerType: innerType,
23114 - });
23115 -}
23116 -// nullish
23117 -function nullish(innerType) {
23118 - return optional(nullable(innerType));
23119 -}
23120 -const ZodDefault = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodDefault", (inst, def) => {
23121 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodDefault.init(inst, def);
23122 - ZodType.init(inst, def);
23123 - inst.unwrap = () => inst._zod.def.innerType;
23124 - inst.removeDefault = inst.unwrap;
23125 -});
23126 -function _default(innerType, defaultValue) {
23127 - return new ZodDefault({
23128 - type: "default",
23129 - innerType: innerType,
23130 - get defaultValue() {
23131 - return typeof defaultValue === "function" ? defaultValue() : defaultValue;
23132 - },
23133 - });
23134 -}
23135 -const ZodPrefault = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodPrefault", (inst, def) => {
23136 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodPrefault.init(inst, def);
23137 - ZodType.init(inst, def);
23138 - inst.unwrap = () => inst._zod.def.innerType;
23139 -});
23140 -function prefault(innerType, defaultValue) {
23141 - return new ZodPrefault({
23142 - type: "prefault",
23143 - innerType: innerType,
23144 - get defaultValue() {
23145 - return typeof defaultValue === "function" ? defaultValue() : defaultValue;
23146 - },
23147 - });
23148 -}
23149 -const ZodNonOptional = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodNonOptional", (inst, def) => {
23150 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNonOptional.init(inst, def);
23151 - ZodType.init(inst, def);
23152 - inst.unwrap = () => inst._zod.def.innerType;
23153 -});
23154 -function nonoptional(innerType, params) {
23155 - return new ZodNonOptional({
23156 - type: "nonoptional",
23157 - innerType: innerType,
23158 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
23159 - });
23160 -}
23161 -const ZodSuccess = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodSuccess", (inst, def) => {
23162 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodSuccess.init(inst, def);
23163 - ZodType.init(inst, def);
23164 - inst.unwrap = () => inst._zod.def.innerType;
23165 -});
23166 -function success(innerType) {
23167 - return new ZodSuccess({
23168 - type: "success",
23169 - innerType: innerType,
23170 - });
23171 -}
23172 -const ZodCatch = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodCatch", (inst, def) => {
23173 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCatch.init(inst, def);
23174 - ZodType.init(inst, def);
23175 - inst.unwrap = () => inst._zod.def.innerType;
23176 - inst.removeCatch = inst.unwrap;
23177 -});
23178 -function _catch(innerType, catchValue) {
23179 - return new ZodCatch({
23180 - type: "catch",
23181 - innerType: innerType,
23182 - catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
23183 - });
23184 -}
23185 -
23186 -const ZodNaN = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodNaN", (inst, def) => {
23187 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNaN.init(inst, def);
23188 - ZodType.init(inst, def);
23189 -});
23190 -function nan(params) {
23191 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._nan(ZodNaN, params);
23192 -}
23193 -const ZodPipe = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodPipe", (inst, def) => {
23194 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodPipe.init(inst, def);
23195 - ZodType.init(inst, def);
23196 - inst.in = def.in;
23197 - inst.out = def.out;
23198 -});
23199 -function pipe(in_, out) {
23200 - return new ZodPipe({
23201 - type: "pipe",
23202 - in: in_,
23203 - out: out,
23204 - // ...util.normalizeParams(params),
23205 - });
23206 -}
23207 -const ZodReadonly = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodReadonly", (inst, def) => {
23208 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodReadonly.init(inst, def);
23209 - ZodType.init(inst, def);
23210 -});
23211 -function readonly(innerType) {
23212 - return new ZodReadonly({
23213 - type: "readonly",
23214 - innerType: innerType,
23215 - });
23216 -}
23217 -const ZodTemplateLiteral = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodTemplateLiteral", (inst, def) => {
23218 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodTemplateLiteral.init(inst, def);
23219 - ZodType.init(inst, def);
23220 -});
23221 -function templateLiteral(parts, params) {
23222 - return new ZodTemplateLiteral({
23223 - type: "template_literal",
23224 - parts,
23225 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
23226 - });
23227 -}
23228 -const ZodLazy = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodLazy", (inst, def) => {
23229 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodLazy.init(inst, def);
23230 - ZodType.init(inst, def);
23231 - inst.unwrap = () => inst._zod.def.getter();
23232 -});
23233 -function lazy(getter) {
23234 - return new ZodLazy({
23235 - type: "lazy",
23236 - getter: getter,
23237 - });
23238 -}
23239 -const ZodPromise = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodPromise", (inst, def) => {
23240 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodPromise.init(inst, def);
23241 - ZodType.init(inst, def);
23242 - inst.unwrap = () => inst._zod.def.innerType;
23243 -});
23244 -function promise(innerType) {
23245 - return new ZodPromise({
23246 - type: "promise",
23247 - innerType: innerType,
23248 - });
23249 -}
23250 -const ZodCustom = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodCustom", (inst, def) => {
23251 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCustom.init(inst, def);
23252 - ZodType.init(inst, def);
23253 -});
23254 -// custom checks
23255 -function check(fn) {
23256 - const ch = new _core_index_js__WEBPACK_IMPORTED_MODULE_2__.$ZodCheck({
23257 - check: "custom",
23258 - // ...util.normalizeParams(params),
23259 - });
23260 - ch._zod.check = fn;
23261 - return ch;
23262 -}
23263 -function custom(fn, _params) {
23264 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._custom(ZodCustom, fn ?? (() => true), _params);
23265 -}
23266 -function refine(fn, _params = {}) {
23267 - return _core_index_js__WEBPACK_IMPORTED_MODULE_5__._refine(ZodCustom, fn, _params);
23268 -}
23269 -// superRefine
23270 -function superRefine(fn) {
23271 - const ch = check((payload) => {
23272 - payload.addIssue = (issue) => {
23273 - if (typeof issue === "string") {
23274 - payload.issues.push(_core_index_js__WEBPACK_IMPORTED_MODULE_3__.issue(issue, payload.value, ch._zod.def));
23275 - }
23276 - else {
23277 - // for Zod 3 backwards compatibility
23278 - const _issue = issue;
23279 - if (_issue.fatal)
23280 - _issue.continue = false;
23281 - _issue.code ?? (_issue.code = "custom");
23282 - _issue.input ?? (_issue.input = payload.value);
23283 - _issue.inst ?? (_issue.inst = ch);
23284 - _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
23285 - payload.issues.push(_core_index_js__WEBPACK_IMPORTED_MODULE_3__.issue(_issue));
23286 - }
23287 - };
23288 - return fn(payload.value, payload);
23289 - });
23290 - return ch;
23291 -}
23292 -function _instanceof(cls, params = {
23293 - error: `Input not instance of ${cls.name}`,
23294 -}) {
23295 - const inst = new ZodCustom({
23296 - type: "custom",
23297 - check: "custom",
23298 - fn: (data) => data instanceof cls,
23299 - abort: true,
23300 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
23301 - });
23302 - inst._zod.bag.Class = cls;
23303 - return inst;
23304 -}
23305 -
23306 -// stringbool
23307 -const stringbool = (...args) => _core_index_js__WEBPACK_IMPORTED_MODULE_5__._stringbool({
23308 - Pipe: ZodPipe,
23309 - Boolean: ZodBoolean,
23310 - String: ZodString,
23311 - Transform: ZodTransform,
23312 -}, ...args);
23313 -function json(params) {
23314 - const jsonSchema = lazy(() => {
23315 - return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
23316 - });
23317 - return jsonSchema;
23318 -}
23319 -// preprocess
23320 -// /** @deprecated Use `z.pipe()` and `z.transform()` instead. */
23321 -function preprocess(fn, schema) {
23322 - return pipe(transform(fn), schema);
23323 -}
23324 -
23325 -
23326 -/***/ }),
23327 -
23328 -/***/ "./node_modules/zod/v4/core/api.js":
23329 -/*!*****************************************!*\
23330 - !*** ./node_modules/zod/v4/core/api.js ***!
23331 - \*****************************************/
23332 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
23333 -
23334 -__webpack_require__.r(__webpack_exports__);
23335 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
23336 -/* harmony export */ TimePrecision: function() { return /* binding */ TimePrecision; },
23337 -/* harmony export */ _any: function() { return /* binding */ _any; },
23338 -/* harmony export */ _array: function() { return /* binding */ _array; },
23339 -/* harmony export */ _base64: function() { return /* binding */ _base64; },
23340 -/* harmony export */ _base64url: function() { return /* binding */ _base64url; },
23341 -/* harmony export */ _bigint: function() { return /* binding */ _bigint; },
23342 -/* harmony export */ _boolean: function() { return /* binding */ _boolean; },
23343 -/* harmony export */ _catch: function() { return /* binding */ _catch; },
23344 -/* harmony export */ _cidrv4: function() { return /* binding */ _cidrv4; },
23345 -/* harmony export */ _cidrv6: function() { return /* binding */ _cidrv6; },
23346 -/* harmony export */ _coercedBigint: function() { return /* binding */ _coercedBigint; },
23347 -/* harmony export */ _coercedBoolean: function() { return /* binding */ _coercedBoolean; },
23348 -/* harmony export */ _coercedDate: function() { return /* binding */ _coercedDate; },
23349 -/* harmony export */ _coercedNumber: function() { return /* binding */ _coercedNumber; },
23350 -/* harmony export */ _coercedString: function() { return /* binding */ _coercedString; },
23351 -/* harmony export */ _cuid: function() { return /* binding */ _cuid; },
23352 -/* harmony export */ _cuid2: function() { return /* binding */ _cuid2; },
23353 -/* harmony export */ _custom: function() { return /* binding */ _custom; },
23354 -/* harmony export */ _date: function() { return /* binding */ _date; },
23355 -/* harmony export */ _default: function() { return /* binding */ _default; },
23356 -/* harmony export */ _discriminatedUnion: function() { return /* binding */ _discriminatedUnion; },
23357 -/* harmony export */ _e164: function() { return /* binding */ _e164; },
23358 -/* harmony export */ _email: function() { return /* binding */ _email; },
23359 -/* harmony export */ _emoji: function() { return /* binding */ _emoji; },
23360 -/* harmony export */ _endsWith: function() { return /* binding */ _endsWith; },
23361 -/* harmony export */ _enum: function() { return /* binding */ _enum; },
23362 -/* harmony export */ _file: function() { return /* binding */ _file; },
23363 -/* harmony export */ _float32: function() { return /* binding */ _float32; },
23364 -/* harmony export */ _float64: function() { return /* binding */ _float64; },
23365 -/* harmony export */ _gt: function() { return /* binding */ _gt; },
23366 -/* harmony export */ _gte: function() { return /* binding */ _gte; },
23367 -/* harmony export */ _guid: function() { return /* binding */ _guid; },
23368 -/* harmony export */ _includes: function() { return /* binding */ _includes; },
23369 -/* harmony export */ _int: function() { return /* binding */ _int; },
23370 -/* harmony export */ _int32: function() { return /* binding */ _int32; },
23371 -/* harmony export */ _int64: function() { return /* binding */ _int64; },
23372 -/* harmony export */ _intersection: function() { return /* binding */ _intersection; },
23373 -/* harmony export */ _ipv4: function() { return /* binding */ _ipv4; },
23374 -/* harmony export */ _ipv6: function() { return /* binding */ _ipv6; },
23375 -/* harmony export */ _isoDate: function() { return /* binding */ _isoDate; },
23376 -/* harmony export */ _isoDateTime: function() { return /* binding */ _isoDateTime; },
23377 -/* harmony export */ _isoDuration: function() { return /* binding */ _isoDuration; },
23378 -/* harmony export */ _isoTime: function() { return /* binding */ _isoTime; },
23379 -/* harmony export */ _jwt: function() { return /* binding */ _jwt; },
23380 -/* harmony export */ _ksuid: function() { return /* binding */ _ksuid; },
23381 -/* harmony export */ _lazy: function() { return /* binding */ _lazy; },
23382 -/* harmony export */ _length: function() { return /* binding */ _length; },
23383 -/* harmony export */ _literal: function() { return /* binding */ _literal; },
23384 -/* harmony export */ _lowercase: function() { return /* binding */ _lowercase; },
23385 -/* harmony export */ _lt: function() { return /* binding */ _lt; },
23386 -/* harmony export */ _lte: function() { return /* binding */ _lte; },
23387 -/* harmony export */ _map: function() { return /* binding */ _map; },
23388 -/* harmony export */ _max: function() { return /* binding */ _lte; },
23389 -/* harmony export */ _maxLength: function() { return /* binding */ _maxLength; },
23390 -/* harmony export */ _maxSize: function() { return /* binding */ _maxSize; },
23391 -/* harmony export */ _mime: function() { return /* binding */ _mime; },
23392 -/* harmony export */ _min: function() { return /* binding */ _gte; },
23393 -/* harmony export */ _minLength: function() { return /* binding */ _minLength; },
23394 -/* harmony export */ _minSize: function() { return /* binding */ _minSize; },
23395 -/* harmony export */ _multipleOf: function() { return /* binding */ _multipleOf; },
23396 -/* harmony export */ _nan: function() { return /* binding */ _nan; },
23397 -/* harmony export */ _nanoid: function() { return /* binding */ _nanoid; },
23398 -/* harmony export */ _nativeEnum: function() { return /* binding */ _nativeEnum; },
23399 -/* harmony export */ _negative: function() { return /* binding */ _negative; },
23400 -/* harmony export */ _never: function() { return /* binding */ _never; },
23401 -/* harmony export */ _nonnegative: function() { return /* binding */ _nonnegative; },
23402 -/* harmony export */ _nonoptional: function() { return /* binding */ _nonoptional; },
23403 -/* harmony export */ _nonpositive: function() { return /* binding */ _nonpositive; },
23404 -/* harmony export */ _normalize: function() { return /* binding */ _normalize; },
23405 -/* harmony export */ _null: function() { return /* binding */ _null; },
23406 -/* harmony export */ _nullable: function() { return /* binding */ _nullable; },
23407 -/* harmony export */ _number: function() { return /* binding */ _number; },
23408 -/* harmony export */ _optional: function() { return /* binding */ _optional; },
23409 -/* harmony export */ _overwrite: function() { return /* binding */ _overwrite; },
23410 -/* harmony export */ _pipe: function() { return /* binding */ _pipe; },
23411 -/* harmony export */ _positive: function() { return /* binding */ _positive; },
23412 -/* harmony export */ _promise: function() { return /* binding */ _promise; },
23413 -/* harmony export */ _property: function() { return /* binding */ _property; },
23414 -/* harmony export */ _readonly: function() { return /* binding */ _readonly; },
23415 -/* harmony export */ _record: function() { return /* binding */ _record; },
23416 -/* harmony export */ _refine: function() { return /* binding */ _refine; },
23417 -/* harmony export */ _regex: function() { return /* binding */ _regex; },
23418 -/* harmony export */ _set: function() { return /* binding */ _set; },
23419 -/* harmony export */ _size: function() { return /* binding */ _size; },
23420 -/* harmony export */ _startsWith: function() { return /* binding */ _startsWith; },
23421 -/* harmony export */ _string: function() { return /* binding */ _string; },
23422 -/* harmony export */ _stringFormat: function() { return /* binding */ _stringFormat; },
23423 -/* harmony export */ _stringbool: function() { return /* binding */ _stringbool; },
23424 -/* harmony export */ _success: function() { return /* binding */ _success; },
23425 -/* harmony export */ _symbol: function() { return /* binding */ _symbol; },
23426 -/* harmony export */ _templateLiteral: function() { return /* binding */ _templateLiteral; },
23427 -/* harmony export */ _toLowerCase: function() { return /* binding */ _toLowerCase; },
23428 -/* harmony export */ _toUpperCase: function() { return /* binding */ _toUpperCase; },
23429 -/* harmony export */ _transform: function() { return /* binding */ _transform; },
23430 -/* harmony export */ _trim: function() { return /* binding */ _trim; },
23431 -/* harmony export */ _tuple: function() { return /* binding */ _tuple; },
23432 -/* harmony export */ _uint32: function() { return /* binding */ _uint32; },
23433 -/* harmony export */ _uint64: function() { return /* binding */ _uint64; },
23434 -/* harmony export */ _ulid: function() { return /* binding */ _ulid; },
23435 -/* harmony export */ _undefined: function() { return /* binding */ _undefined; },
23436 -/* harmony export */ _union: function() { return /* binding */ _union; },
23437 -/* harmony export */ _unknown: function() { return /* binding */ _unknown; },
23438 -/* harmony export */ _uppercase: function() { return /* binding */ _uppercase; },
23439 -/* harmony export */ _url: function() { return /* binding */ _url; },
23440 -/* harmony export */ _uuid: function() { return /* binding */ _uuid; },
23441 -/* harmony export */ _uuidv4: function() { return /* binding */ _uuidv4; },
23442 -/* harmony export */ _uuidv6: function() { return /* binding */ _uuidv6; },
23443 -/* harmony export */ _uuidv7: function() { return /* binding */ _uuidv7; },
23444 -/* harmony export */ _void: function() { return /* binding */ _void; },
23445 -/* harmony export */ _xid: function() { return /* binding */ _xid; }
23446 -/* harmony export */ });
23447 -/* harmony import */ var _checks_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./checks.js */ "./node_modules/zod/v4/core/checks.js");
23448 -/* harmony import */ var _schemas_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./schemas.js */ "./node_modules/zod/v4/core/schemas.js");
23449 -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util.js */ "./node_modules/zod/v4/core/util.js");
23450 -
23451 -
23452 -
23453 -function _string(Class, params) {
23454 - return new Class({
23455 - type: "string",
23456 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23457 - });
23458 -}
23459 -function _coercedString(Class, params) {
23460 - return new Class({
23461 - type: "string",
23462 - coerce: true,
23463 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23464 - });
23465 -}
23466 -function _email(Class, params) {
23467 - return new Class({
23468 - type: "string",
23469 - format: "email",
23470 - check: "string_format",
23471 - abort: false,
23472 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23473 - });
23474 -}
23475 -function _guid(Class, params) {
23476 - return new Class({
23477 - type: "string",
23478 - format: "guid",
23479 - check: "string_format",
23480 - abort: false,
23481 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23482 - });
23483 -}
23484 -function _uuid(Class, params) {
23485 - return new Class({
23486 - type: "string",
23487 - format: "uuid",
23488 - check: "string_format",
23489 - abort: false,
23490 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23491 - });
23492 -}
23493 -function _uuidv4(Class, params) {
23494 - return new Class({
23495 - type: "string",
23496 - format: "uuid",
23497 - check: "string_format",
23498 - abort: false,
23499 - version: "v4",
23500 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23501 - });
23502 -}
23503 -function _uuidv6(Class, params) {
23504 - return new Class({
23505 - type: "string",
23506 - format: "uuid",
23507 - check: "string_format",
23508 - abort: false,
23509 - version: "v6",
23510 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23511 - });
23512 -}
23513 -function _uuidv7(Class, params) {
23514 - return new Class({
23515 - type: "string",
23516 - format: "uuid",
23517 - check: "string_format",
23518 - abort: false,
23519 - version: "v7",
23520 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23521 - });
23522 -}
23523 -function _url(Class, params) {
23524 - return new Class({
23525 - type: "string",
23526 - format: "url",
23527 - check: "string_format",
23528 - abort: false,
23529 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23530 - });
23531 -}
23532 -function _emoji(Class, params) {
23533 - return new Class({
23534 - type: "string",
23535 - format: "emoji",
23536 - check: "string_format",
23537 - abort: false,
23538 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23539 - });
23540 -}
23541 -function _nanoid(Class, params) {
23542 - return new Class({
23543 - type: "string",
23544 - format: "nanoid",
23545 - check: "string_format",
23546 - abort: false,
23547 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23548 - });
23549 -}
23550 -function _cuid(Class, params) {
23551 - return new Class({
23552 - type: "string",
23553 - format: "cuid",
23554 - check: "string_format",
23555 - abort: false,
23556 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23557 - });
23558 -}
23559 -function _cuid2(Class, params) {
23560 - return new Class({
23561 - type: "string",
23562 - format: "cuid2",
23563 - check: "string_format",
23564 - abort: false,
23565 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23566 - });
23567 -}
23568 -function _ulid(Class, params) {
23569 - return new Class({
23570 - type: "string",
23571 - format: "ulid",
23572 - check: "string_format",
23573 - abort: false,
23574 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23575 - });
23576 -}
23577 -function _xid(Class, params) {
23578 - return new Class({
23579 - type: "string",
23580 - format: "xid",
23581 - check: "string_format",
23582 - abort: false,
23583 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23584 - });
23585 -}
23586 -function _ksuid(Class, params) {
23587 - return new Class({
23588 - type: "string",
23589 - format: "ksuid",
23590 - check: "string_format",
23591 - abort: false,
23592 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23593 - });
23594 -}
23595 -function _ipv4(Class, params) {
23596 - return new Class({
23597 - type: "string",
23598 - format: "ipv4",
23599 - check: "string_format",
23600 - abort: false,
23601 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23602 - });
23603 -}
23604 -function _ipv6(Class, params) {
23605 - return new Class({
23606 - type: "string",
23607 - format: "ipv6",
23608 - check: "string_format",
23609 - abort: false,
23610 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23611 - });
23612 -}
23613 -function _cidrv4(Class, params) {
23614 - return new Class({
23615 - type: "string",
23616 - format: "cidrv4",
23617 - check: "string_format",
23618 - abort: false,
23619 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23620 - });
23621 -}
23622 -function _cidrv6(Class, params) {
23623 - return new Class({
23624 - type: "string",
23625 - format: "cidrv6",
23626 - check: "string_format",
23627 - abort: false,
23628 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23629 - });
23630 -}
23631 -function _base64(Class, params) {
23632 - return new Class({
23633 - type: "string",
23634 - format: "base64",
23635 - check: "string_format",
23636 - abort: false,
23637 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23638 - });
23639 -}
23640 -function _base64url(Class, params) {
23641 - return new Class({
23642 - type: "string",
23643 - format: "base64url",
23644 - check: "string_format",
23645 - abort: false,
23646 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23647 - });
23648 -}
23649 -function _e164(Class, params) {
23650 - return new Class({
23651 - type: "string",
23652 - format: "e164",
23653 - check: "string_format",
23654 - abort: false,
23655 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23656 - });
23657 -}
23658 -function _jwt(Class, params) {
23659 - return new Class({
23660 - type: "string",
23661 - format: "jwt",
23662 - check: "string_format",
23663 - abort: false,
23664 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23665 - });
23666 -}
23667 -const TimePrecision = {
23668 - Any: null,
23669 - Minute: -1,
23670 - Second: 0,
23671 - Millisecond: 3,
23672 - Microsecond: 6,
23673 -};
23674 -function _isoDateTime(Class, params) {
23675 - return new Class({
23676 - type: "string",
23677 - format: "datetime",
23678 - check: "string_format",
23679 - offset: false,
23680 - local: false,
23681 - precision: null,
23682 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23683 - });
23684 -}
23685 -function _isoDate(Class, params) {
23686 - return new Class({
23687 - type: "string",
23688 - format: "date",
23689 - check: "string_format",
23690 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23691 - });
23692 -}
23693 -function _isoTime(Class, params) {
23694 - return new Class({
23695 - type: "string",
23696 - format: "time",
23697 - check: "string_format",
23698 - precision: null,
23699 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23700 - });
23701 -}
23702 -function _isoDuration(Class, params) {
23703 - return new Class({
23704 - type: "string",
23705 - format: "duration",
23706 - check: "string_format",
23707 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23708 - });
23709 -}
23710 -function _number(Class, params) {
23711 - return new Class({
23712 - type: "number",
23713 - checks: [],
23714 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23715 - });
23716 -}
23717 -function _coercedNumber(Class, params) {
23718 - return new Class({
23719 - type: "number",
23720 - coerce: true,
23721 - checks: [],
23722 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23723 - });
23724 -}
23725 -function _int(Class, params) {
23726 - return new Class({
23727 - type: "number",
23728 - check: "number_format",
23729 - abort: false,
23730 - format: "safeint",
23731 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23732 - });
23733 -}
23734 -function _float32(Class, params) {
23735 - return new Class({
23736 - type: "number",
23737 - check: "number_format",
23738 - abort: false,
23739 - format: "float32",
23740 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23741 - });
23742 -}
23743 -function _float64(Class, params) {
23744 - return new Class({
23745 - type: "number",
23746 - check: "number_format",
23747 - abort: false,
23748 - format: "float64",
23749 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23750 - });
23751 -}
23752 -function _int32(Class, params) {
23753 - return new Class({
23754 - type: "number",
23755 - check: "number_format",
23756 - abort: false,
23757 - format: "int32",
23758 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23759 - });
23760 -}
23761 -function _uint32(Class, params) {
23762 - return new Class({
23763 - type: "number",
23764 - check: "number_format",
23765 - abort: false,
23766 - format: "uint32",
23767 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23768 - });
23769 -}
23770 -function _boolean(Class, params) {
23771 - return new Class({
23772 - type: "boolean",
23773 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23774 - });
23775 -}
23776 -function _coercedBoolean(Class, params) {
23777 - return new Class({
23778 - type: "boolean",
23779 - coerce: true,
23780 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23781 - });
23782 -}
23783 -function _bigint(Class, params) {
23784 - return new Class({
23785 - type: "bigint",
23786 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23787 - });
23788 -}
23789 -function _coercedBigint(Class, params) {
23790 - return new Class({
23791 - type: "bigint",
23792 - coerce: true,
23793 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23794 - });
23795 -}
23796 -function _int64(Class, params) {
23797 - return new Class({
23798 - type: "bigint",
23799 - check: "bigint_format",
23800 - abort: false,
23801 - format: "int64",
23802 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23803 - });
23804 -}
23805 -function _uint64(Class, params) {
23806 - return new Class({
23807 - type: "bigint",
23808 - check: "bigint_format",
23809 - abort: false,
23810 - format: "uint64",
23811 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23812 - });
23813 -}
23814 -function _symbol(Class, params) {
23815 - return new Class({
23816 - type: "symbol",
23817 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23818 - });
23819 -}
23820 -function _undefined(Class, params) {
23821 - return new Class({
23822 - type: "undefined",
23823 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23824 - });
23825 -}
23826 -function _null(Class, params) {
23827 - return new Class({
23828 - type: "null",
23829 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23830 - });
23831 -}
23832 -function _any(Class) {
23833 - return new Class({
23834 - type: "any",
23835 - });
23836 -}
23837 -function _unknown(Class) {
23838 - return new Class({
23839 - type: "unknown",
23840 - });
23841 -}
23842 -function _never(Class, params) {
23843 - return new Class({
23844 - type: "never",
23845 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23846 - });
23847 -}
23848 -function _void(Class, params) {
23849 - return new Class({
23850 - type: "void",
23851 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23852 - });
23853 -}
23854 -function _date(Class, params) {
23855 - return new Class({
23856 - type: "date",
23857 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23858 - });
23859 -}
23860 -function _coercedDate(Class, params) {
23861 - return new Class({
23862 - type: "date",
23863 - coerce: true,
23864 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23865 - });
23866 -}
23867 -function _nan(Class, params) {
23868 - return new Class({
23869 - type: "nan",
23870 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23871 - });
23872 -}
23873 -function _lt(value, params) {
23874 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckLessThan({
23875 - check: "less_than",
23876 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23877 - value,
23878 - inclusive: false,
23879 - });
23880 -}
23881 -function _lte(value, params) {
23882 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckLessThan({
23883 - check: "less_than",
23884 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23885 - value,
23886 - inclusive: true,
23887 - });
23888 -}
23889 -
23890 -function _gt(value, params) {
23891 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckGreaterThan({
23892 - check: "greater_than",
23893 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23894 - value,
23895 - inclusive: false,
23896 - });
23897 -}
23898 -function _gte(value, params) {
23899 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckGreaterThan({
23900 - check: "greater_than",
23901 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23902 - value,
23903 - inclusive: true,
23904 - });
23905 -}
23906 -
23907 -function _positive(params) {
23908 - return _gt(0, params);
23909 -}
23910 -// negative
23911 -function _negative(params) {
23912 - return _lt(0, params);
23913 -}
23914 -// nonpositive
23915 -function _nonpositive(params) {
23916 - return _lte(0, params);
23917 -}
23918 -// nonnegative
23919 -function _nonnegative(params) {
23920 - return _gte(0, params);
23921 -}
23922 -function _multipleOf(value, params) {
23923 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckMultipleOf({
23924 - check: "multiple_of",
23925 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23926 - value,
23927 - });
23928 -}
23929 -function _maxSize(maximum, params) {
23930 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckMaxSize({
23931 - check: "max_size",
23932 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23933 - maximum,
23934 - });
23935 -}
23936 -function _minSize(minimum, params) {
23937 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckMinSize({
23938 - check: "min_size",
23939 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23940 - minimum,
23941 - });
23942 -}
23943 -function _size(size, params) {
23944 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckSizeEquals({
23945 - check: "size_equals",
23946 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23947 - size,
23948 - });
23949 -}
23950 -function _maxLength(maximum, params) {
23951 - const ch = new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckMaxLength({
23952 - check: "max_length",
23953 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23954 - maximum,
23955 - });
23956 - return ch;
23957 -}
23958 -function _minLength(minimum, params) {
23959 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckMinLength({
23960 - check: "min_length",
23961 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23962 - minimum,
23963 - });
23964 -}
23965 -function _length(length, params) {
23966 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckLengthEquals({
23967 - check: "length_equals",
23968 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23969 - length,
23970 - });
23971 -}
23972 -function _regex(pattern, params) {
23973 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckRegex({
23974 - check: "string_format",
23975 - format: "regex",
23976 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23977 - pattern,
23978 - });
23979 -}
23980 -function _lowercase(params) {
23981 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckLowerCase({
23982 - check: "string_format",
23983 - format: "lowercase",
23984 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23985 - });
23986 -}
23987 -function _uppercase(params) {
23988 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckUpperCase({
23989 - check: "string_format",
23990 - format: "uppercase",
23991 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23992 - });
23993 -}
23994 -function _includes(includes, params) {
23995 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckIncludes({
23996 - check: "string_format",
23997 - format: "includes",
23998 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
23999 - includes,
24000 - });
24001 -}
24002 -function _startsWith(prefix, params) {
24003 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckStartsWith({
24004 - check: "string_format",
24005 - format: "starts_with",
24006 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24007 - prefix,
24008 - });
24009 -}
24010 -function _endsWith(suffix, params) {
24011 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckEndsWith({
24012 - check: "string_format",
24013 - format: "ends_with",
24014 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24015 - suffix,
24016 - });
24017 -}
24018 -function _property(property, schema, params) {
24019 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckProperty({
24020 - check: "property",
24021 - property,
24022 - schema,
24023 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24024 - });
24025 -}
24026 -function _mime(types, params) {
24027 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckMimeType({
24028 - check: "mime_type",
24029 - mime: types,
24030 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24031 - });
24032 -}
24033 -function _overwrite(tx) {
24034 - return new _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckOverwrite({
24035 - check: "overwrite",
24036 - tx,
24037 - });
24038 -}
24039 -// normalize
24040 -function _normalize(form) {
24041 - return _overwrite((input) => input.normalize(form));
24042 -}
24043 -// trim
24044 -function _trim() {
24045 - return _overwrite((input) => input.trim());
24046 -}
24047 -// toLowerCase
24048 -function _toLowerCase() {
24049 - return _overwrite((input) => input.toLowerCase());
24050 -}
24051 -// toUpperCase
24052 -function _toUpperCase() {
24053 - return _overwrite((input) => input.toUpperCase());
24054 -}
24055 -function _array(Class, element, params) {
24056 - return new Class({
24057 - type: "array",
24058 - element,
24059 - // get element() {
24060 - // return element;
24061 - // },
24062 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24063 - });
24064 -}
24065 -function _union(Class, options, params) {
24066 - return new Class({
24067 - type: "union",
24068 - options,
24069 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24070 - });
24071 -}
24072 -function _discriminatedUnion(Class, discriminator, options, params) {
24073 - return new Class({
24074 - type: "union",
24075 - options,
24076 - discriminator,
24077 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24078 - });
24079 -}
24080 -function _intersection(Class, left, right) {
24081 - return new Class({
24082 - type: "intersection",
24083 - left,
24084 - right,
24085 - });
24086 -}
24087 -// export function _tuple(
24088 -// Class: util.SchemaClass<schemas.$ZodTuple>,
24089 -// items: [],
24090 -// params?: string | $ZodTupleParams
24091 -// ): schemas.$ZodTuple<[], null>;
24092 -function _tuple(Class, items, _paramsOrRest, _params) {
24093 - const hasRest = _paramsOrRest instanceof _schemas_js__WEBPACK_IMPORTED_MODULE_1__.$ZodType;
24094 - const params = hasRest ? _params : _paramsOrRest;
24095 - const rest = hasRest ? _paramsOrRest : null;
24096 - return new Class({
24097 - type: "tuple",
24098 - items,
24099 - rest,
24100 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24101 - });
24102 -}
24103 -function _record(Class, keyType, valueType, params) {
24104 - return new Class({
24105 - type: "record",
24106 - keyType,
24107 - valueType,
24108 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24109 - });
24110 -}
24111 -function _map(Class, keyType, valueType, params) {
24112 - return new Class({
24113 - type: "map",
24114 - keyType,
24115 - valueType,
24116 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24117 - });
24118 -}
24119 -function _set(Class, valueType, params) {
24120 - return new Class({
24121 - type: "set",
24122 - valueType,
24123 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24124 - });
24125 -}
24126 -function _enum(Class, values, params) {
24127 - const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
24128 - // if (Array.isArray(values)) {
24129 - // for (const value of values) {
24130 - // entries[value] = value;
24131 - // }
24132 - // } else {
24133 - // Object.assign(entries, values);
24134 - // }
24135 - // const entries: util.EnumLike = {};
24136 - // for (const val of values) {
24137 - // entries[val] = val;
24138 - // }
24139 - return new Class({
24140 - type: "enum",
24141 - entries,
24142 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24143 - });
24144 -}
24145 -/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
24146 - *
24147 - * ```ts
24148 - * enum Colors { red, green, blue }
24149 - * z.enum(Colors);
24150 - * ```
24151 - */
24152 -function _nativeEnum(Class, entries, params) {
24153 - return new Class({
24154 - type: "enum",
24155 - entries,
24156 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24157 - });
24158 -}
24159 -function _literal(Class, value, params) {
24160 - return new Class({
24161 - type: "literal",
24162 - values: Array.isArray(value) ? value : [value],
24163 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24164 - });
24165 -}
24166 -function _file(Class, params) {
24167 - return new Class({
24168 - type: "file",
24169 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24170 - });
24171 -}
24172 -function _transform(Class, fn) {
24173 - return new Class({
24174 - type: "transform",
24175 - transform: fn,
24176 - });
24177 -}
24178 -function _optional(Class, innerType) {
24179 - return new Class({
24180 - type: "optional",
24181 - innerType,
24182 - });
24183 -}
24184 -function _nullable(Class, innerType) {
24185 - return new Class({
24186 - type: "nullable",
24187 - innerType,
24188 - });
24189 -}
24190 -function _default(Class, innerType, defaultValue) {
24191 - return new Class({
24192 - type: "default",
24193 - innerType,
24194 - get defaultValue() {
24195 - return typeof defaultValue === "function" ? defaultValue() : defaultValue;
24196 - },
24197 - });
24198 -}
24199 -function _nonoptional(Class, innerType, params) {
24200 - return new Class({
24201 - type: "nonoptional",
24202 - innerType,
24203 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24204 - });
24205 -}
24206 -function _success(Class, innerType) {
24207 - return new Class({
24208 - type: "success",
24209 - innerType,
24210 - });
24211 -}
24212 -function _catch(Class, innerType, catchValue) {
24213 - return new Class({
24214 - type: "catch",
24215 - innerType,
24216 - catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
24217 - });
24218 -}
24219 -function _pipe(Class, in_, out) {
24220 - return new Class({
24221 - type: "pipe",
24222 - in: in_,
24223 - out,
24224 - });
24225 -}
24226 -function _readonly(Class, innerType) {
24227 - return new Class({
24228 - type: "readonly",
24229 - innerType,
24230 - });
24231 -}
24232 -function _templateLiteral(Class, parts, params) {
24233 - return new Class({
24234 - type: "template_literal",
24235 - parts,
24236 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(params),
24237 - });
24238 -}
24239 -function _lazy(Class, getter) {
24240 - return new Class({
24241 - type: "lazy",
24242 - getter,
24243 - });
24244 -}
24245 -function _promise(Class, innerType) {
24246 - return new Class({
24247 - type: "promise",
24248 - innerType,
24249 - });
24250 -}
24251 -function _custom(Class, fn, _params) {
24252 - const norm = _util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(_params);
24253 - norm.abort ?? (norm.abort = true); // default to abort:false
24254 - const schema = new Class({
24255 - type: "custom",
24256 - check: "custom",
24257 - fn: fn,
24258 - ...norm,
24259 - });
24260 - return schema;
24261 -}
24262 -// export function _refine<T>(
24263 -// Class: util.SchemaClass<schemas.$ZodCustom>,
24264 -// fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>,
24265 -// _params: string | $ZodCustomParams = {}
24266 -// ): checks.$ZodCheck<T> {
24267 -// return _custom(Class, fn, _params);
24268 -// }
24269 -// same as _custom but defaults to abort:false
24270 -function _refine(Class, fn, _params) {
24271 - const schema = new Class({
24272 - type: "custom",
24273 - check: "custom",
24274 - fn: fn,
24275 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(_params),
24276 - });
24277 - return schema;
24278 -}
24279 -function _stringbool(Classes, _params) {
24280 - const params = _util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(_params);
24281 - let truthyArray = params.truthy ?? ["true", "1", "yes", "on", "y", "enabled"];
24282 - let falsyArray = params.falsy ?? ["false", "0", "no", "off", "n", "disabled"];
24283 - if (params.case !== "sensitive") {
24284 - truthyArray = truthyArray.map((v) => (typeof v === "string" ? v.toLowerCase() : v));
24285 - falsyArray = falsyArray.map((v) => (typeof v === "string" ? v.toLowerCase() : v));
24286 - }
24287 - const truthySet = new Set(truthyArray);
24288 - const falsySet = new Set(falsyArray);
24289 - const _Pipe = Classes.Pipe ?? _schemas_js__WEBPACK_IMPORTED_MODULE_1__.$ZodPipe;
24290 - const _Boolean = Classes.Boolean ?? _schemas_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBoolean;
24291 - const _String = Classes.String ?? _schemas_js__WEBPACK_IMPORTED_MODULE_1__.$ZodString;
24292 - const _Transform = Classes.Transform ?? _schemas_js__WEBPACK_IMPORTED_MODULE_1__.$ZodTransform;
24293 - const tx = new _Transform({
24294 - type: "transform",
24295 - transform: (input, payload) => {
24296 - let data = input;
24297 - if (params.case !== "sensitive")
24298 - data = data.toLowerCase();
24299 - if (truthySet.has(data)) {
24300 - return true;
24301 - }
24302 - else if (falsySet.has(data)) {
24303 - return false;
24304 - }
24305 - else {
24306 - payload.issues.push({
24307 - code: "invalid_value",
24308 - expected: "stringbool",
24309 - values: [...truthySet, ...falsySet],
24310 - input: payload.value,
24311 - inst: tx,
24312 - });
24313 - return {};
24314 - }
24315 - },
24316 - error: params.error,
24317 - });
24318 - // params.error;
24319 - const innerPipe = new _Pipe({
24320 - type: "pipe",
24321 - in: new _String({ type: "string", error: params.error }),
24322 - out: tx,
24323 - error: params.error,
24324 - });
24325 - const outerPipe = new _Pipe({
24326 - type: "pipe",
24327 - in: innerPipe,
24328 - out: new _Boolean({
24329 - type: "boolean",
24330 - error: params.error,
24331 - }),
24332 - error: params.error,
24333 - });
24334 - return outerPipe;
24335 -}
24336 -function _stringFormat(Class, format, fnOrRegex, _params = {}) {
24337 - const params = _util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(_params);
24338 - const def = {
24339 - ..._util_js__WEBPACK_IMPORTED_MODULE_2__.normalizeParams(_params),
24340 - check: "string_format",
24341 - type: "string",
24342 - format,
24343 - fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
24344 - ...params,
24345 - };
24346 - if (fnOrRegex instanceof RegExp) {
24347 - def.pattern = fnOrRegex;
24348 - }
24349 - const inst = new Class(def);
24350 - return inst;
24351 -}
24352 -
24353 -
24354 -/***/ }),
24355 -
24356 -/***/ "./node_modules/zod/v4/core/checks.js":
24357 -/*!********************************************!*\
24358 - !*** ./node_modules/zod/v4/core/checks.js ***!
24359 - \********************************************/
24360 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
24361 -
24362 -__webpack_require__.r(__webpack_exports__);
24363 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
24364 -/* harmony export */ $ZodCheck: function() { return /* binding */ $ZodCheck; },
24365 -/* harmony export */ $ZodCheckBigIntFormat: function() { return /* binding */ $ZodCheckBigIntFormat; },
24366 -/* harmony export */ $ZodCheckEndsWith: function() { return /* binding */ $ZodCheckEndsWith; },
24367 -/* harmony export */ $ZodCheckGreaterThan: function() { return /* binding */ $ZodCheckGreaterThan; },
24368 -/* harmony export */ $ZodCheckIncludes: function() { return /* binding */ $ZodCheckIncludes; },
24369 -/* harmony export */ $ZodCheckLengthEquals: function() { return /* binding */ $ZodCheckLengthEquals; },
24370 -/* harmony export */ $ZodCheckLessThan: function() { return /* binding */ $ZodCheckLessThan; },
24371 -/* harmony export */ $ZodCheckLowerCase: function() { return /* binding */ $ZodCheckLowerCase; },
24372 -/* harmony export */ $ZodCheckMaxLength: function() { return /* binding */ $ZodCheckMaxLength; },
24373 -/* harmony export */ $ZodCheckMaxSize: function() { return /* binding */ $ZodCheckMaxSize; },
24374 -/* harmony export */ $ZodCheckMimeType: function() { return /* binding */ $ZodCheckMimeType; },
24375 -/* harmony export */ $ZodCheckMinLength: function() { return /* binding */ $ZodCheckMinLength; },
24376 -/* harmony export */ $ZodCheckMinSize: function() { return /* binding */ $ZodCheckMinSize; },
24377 -/* harmony export */ $ZodCheckMultipleOf: function() { return /* binding */ $ZodCheckMultipleOf; },
24378 -/* harmony export */ $ZodCheckNumberFormat: function() { return /* binding */ $ZodCheckNumberFormat; },
24379 -/* harmony export */ $ZodCheckOverwrite: function() { return /* binding */ $ZodCheckOverwrite; },
24380 -/* harmony export */ $ZodCheckProperty: function() { return /* binding */ $ZodCheckProperty; },
24381 -/* harmony export */ $ZodCheckRegex: function() { return /* binding */ $ZodCheckRegex; },
24382 -/* harmony export */ $ZodCheckSizeEquals: function() { return /* binding */ $ZodCheckSizeEquals; },
24383 -/* harmony export */ $ZodCheckStartsWith: function() { return /* binding */ $ZodCheckStartsWith; },
24384 -/* harmony export */ $ZodCheckStringFormat: function() { return /* binding */ $ZodCheckStringFormat; },
24385 -/* harmony export */ $ZodCheckUpperCase: function() { return /* binding */ $ZodCheckUpperCase; }
24386 -/* harmony export */ });
24387 -/* harmony import */ var _core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core.js */ "./node_modules/zod/v4/core/core.js");
24388 -/* harmony import */ var _regexes_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./regexes.js */ "./node_modules/zod/v4/core/regexes.js");
24389 -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util.js */ "./node_modules/zod/v4/core/util.js");
24390 -// import { $ZodType } from "./schemas.js";
24391 -
24392 -
24393 -
24394 -const $ZodCheck = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheck", (inst, def) => {
24395 - var _a;
24396 - inst._zod ?? (inst._zod = {});
24397 - inst._zod.def = def;
24398 - (_a = inst._zod).onattach ?? (_a.onattach = []);
24399 -});
24400 -const numericOriginMap = {
24401 - number: "number",
24402 - bigint: "bigint",
24403 - object: "date",
24404 -};
24405 -const $ZodCheckLessThan = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckLessThan", (inst, def) => {
24406 - $ZodCheck.init(inst, def);
24407 - const origin = numericOriginMap[typeof def.value];
24408 - inst._zod.onattach.push((inst) => {
24409 - const bag = inst._zod.bag;
24410 - const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
24411 - if (def.value < curr) {
24412 - if (def.inclusive)
24413 - bag.maximum = def.value;
24414 - else
24415 - bag.exclusiveMaximum = def.value;
24416 - }
24417 - });
24418 - inst._zod.check = (payload) => {
24419 - if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {
24420 - return;
24421 - }
24422 - payload.issues.push({
24423 - origin,
24424 - code: "too_big",
24425 - maximum: def.value,
24426 - input: payload.value,
24427 - inclusive: def.inclusive,
24428 - inst,
24429 - continue: !def.abort,
24430 - });
24431 - };
24432 -});
24433 -const $ZodCheckGreaterThan = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckGreaterThan", (inst, def) => {
24434 - $ZodCheck.init(inst, def);
24435 - const origin = numericOriginMap[typeof def.value];
24436 - inst._zod.onattach.push((inst) => {
24437 - const bag = inst._zod.bag;
24438 - const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
24439 - if (def.value > curr) {
24440 - if (def.inclusive)
24441 - bag.minimum = def.value;
24442 - else
24443 - bag.exclusiveMinimum = def.value;
24444 - }
24445 - });
24446 - inst._zod.check = (payload) => {
24447 - if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {
24448 - return;
24449 - }
24450 - payload.issues.push({
24451 - origin,
24452 - code: "too_small",
24453 - minimum: def.value,
24454 - input: payload.value,
24455 - inclusive: def.inclusive,
24456 - inst,
24457 - continue: !def.abort,
24458 - });
24459 - };
24460 -});
24461 -const $ZodCheckMultipleOf =
24462 -/*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckMultipleOf", (inst, def) => {
24463 - $ZodCheck.init(inst, def);
24464 - inst._zod.onattach.push((inst) => {
24465 - var _a;
24466 - (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
24467 - });
24468 - inst._zod.check = (payload) => {
24469 - if (typeof payload.value !== typeof def.value)
24470 - throw new Error("Cannot mix number and bigint in multiple_of check.");
24471 - const isMultiple = typeof payload.value === "bigint"
24472 - ? payload.value % def.value === BigInt(0)
24473 - : _util_js__WEBPACK_IMPORTED_MODULE_2__.floatSafeRemainder(payload.value, def.value) === 0;
24474 - if (isMultiple)
24475 - return;
24476 - payload.issues.push({
24477 - origin: typeof payload.value,
24478 - code: "not_multiple_of",
24479 - divisor: def.value,
24480 - input: payload.value,
24481 - inst,
24482 - continue: !def.abort,
24483 - });
24484 - };
24485 -});
24486 -const $ZodCheckNumberFormat = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckNumberFormat", (inst, def) => {
24487 - $ZodCheck.init(inst, def); // no format checks
24488 - def.format = def.format || "float64";
24489 - const isInt = def.format?.includes("int");
24490 - const origin = isInt ? "int" : "number";
24491 - const [minimum, maximum] = _util_js__WEBPACK_IMPORTED_MODULE_2__.NUMBER_FORMAT_RANGES[def.format];
24492 - inst._zod.onattach.push((inst) => {
24493 - const bag = inst._zod.bag;
24494 - bag.format = def.format;
24495 - bag.minimum = minimum;
24496 - bag.maximum = maximum;
24497 - if (isInt)
24498 - bag.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_1__.integer;
24499 - });
24500 - inst._zod.check = (payload) => {
24501 - const input = payload.value;
24502 - if (isInt) {
24503 - if (!Number.isInteger(input)) {
24504 - // invalid_format issue
24505 - // payload.issues.push({
24506 - // expected: def.format,
24507 - // format: def.format,
24508 - // code: "invalid_format",
24509 - // input,
24510 - // inst,
24511 - // });
24512 - // invalid_type issue
24513 - payload.issues.push({
24514 - expected: origin,
24515 - format: def.format,
24516 - code: "invalid_type",
24517 - input,
24518 - inst,
24519 - });
24520 - return;
24521 - // not_multiple_of issue
24522 - // payload.issues.push({
24523 - // code: "not_multiple_of",
24524 - // origin: "number",
24525 - // input,
24526 - // inst,
24527 - // divisor: 1,
24528 - // });
24529 - }
24530 - if (!Number.isSafeInteger(input)) {
24531 - if (input > 0) {
24532 - // too_big
24533 - payload.issues.push({
24534 - input,
24535 - code: "too_big",
24536 - maximum: Number.MAX_SAFE_INTEGER,
24537 - note: "Integers must be within the safe integer range.",
24538 - inst,
24539 - origin,
24540 - continue: !def.abort,
24541 - });
24542 - }
24543 - else {
24544 - // too_small
24545 - payload.issues.push({
24546 - input,
24547 - code: "too_small",
24548 - minimum: Number.MIN_SAFE_INTEGER,
24549 - note: "Integers must be within the safe integer range.",
24550 - inst,
24551 - origin,
24552 - continue: !def.abort,
24553 - });
24554 - }
24555 - return;
24556 - }
24557 - }
24558 - if (input < minimum) {
24559 - payload.issues.push({
24560 - origin: "number",
24561 - input,
24562 - code: "too_small",
24563 - minimum,
24564 - inclusive: true,
24565 - inst,
24566 - continue: !def.abort,
24567 - });
24568 - }
24569 - if (input > maximum) {
24570 - payload.issues.push({
24571 - origin: "number",
24572 - input,
24573 - code: "too_big",
24574 - maximum,
24575 - inst,
24576 - });
24577 - }
24578 - };
24579 -});
24580 -const $ZodCheckBigIntFormat = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckBigIntFormat", (inst, def) => {
24581 - $ZodCheck.init(inst, def); // no format checks
24582 - const [minimum, maximum] = _util_js__WEBPACK_IMPORTED_MODULE_2__.BIGINT_FORMAT_RANGES[def.format];
24583 - inst._zod.onattach.push((inst) => {
24584 - const bag = inst._zod.bag;
24585 - bag.format = def.format;
24586 - bag.minimum = minimum;
24587 - bag.maximum = maximum;
24588 - });
24589 - inst._zod.check = (payload) => {
24590 - const input = payload.value;
24591 - if (input < minimum) {
24592 - payload.issues.push({
24593 - origin: "bigint",
24594 - input,
24595 - code: "too_small",
24596 - minimum: minimum,
24597 - inclusive: true,
24598 - inst,
24599 - continue: !def.abort,
24600 - });
24601 - }
24602 - if (input > maximum) {
24603 - payload.issues.push({
24604 - origin: "bigint",
24605 - input,
24606 - code: "too_big",
24607 - maximum,
24608 - inst,
24609 - });
24610 - }
24611 - };
24612 -});
24613 -const $ZodCheckMaxSize = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckMaxSize", (inst, def) => {
24614 - var _a;
24615 - $ZodCheck.init(inst, def);
24616 - (_a = inst._zod.def).when ?? (_a.when = (payload) => {
24617 - const val = payload.value;
24618 - return !_util_js__WEBPACK_IMPORTED_MODULE_2__.nullish(val) && val.size !== undefined;
24619 - });
24620 - inst._zod.onattach.push((inst) => {
24621 - const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);
24622 - if (def.maximum < curr)
24623 - inst._zod.bag.maximum = def.maximum;
24624 - });
24625 - inst._zod.check = (payload) => {
24626 - const input = payload.value;
24627 - const size = input.size;
24628 - if (size <= def.maximum)
24629 - return;
24630 - payload.issues.push({
24631 - origin: _util_js__WEBPACK_IMPORTED_MODULE_2__.getSizableOrigin(input),
24632 - code: "too_big",
24633 - maximum: def.maximum,
24634 - input,
24635 - inst,
24636 - continue: !def.abort,
24637 - });
24638 - };
24639 -});
24640 -const $ZodCheckMinSize = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckMinSize", (inst, def) => {
24641 - var _a;
24642 - $ZodCheck.init(inst, def);
24643 - (_a = inst._zod.def).when ?? (_a.when = (payload) => {
24644 - const val = payload.value;
24645 - return !_util_js__WEBPACK_IMPORTED_MODULE_2__.nullish(val) && val.size !== undefined;
24646 - });
24647 - inst._zod.onattach.push((inst) => {
24648 - const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);
24649 - if (def.minimum > curr)
24650 - inst._zod.bag.minimum = def.minimum;
24651 - });
24652 - inst._zod.check = (payload) => {
24653 - const input = payload.value;
24654 - const size = input.size;
24655 - if (size >= def.minimum)
24656 - return;
24657 - payload.issues.push({
24658 - origin: _util_js__WEBPACK_IMPORTED_MODULE_2__.getSizableOrigin(input),
24659 - code: "too_small",
24660 - minimum: def.minimum,
24661 - input,
24662 - inst,
24663 - continue: !def.abort,
24664 - });
24665 - };
24666 -});
24667 -const $ZodCheckSizeEquals = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckSizeEquals", (inst, def) => {
24668 - var _a;
24669 - $ZodCheck.init(inst, def);
24670 - (_a = inst._zod.def).when ?? (_a.when = (payload) => {
24671 - const val = payload.value;
24672 - return !_util_js__WEBPACK_IMPORTED_MODULE_2__.nullish(val) && val.size !== undefined;
24673 - });
24674 - inst._zod.onattach.push((inst) => {
24675 - const bag = inst._zod.bag;
24676 - bag.minimum = def.size;
24677 - bag.maximum = def.size;
24678 - bag.size = def.size;
24679 - });
24680 - inst._zod.check = (payload) => {
24681 - const input = payload.value;
24682 - const size = input.size;
24683 - if (size === def.size)
24684 - return;
24685 - const tooBig = size > def.size;
24686 - payload.issues.push({
24687 - origin: _util_js__WEBPACK_IMPORTED_MODULE_2__.getSizableOrigin(input),
24688 - ...(tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size }),
24689 - inclusive: true,
24690 - exact: true,
24691 - input: payload.value,
24692 - inst,
24693 - continue: !def.abort,
24694 - });
24695 - };
24696 -});
24697 -const $ZodCheckMaxLength = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckMaxLength", (inst, def) => {
24698 - var _a;
24699 - $ZodCheck.init(inst, def);
24700 - (_a = inst._zod.def).when ?? (_a.when = (payload) => {
24701 - const val = payload.value;
24702 - return !_util_js__WEBPACK_IMPORTED_MODULE_2__.nullish(val) && val.length !== undefined;
24703 - });
24704 - inst._zod.onattach.push((inst) => {
24705 - const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);
24706 - if (def.maximum < curr)
24707 - inst._zod.bag.maximum = def.maximum;
24708 - });
24709 - inst._zod.check = (payload) => {
24710 - const input = payload.value;
24711 - const length = input.length;
24712 - if (length <= def.maximum)
24713 - return;
24714 - const origin = _util_js__WEBPACK_IMPORTED_MODULE_2__.getLengthableOrigin(input);
24715 - payload.issues.push({
24716 - origin,
24717 - code: "too_big",
24718 - maximum: def.maximum,
24719 - inclusive: true,
24720 - input,
24721 - inst,
24722 - continue: !def.abort,
24723 - });
24724 - };
24725 -});
24726 -const $ZodCheckMinLength = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckMinLength", (inst, def) => {
24727 - var _a;
24728 - $ZodCheck.init(inst, def);
24729 - (_a = inst._zod.def).when ?? (_a.when = (payload) => {
24730 - const val = payload.value;
24731 - return !_util_js__WEBPACK_IMPORTED_MODULE_2__.nullish(val) && val.length !== undefined;
24732 - });
24733 - inst._zod.onattach.push((inst) => {
24734 - const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);
24735 - if (def.minimum > curr)
24736 - inst._zod.bag.minimum = def.minimum;
24737 - });
24738 - inst._zod.check = (payload) => {
24739 - const input = payload.value;
24740 - const length = input.length;
24741 - if (length >= def.minimum)
24742 - return;
24743 - const origin = _util_js__WEBPACK_IMPORTED_MODULE_2__.getLengthableOrigin(input);
24744 - payload.issues.push({
24745 - origin,
24746 - code: "too_small",
24747 - minimum: def.minimum,
24748 - inclusive: true,
24749 - input,
24750 - inst,
24751 - continue: !def.abort,
24752 - });
24753 - };
24754 -});
24755 -const $ZodCheckLengthEquals = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckLengthEquals", (inst, def) => {
24756 - var _a;
24757 - $ZodCheck.init(inst, def);
24758 - (_a = inst._zod.def).when ?? (_a.when = (payload) => {
24759 - const val = payload.value;
24760 - return !_util_js__WEBPACK_IMPORTED_MODULE_2__.nullish(val) && val.length !== undefined;
24761 - });
24762 - inst._zod.onattach.push((inst) => {
24763 - const bag = inst._zod.bag;
24764 - bag.minimum = def.length;
24765 - bag.maximum = def.length;
24766 - bag.length = def.length;
24767 - });
24768 - inst._zod.check = (payload) => {
24769 - const input = payload.value;
24770 - const length = input.length;
24771 - if (length === def.length)
24772 - return;
24773 - const origin = _util_js__WEBPACK_IMPORTED_MODULE_2__.getLengthableOrigin(input);
24774 - const tooBig = length > def.length;
24775 - payload.issues.push({
24776 - origin,
24777 - ...(tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length }),
24778 - inclusive: true,
24779 - exact: true,
24780 - input: payload.value,
24781 - inst,
24782 - continue: !def.abort,
24783 - });
24784 - };
24785 -});
24786 -const $ZodCheckStringFormat = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckStringFormat", (inst, def) => {
24787 - var _a, _b;
24788 - $ZodCheck.init(inst, def);
24789 - inst._zod.onattach.push((inst) => {
24790 - const bag = inst._zod.bag;
24791 - bag.format = def.format;
24792 - if (def.pattern) {
24793 - bag.patterns ?? (bag.patterns = new Set());
24794 - bag.patterns.add(def.pattern);
24795 - }
24796 - });
24797 - if (def.pattern)
24798 - (_a = inst._zod).check ?? (_a.check = (payload) => {
24799 - def.pattern.lastIndex = 0;
24800 - if (def.pattern.test(payload.value))
24801 - return;
24802 - payload.issues.push({
24803 - origin: "string",
24804 - code: "invalid_format",
24805 - format: def.format,
24806 - input: payload.value,
24807 - ...(def.pattern ? { pattern: def.pattern.toString() } : {}),
24808 - inst,
24809 - continue: !def.abort,
24810 - });
24811 - });
24812 - else
24813 - (_b = inst._zod).check ?? (_b.check = () => { });
24814 -});
24815 -const $ZodCheckRegex = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckRegex", (inst, def) => {
24816 - $ZodCheckStringFormat.init(inst, def);
24817 - inst._zod.check = (payload) => {
24818 - def.pattern.lastIndex = 0;
24819 - if (def.pattern.test(payload.value))
24820 - return;
24821 - payload.issues.push({
24822 - origin: "string",
24823 - code: "invalid_format",
24824 - format: "regex",
24825 - input: payload.value,
24826 - pattern: def.pattern.toString(),
24827 - inst,
24828 - continue: !def.abort,
24829 - });
24830 - };
24831 -});
24832 -const $ZodCheckLowerCase = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckLowerCase", (inst, def) => {
24833 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_1__.lowercase);
24834 - $ZodCheckStringFormat.init(inst, def);
24835 -});
24836 -const $ZodCheckUpperCase = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckUpperCase", (inst, def) => {
24837 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_1__.uppercase);
24838 - $ZodCheckStringFormat.init(inst, def);
24839 -});
24840 -const $ZodCheckIncludes = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckIncludes", (inst, def) => {
24841 - $ZodCheck.init(inst, def);
24842 - const escapedRegex = _util_js__WEBPACK_IMPORTED_MODULE_2__.escapeRegex(def.includes);
24843 - const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
24844 - def.pattern = pattern;
24845 - inst._zod.onattach.push((inst) => {
24846 - const bag = inst._zod.bag;
24847 - bag.patterns ?? (bag.patterns = new Set());
24848 - bag.patterns.add(pattern);
24849 - });
24850 - inst._zod.check = (payload) => {
24851 - if (payload.value.includes(def.includes, def.position))
24852 - return;
24853 - payload.issues.push({
24854 - origin: "string",
24855 - code: "invalid_format",
24856 - format: "includes",
24857 - includes: def.includes,
24858 - input: payload.value,
24859 - inst,
24860 - continue: !def.abort,
24861 - });
24862 - };
24863 -});
24864 -const $ZodCheckStartsWith = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckStartsWith", (inst, def) => {
24865 - $ZodCheck.init(inst, def);
24866 - const pattern = new RegExp(`^${_util_js__WEBPACK_IMPORTED_MODULE_2__.escapeRegex(def.prefix)}.*`);
24867 - def.pattern ?? (def.pattern = pattern);
24868 - inst._zod.onattach.push((inst) => {
24869 - const bag = inst._zod.bag;
24870 - bag.patterns ?? (bag.patterns = new Set());
24871 - bag.patterns.add(pattern);
24872 - });
24873 - inst._zod.check = (payload) => {
24874 - if (payload.value.startsWith(def.prefix))
24875 - return;
24876 - payload.issues.push({
24877 - origin: "string",
24878 - code: "invalid_format",
24879 - format: "starts_with",
24880 - prefix: def.prefix,
24881 - input: payload.value,
24882 - inst,
24883 - continue: !def.abort,
24884 - });
24885 - };
24886 -});
24887 -const $ZodCheckEndsWith = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckEndsWith", (inst, def) => {
24888 - $ZodCheck.init(inst, def);
24889 - const pattern = new RegExp(`.*${_util_js__WEBPACK_IMPORTED_MODULE_2__.escapeRegex(def.suffix)}$`);
24890 - def.pattern ?? (def.pattern = pattern);
24891 - inst._zod.onattach.push((inst) => {
24892 - const bag = inst._zod.bag;
24893 - bag.patterns ?? (bag.patterns = new Set());
24894 - bag.patterns.add(pattern);
24895 - });
24896 - inst._zod.check = (payload) => {
24897 - if (payload.value.endsWith(def.suffix))
24898 - return;
24899 - payload.issues.push({
24900 - origin: "string",
24901 - code: "invalid_format",
24902 - format: "ends_with",
24903 - suffix: def.suffix,
24904 - input: payload.value,
24905 - inst,
24906 - continue: !def.abort,
24907 - });
24908 - };
24909 -});
24910 -///////////////////////////////////
24911 -///// $ZodCheckProperty /////
24912 -///////////////////////////////////
24913 -function handleCheckPropertyResult(result, payload, property) {
24914 - if (result.issues.length) {
24915 - payload.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_2__.prefixIssues(property, result.issues));
24916 - }
24917 -}
24918 -const $ZodCheckProperty = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckProperty", (inst, def) => {
24919 - $ZodCheck.init(inst, def);
24920 - inst._zod.check = (payload) => {
24921 - const result = def.schema._zod.run({
24922 - value: payload.value[def.property],
24923 - issues: [],
24924 - }, {});
24925 - if (result instanceof Promise) {
24926 - return result.then((result) => handleCheckPropertyResult(result, payload, def.property));
24927 - }
24928 - handleCheckPropertyResult(result, payload, def.property);
24929 - return;
24930 - };
24931 -});
24932 -const $ZodCheckMimeType = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckMimeType", (inst, def) => {
24933 - $ZodCheck.init(inst, def);
24934 - const mimeSet = new Set(def.mime);
24935 - inst._zod.onattach.push((inst) => {
24936 - inst._zod.bag.mime = def.mime;
24937 - });
24938 - inst._zod.check = (payload) => {
24939 - if (mimeSet.has(payload.value.type))
24940 - return;
24941 - payload.issues.push({
24942 - code: "invalid_value",
24943 - values: def.mime,
24944 - input: payload.value.type,
24945 - inst,
24946 - });
24947 - };
24948 -});
24949 -const $ZodCheckOverwrite = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("$ZodCheckOverwrite", (inst, def) => {
24950 - $ZodCheck.init(inst, def);
24951 - inst._zod.check = (payload) => {
24952 - payload.value = def.tx(payload.value);
24953 - };
24954 -});
24955 -
24956 -
24957 -/***/ }),
24958 -
24959 -/***/ "./node_modules/zod/v4/core/core.js":
24960 -/*!******************************************!*\
24961 - !*** ./node_modules/zod/v4/core/core.js ***!
24962 - \******************************************/
24963 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
24964 -
24965 -__webpack_require__.r(__webpack_exports__);
24966 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
24967 -/* harmony export */ $ZodAsyncError: function() { return /* binding */ $ZodAsyncError; },
24968 -/* harmony export */ $brand: function() { return /* binding */ $brand; },
24969 -/* harmony export */ $constructor: function() { return /* binding */ $constructor; },
24970 -/* harmony export */ NEVER: function() { return /* binding */ NEVER; },
24971 -/* harmony export */ config: function() { return /* binding */ config; },
24972 -/* harmony export */ globalConfig: function() { return /* binding */ globalConfig; }
24973 -/* harmony export */ });
24974 -/** A special constant with type `never` */
24975 -const NEVER = Object.freeze({
24976 - status: "aborted",
24977 -});
24978 -function $constructor(name, initializer, params) {
24979 - function init(inst, def) {
24980 - var _a;
24981 - Object.defineProperty(inst, "_zod", {
24982 - value: inst._zod ?? {},
24983 - enumerable: false,
24984 - });
24985 - (_a = inst._zod).traits ?? (_a.traits = new Set());
24986 - inst._zod.traits.add(name);
24987 - initializer(inst, def);
24988 - // support prototype modifications
24989 - for (const k in _.prototype) {
24990 - if (!(k in inst))
24991 - Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) });
24992 - }
24993 - inst._zod.constr = _;
24994 - inst._zod.def = def;
24995 - }
24996 - // doesn't work if Parent has a constructor with arguments
24997 - const Parent = params?.Parent ?? Object;
24998 - class Definition extends Parent {
24999 - }
25000 - Object.defineProperty(Definition, "name", { value: name });
25001 - function _(def) {
25002 - var _a;
25003 - const inst = params?.Parent ? new Definition() : this;
25004 - init(inst, def);
25005 - (_a = inst._zod).deferred ?? (_a.deferred = []);
25006 - for (const fn of inst._zod.deferred) {
25007 - fn();
25008 - }
25009 - return inst;
25010 - }
25011 - Object.defineProperty(_, "init", { value: init });
25012 - Object.defineProperty(_, Symbol.hasInstance, {
25013 - value: (inst) => {
25014 - if (params?.Parent && inst instanceof params.Parent)
25015 - return true;
25016 - return inst?._zod?.traits?.has(name);
25017 - },
25018 - });
25019 - Object.defineProperty(_, "name", { value: name });
25020 - return _;
25021 -}
25022 -////////////////////////////// UTILITIES ///////////////////////////////////////
25023 -const $brand = Symbol("zod_brand");
25024 -class $ZodAsyncError extends Error {
25025 - constructor() {
25026 - super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
25027 - }
25028 -}
25029 -const globalConfig = {};
25030 -function config(newConfig) {
25031 - if (newConfig)
25032 - Object.assign(globalConfig, newConfig);
25033 - return globalConfig;
25034 -}
25035 -
25036 -
25037 -/***/ }),
25038 -
25039 -/***/ "./node_modules/zod/v4/core/doc.js":
25040 -/*!*****************************************!*\
25041 - !*** ./node_modules/zod/v4/core/doc.js ***!
25042 - \*****************************************/
25043 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25044 -
25045 -__webpack_require__.r(__webpack_exports__);
25046 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
25047 -/* harmony export */ Doc: function() { return /* binding */ Doc; }
25048 -/* harmony export */ });
25049 -class Doc {
25050 - constructor(args = []) {
25051 - this.content = [];
25052 - this.indent = 0;
25053 - if (this)
25054 - this.args = args;
25055 - }
25056 - indented(fn) {
25057 - this.indent += 1;
25058 - fn(this);
25059 - this.indent -= 1;
25060 - }
25061 - write(arg) {
25062 - if (typeof arg === "function") {
25063 - arg(this, { execution: "sync" });
25064 - arg(this, { execution: "async" });
25065 - return;
25066 - }
25067 - const content = arg;
25068 - const lines = content.split("\n").filter((x) => x);
25069 - const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
25070 - const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
25071 - for (const line of dedented) {
25072 - this.content.push(line);
25073 - }
25074 - }
25075 - compile() {
25076 - const F = Function;
25077 - const args = this?.args;
25078 - const content = this?.content ?? [``];
25079 - const lines = [...content.map((x) => ` ${x}`)];
25080 - // console.log(lines.join("\n"));
25081 - return new F(...args, lines.join("\n"));
25082 - }
25083 -}
25084 -
25085 -
25086 -/***/ }),
25087 -
25088 -/***/ "./node_modules/zod/v4/core/errors.js":
25089 -/*!********************************************!*\
25090 - !*** ./node_modules/zod/v4/core/errors.js ***!
25091 - \********************************************/
25092 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25093 -
25094 -__webpack_require__.r(__webpack_exports__);
25095 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
25096 -/* harmony export */ $ZodError: function() { return /* binding */ $ZodError; },
25097 -/* harmony export */ $ZodRealError: function() { return /* binding */ $ZodRealError; },
25098 -/* harmony export */ flattenError: function() { return /* binding */ flattenError; },
25099 -/* harmony export */ formatError: function() { return /* binding */ formatError; },
25100 -/* harmony export */ prettifyError: function() { return /* binding */ prettifyError; },
25101 -/* harmony export */ toDotPath: function() { return /* binding */ toDotPath; },
25102 -/* harmony export */ treeifyError: function() { return /* binding */ treeifyError; }
25103 -/* harmony export */ });
25104 -/* harmony import */ var _core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core.js */ "./node_modules/zod/v4/core/core.js");
25105 -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util.js */ "./node_modules/zod/v4/core/util.js");
25106 -
25107 -
25108 -const initializer = (inst, def) => {
25109 - inst.name = "$ZodError";
25110 - Object.defineProperty(inst, "_zod", {
25111 - value: inst._zod,
25112 - enumerable: false,
25113 - });
25114 - Object.defineProperty(inst, "issues", {
25115 - value: def,
25116 - enumerable: false,
25117 - });
25118 - Object.defineProperty(inst, "message", {
25119 - get() {
25120 - return JSON.stringify(def, _util_js__WEBPACK_IMPORTED_MODULE_1__.jsonStringifyReplacer, 2);
25121 - },
25122 - enumerable: true,
25123 - // configurable: false,
25124 - });
25125 - Object.defineProperty(inst, "toString", {
25126 - value: () => inst.message,
25127 - enumerable: false,
25128 - });
25129 -};
25130 -const $ZodError = (0,_core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor)("$ZodError", initializer);
25131 -const $ZodRealError = (0,_core_js__WEBPACK_IMPORTED_MODULE_0__.$constructor)("$ZodError", initializer, { Parent: Error });
25132 -function flattenError(error, mapper = (issue) => issue.message) {
25133 - const fieldErrors = {};
25134 - const formErrors = [];
25135 - for (const sub of error.issues) {
25136 - if (sub.path.length > 0) {
25137 - fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
25138 - fieldErrors[sub.path[0]].push(mapper(sub));
25139 - }
25140 - else {
25141 - formErrors.push(mapper(sub));
25142 - }
25143 - }
25144 - return { formErrors, fieldErrors };
25145 -}
25146 -function formatError(error, _mapper) {
25147 - const mapper = _mapper ||
25148 - function (issue) {
25149 - return issue.message;
25150 - };
25151 - const fieldErrors = { _errors: [] };
25152 - const processError = (error) => {
25153 - for (const issue of error.issues) {
25154 - if (issue.code === "invalid_union" && issue.errors.length) {
25155 - issue.errors.map((issues) => processError({ issues }));
25156 - }
25157 - else if (issue.code === "invalid_key") {
25158 - processError({ issues: issue.issues });
25159 - }
25160 - else if (issue.code === "invalid_element") {
25161 - processError({ issues: issue.issues });
25162 - }
25163 - else if (issue.path.length === 0) {
25164 - fieldErrors._errors.push(mapper(issue));
25165 - }
25166 - else {
25167 - let curr = fieldErrors;
25168 - let i = 0;
25169 - while (i < issue.path.length) {
25170 - const el = issue.path[i];
25171 - const terminal = i === issue.path.length - 1;
25172 - if (!terminal) {
25173 - curr[el] = curr[el] || { _errors: [] };
25174 - }
25175 - else {
25176 - curr[el] = curr[el] || { _errors: [] };
25177 - curr[el]._errors.push(mapper(issue));
25178 - }
25179 - curr = curr[el];
25180 - i++;
25181 - }
25182 - }
25183 - }
25184 - };
25185 - processError(error);
25186 - return fieldErrors;
25187 -}
25188 -function treeifyError(error, _mapper) {
25189 - const mapper = _mapper ||
25190 - function (issue) {
25191 - return issue.message;
25192 - };
25193 - const result = { errors: [] };
25194 - const processError = (error, path = []) => {
25195 - var _a, _b;
25196 - for (const issue of error.issues) {
25197 - if (issue.code === "invalid_union" && issue.errors.length) {
25198 - // regular union error
25199 - issue.errors.map((issues) => processError({ issues }, issue.path));
25200 - }
25201 - else if (issue.code === "invalid_key") {
25202 - processError({ issues: issue.issues }, issue.path);
25203 - }
25204 - else if (issue.code === "invalid_element") {
25205 - processError({ issues: issue.issues }, issue.path);
25206 - }
25207 - else {
25208 - const fullpath = [...path, ...issue.path];
25209 - if (fullpath.length === 0) {
25210 - result.errors.push(mapper(issue));
25211 - continue;
25212 - }
25213 - let curr = result;
25214 - let i = 0;
25215 - while (i < fullpath.length) {
25216 - const el = fullpath[i];
25217 - const terminal = i === fullpath.length - 1;
25218 - if (typeof el === "string") {
25219 - curr.properties ?? (curr.properties = {});
25220 - (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });
25221 - curr = curr.properties[el];
25222 - }
25223 - else {
25224 - curr.items ?? (curr.items = []);
25225 - (_b = curr.items)[el] ?? (_b[el] = { errors: [] });
25226 - curr = curr.items[el];
25227 - }
25228 - if (terminal) {
25229 - curr.errors.push(mapper(issue));
25230 - }
25231 - i++;
25232 - }
25233 - }
25234 - }
25235 - };
25236 - processError(error);
25237 - return result;
25238 -}
25239 -/** Format a ZodError as a human-readable string in the following form.
25240 - *
25241 - * From
25242 - *
25243 - * ```ts
25244 - * ZodError {
25245 - * issues: [
25246 - * {
25247 - * expected: 'string',
25248 - * code: 'invalid_type',
25249 - * path: [ 'username' ],
25250 - * message: 'Invalid input: expected string'
25251 - * },
25252 - * {
25253 - * expected: 'number',
25254 - * code: 'invalid_type',
25255 - * path: [ 'favoriteNumbers', 1 ],
25256 - * message: 'Invalid input: expected number'
25257 - * }
25258 - * ];
25259 - * }
25260 - * ```
25261 - *
25262 - * to
25263 - *
25264 - * ```
25265 - * username
25266 - * ✖ Expected number, received string at "username
25267 - * favoriteNumbers[0]
25268 - * ✖ Invalid input: expected number
25269 - * ```
25270 - */
25271 -function toDotPath(path) {
25272 - const segs = [];
25273 - for (const seg of path) {
25274 - if (typeof seg === "number")
25275 - segs.push(`[${seg}]`);
25276 - else if (typeof seg === "symbol")
25277 - segs.push(`[${JSON.stringify(String(seg))}]`);
25278 - else if (/[^\w$]/.test(seg))
25279 - segs.push(`[${JSON.stringify(seg)}]`);
25280 - else {
25281 - if (segs.length)
25282 - segs.push(".");
25283 - segs.push(seg);
25284 - }
25285 - }
25286 - return segs.join("");
25287 -}
25288 -function prettifyError(error) {
25289 - const lines = [];
25290 - // sort by path length
25291 - const issues = [...error.issues].sort((a, b) => a.path.length - b.path.length);
25292 - // Process each issue
25293 - for (const issue of issues) {
25294 - lines.push(`✖ ${issue.message}`);
25295 - if (issue.path?.length)
25296 - lines.push(` → at ${toDotPath(issue.path)}`);
25297 - }
25298 - // Convert Map to formatted string
25299 - return lines.join("\n");
25300 -}
25301 -
25302 -
25303 -/***/ }),
25304 -
25305 -/***/ "./node_modules/zod/v4/core/parse.js":
25306 -/*!*******************************************!*\
25307 - !*** ./node_modules/zod/v4/core/parse.js ***!
25308 - \*******************************************/
25309 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25310 -
25311 -__webpack_require__.r(__webpack_exports__);
25312 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
25313 -/* harmony export */ _parse: function() { return /* binding */ _parse; },
25314 -/* harmony export */ _parseAsync: function() { return /* binding */ _parseAsync; },
25315 -/* harmony export */ _safeParse: function() { return /* binding */ _safeParse; },
25316 -/* harmony export */ _safeParseAsync: function() { return /* binding */ _safeParseAsync; },
25317 -/* harmony export */ parse: function() { return /* binding */ parse; },
25318 -/* harmony export */ parseAsync: function() { return /* binding */ parseAsync; },
25319 -/* harmony export */ safeParse: function() { return /* binding */ safeParse; },
25320 -/* harmony export */ safeParseAsync: function() { return /* binding */ safeParseAsync; }
25321 -/* harmony export */ });
25322 -/* harmony import */ var _core_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core.js */ "./node_modules/zod/v4/core/core.js");
25323 -/* harmony import */ var _errors_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./errors.js */ "./node_modules/zod/v4/core/errors.js");
25324 -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util.js */ "./node_modules/zod/v4/core/util.js");
25325 -
25326 -
25327 -
25328 -const _parse = (_Err) => (schema, value, _ctx, _params) => {
25329 - const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
25330 - const result = schema._zod.run({ value, issues: [] }, ctx);
25331 - if (result instanceof Promise) {
25332 - throw new _core_js__WEBPACK_IMPORTED_MODULE_0__.$ZodAsyncError();
25333 - }
25334 - if (result.issues.length) {
25335 - const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_2__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_0__.config())));
25336 - _util_js__WEBPACK_IMPORTED_MODULE_2__.captureStackTrace(e, _params?.callee);
25337 - throw e;
25338 - }
25339 - return result.value;
25340 -};
25341 -const parse = /* @__PURE__*/ _parse(_errors_js__WEBPACK_IMPORTED_MODULE_1__.$ZodRealError);
25342 -const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
25343 - const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
25344 - let result = schema._zod.run({ value, issues: [] }, ctx);
25345 - if (result instanceof Promise)
25346 - result = await result;
25347 - if (result.issues.length) {
25348 - const e = new (params?.Err ?? _Err)(result.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_2__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_0__.config())));
25349 - _util_js__WEBPACK_IMPORTED_MODULE_2__.captureStackTrace(e, params?.callee);
25350 - throw e;
25351 - }
25352 - return result.value;
25353 -};
25354 -const parseAsync = /* @__PURE__*/ _parseAsync(_errors_js__WEBPACK_IMPORTED_MODULE_1__.$ZodRealError);
25355 -const _safeParse = (_Err) => (schema, value, _ctx) => {
25356 - const ctx = _ctx ? { ..._ctx, async: false } : { async: false };
25357 - const result = schema._zod.run({ value, issues: [] }, ctx);
25358 - if (result instanceof Promise) {
25359 - throw new _core_js__WEBPACK_IMPORTED_MODULE_0__.$ZodAsyncError();
25360 - }
25361 - return result.issues.length
25362 - ? {
25363 - success: false,
25364 - error: new (_Err ?? _errors_js__WEBPACK_IMPORTED_MODULE_1__.$ZodError)(result.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_2__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_0__.config()))),
25365 - }
25366 - : { success: true, data: result.value };
25367 -};
25368 -const safeParse = /* @__PURE__*/ _safeParse(_errors_js__WEBPACK_IMPORTED_MODULE_1__.$ZodRealError);
25369 -const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
25370 - const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
25371 - let result = schema._zod.run({ value, issues: [] }, ctx);
25372 - if (result instanceof Promise)
25373 - result = await result;
25374 - return result.issues.length
25375 - ? {
25376 - success: false,
25377 - error: new _Err(result.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_2__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_0__.config()))),
25378 - }
25379 - : { success: true, data: result.value };
25380 -};
25381 -const safeParseAsync = /* @__PURE__*/ _safeParseAsync(_errors_js__WEBPACK_IMPORTED_MODULE_1__.$ZodRealError);
25382 -
25383 -
25384 -/***/ }),
25385 -
25386 -/***/ "./node_modules/zod/v4/core/regexes.js":
25387 -/*!*********************************************!*\
25388 - !*** ./node_modules/zod/v4/core/regexes.js ***!
25389 - \*********************************************/
25390 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25391 -
25392 -__webpack_require__.r(__webpack_exports__);
25393 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
25394 -/* harmony export */ _emoji: function() { return /* binding */ _emoji; },
25395 -/* harmony export */ base64: function() { return /* binding */ base64; },
25396 -/* harmony export */ base64url: function() { return /* binding */ base64url; },
25397 -/* harmony export */ bigint: function() { return /* binding */ bigint; },
25398 -/* harmony export */ boolean: function() { return /* binding */ boolean; },
25399 -/* harmony export */ browserEmail: function() { return /* binding */ browserEmail; },
25400 -/* harmony export */ cidrv4: function() { return /* binding */ cidrv4; },
25401 -/* harmony export */ cidrv6: function() { return /* binding */ cidrv6; },
25402 -/* harmony export */ cuid: function() { return /* binding */ cuid; },
25403 -/* harmony export */ cuid2: function() { return /* binding */ cuid2; },
25404 -/* harmony export */ date: function() { return /* binding */ date; },
25405 -/* harmony export */ datetime: function() { return /* binding */ datetime; },
25406 -/* harmony export */ domain: function() { return /* binding */ domain; },
25407 -/* harmony export */ duration: function() { return /* binding */ duration; },
25408 -/* harmony export */ e164: function() { return /* binding */ e164; },
25409 -/* harmony export */ email: function() { return /* binding */ email; },
25410 -/* harmony export */ emoji: function() { return /* binding */ emoji; },
25411 -/* harmony export */ extendedDuration: function() { return /* binding */ extendedDuration; },
25412 -/* harmony export */ guid: function() { return /* binding */ guid; },
25413 -/* harmony export */ hostname: function() { return /* binding */ hostname; },
25414 -/* harmony export */ html5Email: function() { return /* binding */ html5Email; },
25415 -/* harmony export */ integer: function() { return /* binding */ integer; },
25416 -/* harmony export */ ipv4: function() { return /* binding */ ipv4; },
25417 -/* harmony export */ ipv6: function() { return /* binding */ ipv6; },
25418 -/* harmony export */ ksuid: function() { return /* binding */ ksuid; },
25419 -/* harmony export */ lowercase: function() { return /* binding */ lowercase; },
25420 -/* harmony export */ nanoid: function() { return /* binding */ nanoid; },
25421 -/* harmony export */ "null": function() { return /* binding */ _null; },
25422 -/* harmony export */ number: function() { return /* binding */ number; },
25423 -/* harmony export */ rfc5322Email: function() { return /* binding */ rfc5322Email; },
25424 -/* harmony export */ string: function() { return /* binding */ string; },
25425 -/* harmony export */ time: function() { return /* binding */ time; },
25426 -/* harmony export */ ulid: function() { return /* binding */ ulid; },
25427 -/* harmony export */ undefined: function() { return /* binding */ _undefined; },
25428 -/* harmony export */ unicodeEmail: function() { return /* binding */ unicodeEmail; },
25429 -/* harmony export */ uppercase: function() { return /* binding */ uppercase; },
25430 -/* harmony export */ uuid: function() { return /* binding */ uuid; },
25431 -/* harmony export */ uuid4: function() { return /* binding */ uuid4; },
25432 -/* harmony export */ uuid6: function() { return /* binding */ uuid6; },
25433 -/* harmony export */ uuid7: function() { return /* binding */ uuid7; },
25434 -/* harmony export */ xid: function() { return /* binding */ xid; }
25435 -/* harmony export */ });
25436 -const cuid = /^[cC][^\s-]{8,}$/;
25437 -const cuid2 = /^[0-9a-z]+$/;
25438 -const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
25439 -const xid = /^[0-9a-vA-V]{20}$/;
25440 -const ksuid = /^[A-Za-z0-9]{27}$/;
25441 -const nanoid = /^[a-zA-Z0-9_-]{21}$/;
25442 -/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
25443 -const duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
25444 -/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */
25445 -const extendedDuration = /^[-+]?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)?)??$/;
25446 -/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
25447 -const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
25448 -/** Returns a regex for validating an RFC 4122 UUID.
25449 - *
25450 - * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
25451 -const uuid = (version) => {
25452 - if (!version)
25453 - return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/;
25454 - return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
25455 -};
25456 -const uuid4 = /*@__PURE__*/ uuid(4);
25457 -const uuid6 = /*@__PURE__*/ uuid(6);
25458 -const uuid7 = /*@__PURE__*/ uuid(7);
25459 -/** Practical email validation */
25460 -const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
25461 -/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */
25462 -const html5Email = /^[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])?)*$/;
25463 -/** The classic emailregex.com regex for RFC 5322-compliant emails */
25464 -const rfc5322Email = /^(([^<>()\[\]\\.,;:\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,}))$/;
25465 -/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */
25466 -const unicodeEmail = /^[^\s@"]{1,64}@[^\s@]{1,255}$/u;
25467 -const browserEmail = /^[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])?)*$/;
25468 -// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression
25469 -const _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
25470 -function emoji() {
25471 - return new RegExp(_emoji, "u");
25472 -}
25473 -const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
25474 -const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/;
25475 -const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
25476 -const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
25477 -// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript
25478 -const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
25479 -const base64url = /^[A-Za-z0-9_-]*$/;
25480 -// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address
25481 -// export const hostname: RegExp =
25482 -// /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/;
25483 -const hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
25484 -const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
25485 -// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)
25486 -const e164 = /^\+(?:[0-9]){6,14}[0-9]$/;
25487 -// const dateSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
25488 -const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
25489 -const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
25490 -function timeSource(args) {
25491 - const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
25492 - const regex = typeof args.precision === "number"
25493 - ? args.precision === -1
25494 - ? `${hhmm}`
25495 - : args.precision === 0
25496 - ? `${hhmm}:[0-5]\\d`
25497 - : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}`
25498 - : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
25499 - return regex;
25500 -}
25501 -function time(args) {
25502 - return new RegExp(`^${timeSource(args)}$`);
25503 -}
25504 -// Adapted from https://stackoverflow.com/a/3143231
25505 -function datetime(args) {
25506 - const time = timeSource({ precision: args.precision });
25507 - const opts = ["Z"];
25508 - if (args.local)
25509 - opts.push("");
25510 - if (args.offset)
25511 - opts.push(`([+-]\\d{2}:\\d{2})`);
25512 - const timeRegex = `${time}(?:${opts.join("|")})`;
25513 - return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
25514 -}
25515 -const string = (params) => {
25516 - const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
25517 - return new RegExp(`^${regex}$`);
25518 -};
25519 -const bigint = /^\d+n?$/;
25520 -const integer = /^\d+$/;
25521 -const number = /^-?\d+(?:\.\d+)?/i;
25522 -const boolean = /true|false/i;
25523 -const _null = /null/i;
25524 -
25525 -const _undefined = /undefined/i;
25526 -
25527 -// regex for string with no uppercase letters
25528 -const lowercase = /^[^A-Z]*$/;
25529 -// regex for string with no lowercase letters
25530 -const uppercase = /^[^a-z]*$/;
25531 -
25532 -
25533 -/***/ }),
25534 -
25535 -/***/ "./node_modules/zod/v4/core/registries.js":
25536 -/*!************************************************!*\
25537 - !*** ./node_modules/zod/v4/core/registries.js ***!
25538 - \************************************************/
25539 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25540 -
25541 -__webpack_require__.r(__webpack_exports__);
25542 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
25543 -/* harmony export */ $ZodRegistry: function() { return /* binding */ $ZodRegistry; },
25544 -/* harmony export */ $input: function() { return /* binding */ $input; },
25545 -/* harmony export */ $output: function() { return /* binding */ $output; },
25546 -/* harmony export */ globalRegistry: function() { return /* binding */ globalRegistry; },
25547 -/* harmony export */ registry: function() { return /* binding */ registry; }
25548 -/* harmony export */ });
25549 -const $output = Symbol("ZodOutput");
25550 -const $input = Symbol("ZodInput");
25551 -class $ZodRegistry {
25552 - constructor() {
25553 - this._map = new Map();
25554 - this._idmap = new Map();
25555 - }
25556 - add(schema, ..._meta) {
25557 - const meta = _meta[0];
25558 - this._map.set(schema, meta);
25559 - if (meta && typeof meta === "object" && "id" in meta) {
25560 - if (this._idmap.has(meta.id)) {
25561 - throw new Error(`ID ${meta.id} already exists in the registry`);
25562 - }
25563 - this._idmap.set(meta.id, schema);
25564 - }
25565 - return this;
25566 - }
25567 - clear() {
25568 - this._map = new Map();
25569 - this._idmap = new Map();
25570 - return this;
25571 - }
25572 - remove(schema) {
25573 - const meta = this._map.get(schema);
25574 - if (meta && typeof meta === "object" && "id" in meta) {
25575 - this._idmap.delete(meta.id);
25576 - }
25577 - this._map.delete(schema);
25578 - return this;
25579 - }
25580 - get(schema) {
25581 - // return this._map.get(schema) as any;
25582 - // inherit metadata
25583 - const p = schema._zod.parent;
25584 - if (p) {
25585 - const pm = { ...(this.get(p) ?? {}) };
25586 - delete pm.id; // do not inherit id
25587 - return { ...pm, ...this._map.get(schema) };
25588 - }
25589 - return this._map.get(schema);
25590 - }
25591 - has(schema) {
25592 - return this._map.has(schema);
25593 - }
25594 -}
25595 -// registries
25596 -function registry() {
25597 - return new $ZodRegistry();
25598 -}
25599 -const globalRegistry = /*@__PURE__*/ registry();
25600 -
25601 -
25602 -/***/ }),
25603 -
25604 -/***/ "./node_modules/zod/v4/core/schemas.js":
25605 -/*!*********************************************!*\
25606 - !*** ./node_modules/zod/v4/core/schemas.js ***!
25607 - \*********************************************/
25608 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25609 -
25610 -__webpack_require__.r(__webpack_exports__);
25611 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
25612 -/* harmony export */ $ZodAny: function() { return /* binding */ $ZodAny; },
25613 -/* harmony export */ $ZodArray: function() { return /* binding */ $ZodArray; },
25614 -/* harmony export */ $ZodBase64: function() { return /* binding */ $ZodBase64; },
25615 -/* harmony export */ $ZodBase64URL: function() { return /* binding */ $ZodBase64URL; },
25616 -/* harmony export */ $ZodBigInt: function() { return /* binding */ $ZodBigInt; },
25617 -/* harmony export */ $ZodBigIntFormat: function() { return /* binding */ $ZodBigIntFormat; },
25618 -/* harmony export */ $ZodBoolean: function() { return /* binding */ $ZodBoolean; },
25619 -/* harmony export */ $ZodCIDRv4: function() { return /* binding */ $ZodCIDRv4; },
25620 -/* harmony export */ $ZodCIDRv6: function() { return /* binding */ $ZodCIDRv6; },
25621 -/* harmony export */ $ZodCUID: function() { return /* binding */ $ZodCUID; },
25622 -/* harmony export */ $ZodCUID2: function() { return /* binding */ $ZodCUID2; },
25623 -/* harmony export */ $ZodCatch: function() { return /* binding */ $ZodCatch; },
25624 -/* harmony export */ $ZodCustom: function() { return /* binding */ $ZodCustom; },
25625 -/* harmony export */ $ZodCustomStringFormat: function() { return /* binding */ $ZodCustomStringFormat; },
25626 -/* harmony export */ $ZodDate: function() { return /* binding */ $ZodDate; },
25627 -/* harmony export */ $ZodDefault: function() { return /* binding */ $ZodDefault; },
25628 -/* harmony export */ $ZodDiscriminatedUnion: function() { return /* binding */ $ZodDiscriminatedUnion; },
25629 -/* harmony export */ $ZodE164: function() { return /* binding */ $ZodE164; },
25630 -/* harmony export */ $ZodEmail: function() { return /* binding */ $ZodEmail; },
25631 -/* harmony export */ $ZodEmoji: function() { return /* binding */ $ZodEmoji; },
25632 -/* harmony export */ $ZodEnum: function() { return /* binding */ $ZodEnum; },
25633 -/* harmony export */ $ZodFile: function() { return /* binding */ $ZodFile; },
25634 -/* harmony export */ $ZodGUID: function() { return /* binding */ $ZodGUID; },
25635 -/* harmony export */ $ZodIPv4: function() { return /* binding */ $ZodIPv4; },
25636 -/* harmony export */ $ZodIPv6: function() { return /* binding */ $ZodIPv6; },
25637 -/* harmony export */ $ZodISODate: function() { return /* binding */ $ZodISODate; },
25638 -/* harmony export */ $ZodISODateTime: function() { return /* binding */ $ZodISODateTime; },
25639 -/* harmony export */ $ZodISODuration: function() { return /* binding */ $ZodISODuration; },
25640 -/* harmony export */ $ZodISOTime: function() { return /* binding */ $ZodISOTime; },
25641 -/* harmony export */ $ZodIntersection: function() { return /* binding */ $ZodIntersection; },
25642 -/* harmony export */ $ZodJWT: function() { return /* binding */ $ZodJWT; },
25643 -/* harmony export */ $ZodKSUID: function() { return /* binding */ $ZodKSUID; },
25644 -/* harmony export */ $ZodLazy: function() { return /* binding */ $ZodLazy; },
25645 -/* harmony export */ $ZodLiteral: function() { return /* binding */ $ZodLiteral; },
25646 -/* harmony export */ $ZodMap: function() { return /* binding */ $ZodMap; },
25647 -/* harmony export */ $ZodNaN: function() { return /* binding */ $ZodNaN; },
25648 -/* harmony export */ $ZodNanoID: function() { return /* binding */ $ZodNanoID; },
25649 -/* harmony export */ $ZodNever: function() { return /* binding */ $ZodNever; },
25650 -/* harmony export */ $ZodNonOptional: function() { return /* binding */ $ZodNonOptional; },
25651 -/* harmony export */ $ZodNull: function() { return /* binding */ $ZodNull; },
25652 -/* harmony export */ $ZodNullable: function() { return /* binding */ $ZodNullable; },
25653 -/* harmony export */ $ZodNumber: function() { return /* binding */ $ZodNumber; },
25654 -/* harmony export */ $ZodNumberFormat: function() { return /* binding */ $ZodNumberFormat; },
25655 -/* harmony export */ $ZodObject: function() { return /* binding */ $ZodObject; },
25656 -/* harmony export */ $ZodOptional: function() { return /* binding */ $ZodOptional; },
25657 -/* harmony export */ $ZodPipe: function() { return /* binding */ $ZodPipe; },
25658 -/* harmony export */ $ZodPrefault: function() { return /* binding */ $ZodPrefault; },
25659 -/* harmony export */ $ZodPromise: function() { return /* binding */ $ZodPromise; },
25660 -/* harmony export */ $ZodReadonly: function() { return /* binding */ $ZodReadonly; },
25661 -/* harmony export */ $ZodRecord: function() { return /* binding */ $ZodRecord; },
25662 -/* harmony export */ $ZodSet: function() { return /* binding */ $ZodSet; },
25663 -/* harmony export */ $ZodString: function() { return /* binding */ $ZodString; },
25664 -/* harmony export */ $ZodStringFormat: function() { return /* binding */ $ZodStringFormat; },
25665 -/* harmony export */ $ZodSuccess: function() { return /* binding */ $ZodSuccess; },
25666 -/* harmony export */ $ZodSymbol: function() { return /* binding */ $ZodSymbol; },
25667 -/* harmony export */ $ZodTemplateLiteral: function() { return /* binding */ $ZodTemplateLiteral; },
25668 -/* harmony export */ $ZodTransform: function() { return /* binding */ $ZodTransform; },
25669 -/* harmony export */ $ZodTuple: function() { return /* binding */ $ZodTuple; },
25670 -/* harmony export */ $ZodType: function() { return /* binding */ $ZodType; },
25671 -/* harmony export */ $ZodULID: function() { return /* binding */ $ZodULID; },
25672 -/* harmony export */ $ZodURL: function() { return /* binding */ $ZodURL; },
25673 -/* harmony export */ $ZodUUID: function() { return /* binding */ $ZodUUID; },
25674 -/* harmony export */ $ZodUndefined: function() { return /* binding */ $ZodUndefined; },
25675 -/* harmony export */ $ZodUnion: function() { return /* binding */ $ZodUnion; },
25676 -/* harmony export */ $ZodUnknown: function() { return /* binding */ $ZodUnknown; },
25677 -/* harmony export */ $ZodVoid: function() { return /* binding */ $ZodVoid; },
25678 -/* harmony export */ $ZodXID: function() { return /* binding */ $ZodXID; },
25679 -/* harmony export */ clone: function() { return /* reexport safe */ _util_js__WEBPACK_IMPORTED_MODULE_5__.clone; },
25680 -/* harmony export */ isValidBase64: function() { return /* binding */ isValidBase64; },
25681 -/* harmony export */ isValidBase64URL: function() { return /* binding */ isValidBase64URL; },
25682 -/* harmony export */ isValidJWT: function() { return /* binding */ isValidJWT; }
25683 -/* harmony export */ });
25684 -/* harmony import */ var _checks_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./checks.js */ "./node_modules/zod/v4/core/checks.js");
25685 -/* harmony import */ var _core_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core.js */ "./node_modules/zod/v4/core/core.js");
25686 -/* harmony import */ var _doc_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./doc.js */ "./node_modules/zod/v4/core/doc.js");
25687 -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parse.js */ "./node_modules/zod/v4/core/parse.js");
25688 -/* harmony import */ var _regexes_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./regexes.js */ "./node_modules/zod/v4/core/regexes.js");
25689 -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util.js */ "./node_modules/zod/v4/core/util.js");
25690 -/* harmony import */ var _versions_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./versions.js */ "./node_modules/zod/v4/core/versions.js");
25691 -
25692 -
25693 -
25694 -
25695 -
25696 -
25697 -
25698 -const $ZodType = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodType", (inst, def) => {
25699 - var _a;
25700 - inst ?? (inst = {});
25701 - inst._zod.def = def; // set _def property
25702 - inst._zod.bag = inst._zod.bag || {}; // initialize _bag object
25703 - inst._zod.version = _versions_js__WEBPACK_IMPORTED_MODULE_6__.version;
25704 - const checks = [...(inst._zod.def.checks ?? [])];
25705 - // if inst is itself a checks.$ZodCheck, run it as a check
25706 - if (inst._zod.traits.has("$ZodCheck")) {
25707 - checks.unshift(inst);
25708 - }
25709 - //
25710 - for (const ch of checks) {
25711 - for (const fn of ch._zod.onattach) {
25712 - fn(inst);
25713 - }
25714 - }
25715 - if (checks.length === 0) {
25716 - // deferred initializer
25717 - // inst._zod.parse is not yet defined
25718 - (_a = inst._zod).deferred ?? (_a.deferred = []);
25719 - inst._zod.deferred?.push(() => {
25720 - inst._zod.run = inst._zod.parse;
25721 - });
25722 - }
25723 - else {
25724 - const runChecks = (payload, checks, ctx) => {
25725 - let isAborted = _util_js__WEBPACK_IMPORTED_MODULE_5__.aborted(payload);
25726 - let asyncResult;
25727 - for (const ch of checks) {
25728 - if (ch._zod.def.when) {
25729 - const shouldRun = ch._zod.def.when(payload);
25730 - if (!shouldRun)
25731 - continue;
25732 - }
25733 - else if (isAborted) {
25734 - continue;
25735 - }
25736 - const currLen = payload.issues.length;
25737 - const _ = ch._zod.check(payload);
25738 - if (_ instanceof Promise && ctx?.async === false) {
25739 - throw new _core_js__WEBPACK_IMPORTED_MODULE_1__.$ZodAsyncError();
25740 - }
25741 - if (asyncResult || _ instanceof Promise) {
25742 - asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
25743 - await _;
25744 - const nextLen = payload.issues.length;
25745 - if (nextLen === currLen)
25746 - return;
25747 - if (!isAborted)
25748 - isAborted = _util_js__WEBPACK_IMPORTED_MODULE_5__.aborted(payload, currLen);
25749 - });
25750 - }
25751 - else {
25752 - const nextLen = payload.issues.length;
25753 - if (nextLen === currLen)
25754 - continue;
25755 - if (!isAborted)
25756 - isAborted = _util_js__WEBPACK_IMPORTED_MODULE_5__.aborted(payload, currLen);
25757 - }
25758 - }
25759 - if (asyncResult) {
25760 - return asyncResult.then(() => {
25761 - return payload;
25762 - });
25763 - }
25764 - return payload;
25765 - };
25766 - inst._zod.run = (payload, ctx) => {
25767 - const result = inst._zod.parse(payload, ctx);
25768 - if (result instanceof Promise) {
25769 - if (ctx.async === false)
25770 - throw new _core_js__WEBPACK_IMPORTED_MODULE_1__.$ZodAsyncError();
25771 - return result.then((result) => runChecks(result, checks, ctx));
25772 - }
25773 - return runChecks(result, checks, ctx);
25774 - };
25775 - }
25776 - inst["~standard"] = {
25777 - validate: (value) => {
25778 - try {
25779 - const r = (0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.safeParse)(inst, value);
25780 - return r.success ? { value: r.data } : { issues: r.error?.issues };
25781 - }
25782 - catch (_) {
25783 - return (0,_parse_js__WEBPACK_IMPORTED_MODULE_3__.safeParseAsync)(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));
25784 - }
25785 - },
25786 - vendor: "zod",
25787 - version: 1,
25788 - };
25789 -});
25790 -
25791 -const $ZodString = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodString", (inst, def) => {
25792 - $ZodType.init(inst, def);
25793 - inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? _regexes_js__WEBPACK_IMPORTED_MODULE_4__.string(inst._zod.bag);
25794 - inst._zod.parse = (payload, _) => {
25795 - if (def.coerce)
25796 - try {
25797 - payload.value = String(payload.value);
25798 - }
25799 - catch (_) { }
25800 - if (typeof payload.value === "string")
25801 - return payload;
25802 - payload.issues.push({
25803 - expected: "string",
25804 - code: "invalid_type",
25805 - input: payload.value,
25806 - inst,
25807 - });
25808 - return payload;
25809 - };
25810 -});
25811 -const $ZodStringFormat = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodStringFormat", (inst, def) => {
25812 - // check initialization must come first
25813 - _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckStringFormat.init(inst, def);
25814 - $ZodString.init(inst, def);
25815 -});
25816 -const $ZodGUID = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodGUID", (inst, def) => {
25817 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.guid);
25818 - $ZodStringFormat.init(inst, def);
25819 -});
25820 -const $ZodUUID = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodUUID", (inst, def) => {
25821 - if (def.version) {
25822 - const versionMap = {
25823 - v1: 1,
25824 - v2: 2,
25825 - v3: 3,
25826 - v4: 4,
25827 - v5: 5,
25828 - v6: 6,
25829 - v7: 7,
25830 - v8: 8,
25831 - };
25832 - const v = versionMap[def.version];
25833 - if (v === undefined)
25834 - throw new Error(`Invalid UUID version: "${def.version}"`);
25835 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.uuid(v));
25836 - }
25837 - else
25838 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.uuid());
25839 - $ZodStringFormat.init(inst, def);
25840 -});
25841 -const $ZodEmail = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodEmail", (inst, def) => {
25842 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.email);
25843 - $ZodStringFormat.init(inst, def);
25844 -});
25845 -const $ZodURL = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodURL", (inst, def) => {
25846 - $ZodStringFormat.init(inst, def);
25847 - inst._zod.check = (payload) => {
25848 - try {
25849 - const orig = payload.value;
25850 - const url = new URL(orig);
25851 - const href = url.href;
25852 - if (def.hostname) {
25853 - def.hostname.lastIndex = 0;
25854 - if (!def.hostname.test(url.hostname)) {
25855 - payload.issues.push({
25856 - code: "invalid_format",
25857 - format: "url",
25858 - note: "Invalid hostname",
25859 - pattern: _regexes_js__WEBPACK_IMPORTED_MODULE_4__.hostname.source,
25860 - input: payload.value,
25861 - inst,
25862 - continue: !def.abort,
25863 - });
25864 - }
25865 - }
25866 - if (def.protocol) {
25867 - def.protocol.lastIndex = 0;
25868 - if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) {
25869 - payload.issues.push({
25870 - code: "invalid_format",
25871 - format: "url",
25872 - note: "Invalid protocol",
25873 - pattern: def.protocol.source,
25874 - input: payload.value,
25875 - inst,
25876 - continue: !def.abort,
25877 - });
25878 - }
25879 - }
25880 - // payload.value = url.href;
25881 - if (!orig.endsWith("/") && href.endsWith("/")) {
25882 - payload.value = href.slice(0, -1);
25883 - }
25884 - else {
25885 - payload.value = href;
25886 - }
25887 - return;
25888 - }
25889 - catch (_) {
25890 - payload.issues.push({
25891 - code: "invalid_format",
25892 - format: "url",
25893 - input: payload.value,
25894 - inst,
25895 - continue: !def.abort,
25896 - });
25897 - }
25898 - };
25899 -});
25900 -const $ZodEmoji = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodEmoji", (inst, def) => {
25901 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.emoji());
25902 - $ZodStringFormat.init(inst, def);
25903 -});
25904 -const $ZodNanoID = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodNanoID", (inst, def) => {
25905 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.nanoid);
25906 - $ZodStringFormat.init(inst, def);
25907 -});
25908 -const $ZodCUID = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodCUID", (inst, def) => {
25909 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.cuid);
25910 - $ZodStringFormat.init(inst, def);
25911 -});
25912 -const $ZodCUID2 = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodCUID2", (inst, def) => {
25913 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.cuid2);
25914 - $ZodStringFormat.init(inst, def);
25915 -});
25916 -const $ZodULID = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodULID", (inst, def) => {
25917 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.ulid);
25918 - $ZodStringFormat.init(inst, def);
25919 -});
25920 -const $ZodXID = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodXID", (inst, def) => {
25921 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.xid);
25922 - $ZodStringFormat.init(inst, def);
25923 -});
25924 -const $ZodKSUID = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodKSUID", (inst, def) => {
25925 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.ksuid);
25926 - $ZodStringFormat.init(inst, def);
25927 -});
25928 -const $ZodISODateTime = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodISODateTime", (inst, def) => {
25929 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.datetime(def));
25930 - $ZodStringFormat.init(inst, def);
25931 -});
25932 -const $ZodISODate = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodISODate", (inst, def) => {
25933 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.date);
25934 - $ZodStringFormat.init(inst, def);
25935 -});
25936 -const $ZodISOTime = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodISOTime", (inst, def) => {
25937 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.time(def));
25938 - $ZodStringFormat.init(inst, def);
25939 -});
25940 -const $ZodISODuration = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodISODuration", (inst, def) => {
25941 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.duration);
25942 - $ZodStringFormat.init(inst, def);
25943 -});
25944 -const $ZodIPv4 = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodIPv4", (inst, def) => {
25945 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.ipv4);
25946 - $ZodStringFormat.init(inst, def);
25947 - inst._zod.onattach.push((inst) => {
25948 - const bag = inst._zod.bag;
25949 - bag.format = `ipv4`;
25950 - });
25951 -});
25952 -const $ZodIPv6 = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodIPv6", (inst, def) => {
25953 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.ipv6);
25954 - $ZodStringFormat.init(inst, def);
25955 - inst._zod.onattach.push((inst) => {
25956 - const bag = inst._zod.bag;
25957 - bag.format = `ipv6`;
25958 - });
25959 - inst._zod.check = (payload) => {
25960 - try {
25961 - new URL(`http://[${payload.value}]`);
25962 - // return;
25963 - }
25964 - catch {
25965 - payload.issues.push({
25966 - code: "invalid_format",
25967 - format: "ipv6",
25968 - input: payload.value,
25969 - inst,
25970 - continue: !def.abort,
25971 - });
25972 - }
25973 - };
25974 -});
25975 -const $ZodCIDRv4 = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodCIDRv4", (inst, def) => {
25976 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.cidrv4);
25977 - $ZodStringFormat.init(inst, def);
25978 -});
25979 -const $ZodCIDRv6 = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodCIDRv6", (inst, def) => {
25980 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.cidrv6); // not used for validation
25981 - $ZodStringFormat.init(inst, def);
25982 - inst._zod.check = (payload) => {
25983 - const [address, prefix] = payload.value.split("/");
25984 - try {
25985 - if (!prefix)
25986 - throw new Error();
25987 - const prefixNum = Number(prefix);
25988 - if (`${prefixNum}` !== prefix)
25989 - throw new Error();
25990 - if (prefixNum < 0 || prefixNum > 128)
25991 - throw new Error();
25992 - new URL(`http://[${address}]`);
25993 - }
25994 - catch {
25995 - payload.issues.push({
25996 - code: "invalid_format",
25997 - format: "cidrv6",
25998 - input: payload.value,
25999 - inst,
26000 - continue: !def.abort,
26001 - });
26002 - }
26003 - };
26004 -});
26005 -////////////////////////////// ZodBase64 //////////////////////////////
26006 -function isValidBase64(data) {
26007 - if (data === "")
26008 - return true;
26009 - if (data.length % 4 !== 0)
26010 - return false;
26011 - try {
26012 - atob(data);
26013 - return true;
26014 - }
26015 - catch {
26016 - return false;
26017 - }
26018 -}
26019 -const $ZodBase64 = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodBase64", (inst, def) => {
26020 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.base64);
26021 - $ZodStringFormat.init(inst, def);
26022 - inst._zod.onattach.push((inst) => {
26023 - inst._zod.bag.contentEncoding = "base64";
26024 - });
26025 - inst._zod.check = (payload) => {
26026 - if (isValidBase64(payload.value))
26027 - return;
26028 - payload.issues.push({
26029 - code: "invalid_format",
26030 - format: "base64",
26031 - input: payload.value,
26032 - inst,
26033 - continue: !def.abort,
26034 - });
26035 - };
26036 -});
26037 -////////////////////////////// ZodBase64 //////////////////////////////
26038 -function isValidBase64URL(data) {
26039 - if (!_regexes_js__WEBPACK_IMPORTED_MODULE_4__.base64url.test(data))
26040 - return false;
26041 - const base64 = data.replace(/[-_]/g, (c) => (c === "-" ? "+" : "/"));
26042 - const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, "=");
26043 - return isValidBase64(padded);
26044 -}
26045 -const $ZodBase64URL = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodBase64URL", (inst, def) => {
26046 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.base64url);
26047 - $ZodStringFormat.init(inst, def);
26048 - inst._zod.onattach.push((inst) => {
26049 - inst._zod.bag.contentEncoding = "base64url";
26050 - });
26051 - inst._zod.check = (payload) => {
26052 - if (isValidBase64URL(payload.value))
26053 - return;
26054 - payload.issues.push({
26055 - code: "invalid_format",
26056 - format: "base64url",
26057 - input: payload.value,
26058 - inst,
26059 - continue: !def.abort,
26060 - });
26061 - };
26062 -});
26063 -const $ZodE164 = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodE164", (inst, def) => {
26064 - def.pattern ?? (def.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.e164);
26065 - $ZodStringFormat.init(inst, def);
26066 -});
26067 -////////////////////////////// ZodJWT //////////////////////////////
26068 -function isValidJWT(token, algorithm = null) {
26069 - try {
26070 - const tokensParts = token.split(".");
26071 - if (tokensParts.length !== 3)
26072 - return false;
26073 - const [header] = tokensParts;
26074 - if (!header)
26075 - return false;
26076 - const parsedHeader = JSON.parse(atob(header));
26077 - if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT")
26078 - return false;
26079 - if (!parsedHeader.alg)
26080 - return false;
26081 - if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm))
26082 - return false;
26083 - return true;
26084 - }
26085 - catch {
26086 - return false;
26087 - }
26088 -}
26089 -const $ZodJWT = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodJWT", (inst, def) => {
26090 - $ZodStringFormat.init(inst, def);
26091 - inst._zod.check = (payload) => {
26092 - if (isValidJWT(payload.value, def.alg))
26093 - return;
26094 - payload.issues.push({
26095 - code: "invalid_format",
26096 - format: "jwt",
26097 - input: payload.value,
26098 - inst,
26099 - continue: !def.abort,
26100 - });
26101 - };
26102 -});
26103 -const $ZodCustomStringFormat = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodCustomStringFormat", (inst, def) => {
26104 - $ZodStringFormat.init(inst, def);
26105 - inst._zod.check = (payload) => {
26106 - if (def.fn(payload.value))
26107 - return;
26108 - payload.issues.push({
26109 - code: "invalid_format",
26110 - format: def.format,
26111 - input: payload.value,
26112 - inst,
26113 - continue: !def.abort,
26114 - });
26115 - };
26116 -});
26117 -const $ZodNumber = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodNumber", (inst, def) => {
26118 - $ZodType.init(inst, def);
26119 - inst._zod.pattern = inst._zod.bag.pattern ?? _regexes_js__WEBPACK_IMPORTED_MODULE_4__.number;
26120 - inst._zod.parse = (payload, _ctx) => {
26121 - if (def.coerce)
26122 - try {
26123 - payload.value = Number(payload.value);
26124 - }
26125 - catch (_) { }
26126 - const input = payload.value;
26127 - if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
26128 - return payload;
26129 - }
26130 - const received = typeof input === "number"
26131 - ? Number.isNaN(input)
26132 - ? "NaN"
26133 - : !Number.isFinite(input)
26134 - ? "Infinity"
26135 - : undefined
26136 - : undefined;
26137 - payload.issues.push({
26138 - expected: "number",
26139 - code: "invalid_type",
26140 - input,
26141 - inst,
26142 - ...(received ? { received } : {}),
26143 - });
26144 - return payload;
26145 - };
26146 -});
26147 -const $ZodNumberFormat = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodNumber", (inst, def) => {
26148 - _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckNumberFormat.init(inst, def);
26149 - $ZodNumber.init(inst, def); // no format checksp
26150 -});
26151 -const $ZodBoolean = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodBoolean", (inst, def) => {
26152 - $ZodType.init(inst, def);
26153 - inst._zod.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.boolean;
26154 - inst._zod.parse = (payload, _ctx) => {
26155 - if (def.coerce)
26156 - try {
26157 - payload.value = Boolean(payload.value);
26158 - }
26159 - catch (_) { }
26160 - const input = payload.value;
26161 - if (typeof input === "boolean")
26162 - return payload;
26163 - payload.issues.push({
26164 - expected: "boolean",
26165 - code: "invalid_type",
26166 - input,
26167 - inst,
26168 - });
26169 - return payload;
26170 - };
26171 -});
26172 -const $ZodBigInt = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodBigInt", (inst, def) => {
26173 - $ZodType.init(inst, def);
26174 - inst._zod.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.bigint;
26175 - inst._zod.parse = (payload, _ctx) => {
26176 - if (def.coerce)
26177 - try {
26178 - payload.value = BigInt(payload.value);
26179 - }
26180 - catch (_) { }
26181 - if (typeof payload.value === "bigint")
26182 - return payload;
26183 - payload.issues.push({
26184 - expected: "bigint",
26185 - code: "invalid_type",
26186 - input: payload.value,
26187 - inst,
26188 - });
26189 - return payload;
26190 - };
26191 -});
26192 -const $ZodBigIntFormat = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodBigInt", (inst, def) => {
26193 - _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheckBigIntFormat.init(inst, def);
26194 - $ZodBigInt.init(inst, def); // no format checks
26195 -});
26196 -const $ZodSymbol = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodSymbol", (inst, def) => {
26197 - $ZodType.init(inst, def);
26198 - inst._zod.parse = (payload, _ctx) => {
26199 - const input = payload.value;
26200 - if (typeof input === "symbol")
26201 - return payload;
26202 - payload.issues.push({
26203 - expected: "symbol",
26204 - code: "invalid_type",
26205 - input,
26206 - inst,
26207 - });
26208 - return payload;
26209 - };
26210 -});
26211 -const $ZodUndefined = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodUndefined", (inst, def) => {
26212 - $ZodType.init(inst, def);
26213 - inst._zod.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__.undefined;
26214 - inst._zod.values = new Set([undefined]);
26215 - inst._zod.optin = "optional";
26216 - inst._zod.optout = "optional";
26217 - inst._zod.parse = (payload, _ctx) => {
26218 - const input = payload.value;
26219 - if (typeof input === "undefined")
26220 - return payload;
26221 - payload.issues.push({
26222 - expected: "undefined",
26223 - code: "invalid_type",
26224 - input,
26225 - inst,
26226 - });
26227 - return payload;
26228 - };
26229 -});
26230 -const $ZodNull = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodNull", (inst, def) => {
26231 - $ZodType.init(inst, def);
26232 - inst._zod.pattern = _regexes_js__WEBPACK_IMPORTED_MODULE_4__["null"];
26233 - inst._zod.values = new Set([null]);
26234 - inst._zod.parse = (payload, _ctx) => {
26235 - const input = payload.value;
26236 - if (input === null)
26237 - return payload;
26238 - payload.issues.push({
26239 - expected: "null",
26240 - code: "invalid_type",
26241 - input,
26242 - inst,
26243 - });
26244 - return payload;
26245 - };
26246 -});
26247 -const $ZodAny = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodAny", (inst, def) => {
26248 - $ZodType.init(inst, def);
26249 - inst._zod.parse = (payload) => payload;
26250 -});
26251 -const $ZodUnknown = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodUnknown", (inst, def) => {
26252 - $ZodType.init(inst, def);
26253 - inst._zod.parse = (payload) => payload;
26254 -});
26255 -const $ZodNever = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodNever", (inst, def) => {
26256 - $ZodType.init(inst, def);
26257 - inst._zod.parse = (payload, _ctx) => {
26258 - payload.issues.push({
26259 - expected: "never",
26260 - code: "invalid_type",
26261 - input: payload.value,
26262 - inst,
26263 - });
26264 - return payload;
26265 - };
26266 -});
26267 -const $ZodVoid = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodVoid", (inst, def) => {
26268 - $ZodType.init(inst, def);
26269 - inst._zod.parse = (payload, _ctx) => {
26270 - const input = payload.value;
26271 - if (typeof input === "undefined")
26272 - return payload;
26273 - payload.issues.push({
26274 - expected: "void",
26275 - code: "invalid_type",
26276 - input,
26277 - inst,
26278 - });
26279 - return payload;
26280 - };
26281 -});
26282 -const $ZodDate = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodDate", (inst, def) => {
26283 - $ZodType.init(inst, def);
26284 - inst._zod.parse = (payload, _ctx) => {
26285 - if (def.coerce) {
26286 - try {
26287 - payload.value = new Date(payload.value);
26288 - }
26289 - catch (_err) { }
26290 - }
26291 - const input = payload.value;
26292 - const isDate = input instanceof Date;
26293 - const isValidDate = isDate && !Number.isNaN(input.getTime());
26294 - if (isValidDate)
26295 - return payload;
26296 - payload.issues.push({
26297 - expected: "date",
26298 - code: "invalid_type",
26299 - input,
26300 - ...(isDate ? { received: "Invalid Date" } : {}),
26301 - inst,
26302 - });
26303 - return payload;
26304 - };
26305 -});
26306 -function handleArrayResult(result, final, index) {
26307 - if (result.issues.length) {
26308 - final.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(index, result.issues));
26309 - }
26310 - final.value[index] = result.value;
26311 -}
26312 -const $ZodArray = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodArray", (inst, def) => {
26313 - $ZodType.init(inst, def);
26314 - inst._zod.parse = (payload, ctx) => {
26315 - const input = payload.value;
26316 - if (!Array.isArray(input)) {
26317 - payload.issues.push({
26318 - expected: "array",
26319 - code: "invalid_type",
26320 - input,
26321 - inst,
26322 - });
26323 - return payload;
26324 - }
26325 - payload.value = Array(input.length);
26326 - const proms = [];
26327 - for (let i = 0; i < input.length; i++) {
26328 - const item = input[i];
26329 - const result = def.element._zod.run({
26330 - value: item,
26331 - issues: [],
26332 - }, ctx);
26333 - if (result instanceof Promise) {
26334 - proms.push(result.then((result) => handleArrayResult(result, payload, i)));
26335 - }
26336 - else {
26337 - handleArrayResult(result, payload, i);
26338 - }
26339 - }
26340 - if (proms.length) {
26341 - return Promise.all(proms).then(() => payload);
26342 - }
26343 - return payload; //handleArrayResultsAsync(parseResults, final);
26344 - };
26345 -});
26346 -function handleObjectResult(result, final, key) {
26347 - // if(isOptional)
26348 - if (result.issues.length) {
26349 - final.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(key, result.issues));
26350 - }
26351 - final.value[key] = result.value;
26352 -}
26353 -function handleOptionalObjectResult(result, final, key, input) {
26354 - if (result.issues.length) {
26355 - // validation failed against value schema
26356 - if (input[key] === undefined) {
26357 - // if input was undefined, ignore the error
26358 - if (key in input) {
26359 - final.value[key] = undefined;
26360 - }
26361 - else {
26362 - final.value[key] = result.value;
26363 - }
26364 - }
26365 - else {
26366 - final.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(key, result.issues));
26367 - }
26368 - }
26369 - else if (result.value === undefined) {
26370 - // validation returned `undefined`
26371 - if (key in input)
26372 - final.value[key] = undefined;
26373 - }
26374 - else {
26375 - // non-undefined value
26376 - final.value[key] = result.value;
26377 - }
26378 -}
26379 -const $ZodObject = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodObject", (inst, def) => {
26380 - // requires cast because technically $ZodObject doesn't extend
26381 - $ZodType.init(inst, def);
26382 - const _normalized = _util_js__WEBPACK_IMPORTED_MODULE_5__.cached(() => {
26383 - const keys = Object.keys(def.shape);
26384 - for (const k of keys) {
26385 - if (!(def.shape[k] instanceof $ZodType)) {
26386 - throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
26387 - }
26388 - }
26389 - const okeys = _util_js__WEBPACK_IMPORTED_MODULE_5__.optionalKeys(def.shape);
26390 - return {
26391 - shape: def.shape,
26392 - keys,
26393 - keySet: new Set(keys),
26394 - numKeys: keys.length,
26395 - optionalKeys: new Set(okeys),
26396 - };
26397 - });
26398 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "propValues", () => {
26399 - const shape = def.shape;
26400 - const propValues = {};
26401 - for (const key in shape) {
26402 - const field = shape[key]._zod;
26403 - if (field.values) {
26404 - propValues[key] ?? (propValues[key] = new Set());
26405 - for (const v of field.values)
26406 - propValues[key].add(v);
26407 - }
26408 - }
26409 - return propValues;
26410 - });
26411 - const generateFastpass = (shape) => {
26412 - const doc = new _doc_js__WEBPACK_IMPORTED_MODULE_2__.Doc(["shape", "payload", "ctx"]);
26413 - const normalized = _normalized.value;
26414 - const parseStr = (key) => {
26415 - const k = _util_js__WEBPACK_IMPORTED_MODULE_5__.esc(key);
26416 - return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
26417 - };
26418 - doc.write(`const input = payload.value;`);
26419 - const ids = Object.create(null);
26420 - let counter = 0;
26421 - for (const key of normalized.keys) {
26422 - ids[key] = `key_${counter++}`;
26423 - }
26424 - // A: preserve key order {
26425 - doc.write(`const newResult = {}`);
26426 - for (const key of normalized.keys) {
26427 - if (normalized.optionalKeys.has(key)) {
26428 - const id = ids[key];
26429 - doc.write(`const ${id} = ${parseStr(key)};`);
26430 - const k = _util_js__WEBPACK_IMPORTED_MODULE_5__.esc(key);
26431 - doc.write(`
26432 - if (${id}.issues.length) {
26433 - if (input[${k}] === undefined) {
26434 - if (${k} in input) {
26435 - newResult[${k}] = undefined;
26436 - }
26437 - } else {
26438 - payload.issues = payload.issues.concat(
26439 - ${id}.issues.map((iss) => ({
26440 - ...iss,
26441 - path: iss.path ? [${k}, ...iss.path] : [${k}],
26442 - }))
26443 - );
26444 - }
26445 - } else if (${id}.value === undefined) {
26446 - if (${k} in input) newResult[${k}] = undefined;
26447 - } else {
26448 - newResult[${k}] = ${id}.value;
26449 - }
26450 - `);
26451 - }
26452 - else {
26453 - const id = ids[key];
26454 - // const id = ids[key];
26455 - doc.write(`const ${id} = ${parseStr(key)};`);
26456 - doc.write(`
26457 - if (${id}.issues.length) payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
26458 - ...iss,
26459 - path: iss.path ? [${_util_js__WEBPACK_IMPORTED_MODULE_5__.esc(key)}, ...iss.path] : [${_util_js__WEBPACK_IMPORTED_MODULE_5__.esc(key)}]
26460 - })));`);
26461 - doc.write(`newResult[${_util_js__WEBPACK_IMPORTED_MODULE_5__.esc(key)}] = ${id}.value`);
26462 - }
26463 - }
26464 - doc.write(`payload.value = newResult;`);
26465 - doc.write(`return payload;`);
26466 - const fn = doc.compile();
26467 - return (payload, ctx) => fn(shape, payload, ctx);
26468 - };
26469 - let fastpass;
26470 - const isObject = _util_js__WEBPACK_IMPORTED_MODULE_5__.isObject;
26471 - const jit = !_core_js__WEBPACK_IMPORTED_MODULE_1__.globalConfig.jitless;
26472 - const allowsEval = _util_js__WEBPACK_IMPORTED_MODULE_5__.allowsEval;
26473 - const fastEnabled = jit && allowsEval.value; // && !def.catchall;
26474 - const catchall = def.catchall;
26475 - let value;
26476 - inst._zod.parse = (payload, ctx) => {
26477 - value ?? (value = _normalized.value);
26478 - const input = payload.value;
26479 - if (!isObject(input)) {
26480 - payload.issues.push({
26481 - expected: "object",
26482 - code: "invalid_type",
26483 - input,
26484 - inst,
26485 - });
26486 - return payload;
26487 - }
26488 - const proms = [];
26489 - if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
26490 - // always synchronous
26491 - if (!fastpass)
26492 - fastpass = generateFastpass(def.shape);
26493 - payload = fastpass(payload, ctx);
26494 - }
26495 - else {
26496 - payload.value = {};
26497 - const shape = value.shape;
26498 - for (const key of value.keys) {
26499 - const el = shape[key];
26500 - // do not add omitted optional keys
26501 - // if (!(key in input)) {
26502 - // if (optionalKeys.has(key)) continue;
26503 - // payload.issues.push({
26504 - // code: "invalid_type",
26505 - // path: [key],
26506 - // expected: "nonoptional",
26507 - // note: `Missing required key: "${key}"`,
26508 - // input,
26509 - // inst,
26510 - // });
26511 - // }
26512 - const r = el._zod.run({ value: input[key], issues: [] }, ctx);
26513 - const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
26514 - if (r instanceof Promise) {
26515 - proms.push(r.then((r) => isOptional ? handleOptionalObjectResult(r, payload, key, input) : handleObjectResult(r, payload, key)));
26516 - }
26517 - else if (isOptional) {
26518 - handleOptionalObjectResult(r, payload, key, input);
26519 - }
26520 - else {
26521 - handleObjectResult(r, payload, key);
26522 - }
26523 - }
26524 - }
26525 - if (!catchall) {
26526 - // return payload;
26527 - return proms.length ? Promise.all(proms).then(() => payload) : payload;
26528 - }
26529 - const unrecognized = [];
26530 - // iterate over input keys
26531 - const keySet = value.keySet;
26532 - const _catchall = catchall._zod;
26533 - const t = _catchall.def.type;
26534 - for (const key of Object.keys(input)) {
26535 - if (keySet.has(key))
26536 - continue;
26537 - if (t === "never") {
26538 - unrecognized.push(key);
26539 - continue;
26540 - }
26541 - const r = _catchall.run({ value: input[key], issues: [] }, ctx);
26542 - if (r instanceof Promise) {
26543 - proms.push(r.then((r) => handleObjectResult(r, payload, key)));
26544 - }
26545 - else {
26546 - handleObjectResult(r, payload, key);
26547 - }
26548 - }
26549 - if (unrecognized.length) {
26550 - payload.issues.push({
26551 - code: "unrecognized_keys",
26552 - keys: unrecognized,
26553 - input,
26554 - inst,
26555 - });
26556 - }
26557 - if (!proms.length)
26558 - return payload;
26559 - return Promise.all(proms).then(() => {
26560 - return payload;
26561 - });
26562 - };
26563 -});
26564 -function handleUnionResults(results, final, inst, ctx) {
26565 - for (const result of results) {
26566 - if (result.issues.length === 0) {
26567 - final.value = result.value;
26568 - return final;
26569 - }
26570 - }
26571 - final.issues.push({
26572 - code: "invalid_union",
26573 - input: final.value,
26574 - inst,
26575 - errors: results.map((result) => result.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_5__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_1__.config()))),
26576 - });
26577 - return final;
26578 -}
26579 -const $ZodUnion = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodUnion", (inst, def) => {
26580 - $ZodType.init(inst, def);
26581 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
26582 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
26583 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "values", () => {
26584 - if (def.options.every((o) => o._zod.values)) {
26585 - return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
26586 - }
26587 - return undefined;
26588 - });
26589 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "pattern", () => {
26590 - if (def.options.every((o) => o._zod.pattern)) {
26591 - const patterns = def.options.map((o) => o._zod.pattern);
26592 - return new RegExp(`^(${patterns.map((p) => _util_js__WEBPACK_IMPORTED_MODULE_5__.cleanRegex(p.source)).join("|")})$`);
26593 - }
26594 - return undefined;
26595 - });
26596 - inst._zod.parse = (payload, ctx) => {
26597 - let async = false;
26598 - const results = [];
26599 - for (const option of def.options) {
26600 - const result = option._zod.run({
26601 - value: payload.value,
26602 - issues: [],
26603 - }, ctx);
26604 - if (result instanceof Promise) {
26605 - results.push(result);
26606 - async = true;
26607 - }
26608 - else {
26609 - if (result.issues.length === 0)
26610 - return result;
26611 - results.push(result);
26612 - }
26613 - }
26614 - if (!async)
26615 - return handleUnionResults(results, payload, inst, ctx);
26616 - return Promise.all(results).then((results) => {
26617 - return handleUnionResults(results, payload, inst, ctx);
26618 - });
26619 - };
26620 -});
26621 -const $ZodDiscriminatedUnion =
26622 -/*@__PURE__*/
26623 -_core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodDiscriminatedUnion", (inst, def) => {
26624 - $ZodUnion.init(inst, def);
26625 - const _super = inst._zod.parse;
26626 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "propValues", () => {
26627 - const propValues = {};
26628 - for (const option of def.options) {
26629 - const pv = option._zod.propValues;
26630 - if (!pv || Object.keys(pv).length === 0)
26631 - throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
26632 - for (const [k, v] of Object.entries(pv)) {
26633 - if (!propValues[k])
26634 - propValues[k] = new Set();
26635 - for (const val of v) {
26636 - propValues[k].add(val);
26637 - }
26638 - }
26639 - }
26640 - return propValues;
26641 - });
26642 - const disc = _util_js__WEBPACK_IMPORTED_MODULE_5__.cached(() => {
26643 - const opts = def.options;
26644 - const map = new Map();
26645 - for (const o of opts) {
26646 - const values = o._zod.propValues[def.discriminator];
26647 - if (!values || values.size === 0)
26648 - throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
26649 - for (const v of values) {
26650 - if (map.has(v)) {
26651 - throw new Error(`Duplicate discriminator value "${String(v)}"`);
26652 - }
26653 - map.set(v, o);
26654 - }
26655 - }
26656 - return map;
26657 - });
26658 - inst._zod.parse = (payload, ctx) => {
26659 - const input = payload.value;
26660 - if (!_util_js__WEBPACK_IMPORTED_MODULE_5__.isObject(input)) {
26661 - payload.issues.push({
26662 - code: "invalid_type",
26663 - expected: "object",
26664 - input,
26665 - inst,
26666 - });
26667 - return payload;
26668 - }
26669 - const opt = disc.value.get(input?.[def.discriminator]);
26670 - if (opt) {
26671 - return opt._zod.run(payload, ctx);
26672 - }
26673 - if (def.unionFallback) {
26674 - return _super(payload, ctx);
26675 - }
26676 - // no matching discriminator
26677 - payload.issues.push({
26678 - code: "invalid_union",
26679 - errors: [],
26680 - note: "No matching discriminator",
26681 - input,
26682 - path: [def.discriminator],
26683 - inst,
26684 - });
26685 - return payload;
26686 - };
26687 -});
26688 -const $ZodIntersection = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodIntersection", (inst, def) => {
26689 - $ZodType.init(inst, def);
26690 - inst._zod.parse = (payload, ctx) => {
26691 - const input = payload.value;
26692 - const left = def.left._zod.run({ value: input, issues: [] }, ctx);
26693 - const right = def.right._zod.run({ value: input, issues: [] }, ctx);
26694 - const async = left instanceof Promise || right instanceof Promise;
26695 - if (async) {
26696 - return Promise.all([left, right]).then(([left, right]) => {
26697 - return handleIntersectionResults(payload, left, right);
26698 - });
26699 - }
26700 - return handleIntersectionResults(payload, left, right);
26701 - };
26702 -});
26703 -function mergeValues(a, b) {
26704 - // const aType = parse.t(a);
26705 - // const bType = parse.t(b);
26706 - if (a === b) {
26707 - return { valid: true, data: a };
26708 - }
26709 - if (a instanceof Date && b instanceof Date && +a === +b) {
26710 - return { valid: true, data: a };
26711 - }
26712 - if (_util_js__WEBPACK_IMPORTED_MODULE_5__.isPlainObject(a) && _util_js__WEBPACK_IMPORTED_MODULE_5__.isPlainObject(b)) {
26713 - const bKeys = Object.keys(b);
26714 - const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
26715 - const newObj = { ...a, ...b };
26716 - for (const key of sharedKeys) {
26717 - const sharedValue = mergeValues(a[key], b[key]);
26718 - if (!sharedValue.valid) {
26719 - return {
26720 - valid: false,
26721 - mergeErrorPath: [key, ...sharedValue.mergeErrorPath],
26722 - };
26723 - }
26724 - newObj[key] = sharedValue.data;
26725 - }
26726 - return { valid: true, data: newObj };
26727 - }
26728 - if (Array.isArray(a) && Array.isArray(b)) {
26729 - if (a.length !== b.length) {
26730 - return { valid: false, mergeErrorPath: [] };
26731 - }
26732 - const newArray = [];
26733 - for (let index = 0; index < a.length; index++) {
26734 - const itemA = a[index];
26735 - const itemB = b[index];
26736 - const sharedValue = mergeValues(itemA, itemB);
26737 - if (!sharedValue.valid) {
26738 - return {
26739 - valid: false,
26740 - mergeErrorPath: [index, ...sharedValue.mergeErrorPath],
26741 - };
26742 - }
26743 - newArray.push(sharedValue.data);
26744 - }
26745 - return { valid: true, data: newArray };
26746 - }
26747 - return { valid: false, mergeErrorPath: [] };
26748 -}
26749 -function handleIntersectionResults(result, left, right) {
26750 - if (left.issues.length) {
26751 - result.issues.push(...left.issues);
26752 - }
26753 - if (right.issues.length) {
26754 - result.issues.push(...right.issues);
26755 - }
26756 - if (_util_js__WEBPACK_IMPORTED_MODULE_5__.aborted(result))
26757 - return result;
26758 - const merged = mergeValues(left.value, right.value);
26759 - if (!merged.valid) {
26760 - throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);
26761 - }
26762 - result.value = merged.data;
26763 - return result;
26764 -}
26765 -const $ZodTuple = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodTuple", (inst, def) => {
26766 - $ZodType.init(inst, def);
26767 - const items = def.items;
26768 - const optStart = items.length - [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
26769 - inst._zod.parse = (payload, ctx) => {
26770 - const input = payload.value;
26771 - if (!Array.isArray(input)) {
26772 - payload.issues.push({
26773 - input,
26774 - inst,
26775 - expected: "tuple",
26776 - code: "invalid_type",
26777 - });
26778 - return payload;
26779 - }
26780 - payload.value = [];
26781 - const proms = [];
26782 - if (!def.rest) {
26783 - const tooBig = input.length > items.length;
26784 - const tooSmall = input.length < optStart - 1;
26785 - if (tooBig || tooSmall) {
26786 - payload.issues.push({
26787 - input,
26788 - inst,
26789 - origin: "array",
26790 - ...(tooBig ? { code: "too_big", maximum: items.length } : { code: "too_small", minimum: items.length }),
26791 - });
26792 - return payload;
26793 - }
26794 - }
26795 - let i = -1;
26796 - for (const item of items) {
26797 - i++;
26798 - if (i >= input.length)
26799 - if (i >= optStart)
26800 - continue;
26801 - const result = item._zod.run({
26802 - value: input[i],
26803 - issues: [],
26804 - }, ctx);
26805 - if (result instanceof Promise) {
26806 - proms.push(result.then((result) => handleTupleResult(result, payload, i)));
26807 - }
26808 - else {
26809 - handleTupleResult(result, payload, i);
26810 - }
26811 - }
26812 - if (def.rest) {
26813 - const rest = input.slice(items.length);
26814 - for (const el of rest) {
26815 - i++;
26816 - const result = def.rest._zod.run({
26817 - value: el,
26818 - issues: [],
26819 - }, ctx);
26820 - if (result instanceof Promise) {
26821 - proms.push(result.then((result) => handleTupleResult(result, payload, i)));
26822 - }
26823 - else {
26824 - handleTupleResult(result, payload, i);
26825 - }
26826 - }
26827 - }
26828 - if (proms.length)
26829 - return Promise.all(proms).then(() => payload);
26830 - return payload;
26831 - };
26832 -});
26833 -function handleTupleResult(result, final, index) {
26834 - if (result.issues.length) {
26835 - final.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(index, result.issues));
26836 - }
26837 - final.value[index] = result.value;
26838 -}
26839 -const $ZodRecord = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodRecord", (inst, def) => {
26840 - $ZodType.init(inst, def);
26841 - inst._zod.parse = (payload, ctx) => {
26842 - const input = payload.value;
26843 - if (!_util_js__WEBPACK_IMPORTED_MODULE_5__.isPlainObject(input)) {
26844 - payload.issues.push({
26845 - expected: "record",
26846 - code: "invalid_type",
26847 - input,
26848 - inst,
26849 - });
26850 - return payload;
26851 - }
26852 - const proms = [];
26853 - if (def.keyType._zod.values) {
26854 - const values = def.keyType._zod.values;
26855 - payload.value = {};
26856 - for (const key of values) {
26857 - if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
26858 - const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
26859 - if (result instanceof Promise) {
26860 - proms.push(result.then((result) => {
26861 - if (result.issues.length) {
26862 - payload.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(key, result.issues));
26863 - }
26864 - payload.value[key] = result.value;
26865 - }));
26866 - }
26867 - else {
26868 - if (result.issues.length) {
26869 - payload.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(key, result.issues));
26870 - }
26871 - payload.value[key] = result.value;
26872 - }
26873 - }
26874 - }
26875 - let unrecognized;
26876 - for (const key in input) {
26877 - if (!values.has(key)) {
26878 - unrecognized = unrecognized ?? [];
26879 - unrecognized.push(key);
26880 - }
26881 - }
26882 - if (unrecognized && unrecognized.length > 0) {
26883 - payload.issues.push({
26884 - code: "unrecognized_keys",
26885 - input,
26886 - inst,
26887 - keys: unrecognized,
26888 - });
26889 - }
26890 - }
26891 - else {
26892 - payload.value = {};
26893 - for (const key of Reflect.ownKeys(input)) {
26894 - if (key === "__proto__")
26895 - continue;
26896 - const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
26897 - if (keyResult instanceof Promise) {
26898 - throw new Error("Async schemas not supported in object keys currently");
26899 - }
26900 - if (keyResult.issues.length) {
26901 - payload.issues.push({
26902 - origin: "record",
26903 - code: "invalid_key",
26904 - issues: keyResult.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_5__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_1__.config())),
26905 - input: key,
26906 - path: [key],
26907 - inst,
26908 - });
26909 - payload.value[keyResult.value] = keyResult.value;
26910 - continue;
26911 - }
26912 - const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
26913 - if (result instanceof Promise) {
26914 - proms.push(result.then((result) => {
26915 - if (result.issues.length) {
26916 - payload.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(key, result.issues));
26917 - }
26918 - payload.value[keyResult.value] = result.value;
26919 - }));
26920 - }
26921 - else {
26922 - if (result.issues.length) {
26923 - payload.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(key, result.issues));
26924 - }
26925 - payload.value[keyResult.value] = result.value;
26926 - }
26927 - }
26928 - }
26929 - if (proms.length) {
26930 - return Promise.all(proms).then(() => payload);
26931 - }
26932 - return payload;
26933 - };
26934 -});
26935 -const $ZodMap = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodMap", (inst, def) => {
26936 - $ZodType.init(inst, def);
26937 - inst._zod.parse = (payload, ctx) => {
26938 - const input = payload.value;
26939 - if (!(input instanceof Map)) {
26940 - payload.issues.push({
26941 - expected: "map",
26942 - code: "invalid_type",
26943 - input,
26944 - inst,
26945 - });
26946 - return payload;
26947 - }
26948 - const proms = [];
26949 - payload.value = new Map();
26950 - for (const [key, value] of input) {
26951 - const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
26952 - const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);
26953 - if (keyResult instanceof Promise || valueResult instanceof Promise) {
26954 - proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {
26955 - handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
26956 - }));
26957 - }
26958 - else {
26959 - handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
26960 - }
26961 - }
26962 - if (proms.length)
26963 - return Promise.all(proms).then(() => payload);
26964 - return payload;
26965 - };
26966 -});
26967 -function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
26968 - if (keyResult.issues.length) {
26969 - if (_util_js__WEBPACK_IMPORTED_MODULE_5__.propertyKeyTypes.has(typeof key)) {
26970 - final.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(key, keyResult.issues));
26971 - }
26972 - else {
26973 - final.issues.push({
26974 - origin: "map",
26975 - code: "invalid_key",
26976 - input,
26977 - inst,
26978 - issues: keyResult.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_5__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_1__.config())),
26979 - });
26980 - }
26981 - }
26982 - if (valueResult.issues.length) {
26983 - if (_util_js__WEBPACK_IMPORTED_MODULE_5__.propertyKeyTypes.has(typeof key)) {
26984 - final.issues.push(..._util_js__WEBPACK_IMPORTED_MODULE_5__.prefixIssues(key, valueResult.issues));
26985 - }
26986 - else {
26987 - final.issues.push({
26988 - origin: "map",
26989 - code: "invalid_element",
26990 - input,
26991 - inst,
26992 - key: key,
26993 - issues: valueResult.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_5__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_1__.config())),
26994 - });
26995 - }
26996 - }
26997 - final.value.set(keyResult.value, valueResult.value);
26998 -}
26999 -const $ZodSet = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodSet", (inst, def) => {
27000 - $ZodType.init(inst, def);
27001 - inst._zod.parse = (payload, ctx) => {
27002 - const input = payload.value;
27003 - if (!(input instanceof Set)) {
27004 - payload.issues.push({
27005 - input,
27006 - inst,
27007 - expected: "set",
27008 - code: "invalid_type",
27009 - });
27010 - return payload;
27011 - }
27012 - const proms = [];
27013 - payload.value = new Set();
27014 - for (const item of input) {
27015 - const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
27016 - if (result instanceof Promise) {
27017 - proms.push(result.then((result) => handleSetResult(result, payload)));
27018 - }
27019 - else
27020 - handleSetResult(result, payload);
27021 - }
27022 - if (proms.length)
27023 - return Promise.all(proms).then(() => payload);
27024 - return payload;
27025 - };
27026 -});
27027 -function handleSetResult(result, final) {
27028 - if (result.issues.length) {
27029 - final.issues.push(...result.issues);
27030 - }
27031 - final.value.add(result.value);
27032 -}
27033 -const $ZodEnum = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodEnum", (inst, def) => {
27034 - $ZodType.init(inst, def);
27035 - const values = _util_js__WEBPACK_IMPORTED_MODULE_5__.getEnumValues(def.entries);
27036 - inst._zod.values = new Set(values);
27037 - inst._zod.pattern = new RegExp(`^(${values
27038 - .filter((k) => _util_js__WEBPACK_IMPORTED_MODULE_5__.propertyKeyTypes.has(typeof k))
27039 - .map((o) => (typeof o === "string" ? _util_js__WEBPACK_IMPORTED_MODULE_5__.escapeRegex(o) : o.toString()))
27040 - .join("|")})$`);
27041 - inst._zod.parse = (payload, _ctx) => {
27042 - const input = payload.value;
27043 - if (inst._zod.values.has(input)) {
27044 - return payload;
27045 - }
27046 - payload.issues.push({
27047 - code: "invalid_value",
27048 - values,
27049 - input,
27050 - inst,
27051 - });
27052 - return payload;
27053 - };
27054 -});
27055 -const $ZodLiteral = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodLiteral", (inst, def) => {
27056 - $ZodType.init(inst, def);
27057 - inst._zod.values = new Set(def.values);
27058 - inst._zod.pattern = new RegExp(`^(${def.values
27059 - .map((o) => (typeof o === "string" ? _util_js__WEBPACK_IMPORTED_MODULE_5__.escapeRegex(o) : o ? o.toString() : String(o)))
27060 - .join("|")})$`);
27061 - inst._zod.parse = (payload, _ctx) => {
27062 - const input = payload.value;
27063 - if (inst._zod.values.has(input)) {
27064 - return payload;
27065 - }
27066 - payload.issues.push({
27067 - code: "invalid_value",
27068 - values: def.values,
27069 - input,
27070 - inst,
27071 - });
27072 - return payload;
27073 - };
27074 -});
27075 -const $ZodFile = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodFile", (inst, def) => {
27076 - $ZodType.init(inst, def);
27077 - inst._zod.parse = (payload, _ctx) => {
27078 - const input = payload.value;
27079 - if (input instanceof File)
27080 - return payload;
27081 - payload.issues.push({
27082 - expected: "file",
27083 - code: "invalid_type",
27084 - input,
27085 - inst,
27086 - });
27087 - return payload;
27088 - };
27089 -});
27090 -const $ZodTransform = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodTransform", (inst, def) => {
27091 - $ZodType.init(inst, def);
27092 - inst._zod.parse = (payload, _ctx) => {
27093 - const _out = def.transform(payload.value, payload);
27094 - if (_ctx.async) {
27095 - const output = _out instanceof Promise ? _out : Promise.resolve(_out);
27096 - return output.then((output) => {
27097 - payload.value = output;
27098 - return payload;
27099 - });
27100 - }
27101 - if (_out instanceof Promise) {
27102 - throw new _core_js__WEBPACK_IMPORTED_MODULE_1__.$ZodAsyncError();
27103 - }
27104 - payload.value = _out;
27105 - return payload;
27106 - };
27107 -});
27108 -const $ZodOptional = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodOptional", (inst, def) => {
27109 - $ZodType.init(inst, def);
27110 - inst._zod.optin = "optional";
27111 - inst._zod.optout = "optional";
27112 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "values", () => {
27113 - return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;
27114 - });
27115 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "pattern", () => {
27116 - const pattern = def.innerType._zod.pattern;
27117 - return pattern ? new RegExp(`^(${_util_js__WEBPACK_IMPORTED_MODULE_5__.cleanRegex(pattern.source)})?$`) : undefined;
27118 - });
27119 - inst._zod.parse = (payload, ctx) => {
27120 - if (def.innerType._zod.optin === "optional") {
27121 - return def.innerType._zod.run(payload, ctx);
27122 - }
27123 - if (payload.value === undefined) {
27124 - return payload;
27125 - }
27126 - return def.innerType._zod.run(payload, ctx);
27127 - };
27128 -});
27129 -const $ZodNullable = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodNullable", (inst, def) => {
27130 - $ZodType.init(inst, def);
27131 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
27132 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
27133 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "pattern", () => {
27134 - const pattern = def.innerType._zod.pattern;
27135 - return pattern ? new RegExp(`^(${_util_js__WEBPACK_IMPORTED_MODULE_5__.cleanRegex(pattern.source)}|null)$`) : undefined;
27136 - });
27137 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "values", () => {
27138 - return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;
27139 - });
27140 - inst._zod.parse = (payload, ctx) => {
27141 - if (payload.value === null)
27142 - return payload;
27143 - return def.innerType._zod.run(payload, ctx);
27144 - };
27145 -});
27146 -const $ZodDefault = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodDefault", (inst, def) => {
27147 - $ZodType.init(inst, def);
27148 - // inst._zod.qin = "true";
27149 - inst._zod.optin = "optional";
27150 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
27151 - inst._zod.parse = (payload, ctx) => {
27152 - if (payload.value === undefined) {
27153 - payload.value = def.defaultValue;
27154 - /**
27155 - * $ZodDefault always returns the default value immediately.
27156 - * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
27157 - return payload;
27158 - }
27159 - const result = def.innerType._zod.run(payload, ctx);
27160 - if (result instanceof Promise) {
27161 - return result.then((result) => handleDefaultResult(result, def));
27162 - }
27163 - return handleDefaultResult(result, def);
27164 - };
27165 -});
27166 -function handleDefaultResult(payload, def) {
27167 - if (payload.value === undefined) {
27168 - payload.value = def.defaultValue;
27169 - }
27170 - return payload;
27171 -}
27172 -const $ZodPrefault = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodPrefault", (inst, def) => {
27173 - $ZodType.init(inst, def);
27174 - inst._zod.optin = "optional";
27175 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
27176 - inst._zod.parse = (payload, ctx) => {
27177 - if (payload.value === undefined) {
27178 - payload.value = def.defaultValue;
27179 - }
27180 - return def.innerType._zod.run(payload, ctx);
27181 - };
27182 -});
27183 -const $ZodNonOptional = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodNonOptional", (inst, def) => {
27184 - $ZodType.init(inst, def);
27185 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "values", () => {
27186 - const v = def.innerType._zod.values;
27187 - return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;
27188 - });
27189 - inst._zod.parse = (payload, ctx) => {
27190 - const result = def.innerType._zod.run(payload, ctx);
27191 - if (result instanceof Promise) {
27192 - return result.then((result) => handleNonOptionalResult(result, inst));
27193 - }
27194 - return handleNonOptionalResult(result, inst);
27195 - };
27196 -});
27197 -function handleNonOptionalResult(payload, inst) {
27198 - if (!payload.issues.length && payload.value === undefined) {
27199 - payload.issues.push({
27200 - code: "invalid_type",
27201 - expected: "nonoptional",
27202 - input: payload.value,
27203 - inst,
27204 - });
27205 - }
27206 - return payload;
27207 -}
27208 -const $ZodSuccess = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodSuccess", (inst, def) => {
27209 - $ZodType.init(inst, def);
27210 - inst._zod.parse = (payload, ctx) => {
27211 - const result = def.innerType._zod.run(payload, ctx);
27212 - if (result instanceof Promise) {
27213 - return result.then((result) => {
27214 - payload.value = result.issues.length === 0;
27215 - return payload;
27216 - });
27217 - }
27218 - payload.value = result.issues.length === 0;
27219 - return payload;
27220 - };
27221 -});
27222 -const $ZodCatch = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodCatch", (inst, def) => {
27223 - $ZodType.init(inst, def);
27224 - inst._zod.optin = "optional";
27225 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
27226 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
27227 - inst._zod.parse = (payload, ctx) => {
27228 - const result = def.innerType._zod.run(payload, ctx);
27229 - if (result instanceof Promise) {
27230 - return result.then((result) => {
27231 - payload.value = result.value;
27232 - if (result.issues.length) {
27233 - payload.value = def.catchValue({
27234 - ...payload,
27235 - error: {
27236 - issues: result.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_5__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_1__.config())),
27237 - },
27238 - input: payload.value,
27239 - });
27240 - payload.issues = [];
27241 - }
27242 - return payload;
27243 - });
27244 - }
27245 - payload.value = result.value;
27246 - if (result.issues.length) {
27247 - payload.value = def.catchValue({
27248 - ...payload,
27249 - error: {
27250 - issues: result.issues.map((iss) => _util_js__WEBPACK_IMPORTED_MODULE_5__.finalizeIssue(iss, ctx, _core_js__WEBPACK_IMPORTED_MODULE_1__.config())),
27251 - },
27252 - input: payload.value,
27253 - });
27254 - payload.issues = [];
27255 - }
27256 - return payload;
27257 - };
27258 -});
27259 -const $ZodNaN = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodNaN", (inst, def) => {
27260 - $ZodType.init(inst, def);
27261 - inst._zod.parse = (payload, _ctx) => {
27262 - if (typeof payload.value !== "number" || !Number.isNaN(payload.value)) {
27263 - payload.issues.push({
27264 - input: payload.value,
27265 - inst,
27266 - expected: "nan",
27267 - code: "invalid_type",
27268 - });
27269 - return payload;
27270 - }
27271 - return payload;
27272 - };
27273 -});
27274 -const $ZodPipe = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodPipe", (inst, def) => {
27275 - $ZodType.init(inst, def);
27276 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "values", () => def.in._zod.values);
27277 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optin", () => def.in._zod.optin);
27278 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optout", () => def.out._zod.optout);
27279 - inst._zod.parse = (payload, ctx) => {
27280 - const left = def.in._zod.run(payload, ctx);
27281 - if (left instanceof Promise) {
27282 - return left.then((left) => handlePipeResult(left, def, ctx));
27283 - }
27284 - return handlePipeResult(left, def, ctx);
27285 - };
27286 -});
27287 -function handlePipeResult(left, def, ctx) {
27288 - if (_util_js__WEBPACK_IMPORTED_MODULE_5__.aborted(left)) {
27289 - return left;
27290 - }
27291 - return def.out._zod.run({ value: left.value, issues: left.issues }, ctx);
27292 -}
27293 -const $ZodReadonly = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodReadonly", (inst, def) => {
27294 - $ZodType.init(inst, def);
27295 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
27296 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "values", () => def.innerType._zod.values);
27297 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
27298 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
27299 - inst._zod.parse = (payload, ctx) => {
27300 - const result = def.innerType._zod.run(payload, ctx);
27301 - if (result instanceof Promise) {
27302 - return result.then(handleReadonlyResult);
27303 - }
27304 - return handleReadonlyResult(result);
27305 - };
27306 -});
27307 -function handleReadonlyResult(payload) {
27308 - payload.value = Object.freeze(payload.value);
27309 - return payload;
27310 -}
27311 -const $ZodTemplateLiteral = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodTemplateLiteral", (inst, def) => {
27312 - $ZodType.init(inst, def);
27313 - const regexParts = [];
27314 - for (const part of def.parts) {
27315 - if (part instanceof $ZodType) {
27316 - if (!part._zod.pattern) {
27317 - // if (!source)
27318 - throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);
27319 - }
27320 - const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;
27321 - if (!source)
27322 - throw new Error(`Invalid template literal part: ${part._zod.traits}`);
27323 - const start = source.startsWith("^") ? 1 : 0;
27324 - const end = source.endsWith("$") ? source.length - 1 : source.length;
27325 - regexParts.push(source.slice(start, end));
27326 - }
27327 - else if (part === null || _util_js__WEBPACK_IMPORTED_MODULE_5__.primitiveTypes.has(typeof part)) {
27328 - regexParts.push(_util_js__WEBPACK_IMPORTED_MODULE_5__.escapeRegex(`${part}`));
27329 - }
27330 - else {
27331 - throw new Error(`Invalid template literal part: ${part}`);
27332 - }
27333 - }
27334 - inst._zod.pattern = new RegExp(`^${regexParts.join("")}$`);
27335 - inst._zod.parse = (payload, _ctx) => {
27336 - if (typeof payload.value !== "string") {
27337 - payload.issues.push({
27338 - input: payload.value,
27339 - inst,
27340 - expected: "template_literal",
27341 - code: "invalid_type",
27342 - });
27343 - return payload;
27344 - }
27345 - inst._zod.pattern.lastIndex = 0;
27346 - if (!inst._zod.pattern.test(payload.value)) {
27347 - payload.issues.push({
27348 - input: payload.value,
27349 - inst,
27350 - code: "invalid_format",
27351 - format: "template_literal",
27352 - pattern: inst._zod.pattern.source,
27353 - });
27354 - return payload;
27355 - }
27356 - return payload;
27357 - };
27358 -});
27359 -const $ZodPromise = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodPromise", (inst, def) => {
27360 - $ZodType.init(inst, def);
27361 - inst._zod.parse = (payload, ctx) => {
27362 - return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));
27363 - };
27364 -});
27365 -const $ZodLazy = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodLazy", (inst, def) => {
27366 - $ZodType.init(inst, def);
27367 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "innerType", () => def.getter());
27368 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "pattern", () => inst._zod.innerType._zod.pattern);
27369 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "propValues", () => inst._zod.innerType._zod.propValues);
27370 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optin", () => inst._zod.innerType._zod.optin);
27371 - _util_js__WEBPACK_IMPORTED_MODULE_5__.defineLazy(inst._zod, "optout", () => inst._zod.innerType._zod.optout);
27372 - inst._zod.parse = (payload, ctx) => {
27373 - const inner = inst._zod.innerType;
27374 - return inner._zod.run(payload, ctx);
27375 - };
27376 -});
27377 -const $ZodCustom = /*@__PURE__*/ _core_js__WEBPACK_IMPORTED_MODULE_1__.$constructor("$ZodCustom", (inst, def) => {
27378 - _checks_js__WEBPACK_IMPORTED_MODULE_0__.$ZodCheck.init(inst, def);
27379 - $ZodType.init(inst, def);
27380 - inst._zod.parse = (payload, _) => {
27381 - return payload;
27382 - };
27383 - inst._zod.check = (payload) => {
27384 - const input = payload.value;
27385 - const r = def.fn(input);
27386 - if (r instanceof Promise) {
27387 - return r.then((r) => handleRefineResult(r, payload, input, inst));
27388 - }
27389 - handleRefineResult(r, payload, input, inst);
27390 - return;
27391 - };
27392 -});
27393 -function handleRefineResult(result, payload, input, inst) {
27394 - if (!result) {
27395 - const _iss = {
27396 - code: "custom",
27397 - input,
27398 - inst, // incorporates params.error into issue reporting
27399 - path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting
27400 - continue: !inst._zod.def.abort,
27401 - // params: inst._zod.def.params,
27402 - };
27403 - if (inst._zod.def.params)
27404 - _iss.params = inst._zod.def.params;
27405 - payload.issues.push(_util_js__WEBPACK_IMPORTED_MODULE_5__.issue(_iss));
27406 - }
27407 -}
27408 -
27409 -
27410 -/***/ }),
27411 -
27412 -/***/ "./node_modules/zod/v4/core/to-json-schema.js":
27413 -/*!****************************************************!*\
27414 - !*** ./node_modules/zod/v4/core/to-json-schema.js ***!
27415 - \****************************************************/
27416 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
27417 -
27418 -__webpack_require__.r(__webpack_exports__);
27419 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
27420 -/* harmony export */ JSONSchemaGenerator: function() { return /* binding */ JSONSchemaGenerator; },
27421 -/* harmony export */ toJSONSchema: function() { return /* binding */ toJSONSchema; }
27422 -/* harmony export */ });
27423 -/* harmony import */ var _registries_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./registries.js */ "./node_modules/zod/v4/core/registries.js");
27424 -/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util.js */ "./node_modules/zod/v4/core/util.js");
27425 -
27426 -
27427 -class JSONSchemaGenerator {
27428 - constructor(params) {
27429 - this.counter = 0;
27430 - this.metadataRegistry = params?.metadata ?? _registries_js__WEBPACK_IMPORTED_MODULE_0__.globalRegistry;
27431 - this.target = params?.target ?? "draft-2020-12";
27432 - this.unrepresentable = params?.unrepresentable ?? "throw";
27433 - this.override = params?.override ?? (() => { });
27434 - this.io = params?.io ?? "output";
27435 - this.seen = new Map();
27436 - }
27437 - process(schema, _params = { path: [], schemaPath: [] }) {
27438 - var _a;
27439 - const def = schema._zod.def;
27440 - const formatMap = {
27441 - guid: "uuid",
27442 - url: "uri",
27443 - datetime: "date-time",
27444 - json_string: "json-string",
27445 - regex: "", // do not set
27446 - };
27447 - // check for schema in seens
27448 - const seen = this.seen.get(schema);
27449 - if (seen) {
27450 - seen.count++;
27451 - // check if cycle
27452 - const isCycle = _params.schemaPath.includes(schema);
27453 - if (isCycle) {
27454 - seen.cycle = _params.path;
27455 - }
27456 - return seen.schema;
27457 - }
27458 - // initialize
27459 - const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };
27460 - this.seen.set(schema, result);
27461 - // custom method overrides default behavior
27462 - const overrideSchema = schema._zod.toJSONSchema?.();
27463 - if (overrideSchema) {
27464 - result.schema = overrideSchema;
27465 - }
27466 - else {
27467 - const params = {
27468 - ..._params,
27469 - schemaPath: [..._params.schemaPath, schema],
27470 - path: _params.path,
27471 - };
27472 - const parent = schema._zod.parent;
27473 - if (parent) {
27474 - // schema was cloned from another schema
27475 - result.ref = parent;
27476 - this.process(parent, params);
27477 - this.seen.get(parent).isParent = true;
27478 - }
27479 - else {
27480 - const _json = result.schema;
27481 - switch (def.type) {
27482 - case "string": {
27483 - const json = _json;
27484 - json.type = "string";
27485 - const { minimum, maximum, format, patterns, contentEncoding } = schema._zod
27486 - .bag;
27487 - if (typeof minimum === "number")
27488 - json.minLength = minimum;
27489 - if (typeof maximum === "number")
27490 - json.maxLength = maximum;
27491 - // custom pattern overrides format
27492 - if (format) {
27493 - json.format = formatMap[format] ?? format;
27494 - if (json.format === "")
27495 - delete json.format; // empty format is not valid
27496 - }
27497 - if (contentEncoding)
27498 - json.contentEncoding = contentEncoding;
27499 - if (patterns && patterns.size > 0) {
27500 - const regexes = [...patterns];
27501 - if (regexes.length === 1)
27502 - json.pattern = regexes[0].source;
27503 - else if (regexes.length > 1) {
27504 - result.schema.allOf = [
27505 - ...regexes.map((regex) => ({
27506 - ...(this.target === "draft-7" ? { type: "string" } : {}),
27507 - pattern: regex.source,
27508 - })),
27509 - ];
27510 - }
27511 - }
27512 - break;
27513 - }
27514 - case "number": {
27515 - const json = _json;
27516 - const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
27517 - if (typeof format === "string" && format.includes("int"))
27518 - json.type = "integer";
27519 - else
27520 - json.type = "number";
27521 - if (typeof exclusiveMinimum === "number")
27522 - json.exclusiveMinimum = exclusiveMinimum;
27523 - if (typeof minimum === "number") {
27524 - json.minimum = minimum;
27525 - if (typeof exclusiveMinimum === "number") {
27526 - if (exclusiveMinimum >= minimum)
27527 - delete json.minimum;
27528 - else
27529 - delete json.exclusiveMinimum;
27530 - }
27531 - }
27532 - if (typeof exclusiveMaximum === "number")
27533 - json.exclusiveMaximum = exclusiveMaximum;
27534 - if (typeof maximum === "number") {
27535 - json.maximum = maximum;
27536 - if (typeof exclusiveMaximum === "number") {
27537 - if (exclusiveMaximum <= maximum)
27538 - delete json.maximum;
27539 - else
27540 - delete json.exclusiveMaximum;
27541 - }
27542 - }
27543 - if (typeof multipleOf === "number")
27544 - json.multipleOf = multipleOf;
27545 - break;
27546 - }
27547 - case "boolean": {
27548 - const json = _json;
27549 - json.type = "boolean";
27550 - break;
27551 - }
27552 - case "bigint": {
27553 - if (this.unrepresentable === "throw") {
27554 - throw new Error("BigInt cannot be represented in JSON Schema");
27555 - }
27556 - break;
27557 - }
27558 - case "symbol": {
27559 - if (this.unrepresentable === "throw") {
27560 - throw new Error("Symbols cannot be represented in JSON Schema");
27561 - }
27562 - break;
27563 - }
27564 - case "null": {
27565 - _json.type = "null";
27566 - break;
27567 - }
27568 - case "any": {
27569 - break;
27570 - }
27571 - case "unknown": {
27572 - break;
27573 - }
27574 - case "undefined": {
27575 - if (this.unrepresentable === "throw") {
27576 - throw new Error("Undefined cannot be represented in JSON Schema");
27577 - }
27578 - break;
27579 - }
27580 - case "void": {
27581 - if (this.unrepresentable === "throw") {
27582 - throw new Error("Void cannot be represented in JSON Schema");
27583 - }
27584 - break;
27585 - }
27586 - case "never": {
27587 - _json.not = {};
27588 - break;
27589 - }
27590 - case "date": {
27591 - if (this.unrepresentable === "throw") {
27592 - throw new Error("Date cannot be represented in JSON Schema");
27593 - }
27594 - break;
27595 - }
27596 - case "array": {
27597 - const json = _json;
27598 - const { minimum, maximum } = schema._zod.bag;
27599 - if (typeof minimum === "number")
27600 - json.minItems = minimum;
27601 - if (typeof maximum === "number")
27602 - json.maxItems = maximum;
27603 - json.type = "array";
27604 - json.items = this.process(def.element, { ...params, path: [...params.path, "items"] });
27605 - break;
27606 - }
27607 - case "object": {
27608 - const json = _json;
27609 - json.type = "object";
27610 - json.properties = {};
27611 - const shape = def.shape; // params.shapeCache.get(schema)!;
27612 - for (const key in shape) {
27613 - json.properties[key] = this.process(shape[key], {
27614 - ...params,
27615 - path: [...params.path, "properties", key],
27616 - });
27617 - }
27618 - // required keys
27619 - const allKeys = new Set(Object.keys(shape));
27620 - // const optionalKeys = new Set(def.optional);
27621 - const requiredKeys = new Set([...allKeys].filter((key) => {
27622 - const v = def.shape[key]._zod;
27623 - if (this.io === "input") {
27624 - return v.optin === undefined;
27625 - }
27626 - else {
27627 - return v.optout === undefined;
27628 - }
27629 - }));
27630 - if (requiredKeys.size > 0) {
27631 - json.required = Array.from(requiredKeys);
27632 - }
27633 - // catchall
27634 - if (def.catchall?._zod.def.type === "never") {
27635 - // strict
27636 - json.additionalProperties = false;
27637 - }
27638 - else if (!def.catchall) {
27639 - // regular
27640 - if (this.io === "output")
27641 - json.additionalProperties = false;
27642 - }
27643 - else if (def.catchall) {
27644 - json.additionalProperties = this.process(def.catchall, {
27645 - ...params,
27646 - path: [...params.path, "additionalProperties"],
27647 - });
27648 - }
27649 - break;
27650 - }
27651 - case "union": {
27652 - const json = _json;
27653 - json.anyOf = def.options.map((x, i) => this.process(x, {
27654 - ...params,
27655 - path: [...params.path, "anyOf", i],
27656 - }));
27657 - break;
27658 - }
27659 - case "intersection": {
27660 - const json = _json;
27661 - const a = this.process(def.left, {
27662 - ...params,
27663 - path: [...params.path, "allOf", 0],
27664 - });
27665 - const b = this.process(def.right, {
27666 - ...params,
27667 - path: [...params.path, "allOf", 1],
27668 - });
27669 - const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
27670 - const allOf = [
27671 - ...(isSimpleIntersection(a) ? a.allOf : [a]),
27672 - ...(isSimpleIntersection(b) ? b.allOf : [b]),
27673 - ];
27674 - json.allOf = allOf;
27675 - break;
27676 - }
27677 - case "tuple": {
27678 - const json = _json;
27679 - json.type = "array";
27680 - const prefixItems = def.items.map((x, i) => this.process(x, { ...params, path: [...params.path, "prefixItems", i] }));
27681 - if (this.target === "draft-2020-12") {
27682 - json.prefixItems = prefixItems;
27683 - }
27684 - else {
27685 - json.items = prefixItems;
27686 - }
27687 - if (def.rest) {
27688 - const rest = this.process(def.rest, {
27689 - ...params,
27690 - path: [...params.path, "items"],
27691 - });
27692 - if (this.target === "draft-2020-12") {
27693 - json.items = rest;
27694 - }
27695 - else {
27696 - json.additionalItems = rest;
27697 - }
27698 - }
27699 - // additionalItems
27700 - if (def.rest) {
27701 - json.items = this.process(def.rest, {
27702 - ...params,
27703 - path: [...params.path, "items"],
27704 - });
27705 - }
27706 - // length
27707 - const { minimum, maximum } = schema._zod.bag;
27708 - if (typeof minimum === "number")
27709 - json.minItems = minimum;
27710 - if (typeof maximum === "number")
27711 - json.maxItems = maximum;
27712 - break;
27713 - }
27714 - case "record": {
27715 - const json = _json;
27716 - json.type = "object";
27717 - json.propertyNames = this.process(def.keyType, { ...params, path: [...params.path, "propertyNames"] });
27718 - json.additionalProperties = this.process(def.valueType, {
27719 - ...params,
27720 - path: [...params.path, "additionalProperties"],
27721 - });
27722 - break;
27723 - }
27724 - case "map": {
27725 - if (this.unrepresentable === "throw") {
27726 - throw new Error("Map cannot be represented in JSON Schema");
27727 - }
27728 - break;
27729 - }
27730 - case "set": {
27731 - if (this.unrepresentable === "throw") {
27732 - throw new Error("Set cannot be represented in JSON Schema");
27733 - }
27734 - break;
27735 - }
27736 - case "enum": {
27737 - const json = _json;
27738 - const values = (0,_util_js__WEBPACK_IMPORTED_MODULE_1__.getEnumValues)(def.entries);
27739 - // Number enums can have both string and number values
27740 - if (values.every((v) => typeof v === "number"))
27741 - json.type = "number";
27742 - if (values.every((v) => typeof v === "string"))
27743 - json.type = "string";
27744 - json.enum = values;
27745 - break;
27746 - }
27747 - case "literal": {
27748 - const json = _json;
27749 - const vals = [];
27750 - for (const val of def.values) {
27751 - if (val === undefined) {
27752 - if (this.unrepresentable === "throw") {
27753 - throw new Error("Literal `undefined` cannot be represented in JSON Schema");
27754 - }
27755 - else {
27756 - // do not add to vals
27757 - }
27758 - }
27759 - else if (typeof val === "bigint") {
27760 - if (this.unrepresentable === "throw") {
27761 - throw new Error("BigInt literals cannot be represented in JSON Schema");
27762 - }
27763 - else {
27764 - vals.push(Number(val));
27765 - }
27766 - }
27767 - else {
27768 - vals.push(val);
27769 - }
27770 - }
27771 - if (vals.length === 0) {
27772 - // do nothing (an undefined literal was stripped)
27773 - }
27774 - else if (vals.length === 1) {
27775 - const val = vals[0];
27776 - json.type = val === null ? "null" : typeof val;
27777 - json.const = val;
27778 - }
27779 - else {
27780 - if (vals.every((v) => typeof v === "number"))
27781 - json.type = "number";
27782 - if (vals.every((v) => typeof v === "string"))
27783 - json.type = "string";
27784 - if (vals.every((v) => typeof v === "boolean"))
27785 - json.type = "string";
27786 - if (vals.every((v) => v === null))
27787 - json.type = "null";
27788 - json.enum = vals;
27789 - }
27790 - break;
27791 - }
27792 - case "file": {
27793 - const json = _json;
27794 - const file = {
27795 - type: "string",
27796 - format: "binary",
27797 - contentEncoding: "binary",
27798 - };
27799 - const { minimum, maximum, mime } = schema._zod.bag;
27800 - if (minimum !== undefined)
27801 - file.minLength = minimum;
27802 - if (maximum !== undefined)
27803 - file.maxLength = maximum;
27804 - if (mime) {
27805 - if (mime.length === 1) {
27806 - file.contentMediaType = mime[0];
27807 - Object.assign(json, file);
27808 - }
27809 - else {
27810 - json.anyOf = mime.map((m) => {
27811 - const mFile = { ...file, contentMediaType: m };
27812 - return mFile;
27813 - });
27814 - }
27815 - }
27816 - else {
27817 - Object.assign(json, file);
27818 - }
27819 - // if (this.unrepresentable === "throw") {
27820 - // throw new Error("File cannot be represented in JSON Schema");
27821 - // }
27822 - break;
27823 - }
27824 - case "transform": {
27825 - if (this.unrepresentable === "throw") {
27826 - throw new Error("Transforms cannot be represented in JSON Schema");
27827 - }
27828 - break;
27829 - }
27830 - case "nullable": {
27831 - const inner = this.process(def.innerType, params);
27832 - _json.anyOf = [inner, { type: "null" }];
27833 - break;
27834 - }
27835 - case "nonoptional": {
27836 - this.process(def.innerType, params);
27837 - result.ref = def.innerType;
27838 - break;
27839 - }
27840 - case "success": {
27841 - const json = _json;
27842 - json.type = "boolean";
27843 - break;
27844 - }
27845 - case "default": {
27846 - this.process(def.innerType, params);
27847 - result.ref = def.innerType;
27848 - _json.default = JSON.parse(JSON.stringify(def.defaultValue));
27849 - break;
27850 - }
27851 - case "prefault": {
27852 - this.process(def.innerType, params);
27853 - result.ref = def.innerType;
27854 - if (this.io === "input")
27855 - _json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
27856 - break;
27857 - }
27858 - case "catch": {
27859 - // use conditionals
27860 - this.process(def.innerType, params);
27861 - result.ref = def.innerType;
27862 - let catchValue;
27863 - try {
27864 - catchValue = def.catchValue(undefined);
27865 - }
27866 - catch {
27867 - throw new Error("Dynamic catch values are not supported in JSON Schema");
27868 - }
27869 - _json.default = catchValue;
27870 - break;
27871 - }
27872 - case "nan": {
27873 - if (this.unrepresentable === "throw") {
27874 - throw new Error("NaN cannot be represented in JSON Schema");
27875 - }
27876 - break;
27877 - }
27878 - case "template_literal": {
27879 - const json = _json;
27880 - const pattern = schema._zod.pattern;
27881 - if (!pattern)
27882 - throw new Error("Pattern not found in template literal");
27883 - json.type = "string";
27884 - json.pattern = pattern.source;
27885 - break;
27886 - }
27887 - case "pipe": {
27888 - const innerType = this.io === "input" ? (def.in._zod.def.type === "transform" ? def.out : def.in) : def.out;
27889 - this.process(innerType, params);
27890 - result.ref = innerType;
27891 - break;
27892 - }
27893 - case "readonly": {
27894 - this.process(def.innerType, params);
27895 - result.ref = def.innerType;
27896 - _json.readOnly = true;
27897 - break;
27898 - }
27899 - // passthrough types
27900 - case "promise": {
27901 - this.process(def.innerType, params);
27902 - result.ref = def.innerType;
27903 - break;
27904 - }
27905 - case "optional": {
27906 - this.process(def.innerType, params);
27907 - result.ref = def.innerType;
27908 - break;
27909 - }
27910 - case "lazy": {
27911 - const innerType = schema._zod.innerType;
27912 - this.process(innerType, params);
27913 - result.ref = innerType;
27914 - break;
27915 - }
27916 - case "custom": {
27917 - if (this.unrepresentable === "throw") {
27918 - throw new Error("Custom types cannot be represented in JSON Schema");
27919 - }
27920 - break;
27921 - }
27922 - default: {
27923 - def;
27924 - }
27925 - }
27926 - }
27927 - }
27928 - // metadata
27929 - const meta = this.metadataRegistry.get(schema);
27930 - if (meta)
27931 - Object.assign(result.schema, meta);
27932 - if (this.io === "input" && isTransforming(schema)) {
27933 - // examples/defaults only apply to output type of pipe
27934 - delete result.schema.examples;
27935 - delete result.schema.default;
27936 - }
27937 - // set prefault as default
27938 - if (this.io === "input" && result.schema._prefault)
27939 - (_a = result.schema).default ?? (_a.default = result.schema._prefault);
27940 - delete result.schema._prefault;
27941 - // pulling fresh from this.seen in case it was overwritten
27942 - const _result = this.seen.get(schema);
27943 - return _result.schema;
27944 - }
27945 - emit(schema, _params) {
27946 - const params = {
27947 - cycles: _params?.cycles ?? "ref",
27948 - reused: _params?.reused ?? "inline",
27949 - // unrepresentable: _params?.unrepresentable ?? "throw",
27950 - // uri: _params?.uri ?? ((id) => `${id}`),
27951 - external: _params?.external ?? undefined,
27952 - };
27953 - // iterate over seen map;
27954 - const root = this.seen.get(schema);
27955 - if (!root)
27956 - throw new Error("Unprocessed schema. This is a bug in Zod.");
27957 - // initialize result with root schema fields
27958 - // Object.assign(result, seen.cached);
27959 - // returns a ref to the schema
27960 - // defId will be empty if the ref points to an external schema (or #)
27961 - const makeURI = (entry) => {
27962 - // comparing the seen objects because sometimes
27963 - // multiple schemas map to the same seen object.
27964 - // e.g. lazy
27965 - // external is configured
27966 - const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
27967 - if (params.external) {
27968 - const externalId = params.external.registry.get(entry[0])?.id; // ?? "__shared";// `__schema${this.counter++}`;
27969 - // check if schema is in the external registry
27970 - const uriGenerator = params.external.uri ?? ((id) => id);
27971 - if (externalId) {
27972 - return { ref: uriGenerator(externalId) };
27973 - }
27974 - // otherwise, add to __shared
27975 - const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
27976 - entry[1].defId = id; // set defId so it will be reused if needed
27977 - return { defId: id, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}` };
27978 - }
27979 - if (entry[1] === root) {
27980 - return { ref: "#" };
27981 - }
27982 - // self-contained schema
27983 - const uriPrefix = `#`;
27984 - const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
27985 - const defId = entry[1].schema.id ?? `__schema${this.counter++}`;
27986 - return { defId, ref: defUriPrefix + defId };
27987 - };
27988 - // stored cached version in `def` property
27989 - // remove all properties, set $ref
27990 - const extractToDef = (entry) => {
27991 - // if the schema is already a reference, do not extract it
27992 - if (entry[1].schema.$ref) {
27993 - return;
27994 - }
27995 - const seen = entry[1];
27996 - const { ref, defId } = makeURI(entry);
27997 - seen.def = { ...seen.schema };
27998 - // defId won't be set if the schema is a reference to an external schema
27999 - if (defId)
28000 - seen.defId = defId;
28001 - // wipe away all properties except $ref
28002 - const schema = seen.schema;
28003 - for (const key in schema) {
28004 - delete schema[key];
28005 - }
28006 - schema.$ref = ref;
28007 - };
28008 - // throw on cycles
28009 - // break cycles
28010 - if (params.cycles === "throw") {
28011 - for (const entry of this.seen.entries()) {
28012 - const seen = entry[1];
28013 - if (seen.cycle) {
28014 - throw new Error("Cycle detected: " +
28015 - `#/${seen.cycle?.join("/")}/<root>` +
28016 - '\n\nSet the `cycles` parameter to `"ref"` to resolve cyclical schemas with defs.');
28017 - }
28018 - }
28019 - }
28020 - // extract schemas into $defs
28021 - for (const entry of this.seen.entries()) {
28022 - const seen = entry[1];
28023 - // convert root schema to # $ref
28024 - if (schema === entry[0]) {
28025 - extractToDef(entry); // this has special handling for the root schema
28026 - continue;
28027 - }
28028 - // extract schemas that are in the external registry
28029 - if (params.external) {
28030 - const ext = params.external.registry.get(entry[0])?.id;
28031 - if (schema !== entry[0] && ext) {
28032 - extractToDef(entry);
28033 - continue;
28034 - }
28035 - }
28036 - // extract schemas with `id` meta
28037 - const id = this.metadataRegistry.get(entry[0])?.id;
28038 - if (id) {
28039 - extractToDef(entry);
28040 - continue;
28041 - }
28042 - // break cycles
28043 - if (seen.cycle) {
28044 - // any
28045 - extractToDef(entry);
28046 - continue;
28047 - }
28048 - // extract reused schemas
28049 - if (seen.count > 1) {
28050 - if (params.reused === "ref") {
28051 - extractToDef(entry);
28052 - // biome-ignore lint:
28053 - continue;
28054 - }
28055 - }
28056 - }
28057 - // flatten _refs
28058 - const flattenRef = (zodSchema, params) => {
28059 - const seen = this.seen.get(zodSchema);
28060 - const schema = seen.def ?? seen.schema;
28061 - const _cached = { ...schema };
28062 - // already seen
28063 - if (seen.ref === null) {
28064 - return;
28065 - }
28066 - // flatten ref if defined
28067 - const ref = seen.ref;
28068 - seen.ref = null; // prevent recursion
28069 - if (ref) {
28070 - flattenRef(ref, params);
28071 - // merge referenced schema into current
28072 - const refSchema = this.seen.get(ref).schema;
28073 - if (refSchema.$ref && params.target === "draft-7") {
28074 - schema.allOf = schema.allOf ?? [];
28075 - schema.allOf.push(refSchema);
28076 - }
28077 - else {
28078 - Object.assign(schema, refSchema);
28079 - Object.assign(schema, _cached); // prevent overwriting any fields in the original schema
28080 - }
28081 - }
28082 - // execute overrides
28083 - if (!seen.isParent)
28084 - this.override({
28085 - zodSchema: zodSchema,
28086 - jsonSchema: schema,
28087 - path: seen.path ?? [],
28088 - });
28089 - };
28090 - for (const entry of [...this.seen.entries()].reverse()) {
28091 - flattenRef(entry[0], { target: this.target });
28092 - }
28093 - const result = {};
28094 - if (this.target === "draft-2020-12") {
28095 - result.$schema = "https://json-schema.org/draft/2020-12/schema";
28096 - }
28097 - else if (this.target === "draft-7") {
28098 - result.$schema = "http://json-schema.org/draft-07/schema#";
28099 - }
28100 - else {
28101 - console.warn(`Invalid target: ${this.target}`);
28102 - }
28103 - if (params.external?.uri) {
28104 - const id = params.external.registry.get(schema)?.id;
28105 - if (!id)
28106 - throw new Error("Schema is missing an `id` property");
28107 - result.$id = params.external.uri(id);
28108 - }
28109 - Object.assign(result, root.def);
28110 - // build defs object
28111 - const defs = params.external?.defs ?? {};
28112 - for (const entry of this.seen.entries()) {
28113 - const seen = entry[1];
28114 - if (seen.def && seen.defId) {
28115 - defs[seen.defId] = seen.def;
28116 - }
28117 - }
28118 - // set definitions in result
28119 - if (params.external) {
28120 - }
28121 - else {
28122 - if (Object.keys(defs).length > 0) {
28123 - if (this.target === "draft-2020-12") {
28124 - result.$defs = defs;
28125 - }
28126 - else {
28127 - result.definitions = defs;
28128 - }
28129 - }
28130 - }
28131 - try {
28132 - // this "finalizes" this schema and ensures all cycles are removed
28133 - // each call to .emit() is functionally independent
28134 - // though the seen map is shared
28135 - return JSON.parse(JSON.stringify(result));
28136 - }
28137 - catch (_err) {
28138 - throw new Error("Error converting schema to JSON.");
28139 - }
28140 - }
28141 -}
28142 -function toJSONSchema(input, _params) {
28143 - if (input instanceof _registries_js__WEBPACK_IMPORTED_MODULE_0__.$ZodRegistry) {
28144 - const gen = new JSONSchemaGenerator(_params);
28145 - const defs = {};
28146 - for (const entry of input._idmap.entries()) {
28147 - const [_, schema] = entry;
28148 - gen.process(schema);
28149 - }
28150 - const schemas = {};
28151 - const external = {
28152 - registry: input,
28153 - uri: _params?.uri,
28154 - defs,
28155 - };
28156 - for (const entry of input._idmap.entries()) {
28157 - const [key, schema] = entry;
28158 - schemas[key] = gen.emit(schema, {
28159 - ..._params,
28160 - external,
28161 - });
28162 - }
28163 - if (Object.keys(defs).length > 0) {
28164 - const defsSegment = gen.target === "draft-2020-12" ? "$defs" : "definitions";
28165 - schemas.__shared = {
28166 - [defsSegment]: defs,
28167 - };
28168 - }
28169 - return { schemas };
28170 - }
28171 - const gen = new JSONSchemaGenerator(_params);
28172 - gen.process(input);
28173 - return gen.emit(input, _params);
28174 -}
28175 -function isTransforming(_schema, _ctx) {
28176 - const ctx = _ctx ?? { seen: new Set() };
28177 - if (ctx.seen.has(_schema))
28178 - return false;
28179 - ctx.seen.add(_schema);
28180 - const schema = _schema;
28181 - const def = schema._zod.def;
28182 - switch (def.type) {
28183 - case "string":
28184 - case "number":
28185 - case "bigint":
28186 - case "boolean":
28187 - case "date":
28188 - case "symbol":
28189 - case "undefined":
28190 - case "null":
28191 - case "any":
28192 - case "unknown":
28193 - case "never":
28194 - case "void":
28195 - case "literal":
28196 - case "enum":
28197 - case "nan":
28198 - case "file":
28199 - case "template_literal":
28200 - return false;
28201 - case "array": {
28202 - return isTransforming(def.element, ctx);
28203 - }
28204 - case "object": {
28205 - for (const key in def.shape) {
28206 - if (isTransforming(def.shape[key], ctx))
28207 - return true;
28208 - }
28209 - return false;
28210 - }
28211 - case "union": {
28212 - for (const option of def.options) {
28213 - if (isTransforming(option, ctx))
28214 - return true;
28215 - }
28216 - return false;
28217 - }
28218 - case "intersection": {
28219 - return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
28220 - }
28221 - case "tuple": {
28222 - for (const item of def.items) {
28223 - if (isTransforming(item, ctx))
28224 - return true;
28225 - }
28226 - if (def.rest && isTransforming(def.rest, ctx))
28227 - return true;
28228 - return false;
28229 - }
28230 - case "record": {
28231 - return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
28232 - }
28233 - case "map": {
28234 - return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
28235 - }
28236 - case "set": {
28237 - return isTransforming(def.valueType, ctx);
28238 - }
28239 - // inner types
28240 - case "promise":
28241 - case "optional":
28242 - case "nonoptional":
28243 - case "nullable":
28244 - case "readonly":
28245 - return isTransforming(def.innerType, ctx);
28246 - case "lazy":
28247 - return isTransforming(def.getter(), ctx);
28248 - case "default": {
28249 - return isTransforming(def.innerType, ctx);
28250 - }
28251 - case "prefault": {
28252 - return isTransforming(def.innerType, ctx);
28253 - }
28254 - case "custom": {
28255 - return false;
28256 - }
28257 - case "transform": {
28258 - return true;
28259 - }
28260 - case "pipe": {
28261 - return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
28262 - }
28263 - case "success": {
28264 - return false;
28265 - }
28266 - case "catch": {
28267 - return false;
28268 - }
28269 - default:
28270 - def;
28271 - }
28272 - throw new Error(`Unknown schema type: ${def.type}`);
28273 -}
28274 -
28275 -
28276 -/***/ }),
28277 -
28278 -/***/ "./node_modules/zod/v4/core/util.js":
28279 -/*!******************************************!*\
28280 - !*** ./node_modules/zod/v4/core/util.js ***!
28281 - \******************************************/
28282 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
28283 -
28284 -__webpack_require__.r(__webpack_exports__);
28285 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
28286 -/* harmony export */ BIGINT_FORMAT_RANGES: function() { return /* binding */ BIGINT_FORMAT_RANGES; },
28287 -/* harmony export */ Class: function() { return /* binding */ Class; },
28288 -/* harmony export */ NUMBER_FORMAT_RANGES: function() { return /* binding */ NUMBER_FORMAT_RANGES; },
28289 -/* harmony export */ aborted: function() { return /* binding */ aborted; },
28290 -/* harmony export */ allowsEval: function() { return /* binding */ allowsEval; },
28291 -/* harmony export */ assert: function() { return /* binding */ assert; },
28292 -/* harmony export */ assertEqual: function() { return /* binding */ assertEqual; },
28293 -/* harmony export */ assertIs: function() { return /* binding */ assertIs; },
28294 -/* harmony export */ assertNever: function() { return /* binding */ assertNever; },
28295 -/* harmony export */ assertNotEqual: function() { return /* binding */ assertNotEqual; },
28296 -/* harmony export */ assignProp: function() { return /* binding */ assignProp; },
28297 -/* harmony export */ cached: function() { return /* binding */ cached; },
28298 -/* harmony export */ captureStackTrace: function() { return /* binding */ captureStackTrace; },
28299 -/* harmony export */ cleanEnum: function() { return /* binding */ cleanEnum; },
28300 -/* harmony export */ cleanRegex: function() { return /* binding */ cleanRegex; },
28301 -/* harmony export */ clone: function() { return /* binding */ clone; },
28302 -/* harmony export */ createTransparentProxy: function() { return /* binding */ createTransparentProxy; },
28303 -/* harmony export */ defineLazy: function() { return /* binding */ defineLazy; },
28304 -/* harmony export */ esc: function() { return /* binding */ esc; },
28305 -/* harmony export */ escapeRegex: function() { return /* binding */ escapeRegex; },
28306 -/* harmony export */ extend: function() { return /* binding */ extend; },
28307 -/* harmony export */ finalizeIssue: function() { return /* binding */ finalizeIssue; },
28308 -/* harmony export */ floatSafeRemainder: function() { return /* binding */ floatSafeRemainder; },
28309 -/* harmony export */ getElementAtPath: function() { return /* binding */ getElementAtPath; },
28310 -/* harmony export */ getEnumValues: function() { return /* binding */ getEnumValues; },
28311 -/* harmony export */ getLengthableOrigin: function() { return /* binding */ getLengthableOrigin; },
28312 -/* harmony export */ getParsedType: function() { return /* binding */ getParsedType; },
28313 -/* harmony export */ getSizableOrigin: function() { return /* binding */ getSizableOrigin; },
28314 -/* harmony export */ isObject: function() { return /* binding */ isObject; },
28315 -/* harmony export */ isPlainObject: function() { return /* binding */ isPlainObject; },
28316 -/* harmony export */ issue: function() { return /* binding */ issue; },
28317 -/* harmony export */ joinValues: function() { return /* binding */ joinValues; },
28318 -/* harmony export */ jsonStringifyReplacer: function() { return /* binding */ jsonStringifyReplacer; },
28319 -/* harmony export */ merge: function() { return /* binding */ merge; },
28320 -/* harmony export */ normalizeParams: function() { return /* binding */ normalizeParams; },
28321 -/* harmony export */ nullish: function() { return /* binding */ nullish; },
28322 -/* harmony export */ numKeys: function() { return /* binding */ numKeys; },
28323 -/* harmony export */ omit: function() { return /* binding */ omit; },
28324 -/* harmony export */ optionalKeys: function() { return /* binding */ optionalKeys; },
28325 -/* harmony export */ partial: function() { return /* binding */ partial; },
28326 -/* harmony export */ pick: function() { return /* binding */ pick; },
28327 -/* harmony export */ prefixIssues: function() { return /* binding */ prefixIssues; },
28328 -/* harmony export */ primitiveTypes: function() { return /* binding */ primitiveTypes; },
28329 -/* harmony export */ promiseAllObject: function() { return /* binding */ promiseAllObject; },
28330 -/* harmony export */ propertyKeyTypes: function() { return /* binding */ propertyKeyTypes; },
28331 -/* harmony export */ randomString: function() { return /* binding */ randomString; },
28332 -/* harmony export */ required: function() { return /* binding */ required; },
28333 -/* harmony export */ stringifyPrimitive: function() { return /* binding */ stringifyPrimitive; },
28334 -/* harmony export */ unwrapMessage: function() { return /* binding */ unwrapMessage; }
28335 -/* harmony export */ });
28336 -// functions
28337 -function assertEqual(val) {
28338 - return val;
28339 -}
28340 -function assertNotEqual(val) {
28341 - return val;
28342 -}
28343 -function assertIs(_arg) { }
28344 -function assertNever(_x) {
28345 - throw new Error();
28346 -}
28347 -function assert(_) { }
28348 -function getEnumValues(entries) {
28349 - const numericValues = Object.values(entries).filter((v) => typeof v === "number");
28350 - const values = Object.entries(entries)
28351 - .filter(([k, _]) => numericValues.indexOf(+k) === -1)
28352 - .map(([_, v]) => v);
28353 - return values;
28354 -}
28355 -function joinValues(array, separator = "|") {
28356 - return array.map((val) => stringifyPrimitive(val)).join(separator);
28357 -}
28358 -function jsonStringifyReplacer(_, value) {
28359 - if (typeof value === "bigint")
28360 - return value.toString();
28361 - return value;
28362 -}
28363 -function cached(getter) {
28364 - const set = false;
28365 - return {
28366 - get value() {
28367 - if (!set) {
28368 - const value = getter();
28369 - Object.defineProperty(this, "value", { value });
28370 - return value;
28371 - }
28372 - throw new Error("cached value already set");
28373 - },
28374 - };
28375 -}
28376 -function nullish(input) {
28377 - return input === null || input === undefined;
28378 -}
28379 -function cleanRegex(source) {
28380 - const start = source.startsWith("^") ? 1 : 0;
28381 - const end = source.endsWith("$") ? source.length - 1 : source.length;
28382 - return source.slice(start, end);
28383 -}
28384 -function floatSafeRemainder(val, step) {
28385 - const valDecCount = (val.toString().split(".")[1] || "").length;
28386 - const stepDecCount = (step.toString().split(".")[1] || "").length;
28387 - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
28388 - const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
28389 - const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
28390 - return (valInt % stepInt) / 10 ** decCount;
28391 -}
28392 -function defineLazy(object, key, getter) {
28393 - const set = false;
28394 - Object.defineProperty(object, key, {
28395 - get() {
28396 - if (!set) {
28397 - const value = getter();
28398 - object[key] = value;
28399 - return value;
28400 - }
28401 - throw new Error("cached value already set");
28402 - },
28403 - set(v) {
28404 - Object.defineProperty(object, key, {
28405 - value: v,
28406 - // configurable: true,
28407 - });
28408 - // object[key] = v;
28409 - },
28410 - configurable: true,
28411 - });
28412 -}
28413 -function assignProp(target, prop, value) {
28414 - Object.defineProperty(target, prop, {
28415 - value,
28416 - writable: true,
28417 - enumerable: true,
28418 - configurable: true,
28419 - });
28420 -}
28421 -function getElementAtPath(obj, path) {
28422 - if (!path)
28423 - return obj;
28424 - return path.reduce((acc, key) => acc?.[key], obj);
28425 -}
28426 -function promiseAllObject(promisesObj) {
28427 - const keys = Object.keys(promisesObj);
28428 - const promises = keys.map((key) => promisesObj[key]);
28429 - return Promise.all(promises).then((results) => {
28430 - const resolvedObj = {};
28431 - for (let i = 0; i < keys.length; i++) {
28432 - resolvedObj[keys[i]] = results[i];
28433 - }
28434 - return resolvedObj;
28435 - });
28436 -}
28437 -function randomString(length = 10) {
28438 - const chars = "abcdefghijklmnopqrstuvwxyz";
28439 - let str = "";
28440 - for (let i = 0; i < length; i++) {
28441 - str += chars[Math.floor(Math.random() * chars.length)];
28442 - }
28443 - return str;
28444 -}
28445 -function esc(str) {
28446 - return JSON.stringify(str);
28447 -}
28448 -const captureStackTrace = Error.captureStackTrace
28449 - ? Error.captureStackTrace
28450 - : (..._args) => { };
28451 -function isObject(data) {
28452 - return typeof data === "object" && data !== null && !Array.isArray(data);
28453 -}
28454 -const allowsEval = cached(() => {
28455 - if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
28456 - return false;
28457 - }
28458 - try {
28459 - const F = Function;
28460 - new F("");
28461 - return true;
28462 - }
28463 - catch (_) {
28464 - return false;
28465 - }
28466 -});
28467 -function isPlainObject(o) {
28468 - if (isObject(o) === false)
28469 - return false;
28470 - // modified constructor
28471 - const ctor = o.constructor;
28472 - if (ctor === undefined)
28473 - return true;
28474 - // modified prototype
28475 - const prot = ctor.prototype;
28476 - if (isObject(prot) === false)
28477 - return false;
28478 - // ctor doesn't have static `isPrototypeOf`
28479 - if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
28480 - return false;
28481 - }
28482 - return true;
28483 -}
28484 -function numKeys(data) {
28485 - let keyCount = 0;
28486 - for (const key in data) {
28487 - if (Object.prototype.hasOwnProperty.call(data, key)) {
28488 - keyCount++;
28489 - }
28490 - }
28491 - return keyCount;
28492 -}
28493 -const getParsedType = (data) => {
28494 - const t = typeof data;
28495 - switch (t) {
28496 - case "undefined":
28497 - return "undefined";
28498 - case "string":
28499 - return "string";
28500 - case "number":
28501 - return Number.isNaN(data) ? "nan" : "number";
28502 - case "boolean":
28503 - return "boolean";
28504 - case "function":
28505 - return "function";
28506 - case "bigint":
28507 - return "bigint";
28508 - case "symbol":
28509 - return "symbol";
28510 - case "object":
28511 - if (Array.isArray(data)) {
28512 - return "array";
28513 - }
28514 - if (data === null) {
28515 - return "null";
28516 - }
28517 - if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
28518 - return "promise";
28519 - }
28520 - if (typeof Map !== "undefined" && data instanceof Map) {
28521 - return "map";
28522 - }
28523 - if (typeof Set !== "undefined" && data instanceof Set) {
28524 - return "set";
28525 - }
28526 - if (typeof Date !== "undefined" && data instanceof Date) {
28527 - return "date";
28528 - }
28529 - if (typeof File !== "undefined" && data instanceof File) {
28530 - return "file";
28531 - }
28532 - return "object";
28533 - default:
28534 - throw new Error(`Unknown data type: ${t}`);
28535 - }
28536 -};
28537 -const propertyKeyTypes = new Set(["string", "number", "symbol"]);
28538 -const primitiveTypes = new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]);
28539 -function escapeRegex(str) {
28540 - return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
28541 -}
28542 -// zod-specific utils
28543 -function clone(inst, def, params) {
28544 - const cl = new inst._zod.constr(def ?? inst._zod.def);
28545 - if (!def || params?.parent)
28546 - cl._zod.parent = inst;
28547 - return cl;
28548 -}
28549 -function normalizeParams(_params) {
28550 - const params = _params;
28551 - if (!params)
28552 - return {};
28553 - if (typeof params === "string")
28554 - return { error: () => params };
28555 - if (params?.message !== undefined) {
28556 - if (params?.error !== undefined)
28557 - throw new Error("Cannot specify both `message` and `error` params");
28558 - params.error = params.message;
28559 - }
28560 - delete params.message;
28561 - if (typeof params.error === "string")
28562 - return { ...params, error: () => params.error };
28563 - return params;
28564 -}
28565 -function createTransparentProxy(getter) {
28566 - let target;
28567 - return new Proxy({}, {
28568 - get(_, prop, receiver) {
28569 - target ?? (target = getter());
28570 - return Reflect.get(target, prop, receiver);
28571 - },
28572 - set(_, prop, value, receiver) {
28573 - target ?? (target = getter());
28574 - return Reflect.set(target, prop, value, receiver);
28575 - },
28576 - has(_, prop) {
28577 - target ?? (target = getter());
28578 - return Reflect.has(target, prop);
28579 - },
28580 - deleteProperty(_, prop) {
28581 - target ?? (target = getter());
28582 - return Reflect.deleteProperty(target, prop);
28583 - },
28584 - ownKeys(_) {
28585 - target ?? (target = getter());
28586 - return Reflect.ownKeys(target);
28587 - },
28588 - getOwnPropertyDescriptor(_, prop) {
28589 - target ?? (target = getter());
28590 - return Reflect.getOwnPropertyDescriptor(target, prop);
28591 - },
28592 - defineProperty(_, prop, descriptor) {
28593 - target ?? (target = getter());
28594 - return Reflect.defineProperty(target, prop, descriptor);
28595 - },
28596 - });
28597 -}
28598 -function stringifyPrimitive(value) {
28599 - if (typeof value === "bigint")
28600 - return value.toString() + "n";
28601 - if (typeof value === "string")
28602 - return `"${value}"`;
28603 - return `${value}`;
28604 -}
28605 -function optionalKeys(shape) {
28606 - return Object.keys(shape).filter((k) => {
28607 - return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
28608 - });
28609 -}
28610 -const NUMBER_FORMAT_RANGES = {
28611 - safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
28612 - int32: [-2147483648, 2147483647],
28613 - uint32: [0, 4294967295],
28614 - float32: [-3.4028234663852886e38, 3.4028234663852886e38],
28615 - float64: [-Number.MAX_VALUE, Number.MAX_VALUE],
28616 -};
28617 -const BIGINT_FORMAT_RANGES = {
28618 - int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
28619 - uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")],
28620 -};
28621 -function pick(schema, mask) {
28622 - const newShape = {};
28623 - const currDef = schema._zod.def; //.shape;
28624 - for (const key in mask) {
28625 - if (!(key in currDef.shape)) {
28626 - throw new Error(`Unrecognized key: "${key}"`);
28627 - }
28628 - if (!mask[key])
28629 - continue;
28630 - // pick key
28631 - newShape[key] = currDef.shape[key];
28632 - }
28633 - return clone(schema, {
28634 - ...schema._zod.def,
28635 - shape: newShape,
28636 - checks: [],
28637 - });
28638 -}
28639 -function omit(schema, mask) {
28640 - const newShape = { ...schema._zod.def.shape };
28641 - const currDef = schema._zod.def; //.shape;
28642 - for (const key in mask) {
28643 - if (!(key in currDef.shape)) {
28644 - throw new Error(`Unrecognized key: "${key}"`);
28645 - }
28646 - if (!mask[key])
28647 - continue;
28648 - delete newShape[key];
28649 - }
28650 - return clone(schema, {
28651 - ...schema._zod.def,
28652 - shape: newShape,
28653 - checks: [],
28654 - });
28655 -}
28656 -function extend(schema, shape) {
28657 - if (!isPlainObject(shape)) {
28658 - throw new Error("Invalid input to extend: expected a plain object");
28659 - }
28660 - const def = {
28661 - ...schema._zod.def,
28662 - get shape() {
28663 - const _shape = { ...schema._zod.def.shape, ...shape };
28664 - assignProp(this, "shape", _shape); // self-caching
28665 - return _shape;
28666 - },
28667 - checks: [], // delete existing checks
28668 - };
28669 - return clone(schema, def);
28670 -}
28671 -function merge(a, b) {
28672 - return clone(a, {
28673 - ...a._zod.def,
28674 - get shape() {
28675 - const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };
28676 - assignProp(this, "shape", _shape); // self-caching
28677 - return _shape;
28678 - },
28679 - catchall: b._zod.def.catchall,
28680 - checks: [], // delete existing checks
28681 - });
28682 -}
28683 -function partial(Class, schema, mask) {
28684 - const oldShape = schema._zod.def.shape;
28685 - const shape = { ...oldShape };
28686 - if (mask) {
28687 - for (const key in mask) {
28688 - if (!(key in oldShape)) {
28689 - throw new Error(`Unrecognized key: "${key}"`);
28690 - }
28691 - if (!mask[key])
28692 - continue;
28693 - // if (oldShape[key]!._zod.optin === "optional") continue;
28694 - shape[key] = Class
28695 - ? new Class({
28696 - type: "optional",
28697 - innerType: oldShape[key],
28698 - })
28699 - : oldShape[key];
28700 - }
28701 - }
28702 - else {
28703 - for (const key in oldShape) {
28704 - // if (oldShape[key]!._zod.optin === "optional") continue;
28705 - shape[key] = Class
28706 - ? new Class({
28707 - type: "optional",
28708 - innerType: oldShape[key],
28709 - })
28710 - : oldShape[key];
28711 - }
28712 - }
28713 - return clone(schema, {
28714 - ...schema._zod.def,
28715 - shape,
28716 - checks: [],
28717 - });
28718 -}
28719 -function required(Class, schema, mask) {
28720 - const oldShape = schema._zod.def.shape;
28721 - const shape = { ...oldShape };
28722 - if (mask) {
28723 - for (const key in mask) {
28724 - if (!(key in shape)) {
28725 - throw new Error(`Unrecognized key: "${key}"`);
28726 - }
28727 - if (!mask[key])
28728 - continue;
28729 - // overwrite with non-optional
28730 - shape[key] = new Class({
28731 - type: "nonoptional",
28732 - innerType: oldShape[key],
28733 - });
28734 - }
28735 - }
28736 - else {
28737 - for (const key in oldShape) {
28738 - // overwrite with non-optional
28739 - shape[key] = new Class({
28740 - type: "nonoptional",
28741 - innerType: oldShape[key],
28742 - });
28743 - }
28744 - }
28745 - return clone(schema, {
28746 - ...schema._zod.def,
28747 - shape,
28748 - // optional: [],
28749 - checks: [],
28750 - });
28751 -}
28752 -function aborted(x, startIndex = 0) {
28753 - for (let i = startIndex; i < x.issues.length; i++) {
28754 - if (x.issues[i]?.continue !== true)
28755 - return true;
28756 - }
28757 - return false;
28758 -}
28759 -function prefixIssues(path, issues) {
28760 - return issues.map((iss) => {
28761 - var _a;
28762 - (_a = iss).path ?? (_a.path = []);
28763 - iss.path.unshift(path);
28764 - return iss;
28765 - });
28766 -}
28767 -function unwrapMessage(message) {
28768 - return typeof message === "string" ? message : message?.message;
28769 -}
28770 -function finalizeIssue(iss, ctx, config) {
28771 - const full = { ...iss, path: iss.path ?? [] };
28772 - // for backwards compatibility
28773 - if (!iss.message) {
28774 - const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??
28775 - unwrapMessage(ctx?.error?.(iss)) ??
28776 - unwrapMessage(config.customError?.(iss)) ??
28777 - unwrapMessage(config.localeError?.(iss)) ??
28778 - "Invalid input";
28779 - full.message = message;
28780 - }
28781 - // delete (full as any).def;
28782 - delete full.inst;
28783 - delete full.continue;
28784 - if (!ctx?.reportInput) {
28785 - delete full.input;
28786 - }
28787 - return full;
28788 -}
28789 -function getSizableOrigin(input) {
28790 - if (input instanceof Set)
28791 - return "set";
28792 - if (input instanceof Map)
28793 - return "map";
28794 - if (input instanceof File)
28795 - return "file";
28796 - return "unknown";
28797 -}
28798 -function getLengthableOrigin(input) {
28799 - if (Array.isArray(input))
28800 - return "array";
28801 - if (typeof input === "string")
28802 - return "string";
28803 - return "unknown";
28804 -}
28805 -function issue(...args) {
28806 - const [iss, input, inst] = args;
28807 - if (typeof iss === "string") {
28808 - return {
28809 - message: iss,
28810 - code: "custom",
28811 - input,
28812 - inst,
28813 - };
28814 - }
28815 - return { ...iss };
28816 -}
28817 -function cleanEnum(obj) {
28818 - return Object.entries(obj)
28819 - .filter(([k, _]) => {
28820 - // return true if NaN, meaning it's not a number, thus a string key
28821 - return Number.isNaN(Number.parseInt(k, 10));
28822 - })
28823 - .map((el) => el[1]);
28824 -}
28825 -// instanceof
28826 -class Class {
28827 - constructor(..._args) { }
28828 -}
28829 -
28830 -
28831 -/***/ }),
28832 -
28833 -/***/ "./node_modules/zod/v4/core/versions.js":
28834 -/*!**********************************************!*\
28835 - !*** ./node_modules/zod/v4/core/versions.js ***!
28836 - \**********************************************/
28837 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
28838 -
28839 -__webpack_require__.r(__webpack_exports__);
28840 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
28841 -/* harmony export */ version: function() { return /* binding */ version; }
28842 -/* harmony export */ });
28843 -const version = {
28844 - major: 4,
28845 - minor: 0,
28846 - patch: 0,
28847 -};
28848 -
28849 -
28850 -/***/ }),
28851 -
28852 -/***/ "./node_modules/zod/v4/mini/schemas.js":
28853 -/*!*********************************************!*\
28854 - !*** ./node_modules/zod/v4/mini/schemas.js ***!
28855 - \*********************************************/
28856 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
28857 -
28858 -__webpack_require__.r(__webpack_exports__);
28859 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
28860 -/* harmony export */ ZodMiniAny: function() { return /* binding */ ZodMiniAny; },
28861 -/* harmony export */ ZodMiniArray: function() { return /* binding */ ZodMiniArray; },
28862 -/* harmony export */ ZodMiniBase64: function() { return /* binding */ ZodMiniBase64; },
28863 -/* harmony export */ ZodMiniBase64URL: function() { return /* binding */ ZodMiniBase64URL; },
28864 -/* harmony export */ ZodMiniBigInt: function() { return /* binding */ ZodMiniBigInt; },
28865 -/* harmony export */ ZodMiniBigIntFormat: function() { return /* binding */ ZodMiniBigIntFormat; },
28866 -/* harmony export */ ZodMiniBoolean: function() { return /* binding */ ZodMiniBoolean; },
28867 -/* harmony export */ ZodMiniCIDRv4: function() { return /* binding */ ZodMiniCIDRv4; },
28868 -/* harmony export */ ZodMiniCIDRv6: function() { return /* binding */ ZodMiniCIDRv6; },
28869 -/* harmony export */ ZodMiniCUID: function() { return /* binding */ ZodMiniCUID; },
28870 -/* harmony export */ ZodMiniCUID2: function() { return /* binding */ ZodMiniCUID2; },
28871 -/* harmony export */ ZodMiniCatch: function() { return /* binding */ ZodMiniCatch; },
28872 -/* harmony export */ ZodMiniCustom: function() { return /* binding */ ZodMiniCustom; },
28873 -/* harmony export */ ZodMiniCustomStringFormat: function() { return /* binding */ ZodMiniCustomStringFormat; },
28874 -/* harmony export */ ZodMiniDate: function() { return /* binding */ ZodMiniDate; },
28875 -/* harmony export */ ZodMiniDefault: function() { return /* binding */ ZodMiniDefault; },
28876 -/* harmony export */ ZodMiniDiscriminatedUnion: function() { return /* binding */ ZodMiniDiscriminatedUnion; },
28877 -/* harmony export */ ZodMiniE164: function() { return /* binding */ ZodMiniE164; },
28878 -/* harmony export */ ZodMiniEmail: function() { return /* binding */ ZodMiniEmail; },
28879 -/* harmony export */ ZodMiniEmoji: function() { return /* binding */ ZodMiniEmoji; },
28880 -/* harmony export */ ZodMiniEnum: function() { return /* binding */ ZodMiniEnum; },
28881 -/* harmony export */ ZodMiniFile: function() { return /* binding */ ZodMiniFile; },
28882 -/* harmony export */ ZodMiniGUID: function() { return /* binding */ ZodMiniGUID; },
28883 -/* harmony export */ ZodMiniIPv4: function() { return /* binding */ ZodMiniIPv4; },
28884 -/* harmony export */ ZodMiniIPv6: function() { return /* binding */ ZodMiniIPv6; },
28885 -/* harmony export */ ZodMiniIntersection: function() { return /* binding */ ZodMiniIntersection; },
28886 -/* harmony export */ ZodMiniJWT: function() { return /* binding */ ZodMiniJWT; },
28887 -/* harmony export */ ZodMiniKSUID: function() { return /* binding */ ZodMiniKSUID; },
28888 -/* harmony export */ ZodMiniLazy: function() { return /* binding */ ZodMiniLazy; },
28889 -/* harmony export */ ZodMiniLiteral: function() { return /* binding */ ZodMiniLiteral; },
28890 -/* harmony export */ ZodMiniMap: function() { return /* binding */ ZodMiniMap; },
28891 -/* harmony export */ ZodMiniNaN: function() { return /* binding */ ZodMiniNaN; },
28892 -/* harmony export */ ZodMiniNanoID: function() { return /* binding */ ZodMiniNanoID; },
28893 -/* harmony export */ ZodMiniNever: function() { return /* binding */ ZodMiniNever; },
28894 -/* harmony export */ ZodMiniNonOptional: function() { return /* binding */ ZodMiniNonOptional; },
28895 -/* harmony export */ ZodMiniNull: function() { return /* binding */ ZodMiniNull; },
28896 -/* harmony export */ ZodMiniNullable: function() { return /* binding */ ZodMiniNullable; },
28897 -/* harmony export */ ZodMiniNumber: function() { return /* binding */ ZodMiniNumber; },
28898 -/* harmony export */ ZodMiniNumberFormat: function() { return /* binding */ ZodMiniNumberFormat; },
28899 -/* harmony export */ ZodMiniObject: function() { return /* binding */ ZodMiniObject; },
28900 -/* harmony export */ ZodMiniOptional: function() { return /* binding */ ZodMiniOptional; },
28901 -/* harmony export */ ZodMiniPipe: function() { return /* binding */ ZodMiniPipe; },
28902 -/* harmony export */ ZodMiniPrefault: function() { return /* binding */ ZodMiniPrefault; },
28903 -/* harmony export */ ZodMiniPromise: function() { return /* binding */ ZodMiniPromise; },
28904 -/* harmony export */ ZodMiniReadonly: function() { return /* binding */ ZodMiniReadonly; },
28905 -/* harmony export */ ZodMiniRecord: function() { return /* binding */ ZodMiniRecord; },
28906 -/* harmony export */ ZodMiniSet: function() { return /* binding */ ZodMiniSet; },
28907 -/* harmony export */ ZodMiniString: function() { return /* binding */ ZodMiniString; },
28908 -/* harmony export */ ZodMiniStringFormat: function() { return /* binding */ ZodMiniStringFormat; },
28909 -/* harmony export */ ZodMiniSuccess: function() { return /* binding */ ZodMiniSuccess; },
28910 -/* harmony export */ ZodMiniSymbol: function() { return /* binding */ ZodMiniSymbol; },
28911 -/* harmony export */ ZodMiniTemplateLiteral: function() { return /* binding */ ZodMiniTemplateLiteral; },
28912 -/* harmony export */ ZodMiniTransform: function() { return /* binding */ ZodMiniTransform; },
28913 -/* harmony export */ ZodMiniTuple: function() { return /* binding */ ZodMiniTuple; },
28914 -/* harmony export */ ZodMiniType: function() { return /* binding */ ZodMiniType; },
28915 -/* harmony export */ ZodMiniULID: function() { return /* binding */ ZodMiniULID; },
28916 -/* harmony export */ ZodMiniURL: function() { return /* binding */ ZodMiniURL; },
28917 -/* harmony export */ ZodMiniUUID: function() { return /* binding */ ZodMiniUUID; },
28918 -/* harmony export */ ZodMiniUndefined: function() { return /* binding */ ZodMiniUndefined; },
28919 -/* harmony export */ ZodMiniUnion: function() { return /* binding */ ZodMiniUnion; },
28920 -/* harmony export */ ZodMiniUnknown: function() { return /* binding */ ZodMiniUnknown; },
28921 -/* harmony export */ ZodMiniVoid: function() { return /* binding */ ZodMiniVoid; },
28922 -/* harmony export */ ZodMiniXID: function() { return /* binding */ ZodMiniXID; },
28923 -/* harmony export */ _default: function() { return /* binding */ _default; },
28924 -/* harmony export */ any: function() { return /* binding */ any; },
28925 -/* harmony export */ array: function() { return /* binding */ array; },
28926 -/* harmony export */ base64: function() { return /* binding */ base64; },
28927 -/* harmony export */ base64url: function() { return /* binding */ base64url; },
28928 -/* harmony export */ bigint: function() { return /* binding */ bigint; },
28929 -/* harmony export */ boolean: function() { return /* binding */ boolean; },
28930 -/* harmony export */ "catch": function() { return /* binding */ _catch; },
28931 -/* harmony export */ catchall: function() { return /* binding */ catchall; },
28932 -/* harmony export */ check: function() { return /* binding */ check; },
28933 -/* harmony export */ cidrv4: function() { return /* binding */ cidrv4; },
28934 -/* harmony export */ cidrv6: function() { return /* binding */ cidrv6; },
28935 -/* harmony export */ cuid: function() { return /* binding */ cuid; },
28936 -/* harmony export */ cuid2: function() { return /* binding */ cuid2; },
28937 -/* harmony export */ custom: function() { return /* binding */ custom; },
28938 -/* harmony export */ date: function() { return /* binding */ date; },
28939 -/* harmony export */ discriminatedUnion: function() { return /* binding */ discriminatedUnion; },
28940 -/* harmony export */ e164: function() { return /* binding */ e164; },
28941 -/* harmony export */ email: function() { return /* binding */ email; },
28942 -/* harmony export */ emoji: function() { return /* binding */ emoji; },
28943 -/* harmony export */ "enum": function() { return /* binding */ _enum; },
28944 -/* harmony export */ extend: function() { return /* binding */ extend; },
28945 -/* harmony export */ file: function() { return /* binding */ file; },
28946 -/* harmony export */ float32: function() { return /* binding */ float32; },
28947 -/* harmony export */ float64: function() { return /* binding */ float64; },
28948 -/* harmony export */ guid: function() { return /* binding */ guid; },
28949 -/* harmony export */ "instanceof": function() { return /* binding */ _instanceof; },
28950 -/* harmony export */ int: function() { return /* binding */ int; },
28951 -/* harmony export */ int32: function() { return /* binding */ int32; },
28952 -/* harmony export */ int64: function() { return /* binding */ int64; },
28953 -/* harmony export */ intersection: function() { return /* binding */ intersection; },
28954 -/* harmony export */ ipv4: function() { return /* binding */ ipv4; },
28955 -/* harmony export */ ipv6: function() { return /* binding */ ipv6; },
28956 -/* harmony export */ json: function() { return /* binding */ json; },
28957 -/* harmony export */ jwt: function() { return /* binding */ jwt; },
28958 -/* harmony export */ keyof: function() { return /* binding */ keyof; },
28959 -/* harmony export */ ksuid: function() { return /* binding */ ksuid; },
28960 -/* harmony export */ lazy: function() { return /* binding */ _lazy; },
28961 -/* harmony export */ literal: function() { return /* binding */ literal; },
28962 -/* harmony export */ looseObject: function() { return /* binding */ looseObject; },
28963 -/* harmony export */ map: function() { return /* binding */ map; },
28964 -/* harmony export */ merge: function() { return /* binding */ merge; },
28965 -/* harmony export */ nan: function() { return /* binding */ nan; },
28966 -/* harmony export */ nanoid: function() { return /* binding */ nanoid; },
28967 -/* harmony export */ nativeEnum: function() { return /* binding */ nativeEnum; },
28968 -/* harmony export */ never: function() { return /* binding */ never; },
28969 -/* harmony export */ nonoptional: function() { return /* binding */ nonoptional; },
28970 -/* harmony export */ "null": function() { return /* binding */ _null; },
28971 -/* harmony export */ nullable: function() { return /* binding */ nullable; },
28972 -/* harmony export */ nullish: function() { return /* binding */ nullish; },
28973 -/* harmony export */ number: function() { return /* binding */ number; },
28974 -/* harmony export */ object: function() { return /* binding */ object; },
28975 -/* harmony export */ omit: function() { return /* binding */ omit; },
28976 -/* harmony export */ optional: function() { return /* binding */ optional; },
28977 -/* harmony export */ partial: function() { return /* binding */ partial; },
28978 -/* harmony export */ partialRecord: function() { return /* binding */ partialRecord; },
28979 -/* harmony export */ pick: function() { return /* binding */ pick; },
28980 -/* harmony export */ pipe: function() { return /* binding */ pipe; },
28981 -/* harmony export */ prefault: function() { return /* binding */ prefault; },
28982 -/* harmony export */ promise: function() { return /* binding */ promise; },
28983 -/* harmony export */ readonly: function() { return /* binding */ readonly; },
28984 -/* harmony export */ record: function() { return /* binding */ record; },
28985 -/* harmony export */ refine: function() { return /* binding */ refine; },
28986 -/* harmony export */ required: function() { return /* binding */ required; },
28987 -/* harmony export */ set: function() { return /* binding */ set; },
28988 -/* harmony export */ strictObject: function() { return /* binding */ strictObject; },
28989 -/* harmony export */ string: function() { return /* binding */ string; },
28990 -/* harmony export */ stringFormat: function() { return /* binding */ stringFormat; },
28991 -/* harmony export */ stringbool: function() { return /* binding */ stringbool; },
28992 -/* harmony export */ success: function() { return /* binding */ success; },
28993 -/* harmony export */ symbol: function() { return /* binding */ symbol; },
28994 -/* harmony export */ templateLiteral: function() { return /* binding */ templateLiteral; },
28995 -/* harmony export */ transform: function() { return /* binding */ transform; },
28996 -/* harmony export */ tuple: function() { return /* binding */ tuple; },
28997 -/* harmony export */ uint32: function() { return /* binding */ uint32; },
28998 -/* harmony export */ uint64: function() { return /* binding */ uint64; },
28999 -/* harmony export */ ulid: function() { return /* binding */ ulid; },
29000 -/* harmony export */ undefined: function() { return /* binding */ _undefined; },
29001 -/* harmony export */ union: function() { return /* binding */ union; },
29002 -/* harmony export */ unknown: function() { return /* binding */ unknown; },
29003 -/* harmony export */ url: function() { return /* binding */ url; },
29004 -/* harmony export */ uuid: function() { return /* binding */ uuid; },
29005 -/* harmony export */ uuidv4: function() { return /* binding */ uuidv4; },
29006 -/* harmony export */ uuidv6: function() { return /* binding */ uuidv6; },
29007 -/* harmony export */ uuidv7: function() { return /* binding */ uuidv7; },
29008 -/* harmony export */ "void": function() { return /* binding */ _void; },
29009 -/* harmony export */ xid: function() { return /* binding */ xid; }
29010 -/* harmony export */ });
29011 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/core.js");
29012 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/schemas.js");
29013 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/checks.js");
29014 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/util.js");
29015 -/* harmony import */ var _core_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../core/index.js */ "./node_modules/zod/v4/core/api.js");
29016 -/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parse.js */ "./node_modules/zod/v4/core/parse.js");
29017 -
29018 -
29019 -
29020 -const ZodMiniType = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniType", (inst, def) => {
29021 - if (!inst._zod)
29022 - throw new Error("Uninitialized schema in ZodMiniType.");
29023 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodType.init(inst, def);
29024 - inst.def = def;
29025 - inst.parse = (data, params) => _parse_js__WEBPACK_IMPORTED_MODULE_5__.parse(inst, data, params, { callee: inst.parse });
29026 - inst.safeParse = (data, params) => _parse_js__WEBPACK_IMPORTED_MODULE_5__.safeParse(inst, data, params);
29027 - inst.parseAsync = async (data, params) => _parse_js__WEBPACK_IMPORTED_MODULE_5__.parseAsync(inst, data, params, { callee: inst.parseAsync });
29028 - inst.safeParseAsync = async (data, params) => _parse_js__WEBPACK_IMPORTED_MODULE_5__.safeParseAsync(inst, data, params);
29029 - inst.check = (...checks) => {
29030 - return inst.clone({
29031 - ...def,
29032 - checks: [
29033 - ...(def.checks ?? []),
29034 - ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch),
29035 - ],
29036 - }
29037 - // { parent: true }
29038 - );
29039 - };
29040 - inst.clone = (_def, params) => _core_index_js__WEBPACK_IMPORTED_MODULE_3__.clone(inst, _def, params);
29041 - inst.brand = () => inst;
29042 - inst.register = ((reg, meta) => {
29043 - reg.add(inst, meta);
29044 - return inst;
29045 - });
29046 -});
29047 -const ZodMiniString = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniString", (inst, def) => {
29048 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodString.init(inst, def);
29049 - ZodMiniType.init(inst, def);
29050 -});
29051 -function string(params) {
29052 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._string(ZodMiniString, params);
29053 -}
29054 -const ZodMiniStringFormat = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniStringFormat", (inst, def) => {
29055 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodStringFormat.init(inst, def);
29056 - ZodMiniString.init(inst, def);
29057 -});
29058 -const ZodMiniEmail = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniEmail", (inst, def) => {
29059 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodEmail.init(inst, def);
29060 - ZodMiniStringFormat.init(inst, def);
29061 -});
29062 -function email(params) {
29063 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._email(ZodMiniEmail, params);
29064 -}
29065 -const ZodMiniGUID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniGUID", (inst, def) => {
29066 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodGUID.init(inst, def);
29067 - ZodMiniStringFormat.init(inst, def);
29068 -});
29069 -function guid(params) {
29070 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._guid(ZodMiniGUID, params);
29071 -}
29072 -const ZodMiniUUID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniUUID", (inst, def) => {
29073 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodUUID.init(inst, def);
29074 - ZodMiniStringFormat.init(inst, def);
29075 -});
29076 -function uuid(params) {
29077 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._uuid(ZodMiniUUID, params);
29078 -}
29079 -function uuidv4(params) {
29080 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._uuidv4(ZodMiniUUID, params);
29081 -}
29082 -// ZodMiniUUIDv6
29083 -function uuidv6(params) {
29084 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._uuidv6(ZodMiniUUID, params);
29085 -}
29086 -// ZodMiniUUIDv7
29087 -function uuidv7(params) {
29088 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._uuidv7(ZodMiniUUID, params);
29089 -}
29090 -const ZodMiniURL = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniURL", (inst, def) => {
29091 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodURL.init(inst, def);
29092 - ZodMiniStringFormat.init(inst, def);
29093 -});
29094 -function url(params) {
29095 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._url(ZodMiniURL, params);
29096 -}
29097 -const ZodMiniEmoji = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniEmoji", (inst, def) => {
29098 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodEmoji.init(inst, def);
29099 - ZodMiniStringFormat.init(inst, def);
29100 -});
29101 -function emoji(params) {
29102 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._emoji(ZodMiniEmoji, params);
29103 -}
29104 -const ZodMiniNanoID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniNanoID", (inst, def) => {
29105 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNanoID.init(inst, def);
29106 - ZodMiniStringFormat.init(inst, def);
29107 -});
29108 -function nanoid(params) {
29109 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._nanoid(ZodMiniNanoID, params);
29110 -}
29111 -const ZodMiniCUID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniCUID", (inst, def) => {
29112 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCUID.init(inst, def);
29113 - ZodMiniStringFormat.init(inst, def);
29114 -});
29115 -function cuid(params) {
29116 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._cuid(ZodMiniCUID, params);
29117 -}
29118 -const ZodMiniCUID2 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniCUID2", (inst, def) => {
29119 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCUID2.init(inst, def);
29120 - ZodMiniStringFormat.init(inst, def);
29121 -});
29122 -function cuid2(params) {
29123 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._cuid2(ZodMiniCUID2, params);
29124 -}
29125 -const ZodMiniULID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniULID", (inst, def) => {
29126 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodULID.init(inst, def);
29127 - ZodMiniStringFormat.init(inst, def);
29128 -});
29129 -function ulid(params) {
29130 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._ulid(ZodMiniULID, params);
29131 -}
29132 -const ZodMiniXID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniXID", (inst, def) => {
29133 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodXID.init(inst, def);
29134 - ZodMiniStringFormat.init(inst, def);
29135 -});
29136 -function xid(params) {
29137 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._xid(ZodMiniXID, params);
29138 -}
29139 -const ZodMiniKSUID = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniKSUID", (inst, def) => {
29140 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodKSUID.init(inst, def);
29141 - ZodMiniStringFormat.init(inst, def);
29142 -});
29143 -function ksuid(params) {
29144 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._ksuid(ZodMiniKSUID, params);
29145 -}
29146 -const ZodMiniIPv4 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniIPv4", (inst, def) => {
29147 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodIPv4.init(inst, def);
29148 - ZodMiniStringFormat.init(inst, def);
29149 -});
29150 -function ipv4(params) {
29151 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._ipv4(ZodMiniIPv4, params);
29152 -}
29153 -const ZodMiniIPv6 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniIPv6", (inst, def) => {
29154 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodIPv6.init(inst, def);
29155 - ZodMiniStringFormat.init(inst, def);
29156 -});
29157 -function ipv6(params) {
29158 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._ipv6(ZodMiniIPv6, params);
29159 -}
29160 -const ZodMiniCIDRv4 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniCIDRv4", (inst, def) => {
29161 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCIDRv4.init(inst, def);
29162 - ZodMiniStringFormat.init(inst, def);
29163 -});
29164 -function cidrv4(params) {
29165 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._cidrv4(ZodMiniCIDRv4, params);
29166 -}
29167 -const ZodMiniCIDRv6 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniCIDRv6", (inst, def) => {
29168 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCIDRv6.init(inst, def);
29169 - ZodMiniStringFormat.init(inst, def);
29170 -});
29171 -function cidrv6(params) {
29172 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._cidrv6(ZodMiniCIDRv6, params);
29173 -}
29174 -const ZodMiniBase64 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniBase64", (inst, def) => {
29175 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBase64.init(inst, def);
29176 - ZodMiniStringFormat.init(inst, def);
29177 -});
29178 -function base64(params) {
29179 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._base64(ZodMiniBase64, params);
29180 -}
29181 -const ZodMiniBase64URL = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniBase64URL", (inst, def) => {
29182 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBase64URL.init(inst, def);
29183 - ZodMiniStringFormat.init(inst, def);
29184 -});
29185 -function base64url(params) {
29186 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._base64url(ZodMiniBase64URL, params);
29187 -}
29188 -const ZodMiniE164 = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniE164", (inst, def) => {
29189 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodE164.init(inst, def);
29190 - ZodMiniStringFormat.init(inst, def);
29191 -});
29192 -function e164(params) {
29193 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._e164(ZodMiniE164, params);
29194 -}
29195 -const ZodMiniJWT = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniJWT", (inst, def) => {
29196 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodJWT.init(inst, def);
29197 - ZodMiniStringFormat.init(inst, def);
29198 -});
29199 -function jwt(params) {
29200 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._jwt(ZodMiniJWT, params);
29201 -}
29202 -const ZodMiniCustomStringFormat = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniCustomStringFormat", (inst, def) => {
29203 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCustomStringFormat.init(inst, def);
29204 - ZodMiniStringFormat.init(inst, def);
29205 -});
29206 -function stringFormat(format, fnOrRegex, _params = {}) {
29207 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params);
29208 -}
29209 -const ZodMiniNumber = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniNumber", (inst, def) => {
29210 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNumber.init(inst, def);
29211 - ZodMiniType.init(inst, def);
29212 -});
29213 -function number(params) {
29214 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._number(ZodMiniNumber, params);
29215 -}
29216 -const ZodMiniNumberFormat = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniNumberFormat", (inst, def) => {
29217 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNumberFormat.init(inst, def);
29218 - ZodMiniNumber.init(inst, def);
29219 -});
29220 -// int
29221 -function int(params) {
29222 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._int(ZodMiniNumberFormat, params);
29223 -}
29224 -// float32
29225 -function float32(params) {
29226 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._float32(ZodMiniNumberFormat, params);
29227 -}
29228 -// float64
29229 -function float64(params) {
29230 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._float64(ZodMiniNumberFormat, params);
29231 -}
29232 -// int32
29233 -function int32(params) {
29234 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._int32(ZodMiniNumberFormat, params);
29235 -}
29236 -// uint32
29237 -function uint32(params) {
29238 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._uint32(ZodMiniNumberFormat, params);
29239 -}
29240 -const ZodMiniBoolean = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniBoolean", (inst, def) => {
29241 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBoolean.init(inst, def);
29242 - ZodMiniType.init(inst, def);
29243 -});
29244 -function boolean(params) {
29245 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._boolean(ZodMiniBoolean, params);
29246 -}
29247 -const ZodMiniBigInt = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniBigInt", (inst, def) => {
29248 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBigInt.init(inst, def);
29249 - ZodMiniType.init(inst, def);
29250 -});
29251 -function bigint(params) {
29252 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._bigint(ZodMiniBigInt, params);
29253 -}
29254 -const ZodMiniBigIntFormat = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniBigIntFormat", (inst, def) => {
29255 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodBigIntFormat.init(inst, def);
29256 - ZodMiniBigInt.init(inst, def);
29257 -});
29258 -// int64
29259 -function int64(params) {
29260 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._int64(ZodMiniBigIntFormat, params);
29261 -}
29262 -// uint64
29263 -function uint64(params) {
29264 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._uint64(ZodMiniBigIntFormat, params);
29265 -}
29266 -const ZodMiniSymbol = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniSymbol", (inst, def) => {
29267 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodSymbol.init(inst, def);
29268 - ZodMiniType.init(inst, def);
29269 -});
29270 -function symbol(params) {
29271 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._symbol(ZodMiniSymbol, params);
29272 -}
29273 -const ZodMiniUndefined = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniUndefined", (inst, def) => {
29274 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodUndefined.init(inst, def);
29275 - ZodMiniType.init(inst, def);
29276 -});
29277 -function _undefined(params) {
29278 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._undefined(ZodMiniUndefined, params);
29279 -}
29280 -
29281 -const ZodMiniNull = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniNull", (inst, def) => {
29282 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNull.init(inst, def);
29283 - ZodMiniType.init(inst, def);
29284 -});
29285 -function _null(params) {
29286 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._null(ZodMiniNull, params);
29287 -}
29288 -
29289 -const ZodMiniAny = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniAny", (inst, def) => {
29290 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodAny.init(inst, def);
29291 - ZodMiniType.init(inst, def);
29292 -});
29293 -function any() {
29294 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._any(ZodMiniAny);
29295 -}
29296 -const ZodMiniUnknown = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniUnknown", (inst, def) => {
29297 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodUnknown.init(inst, def);
29298 - ZodMiniType.init(inst, def);
29299 -});
29300 -function unknown() {
29301 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._unknown(ZodMiniUnknown);
29302 -}
29303 -const ZodMiniNever = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniNever", (inst, def) => {
29304 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNever.init(inst, def);
29305 - ZodMiniType.init(inst, def);
29306 -});
29307 -function never(params) {
29308 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._never(ZodMiniNever, params);
29309 -}
29310 -const ZodMiniVoid = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniVoid", (inst, def) => {
29311 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodVoid.init(inst, def);
29312 - ZodMiniType.init(inst, def);
29313 -});
29314 -function _void(params) {
29315 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._void(ZodMiniVoid, params);
29316 -}
29317 -
29318 -const ZodMiniDate = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniDate", (inst, def) => {
29319 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodDate.init(inst, def);
29320 - ZodMiniType.init(inst, def);
29321 -});
29322 -function date(params) {
29323 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._date(ZodMiniDate, params);
29324 -}
29325 -const ZodMiniArray = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniArray", (inst, def) => {
29326 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodArray.init(inst, def);
29327 - ZodMiniType.init(inst, def);
29328 -});
29329 -function array(element, params) {
29330 - return new ZodMiniArray({
29331 - type: "array",
29332 - element: element,
29333 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29334 - });
29335 -}
29336 -// .keyof
29337 -function keyof(schema) {
29338 - const shape = schema._zod.def.shape;
29339 - return literal(Object.keys(shape));
29340 -}
29341 -const ZodMiniObject = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniObject", (inst, def) => {
29342 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodObject.init(inst, def);
29343 - ZodMiniType.init(inst, def);
29344 - _core_index_js__WEBPACK_IMPORTED_MODULE_3__.defineLazy(inst, "shape", () => def.shape);
29345 -});
29346 -function object(shape, params) {
29347 - const def = {
29348 - type: "object",
29349 - get shape() {
29350 - _core_index_js__WEBPACK_IMPORTED_MODULE_3__.assignProp(this, "shape", { ...shape });
29351 - return this.shape;
29352 - },
29353 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29354 - };
29355 - return new ZodMiniObject(def);
29356 -}
29357 -// strictObject
29358 -function strictObject(shape, params) {
29359 - return new ZodMiniObject({
29360 - type: "object",
29361 - // shape: shape as core.$ZodLooseShape,
29362 - get shape() {
29363 - _core_index_js__WEBPACK_IMPORTED_MODULE_3__.assignProp(this, "shape", { ...shape });
29364 - return this.shape;
29365 - },
29366 - catchall: never(),
29367 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29368 - });
29369 -}
29370 -// looseObject
29371 -function looseObject(shape, params) {
29372 - return new ZodMiniObject({
29373 - type: "object",
29374 - // shape: shape as core.$ZodLooseShape,
29375 - get shape() {
29376 - _core_index_js__WEBPACK_IMPORTED_MODULE_3__.assignProp(this, "shape", { ...shape });
29377 - return this.shape;
29378 - },
29379 - // get optional() {
29380 - // return util.optionalKeys(shape);
29381 - // },
29382 - catchall: unknown(),
29383 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29384 - });
29385 -}
29386 -// object methods
29387 -function extend(schema, shape) {
29388 - return _core_index_js__WEBPACK_IMPORTED_MODULE_3__.extend(schema, shape);
29389 -}
29390 -function merge(schema, shape) {
29391 - return _core_index_js__WEBPACK_IMPORTED_MODULE_3__.extend(schema, shape);
29392 -}
29393 -function pick(schema, mask) {
29394 - return _core_index_js__WEBPACK_IMPORTED_MODULE_3__.pick(schema, mask);
29395 -}
29396 -// .omit
29397 -function omit(schema, mask) {
29398 - return _core_index_js__WEBPACK_IMPORTED_MODULE_3__.omit(schema, mask);
29399 -}
29400 -function partial(schema, mask) {
29401 - return _core_index_js__WEBPACK_IMPORTED_MODULE_3__.partial(ZodMiniOptional, schema, mask);
29402 -}
29403 -function required(schema, mask) {
29404 - return _core_index_js__WEBPACK_IMPORTED_MODULE_3__.required(ZodMiniNonOptional, schema, mask);
29405 -}
29406 -function catchall(inst, catchall) {
29407 - return inst.clone({ ...inst._zod.def, catchall: catchall });
29408 -}
29409 -const ZodMiniUnion = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniUnion", (inst, def) => {
29410 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodUnion.init(inst, def);
29411 - ZodMiniType.init(inst, def);
29412 -});
29413 -function union(options, params) {
29414 - return new ZodMiniUnion({
29415 - type: "union",
29416 - options: options,
29417 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29418 - });
29419 -}
29420 -const ZodMiniDiscriminatedUnion = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniDiscriminatedUnion", (inst, def) => {
29421 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodDiscriminatedUnion.init(inst, def);
29422 - ZodMiniType.init(inst, def);
29423 -});
29424 -function discriminatedUnion(discriminator, options, params) {
29425 - return new ZodMiniDiscriminatedUnion({
29426 - type: "union",
29427 - options,
29428 - discriminator,
29429 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29430 - });
29431 -}
29432 -const ZodMiniIntersection = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniIntersection", (inst, def) => {
29433 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodIntersection.init(inst, def);
29434 - ZodMiniType.init(inst, def);
29435 -});
29436 -function intersection(left, right) {
29437 - return new ZodMiniIntersection({
29438 - type: "intersection",
29439 - left: left,
29440 - right: right,
29441 - });
29442 -}
29443 -const ZodMiniTuple = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniTuple", (inst, def) => {
29444 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodTuple.init(inst, def);
29445 - ZodMiniType.init(inst, def);
29446 -});
29447 -function tuple(items, _paramsOrRest, _params) {
29448 - const hasRest = _paramsOrRest instanceof _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodType;
29449 - const params = hasRest ? _params : _paramsOrRest;
29450 - const rest = hasRest ? _paramsOrRest : null;
29451 - return new ZodMiniTuple({
29452 - type: "tuple",
29453 - items: items,
29454 - rest,
29455 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29456 - });
29457 -}
29458 -const ZodMiniRecord = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniRecord", (inst, def) => {
29459 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodRecord.init(inst, def);
29460 - ZodMiniType.init(inst, def);
29461 -});
29462 -function record(keyType, valueType, params) {
29463 - return new ZodMiniRecord({
29464 - type: "record",
29465 - keyType,
29466 - valueType: valueType,
29467 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29468 - });
29469 -}
29470 -function partialRecord(keyType, valueType, params) {
29471 - return new ZodMiniRecord({
29472 - type: "record",
29473 - keyType: union([keyType, never()]),
29474 - valueType: valueType,
29475 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29476 - });
29477 -}
29478 -const ZodMiniMap = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniMap", (inst, def) => {
29479 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodMap.init(inst, def);
29480 - ZodMiniType.init(inst, def);
29481 -});
29482 -function map(keyType, valueType, params) {
29483 - return new ZodMiniMap({
29484 - type: "map",
29485 - keyType: keyType,
29486 - valueType: valueType,
29487 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29488 - });
29489 -}
29490 -const ZodMiniSet = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniSet", (inst, def) => {
29491 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodSet.init(inst, def);
29492 - ZodMiniType.init(inst, def);
29493 -});
29494 -function set(valueType, params) {
29495 - return new ZodMiniSet({
29496 - type: "set",
29497 - valueType: valueType,
29498 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29499 - });
29500 -}
29501 -const ZodMiniEnum = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniEnum", (inst, def) => {
29502 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodEnum.init(inst, def);
29503 - ZodMiniType.init(inst, def);
29504 -});
29505 -function _enum(values, params) {
29506 - const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
29507 - return new ZodMiniEnum({
29508 - type: "enum",
29509 - entries,
29510 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29511 - });
29512 -}
29513 -
29514 -/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
29515 - *
29516 - * ```ts
29517 - * enum Colors { red, green, blue }
29518 - * z.enum(Colors);
29519 - * ```
29520 - */
29521 -function nativeEnum(entries, params) {
29522 - return new ZodMiniEnum({
29523 - type: "enum",
29524 - entries,
29525 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29526 - });
29527 -}
29528 -const ZodMiniLiteral = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniLiteral", (inst, def) => {
29529 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodLiteral.init(inst, def);
29530 - ZodMiniType.init(inst, def);
29531 -});
29532 -function literal(value, params) {
29533 - return new ZodMiniLiteral({
29534 - type: "literal",
29535 - values: Array.isArray(value) ? value : [value],
29536 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29537 - });
29538 -}
29539 -const ZodMiniFile = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniFile", (inst, def) => {
29540 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodFile.init(inst, def);
29541 - ZodMiniType.init(inst, def);
29542 -});
29543 -function file(params) {
29544 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._file(ZodMiniFile, params);
29545 -}
29546 -const ZodMiniTransform = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniTransform", (inst, def) => {
29547 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodTransform.init(inst, def);
29548 - ZodMiniType.init(inst, def);
29549 -});
29550 -function transform(fn) {
29551 - return new ZodMiniTransform({
29552 - type: "transform",
29553 - transform: fn,
29554 - });
29555 -}
29556 -const ZodMiniOptional = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniOptional", (inst, def) => {
29557 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodOptional.init(inst, def);
29558 - ZodMiniType.init(inst, def);
29559 -});
29560 -function optional(innerType) {
29561 - return new ZodMiniOptional({
29562 - type: "optional",
29563 - innerType: innerType,
29564 - });
29565 -}
29566 -const ZodMiniNullable = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniNullable", (inst, def) => {
29567 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNullable.init(inst, def);
29568 - ZodMiniType.init(inst, def);
29569 -});
29570 -function nullable(innerType) {
29571 - return new ZodMiniNullable({
29572 - type: "nullable",
29573 - innerType: innerType,
29574 - });
29575 -}
29576 -// nullish
29577 -function nullish(innerType) {
29578 - return optional(nullable(innerType));
29579 -}
29580 -const ZodMiniDefault = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniDefault", (inst, def) => {
29581 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodDefault.init(inst, def);
29582 - ZodMiniType.init(inst, def);
29583 -});
29584 -function _default(innerType, defaultValue) {
29585 - return new ZodMiniDefault({
29586 - type: "default",
29587 - innerType: innerType,
29588 - get defaultValue() {
29589 - return typeof defaultValue === "function" ? defaultValue() : defaultValue;
29590 - },
29591 - });
29592 -}
29593 -const ZodMiniPrefault = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniPrefault", (inst, def) => {
29594 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodPrefault.init(inst, def);
29595 - ZodMiniType.init(inst, def);
29596 -});
29597 -function prefault(innerType, defaultValue) {
29598 - return new ZodMiniPrefault({
29599 - type: "prefault",
29600 - innerType: innerType,
29601 - get defaultValue() {
29602 - return typeof defaultValue === "function" ? defaultValue() : defaultValue;
29603 - },
29604 - });
29605 -}
29606 -const ZodMiniNonOptional = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniNonOptional", (inst, def) => {
29607 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNonOptional.init(inst, def);
29608 - ZodMiniType.init(inst, def);
29609 -});
29610 -function nonoptional(innerType, params) {
29611 - return new ZodMiniNonOptional({
29612 - type: "nonoptional",
29613 - innerType: innerType,
29614 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29615 - });
29616 -}
29617 -const ZodMiniSuccess = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniSuccess", (inst, def) => {
29618 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodSuccess.init(inst, def);
29619 - ZodMiniType.init(inst, def);
29620 -});
29621 -function success(innerType) {
29622 - return new ZodMiniSuccess({
29623 - type: "success",
29624 - innerType: innerType,
29625 - });
29626 -}
29627 -const ZodMiniCatch = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniCatch", (inst, def) => {
29628 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCatch.init(inst, def);
29629 - ZodMiniType.init(inst, def);
29630 -});
29631 -function _catch(innerType, catchValue) {
29632 - return new ZodMiniCatch({
29633 - type: "catch",
29634 - innerType: innerType,
29635 - catchValue: (typeof catchValue === "function" ? catchValue : () => catchValue),
29636 - });
29637 -}
29638 -
29639 -const ZodMiniNaN = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniNaN", (inst, def) => {
29640 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodNaN.init(inst, def);
29641 - ZodMiniType.init(inst, def);
29642 -});
29643 -function nan(params) {
29644 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._nan(ZodMiniNaN, params);
29645 -}
29646 -const ZodMiniPipe = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniPipe", (inst, def) => {
29647 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodPipe.init(inst, def);
29648 - ZodMiniType.init(inst, def);
29649 -});
29650 -function pipe(in_, out) {
29651 - return new ZodMiniPipe({
29652 - type: "pipe",
29653 - in: in_,
29654 - out: out,
29655 - });
29656 -}
29657 -const ZodMiniReadonly = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniReadonly", (inst, def) => {
29658 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodReadonly.init(inst, def);
29659 - ZodMiniType.init(inst, def);
29660 -});
29661 -function readonly(innerType) {
29662 - return new ZodMiniReadonly({
29663 - type: "readonly",
29664 - innerType: innerType,
29665 - });
29666 -}
29667 -const ZodMiniTemplateLiteral = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniTemplateLiteral", (inst, def) => {
29668 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodTemplateLiteral.init(inst, def);
29669 - ZodMiniType.init(inst, def);
29670 -});
29671 -function templateLiteral(parts, params) {
29672 - return new ZodMiniTemplateLiteral({
29673 - type: "template_literal",
29674 - parts,
29675 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29676 - });
29677 -}
29678 -const ZodMiniLazy = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniLazy", (inst, def) => {
29679 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodLazy.init(inst, def);
29680 - ZodMiniType.init(inst, def);
29681 -});
29682 -// export function lazy<T extends object>(getter: () => T): T {
29683 -// return util.createTransparentProxy<T>(getter);
29684 -// }
29685 -function _lazy(getter) {
29686 - return new ZodMiniLazy({
29687 - type: "lazy",
29688 - getter: getter,
29689 - });
29690 -}
29691 -
29692 -const ZodMiniPromise = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniPromise", (inst, def) => {
29693 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodPromise.init(inst, def);
29694 - ZodMiniType.init(inst, def);
29695 -});
29696 -function promise(innerType) {
29697 - return new ZodMiniPromise({
29698 - type: "promise",
29699 - innerType: innerType,
29700 - });
29701 -}
29702 -const ZodMiniCustom = /*@__PURE__*/ _core_index_js__WEBPACK_IMPORTED_MODULE_0__.$constructor("ZodMiniCustom", (inst, def) => {
29703 - _core_index_js__WEBPACK_IMPORTED_MODULE_1__.$ZodCustom.init(inst, def);
29704 - ZodMiniType.init(inst, def);
29705 -});
29706 -// custom checks
29707 -function check(fn, params) {
29708 - const ch = new _core_index_js__WEBPACK_IMPORTED_MODULE_2__.$ZodCheck({
29709 - check: "custom",
29710 - ..._core_index_js__WEBPACK_IMPORTED_MODULE_3__.normalizeParams(params),
29711 - });
29712 - ch._zod.check = fn;
29713 - return ch;
29714 -}
29715 -// ZodCustom
29716 -// custom schema
29717 -function custom(fn, _params) {
29718 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._custom(ZodMiniCustom, fn ?? (() => true), _params);
29719 -}
29720 -// refine
29721 -function refine(fn, _params = {}) {
29722 - return _core_index_js__WEBPACK_IMPORTED_MODULE_4__._refine(ZodMiniCustom, fn, _params);
29723 -}
29724 -// instanceof
29725 -class Class {
29726 - constructor(..._args) { }
29727 -}
29728 -function _instanceof(cls, params = {
29729 - error: `Input not instance of ${cls.name}`,
29730 -}) {
29731 - const inst = custom((data) => data instanceof cls, params);
29732 - inst._zod.bag.Class = cls;
29733 - return inst;
29734 -}
29735 -
29736 -// stringbool
29737 -const stringbool = (...args) => _core_index_js__WEBPACK_IMPORTED_MODULE_4__._stringbool({
29738 - Pipe: ZodMiniPipe,
29739 - Boolean: ZodMiniBoolean,
29740 - String: ZodMiniString,
29741 - Transform: ZodMiniTransform,
29742 -}, ...args);
29743 -function json() {
29744 - const jsonSchema = _lazy(() => {
29745 - return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);
29746 - });
29747 - return jsonSchema;
29748 -}
29749 -
29750 -
29751 -/***/ }),
29752 -
29753 -/***/ "./packages/node_modules/@elementor-external/angie-sdk/dist/index.js":
29754 -/*!***************************************************************************!*\
29755 - !*** ./packages/node_modules/@elementor-external/angie-sdk/dist/index.js ***!
29756 - \***************************************************************************/
29757 -/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
29758 -
29759 -__webpack_require__.r(__webpack_exports__);
29760 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
29761 -/* harmony export */ ANGIE_EXTENDED_TIMEOUT: function() { return /* binding */ Kt; },
29762 -/* harmony export */ ANGIE_MODEL_PREFERENCES: function() { return /* binding */ Ft; },
29763 -/* harmony export */ ANGIE_REQUIRED_RESOURCES: function() { return /* binding */ Wt; },
29764 -/* harmony export */ ANGIE_SIDEBAR_STATE_OPEN: function() { return /* binding */ Et; },
29765 -/* harmony export */ AngieDetector: function() { return /* binding */ k; },
29766 -/* harmony export */ AngieLocalServerTransport: function() { return /* binding */ m; },
29767 -/* harmony export */ AngieMCPTransport: function() { return /* binding */ w; },
29768 -/* harmony export */ AngieMcpSdk: function() { return /* binding */ jt; },
29769 -/* harmony export */ AngieRemoteServerTransport: function() { return /* binding */ f; },
29770 -/* harmony export */ AngieServerType: function() { return /* binding */ y; },
29771 -/* harmony export */ BrowserContextTransport: function() { return /* binding */ I; },
29772 -/* harmony export */ ClientManager: function() { return /* binding */ T; },
29773 -/* harmony export */ DEFAULT_CONTAINER_ID: function() { return /* binding */ R; },
29774 -/* harmony export */ HostEventType: function() { return /* binding */ b; },
29775 -/* harmony export */ HostLocalStorageEventType: function() { return /* binding */ v; },
29776 -/* harmony export */ MCP_READONLY: function() { return /* binding */ Jt; },
29777 -/* harmony export */ McpAppDisplayMode: function() { return /* binding */ Bt; },
29778 -/* harmony export */ MessageEventType: function() { return /* binding */ S; },
29779 -/* harmony export */ RegistrationQueue: function() { return /* binding */ Ht; },
29780 -/* harmony export */ applyWidth: function() { return /* binding */ Pt; },
29781 -/* harmony export */ clearReferrerRedirect: function() { return /* binding */ gt; },
29782 -/* harmony export */ disableNavigationPrevention: function() { return /* binding */ Nt; },
29783 -/* harmony export */ executeReferrerRedirect: function() { return /* binding */ ut; },
29784 -/* harmony export */ getAngieIframe: function() { return /* binding */ p; },
29785 -/* harmony export */ getAngieSidebarSavedState: function() { return /* binding */ Tt; },
29786 -/* harmony export */ getReferrerRedirect: function() { return /* binding */ lt; },
29787 -/* harmony export */ initAngieSidebar: function() { return /* binding */ Ut; },
29788 -/* harmony export */ initializeResize: function() { return /* binding */ Ot; },
29789 -/* harmony export */ loadState: function() { return /* binding */ Ct; },
29790 -/* harmony export */ loadWidth: function() { return /* binding */ It; },
29791 -/* harmony export */ navigateAngieIframe: function() { return /* binding */ zt; },
29792 -/* harmony export */ saveState: function() { return /* binding */ Rt; },
29793 -/* harmony export */ saveWidth: function() { return /* binding */ At; },
29794 -/* harmony export */ setReferrerRedirect: function() { return /* binding */ dt; },
29795 -/* harmony export */ toggleAngieSidebar: function() { return /* binding */ wt; },
29796 -/* harmony export */ waitForDocumentReady: function() { return /* binding */ ft; }
29797 -/* harmony export */ });
29798 -/* harmony import */ var _modelcontextprotocol_sdk_types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @modelcontextprotocol/sdk/types.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");
29799 -const t={none:0,error:1,warn:2,info:3,debug:4},i={error:"error",warn:"warn",info:"info",log:"info",debug:"debug"},s=(e,i)=>t[e]<=t[i],r=e=>"string"==typeof e?e:JSON.stringify(e),n=(e,t)=>`${r(e)} > ${r(t)}`,o=(e,t)=>{let i=`[${r(e)}]`;return typeof window<"u"?{text:`%c${i}`,style:`color: ${t.color||"#00bcd4"}; font-weight: bold;`}:{text:i}},a=(e,t,r,n)=>(...a)=>{if(!s(i[e],n()))return;if(!t)return void console[e](...a);let{text:c,style:d}=o(t,r);d?console[e](c,d,...a):console[e](c,...a)},c=(e,t)=>{let i=t.logLevel??"debug",s=()=>i;return{log:a("log",e,t,s),info:a("info",e,t,s),warn:a("warn",e,t,s),error:a("error",e,t,s),debug:a("debug",e,t,s),setLogLevel:e=>{i=e},extend:s=>c(e?n(e,s):s,{...t,logLevel:i})}},d=(e,t)=>c(e,{color:"#00bcd4",logLevel:"debug",...t}),l=d("angie-sdk",{color:"#00BCD4",logLevel:"error"}),g=e=>l.extend(e),h=g("iframe-utils");let u=null;const p=()=>(u&&document.contains(u)||(u=document.querySelector('iframe[src*="angie/"]')),u),_=(e,t)=>{h.log("postMessageToAngieIframe",e,t);const i=p();if(!i?.contentWindow)return!1;const s=t||(()=>{const e=p();if(!e)return null;try{return new URL(e.src).origin}catch(e){return h.error("Error parsing iframe URL:",e),null}})();return s?(i.contentWindow.postMessage(e,s),!0):(h.error("Could not determine target origin for Angie iframe"),!1)};var w,m,f,y,S,v,b;!function(e){e.POST_MESSAGE="postMessage"}(w||(w={})),function(e){e.POST_MESSAGE="postMessage"}(m||(m={})),function(e){e.STREAMABLE_HTTP="streamableHttp",e.SSE="sse"}(f||(f={})),function(e){e.LOCAL="local",e.REMOTE="remote"}(y||(y={})),function(e){e.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",e.SDK_ANGIE_REFRESH_PING="sdk-angie-refresh-ping",e.SDK_ANGIE_ALL_SERVERS_REGISTERED="sdk-angie-all-servers-registered",e.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",e.SDK_REQUEST_INIT_SERVER="sdk-request-init-server",e.SDK_TRIGGER_ANGIE="sdk-trigger-angie",e.SDK_TRIGGER_ANGIE_RESPONSE="sdk-trigger-angie-response",e.ANGIE_SIDEBAR_RESIZED="angie-sidebar-resized",e.ANGIE_SIDEBAR_TOGGLED="angie-sidebar-toggled",e.ANGIE_CHAT_TOGGLE="angie-chat-toggle",e.ANGIE_STUDIO_TOGGLE="angie-studio-toggle",e.ANGIE_NAVIGATE_TO_URL="angie/navigate-to-url",e.ANGIE_PAGE_RELOAD="angie/page-reload",e.ANGIE_DISABLE_NAVIGATION_PREVENTION="angie/disable-navigation-prevention",e.ANGIE_NAVIGATE_AFTER_RESPONSE="angie/navigate-after-response"}(S||(S={})),function(e){e.SET="ANGIE_SET_LOCALSTORAGE",e.GET="ANGIE_GET_LOCALSTORAGE"}(v||(v={})),function(e){e.RESET_HASH="reset-hash",e.HOST_READY="host/ready",e.ANGIE_LOADED="angie/loaded",e.ANGIE_READY="angie/ready"}(b||(b={}));const E=g("angie-detector");class k{isAngieReady=!1;readyPromise;readyResolve;constructor(){if(this.readyPromise=new Promise(e=>{this.readyResolve=e}),"undefined"==typeof window)return;let e=0;const t=()=>{if(this.isAngieReady||e>=500)return void(!this.isAngieReady&&e>=500&&this.handleDetectionTimeout());const i=new MessageChannel;i.port1.onmessage=e=>{this.handleAngieReady(e.data),i.port1.close(),i.port2.close()};const s={type:S.SDK_ANGIE_READY_PING,timestamp:Date.now()};window.postMessage(s,window.location.origin,[i.port2]),e++,setTimeout(t,500)};t()}handleAngieReady(e){this.isAngieReady=!0;const t={isReady:!0,version:e.version,capabilities:e.capabilities};this.readyResolve&&this.readyResolve(t)}handleDetectionTimeout(){this.readyResolve&&this.readyResolve({isReady:!1}),E.warn("Detection timeout - Angie may not be available")}isReady(){return this.isAngieReady}async waitForReady(){return this.readyPromise}}class I{sessionId;onmessage;onerror;onclose;_port;_started=!1;_closed=!1;constructor(t){if(!t)throw new Error("MessagePort is required");this._port=t,this._port.onmessage=t=>{try{const i=_modelcontextprotocol_sdk_types_js__WEBPACK_IMPORTED_MODULE_0__.JSONRPCMessageSchema.parse(t.data);this.onmessage?.(i)}catch(e){const t=new Error(`Failed to parse message: ${e}`);this.onerror?.(t)}},this._port.onmessageerror=e=>{const t=new Error(`MessagePort error: ${JSON.stringify(e)}`);this.onerror?.(t)}}async start(){if(this._started)throw new Error("BrowserContextTransport already started! If using Client or Server class, note that connect() calls start() automatically.");if(this._closed)throw new Error("Cannot start a closed BrowserContextTransport");this._started=!0,this._port.start()}async send(e){if(this._closed)throw new Error("Cannot send on a closed BrowserContextTransport");return new Promise((t,i)=>{try{this._port.postMessage(e),t()}catch(e){const t=e instanceof Error?e:new Error(String(e));this.onerror?.(t),i(t)}})}async close(){this._closed||(this._closed=!0,this._port.close(),this.onclose?.())}}class T{async requestClientCreation(e){const{config:t}=e,i={serverId:e.id,serverName:t.name,serverTitle:t.title,serverVersion:t.version,description:t.description,transport:t.transport||m.POST_MESSAGE,capabilities:t.capabilities,instanceId:e.instanceId};return"type"in t&&"remote"===t.type&&(i.remote={url:t.url}),new Promise((e,t)=>{const s=new MessageChannel,r=setTimeout(()=>{t(new Error("Client creation request timed out after 15000ms"))},15e3);s.port1.onmessage=t=>{clearTimeout(r),e(t.data)};const n={type:S.SDK_REQUEST_CLIENT_CREATION,payload:i,timestamp:Date.now()};window.postMessage(n,window.location.origin,[s.port2])})}}const R="angie-sidebar-container",A={open:!1,iframe:null,iframeUrlObject:null,containerId:R};class P extends Error{}P.prototype.name="InvalidTokenError";var C,x,O,U={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},L=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(L||{});(O=L||(L={})).reset=function(){C=3,x=U},O.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");C=e},O.setLogger=function(e){x=e};var D=class e{constructor(e){this._name=e}debug(...t){C>=4&&x.debug(e._format(this._name,this._method),...t)}info(...t){C>=3&&x.info(e._format(this._name,this._method),...t)}warn(...t){C>=2&&x.warn(e._format(this._name,this._method),...t)}error(...t){C>=1&&x.error(e._format(this._name,this._method),...t)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(t,i){const s=new e(`${t}.${i}`);return s.debug("begin"),s}static _format(e,t){const i=`[${e}]`;return t?`${i} ${t}:`:i}static debug(t,...i){C>=4&&x.debug(e._format(t),...i)}static info(t,...i){C>=3&&x.info(e._format(t),...i)}static warn(t,...i){C>=2&&x.warn(e._format(t),...i)}static error(t,...i){C>=1&&x.error(e._format(t),...i)}};L.reset();var N=class{static decode(e){try{return function(e,t){if("string"!=typeof e)throw new P("Invalid token specified: must be a string");t||(t={});const i=!0===t.header?0:1,s=e.split(".")[i];if("string"!=typeof s)throw new P(`Invalid token specified: missing part #${i+1}`);let r;try{r=function(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(e){return decodeURIComponent(atob(e).replace(/(.)/g,(e,t)=>{let i=t.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(t)}catch(e){return atob(t)}}(s)}catch(e){throw new P(`Invalid token specified: invalid base64 for part #${i+1} (${e.message})`)}try{return JSON.parse(r)}catch(e){throw new P(`Invalid token specified: invalid json for part #${i+1} (${e.message})`)}}(e)}catch(e){throw D.error("JwtUtils.decode",e),e}}static async generateSignedJwt(e,t,i){const s=`${H.encodeBase64Url((new TextEncoder).encode(JSON.stringify(e)))}.${H.encodeBase64Url((new TextEncoder).encode(JSON.stringify(t)))}`,r=await window.crypto.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},i,(new TextEncoder).encode(s));return`${s}.${H.encodeBase64Url(new Uint8Array(r))}`}static async generateSignedJwtWithHmac(e,t,i){const s=`${H.encodeBase64Url((new TextEncoder).encode(JSON.stringify(e)))}.${H.encodeBase64Url((new TextEncoder).encode(JSON.stringify(t)))}`,r=await window.crypto.subtle.sign("HMAC",i,(new TextEncoder).encode(s));return`${s}.${H.encodeBase64Url(new Uint8Array(r))}`}},q=e=>btoa([...new Uint8Array(e)].map(e=>String.fromCharCode(e)).join("")),M=class e{static _randomWord(){const e=new Uint32Array(1);return crypto.getRandomValues(e),e[0]}static generateUUIDv4(){const t="10000000-1000-4000-8000-100000000000".replace(/[018]/g,t=>(+t^e._randomWord()&15>>+t/4).toString(16));return t.replace(/-/g,"")}static generateCodeVerifier(){return e.generateUUIDv4()+e.generateUUIDv4()+e.generateUUIDv4()}static async generateCodeChallenge(e){if(!crypto.subtle)throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");try{const t=(new TextEncoder).encode(e),i=await crypto.subtle.digest("SHA-256",t);return q(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw D.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(e,t){const i=(new TextEncoder).encode([e,t].join(":"));return q(i)}static async hash(e,t){const i=(new TextEncoder).encode(t),s=await crypto.subtle.digest(e,i);return new Uint8Array(s)}static async customCalculateJwkThumbprint(t){let i;switch(t.kty){case"RSA":i={e:t.e,kty:t.kty,n:t.n};break;case"EC":i={crv:t.crv,kty:t.kty,x:t.x,y:t.y};break;case"OKP":i={crv:t.crv,kty:t.kty,x:t.x};break;case"oct":i={crv:t.k,kty:t.kty};break;default:throw new Error("Unknown jwk type")}const s=await e.hash("SHA-256",JSON.stringify(i));return e.encodeBase64Url(s)}static async generateDPoPProof({url:t,accessToken:i,httpMethod:s,keyPair:r,nonce:n}){let o,a;const c={jti:window.crypto.randomUUID(),htm:null!=s?s:"GET",htu:t,iat:Math.floor(Date.now()/1e3)};i&&(o=await e.hash("SHA-256",i),a=e.encodeBase64Url(o),c.ath=a),n&&(c.nonce=n);try{const e=await crypto.subtle.exportKey("jwk",r.publicKey),t={alg:"ES256",typ:"dpop+jwt",jwk:{crv:e.crv,kty:e.kty,x:e.x,y:e.y}};return await N.generateSignedJwt(t,c,r.privateKey)}catch(e){throw e instanceof TypeError?new Error(`Error exporting dpop public key: ${e.message}`):e}}static async generateDPoPJkt(t){try{const i=await crypto.subtle.exportKey("jwk",t.publicKey);return await e.customCalculateJwkThumbprint(i)}catch(e){throw e instanceof TypeError?new Error(`Could not retrieve dpop keys from storage: ${e.message}`):e}}static async generateDPoPKeys(){return await window.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"])}static async generateClientAssertionJwt(t,i,s,r="HS256"){const n=Math.floor(Date.now()/1e3),o={alg:r,typ:"JWT"},a={iss:t,sub:t,aud:s,jti:e.generateUUIDv4(),exp:n+300,iat:n},c={HS256:"SHA-256",HS384:"SHA-384",HS512:"SHA-512"}[r];if(!c)throw new Error(`Unsupported algorithm: ${r}. Supported algorithms are: HS256, HS384, HS512`);const d=new TextEncoder,l=await crypto.subtle.importKey("raw",d.encode(i),{name:"HMAC",hash:c},!1,["sign"]);return await N.generateSignedJwtWithHmac(o,a,l)}};M.encodeBase64Url=e=>q(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");var H=M,$=class{constructor(e){this._name=e,this._callbacks=[],this._logger=new D(`Event('${this._name}')`)}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}async raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)await t(...e)}},j=class{static center({...e}){var t;return null==e.width&&(e.width=null!=(t=[800,720,600,480].find(e=>e<=window.outerWidth/1.618))?t:360),null!=e.left||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),null!=e.height&&(null!=e.top||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,e])=>null!=e).map(([e,t])=>`${e}=${"boolean"!=typeof t?t:t?"yes":"no"}`).join(",")}},G=class e extends ${constructor(){super(...arguments),this._logger=new D(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const t=this._expiration-e.getEpochTime();this._logger.debug("timer completes in",t),this._expiration<=e.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(t){const i=this._logger.create("init");t=Math.max(Math.floor(t),1);const s=e.getEpochTime()+t;if(this.expiration===s&&this._timerHandle)return void i.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),i.debug("using duration",t),this._expiration=s;const r=Math.min(t,5);this._timerHandle=setInterval(this._callback,1e3*r)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},z=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const i=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(i.slice(1))}},W=";",F=class extends Error{constructor(e,t){var i,s,r;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw D.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(i=e.error_description)?i:null,this.error_uri=null!=(s=e.error_uri)?s:null,this.state=e.userState,this.session_state=null!=(r=e.session_state)?r:null,this.url_state=e.url_state}},K=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},J=class{constructor(e){this._logger=new D("AccessTokenEvents"),this._expiringTimer=new G("Access token expiring"),this._expiredTimer=new G("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}async load(e){const t=this._logger.create("load");if(e.access_token&&void 0!==e.expires_in){const i=e.expires_in;if(t.debug("access token present, remaining duration:",i),i>0){let e=i-this._expiringNotificationTimeInSeconds;e<=0&&(e=1),t.debug("registering expiring timer, raising in",e,"seconds"),this._expiringTimer.init(e)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const s=i+1;t.debug("registering expired timer, raising in",s,"seconds"),this._expiredTimer.init(s)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}async unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},B=class{constructor(e,t,i,s,r){this._callback=e,this._client_id=t,this._intervalInSeconds=s,this._stopOnError=r,this._logger=new D("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=e=>{e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(e.data+" message from check session op iframe"))};const n=new URL(i);this._frame_origin=n.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=n.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},Q=class{constructor(){this._logger=new D("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},V=class extends Error{constructor(e,t){super(t),this.name="ErrorDPoPNonce",this.nonce=e}},X=class{constructor(e=[],t=null,i={}){this._jwtHandler=t,this._extraHeaders=i,this._logger=new D("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:i,...s}=t;if(!i)return await fetch(e,s);const r=new AbortController,n=setTimeout(()=>r.abort(),1e3*i);try{return await fetch(e,{...t,signal:r.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new K("Network timed out");throw e}finally{clearTimeout(n)}}async getJson(e,{token:t,credentials:i,timeoutInSeconds:s}={}){const r=this._logger.create("getJson"),n={Accept:this._contentTypes.join(", ")};let o;t&&(r.debug("token passed, setting Authorization header"),n.Authorization="Bearer "+t),this._appendExtraHeaders(n);try{r.debug("url:",e),o=await this.fetchWithTimeout(e,{method:"GET",headers:n,timeoutInSeconds:s,credentials:i})}catch(e){throw r.error("Network Error"),e}r.debug("HTTP response received, status",o.status);const a=o.headers.get("Content-Type");if(a&&!this._contentTypes.find(e=>a.startsWith(e))&&r.throw(new Error(`Invalid response Content-Type: ${null!=a?a:"undefined"}, from URL: ${e}`)),o.ok&&this._jwtHandler&&(null==a?void 0:a.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let c;try{c=await o.json()}catch(e){if(r.error("Error parsing JSON response",e),o.ok)throw e;throw new Error(`${o.statusText} (${o.status})`)}if(!o.ok){if(r.error("Error from server:",c),c.error)throw new F(c);throw new Error(`${o.statusText} (${o.status}): ${JSON.stringify(c)}`)}return c}async postForm(e,{body:t,basicAuth:i,timeoutInSeconds:s,initCredentials:r,extraHeaders:n}){const o=this._logger.create("postForm"),a={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded",...n};let c;void 0!==i&&(a.Authorization="Basic "+i),this._appendExtraHeaders(a);try{o.debug("url:",e),c=await this.fetchWithTimeout(e,{method:"POST",headers:a,body:t,timeoutInSeconds:s,credentials:r})}catch(e){throw o.error("Network error"),e}o.debug("HTTP response received, status",c.status);const d=c.headers.get("Content-Type");if(d&&!this._contentTypes.find(e=>d.startsWith(e)))throw new Error(`Invalid response Content-Type: ${null!=d?d:"undefined"}, from URL: ${e}`);const l=await c.text();let g={};if(l)try{g=JSON.parse(l)}catch(e){if(o.error("Error parsing JSON response",e),c.ok)throw e;throw new Error(`${c.statusText} (${c.status})`)}if(!c.ok){if(o.error("Error from server:",g),c.headers.has("dpop-nonce")){const e=c.headers.get("dpop-nonce");throw new V(e,`${JSON.stringify(g)}`)}if(g.error)throw new F(g,t);throw new Error(`${c.statusText} (${c.status}): ${JSON.stringify(g)}`)}return g}_appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),i=Object.keys(this._extraHeaders),s=["accept","content-type"],r=["authorization"];0!==i.length&&i.forEach(i=>{if(s.includes(i.toLocaleLowerCase()))return void t.warn("Protected header could not be set",i,s);if(r.includes(i.toLocaleLowerCase())&&Object.keys(e).includes(i))return void t.warn("Header could not be overridden",i,r);const n="function"==typeof this._extraHeaders[i]?this._extraHeaders[i]():this._extraHeaders[i];n&&""!==n&&(e[i]=n)})}},Y=class{constructor(e){this._settings=e,this._logger=new D("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new X(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},t,this._settings.metadataSeed),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const i=this._logger.create(`_getMetadataProperty('${e}')`),s=await this.getMetadata();if(i.debug("resolved"),void 0===s[e]){if(!0===t)return void i.warn("Metadata does not contain optional property");i.throw(new Error("Metadata does not contain property "+e))}return s[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const i=await this._jsonService.getJson(t,{timeoutInSeconds:this._settings.requestTimeoutInSeconds});if(e.debug("got key set",i),!Array.isArray(i.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=i.keys,this._signingKeys}},Z=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new D("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let i=0;i<e;i++){const e=await this._store.key(i);e&&0===e.indexOf(this._prefix)&&t.push(e.substr(this._prefix.length))}return t}},ee=class{constructor({authority:e,metadataUrl:t,metadata:i,signingKeys:s,metadataSeed:r,client_id:n,client_secret:o,response_type:a="code",scope:c="openid",redirect_uri:d,post_logout_redirect_uri:l,client_authentication:g="client_secret_post",token_endpoint_auth_signing_alg:h="HS256",prompt:u,display:p,max_age:_,ui_locales:w,acr_values:m,resource:f,response_mode:y,filterProtocolClaims:S=!0,loadUserInfo:v=!1,requestTimeoutInSeconds:b,staleStateAgeInSeconds:E=900,mergeClaimsStrategy:k={array:"replace"},disablePKCE:I=!1,stateStore:T,revokeTokenAdditionalContentTypes:R,fetchRequestCredentials:A,refreshTokenAllowedScope:P,extraQueryParams:C={},extraTokenParams:x={},extraHeaders:O={},dpop:U,omitScopeWhenRequesting:L=!1}){var D;if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=i,this.metadataSeed=r,this.signingKeys=s,this.client_id=n,this.client_secret=o,this.response_type=a,this.scope=c,this.redirect_uri=d,this.post_logout_redirect_uri=l,this.client_authentication=g,this.token_endpoint_auth_signing_alg=h,this.prompt=u,this.display=p,this.max_age=_,this.ui_locales=w,this.acr_values=m,this.resource=f,this.response_mode=y,this.filterProtocolClaims=null==S||S,this.loadUserInfo=!!v,this.staleStateAgeInSeconds=E,this.mergeClaimsStrategy=k,this.omitScopeWhenRequesting=L,this.disablePKCE=!!I,this.revokeTokenAdditionalContentTypes=R,this.fetchRequestCredentials=A||"same-origin",this.requestTimeoutInSeconds=b,T)this.stateStore=T;else{const e="undefined"!=typeof window?window.localStorage:new Q;this.stateStore=new Z({store:e})}if(this.refreshTokenAllowedScope=P,this.extraQueryParams=C,this.extraTokenParams=x,this.extraHeaders=O,this.dpop=U,this.dpop&&!(null==(D=this.dpop)?void 0:D.store))throw new Error("A DPoPStore is required when dpop is enabled")}},te=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new D("UserInfoService"),this._getClaimsFromJwt=async e=>{const t=this._logger.create("_getClaimsFromJwt");try{const i=N.decode(e);return t.debug("JWT decoding successful"),i}catch(e){throw t.error("Error parsing JWT response"),e}},this._jsonService=new X(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const i=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",i);const s=await this._jsonService.getJson(i,{token:e,credentials:this._settings.fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return t.debug("got claims",s),s}},ie=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new D("TokenClient"),this._jsonService=new X(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:i=this._settings.client_id,client_secret:s=this._settings.client_secret,extraHeaders:r,...n}){const o=this._logger.create("exchangeCode");i||o.throw(new Error("A client_id is required")),t||o.throw(new Error("A redirect_uri is required")),n.code||o.throw(new Error("A code is required"));const a=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[e,t]of Object.entries(n))null!=t&&a.set(e,t);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==s)throw o.throw(new Error("A client_secret is required")),null;let c;const d=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":c=H.generateBasicAuth(i,s);break;case"client_secret_post":a.append("client_id",i),s&&a.append("client_secret",s);break;case"client_secret_jwt":{const e=await H.generateClientAssertionJwt(i,s,d,this._settings.token_endpoint_auth_signing_alg);a.append("client_id",i),a.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),a.append("client_assertion",e);break}}o.debug("got token endpoint");const l=await this._jsonService.postForm(d,{body:a,basicAuth:c,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:r});return o.debug("got response"),l}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:i=this._settings.client_secret,scope:s=this._settings.scope,...r}){const n=this._logger.create("exchangeCredentials");t||n.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:e});this._settings.omitScopeWhenRequesting||o.set("scope",s);for(const[e,t]of Object.entries(r))null!=t&&o.set(e,t);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==i)throw n.throw(new Error("A client_secret is required")),null;let a;const c=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":a=H.generateBasicAuth(t,i);break;case"client_secret_post":o.append("client_id",t),i&&o.append("client_secret",i);break;case"client_secret_jwt":{const e=await H.generateClientAssertionJwt(t,i,c,this._settings.token_endpoint_auth_signing_alg);o.append("client_id",t),o.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),o.append("client_assertion",e);break}}n.debug("got token endpoint");const d=await this._jsonService.postForm(c,{body:o,basicAuth:a,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials});return n.debug("got response"),d}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:i=this._settings.client_secret,timeoutInSeconds:s,extraHeaders:r,...n}){const o=this._logger.create("exchangeRefreshToken");t||o.throw(new Error("A client_id is required")),n.refresh_token||o.throw(new Error("A refresh_token is required"));const a=new URLSearchParams({grant_type:e});for(const[e,t]of Object.entries(n))Array.isArray(t)?t.forEach(t=>a.append(e,t)):null!=t&&a.set(e,t);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==i)throw o.throw(new Error("A client_secret is required")),null;let c;const d=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":c=H.generateBasicAuth(t,i);break;case"client_secret_post":a.append("client_id",t),i&&a.append("client_secret",i);break;case"client_secret_jwt":{const e=await H.generateClientAssertionJwt(t,i,d,this._settings.token_endpoint_auth_signing_alg);a.append("client_id",t),a.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),a.append("client_assertion",e);break}}o.debug("got token endpoint");const l=await this._jsonService.postForm(d,{body:a,basicAuth:c,timeoutInSeconds:s,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:r});return o.debug("got response"),l}async revoke(e){var t;const i=this._logger.create("revoke");e.token||i.throw(new Error("A token is required"));const s=await this._metadataService.getRevocationEndpoint(!1);i.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const r=new URLSearchParams;for(const[t,i]of Object.entries(e))null!=i&&r.set(t,i);r.set("client_id",this._settings.client_id),this._settings.client_secret&&r.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(s,{body:r,timeoutInSeconds:this._settings.requestTimeoutInSeconds}),i.debug("got response")}},se=class{constructor(e,t,i){this._settings=e,this._metadataService=t,this._claimsService=i,this._logger=new D("ResponseValidator"),this._userInfoService=new te(this._settings,this._metadataService),this._tokenClient=new ie(this._settings,this._metadataService)}async validateSigninResponse(e,t,i){const s=this._logger.create("validateSigninResponse");this._processSigninState(e,t),s.debug("state processed"),await this._processCode(e,t,i),s.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),s.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),s.debug("claims processed")}async validateCredentialsResponse(e,t){const i=this._logger.create("validateCredentialsResponse"),s=e.isOpenId&&!!e.id_token;s&&this._validateIdTokenAttributes(e),i.debug("tokens validated"),await this._processClaims(e,t,s),i.debug("claims processed")}async validateRefreshResponse(e,t){const i=this._logger.create("validateRefreshResponse");e.userState=t.data,null!=e.session_state||(e.session_state=t.session_state),null!=e.scope||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),i.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const s=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,s),i.debug("claims processed")}validateSignoutResponse(e,t){const i=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&i.throw(new Error("State does not match")),i.debug("state validated"),e.userState=t.data,e.error)throw i.warn("Response was error",e.error),new F(e)}_processSigninState(e,t){const i=this._logger.create("_processSigninState");if(t.id!==e.state&&i.throw(new Error("State does not match")),t.client_id||i.throw(new Error("No client_id on state")),t.authority||i.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&i.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&i.throw(new Error("client_id mismatch on settings vs. signin state")),i.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,null!=e.scope||(e.scope=t.scope),e.error)throw i.warn("Response was error",e.error),new F(e);t.code_verifier&&!e.code&&i.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,i=!0){const s=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void s.debug("not loading user info");s.debug("loading user info");const r=await this._userInfoService.getClaims(e.access_token);s.debug("user info claims received from user info endpoint"),i&&r.sub!==e.profile.sub&&s.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(r)),s.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t,i){const s=this._logger.create("_processCode");if(e.code){s.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,extraHeaders:i,...t.extraTokenParams});Object.assign(e,r)}else s.debug("No code to process")}_validateIdTokenAttributes(e,t){var i;const s=this._logger.create("_validateIdTokenAttributes");s.debug("decoding ID Token JWT");const r=N.decode(null!=(i=e.id_token)?i:"");if(r.sub||s.throw(new Error("ID Token is missing a subject claim")),t){const e=N.decode(t);r.sub!==e.sub&&s.throw(new Error("sub in id_token does not match current sub")),r.auth_time&&r.auth_time!==e.auth_time&&s.throw(new Error("auth_time in id_token does not match original auth_time")),r.azp&&r.azp!==e.azp&&s.throw(new Error("azp in id_token does not match original azp")),!r.azp&&e.azp&&s.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=r}},re=class e{constructor(e){this.id=e.id||H.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=G.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new D("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(t){return D.createStatic("State","fromStorageString"),Promise.resolve(new e(JSON.parse(t)))}static async clearStaleState(t,i){const s=D.createStatic("State","clearStaleState"),r=G.getEpochTime()-i,n=await t.getAllKeys();s.debug("got keys",n);for(let i=0;i<n.length;i++){const o=n[i],a=await t.get(o);let c=!1;if(a)try{const t=await e.fromStorageString(a);s.debug("got item from key:",o,t.created),t.created<=r&&(c=!0)}catch(e){s.error("Error parsing state for key:",o,e),c=!0}else s.debug("no item in storage for key:",o),c=!0;c&&(s.debug("removed item for key:",o),t.remove(o))}}},ne=class e extends re{constructor(e){super(e),this.code_verifier=e.code_verifier,this.code_challenge=e.code_challenge,this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo}static async create(t){const i=!0===t.code_verifier?H.generateCodeVerifier():t.code_verifier||void 0,s=i?await H.generateCodeChallenge(i):void 0;return new e({...t,code_verifier:i,code_challenge:s})}toStorageString(){return new D("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(t){D.createStatic("SigninState","fromStorageString");const i=JSON.parse(t);return e.create(i)}},oe=class e{constructor(e){this.url=e.url,this.state=e.state}static async create({url:t,authority:i,client_id:s,redirect_uri:r,response_type:n,scope:o,state_data:a,response_mode:c,request_type:d,client_secret:l,nonce:g,url_state:h,resource:u,skipUserInfo:p,extraQueryParams:_,extraTokenParams:w,disablePKCE:m,dpopJkt:f,omitScopeWhenRequesting:y,...S}){if(!t)throw this._logger.error("create: No url passed"),new Error("url");if(!s)throw this._logger.error("create: No client_id passed"),new Error("client_id");if(!r)throw this._logger.error("create: No redirect_uri passed"),new Error("redirect_uri");if(!n)throw this._logger.error("create: No response_type passed"),new Error("response_type");if(!o)throw this._logger.error("create: No scope passed"),new Error("scope");if(!i)throw this._logger.error("create: No authority passed"),new Error("authority");const v=await ne.create({data:a,request_type:d,url_state:h,code_verifier:!m,client_id:s,authority:i,redirect_uri:r,response_mode:c,client_secret:l,scope:o,extraTokenParams:w,skipUserInfo:p}),b=new URL(t);b.searchParams.append("client_id",s),b.searchParams.append("redirect_uri",r),b.searchParams.append("response_type",n),y||b.searchParams.append("scope",o),g&&b.searchParams.append("nonce",g),f&&b.searchParams.append("dpop_jkt",f);let E=v.id;h&&(E=`${E}${W}${h}`),b.searchParams.append("state",E),v.code_challenge&&(b.searchParams.append("code_challenge",v.code_challenge),b.searchParams.append("code_challenge_method","S256")),u&&(Array.isArray(u)?u:[u]).forEach(e=>b.searchParams.append("resource",e));for(const[e,t]of Object.entries({response_mode:c,...S,..._}))null!=t&&b.searchParams.append(e,t.toString());return new e({url:b.href,state:v})}};oe._logger=new D("SigninRequest");var ae=oe,ce=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const e=decodeURIComponent(this.state).split(W);this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(W))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-G.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+G.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},de=class{constructor({url:e,state_data:t,id_token_hint:i,post_logout_redirect_uri:s,extraQueryParams:r,request_type:n,client_id:o,url_state:a}){if(this._logger=new D("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const c=new URL(e);if(i&&c.searchParams.append("id_token_hint",i),o&&c.searchParams.append("client_id",o),s&&(c.searchParams.append("post_logout_redirect_uri",s),t||a)){this.state=new re({data:t,request_type:n,url_state:a});let e=this.state.id;a&&(e=`${e}${W}${a}`),c.searchParams.append("state",e)}for(const[e,t]of Object.entries({...r}))null!=t&&c.searchParams.append(e,t.toString());this.url=c.href}},le=class{constructor(e){if(this.state=e.get("state"),this.state){const e=decodeURIComponent(this.state).split(W);this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(W))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},ge=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],he=["sub","iss","aud","exp","iat"],ue=class{constructor(e){this._settings=e,this._logger=new D("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:ge;for(const i of e)he.includes(i)||delete t[i]}return t}mergeClaims(e,t){const i={...e};for(const[e,s]of Object.entries(t))if(i[e]!==s)if(Array.isArray(i[e])||Array.isArray(s))if("replace"==this._settings.mergeClaimsStrategy.array)i[e]=s;else{const t=Array.isArray(i[e])?i[e]:[i[e]];for(const e of Array.isArray(s)?s:[s])t.includes(e)||t.push(e);i[e]=t}else"object"==typeof i[e]&&"object"==typeof s?i[e]=this.mergeClaims(i[e],s):i[e]=s;return i}},pe=class{constructor(e,t){this.keys=e,this.nonce=t}},_e=class{constructor(e,t){this._logger=new D("OidcClient"),this.settings=e instanceof ee?e:new ee(e),this.metadataService=null!=t?t:new Y(this.settings),this._claimsService=new ue(this.settings),this._validator=new se(this.settings,this.metadataService,this._claimsService),this._tokenClient=new ie(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:i,request_type:s,id_token_hint:r,login_hint:n,skipUserInfo:o,nonce:a,url_state:c,response_type:d=this.settings.response_type,scope:l=this.settings.scope,redirect_uri:g=this.settings.redirect_uri,prompt:h=this.settings.prompt,display:u=this.settings.display,max_age:p=this.settings.max_age,ui_locales:_=this.settings.ui_locales,acr_values:w=this.settings.acr_values,resource:m=this.settings.resource,response_mode:f=this.settings.response_mode,extraQueryParams:y=this.settings.extraQueryParams,extraTokenParams:S=this.settings.extraTokenParams,dpopJkt:v,omitScopeWhenRequesting:b=this.settings.omitScopeWhenRequesting}){const E=this._logger.create("createSigninRequest");if("code"!==d)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const k=await this.metadataService.getAuthorizationEndpoint();E.debug("Received authorization endpoint",k);const I=await ae.create({url:k,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:g,response_type:d,scope:l,state_data:e,url_state:c,prompt:h,display:u,max_age:p,ui_locales:_,id_token_hint:r,login_hint:n,acr_values:w,dpopJkt:v,resource:m,request:t,request_uri:i,extraQueryParams:y,extraTokenParams:S,request_type:s,response_mode:f,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:a,disablePKCE:this.settings.disablePKCE,omitScopeWhenRequesting:b});await this.clearStaleState();const T=I.state;return await this.settings.stateStore.set(T.id,T.toStorageString()),I}async readSigninResponseState(e,t=!1){const i=this._logger.create("readSigninResponseState"),s=new ce(z.readParams(e,this.settings.response_mode));if(!s.state)throw i.throw(new Error("No state in response")),null;const r=await this.settings.stateStore[t?"remove":"get"](s.state);if(!r)throw i.throw(new Error("No matching state found in storage")),null;return{state:await ne.fromStorageString(r),response:s}}async processSigninResponse(e,t,i=!0){const s=this._logger.create("processSigninResponse"),{state:r,response:n}=await this.readSigninResponseState(e,i);if(s.debug("received state from storage; validating response"),this.settings.dpop&&this.settings.dpop.store){const e=await this.getDpopProof(this.settings.dpop.store);t={...t,DPoP:e}}try{await this._validator.validateSigninResponse(n,r,t)}catch(e){if(!(e instanceof V&&this.settings.dpop))throw e;{const i=await this.getDpopProof(this.settings.dpop.store,e.nonce);t.DPoP=i,await this._validator.validateSigninResponse(n,r,t)}}return n}async getDpopProof(e,t){let i,s;return(await e.getAllKeys()).includes(this.settings.client_id)?(s=await e.get(this.settings.client_id),s.nonce!==t&&t&&(s.nonce=t,await e.set(this.settings.client_id,s))):(i=await H.generateDPoPKeys(),s=new pe(i,t),await e.set(this.settings.client_id,s)),await H.generateDPoPProof({url:await this.metadataService.getTokenEndpoint(!1),httpMethod:"POST",keyPair:s.keys,nonce:s.nonce})}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:i=!1,extraTokenParams:s={}}){const r=await this._tokenClient.exchangeCredentials({username:e,password:t,...s}),n=new ce(new URLSearchParams);return Object.assign(n,r),await this._validator.validateCredentialsResponse(n,i),n}async useRefreshToken({state:e,redirect_uri:t,resource:i,timeoutInSeconds:s,extraHeaders:r,extraTokenParams:n}){var o;const a=this._logger.create("useRefreshToken");let c,d;if(void 0===this.settings.refreshTokenAllowedScope)c=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");c=((null==(o=e.scope)?void 0:o.split(" "))||[]).filter(e=>t.includes(e)).join(" ")}if(this.settings.dpop&&this.settings.dpop.store){const e=await this.getDpopProof(this.settings.dpop.store);r={...r,DPoP:e}}try{d=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:c,redirect_uri:t,resource:i,timeoutInSeconds:s,extraHeaders:r,...n})}catch(o){if(!(o instanceof V&&this.settings.dpop))throw o;r.DPoP=await this.getDpopProof(this.settings.dpop.store,o.nonce),d=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:c,redirect_uri:t,resource:i,timeoutInSeconds:s,extraHeaders:r,...n})}const l=new ce(new URLSearchParams);return Object.assign(l,d),a.debug("validating response",l),await this._validator.validateRefreshResponse(l,{...e,scope:c}),l}async createSignoutRequest({state:e,id_token_hint:t,client_id:i,request_type:s,url_state:r,post_logout_redirect_uri:n=this.settings.post_logout_redirect_uri,extraQueryParams:o=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),c=await this.metadataService.getEndSessionEndpoint();if(!c)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",c),i||!n||t||(i=this.settings.client_id);const d=new de({url:c,id_token_hint:t,client_id:i,post_logout_redirect_uri:n,state_data:e,extraQueryParams:o,request_type:s,url_state:r});await this.clearStaleState();const l=d.state;return l&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),d}async readSignoutResponseState(e,t=!1){const i=this._logger.create("readSignoutResponseState"),s=new le(z.readParams(e,this.settings.response_mode));if(!s.state){if(i.debug("No state in response"),s.error)throw i.warn("Response was error:",s.error),new F(s);return{state:void 0,response:s}}const r=await this.settings.stateStore[t?"remove":"get"](s.state);if(!r)throw i.throw(new Error("No matching state found in storage")),null;return{state:await re.fromStorageString(r),response:s}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:i,response:s}=await this.readSignoutResponseState(e,!0);return i?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(s,i)):t.debug("No state from storage; skipping response validation"),s}clearStaleState(){return this._logger.create("clearStaleState"),re.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},we=class{constructor(e){this._userManager=e,this._logger=new D("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const i=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,i.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,i.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){i.debug("initializing check session iframe");const s=this._userManager.settings.client_id,r=this._userManager.settings.checkSessionIntervalInSeconds,n=this._userManager.settings.stopCheckSessionOnError,o=new B(this._callback,s,e,r,n);await o.load(),this._checkSessionIFrame=o,o.start(t)}else i.warn("no check session iframe found in the metadata")}catch(e){i.error("Error from getCheckSessionIframe:",e instanceof Error?e.message:e)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const t=setInterval(async()=>{clearInterval(t);try{const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub?{sub:e.sub}:null};this._start(t)}}catch(t){e.error("error from querySessionStatus",t instanceof Error?t.message:t)}},1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const t=await this._userManager.querySessionStatus();let i=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(i=!1,this._checkSessionIFrame.start(t.session_state),e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",t.session_state),await this._userManager.events._raiseUserSessionChanged()):e.debug("different subject signed into OP",t.sub):e.debug("subject no longer signed into OP"),i?this._sub?await this._userManager.events._raiseUserSignedOut():await this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(t){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",t),await this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(e=>{this._logger.error(e)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub?{sub:e.sub}:null};this._start(t)}}}},me=class e{constructor(e){var t;this.id_token=e.id_token,this.session_state=null!=(t=e.session_state)?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState,this.url_state=e.url_state}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-G.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+G.getEpochTime())}get expired(){const e=this.expires_in;if(void 0!==e)return e<=0}get scopes(){var e,t;return null!=(t=null==(e=this.scope)?void 0:e.split(" "))?t:[]}toStorageString(){return new D("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(t){return D.createStatic("User","fromStorageString"),new e(JSON.parse(t))}},fe="oidc-client",ye=class{constructor(){this._abort=new $("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:i,keepOpen:s}=await new Promise((i,s)=>{const r=r=>{var n;const o=r.data,a=null!=(n=e.scriptOrigin)?n:window.location.origin;if(r.origin===a&&(null==o?void 0:o.source)===fe){try{const i=z.readParams(o.url,e.response_mode).get("state");if(i||t.warn("no state found in response url"),r.source!==this._window&&i!==e.state)return}catch{this._dispose(),s(new Error("Invalid response from window"))}i(o)}};window.addEventListener("message",r,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",r,!1));const n=new BroadcastChannel(`oidc-client-popup-${e.state}`);n.addEventListener("message",r,!1),this._disposeHandlers.add(()=>n.close()),this._disposeHandlers.add(this._abort.addHandler(e=>{this._dispose(),s(e)}))});return t.debug("got response from window"),this._dispose(),s||this.close(),{url:i}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,i=!1,s=window.location.origin){const r={source:fe,url:t,keepOpen:i},n=new D("_notifyParent");if(e)n.debug("With parent. Using parent.postMessage."),e.postMessage(r,s);else{n.debug("No parent. Using BroadcastChannel.");const e=new URL(t).searchParams.get("state");if(!e)throw new Error("No parent and no state in URL. Can't complete notification.");const i=new BroadcastChannel(`oidc-client-popup-${e}`);i.postMessage(r),i.close()}}},Se={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},ve="_blank",be=60,Ee=2,ke=class extends ee{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:i=e.post_logout_redirect_uri,popupWindowFeatures:s=Se,popupWindowTarget:r=ve,redirectMethod:n="assign",redirectTarget:o="self",iframeNotifyParentOrigin:a=e.iframeNotifyParentOrigin,iframeScriptOrigin:c=e.iframeScriptOrigin,requestTimeoutInSeconds:d,silent_redirect_uri:l=e.redirect_uri,silentRequestTimeoutInSeconds:g,automaticSilentRenew:h=!0,validateSubOnSilentRenew:u=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:_=!1,monitorAnonymousSession:w=!1,checkSessionIntervalInSeconds:m=Ee,query_status_response_type:f="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:S=["access_token","refresh_token"],revokeTokensOnSignout:v=!1,includeIdTokenInSilentSignout:b=!1,accessTokenExpiringNotificationTimeInSeconds:E=be,userStore:k}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=i,this.popupWindowFeatures=s,this.popupWindowTarget=r,this.redirectMethod=n,this.redirectTarget=o,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=c,this.silent_redirect_uri=l,this.silentRequestTimeoutInSeconds=g||d||10,this.automaticSilentRenew=h,this.validateSubOnSilentRenew=u,this.includeIdTokenInSilentRenew=p,this.monitorSession=_,this.monitorAnonymousSession=w,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=y,this.query_status_response_type=f,this.revokeTokenTypes=S,this.revokeTokensOnSignout=v,this.includeIdTokenInSilentSignout=b,this.accessTokenExpiringNotificationTimeInSeconds=E,k)this.userStore=k;else{const e="undefined"!=typeof window?window.sessionStorage:new Q;this.userStore=new Z({store:e})}}},Ie=class e extends ye{constructor({silentRequestTimeoutInSeconds:t=10}){super(),this._logger=new D("IFrameWindow"),this._timeoutInSeconds=t,this._frame=e.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout(()=>{this._abort.raise(new K("IFrame timed out without a response"))},1e3*this._timeoutInSeconds);return this._disposeHandlers.add(()=>clearTimeout(t)),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",e=>{var t;const i=e.target;null==(t=i.parentNode)||t.removeChild(i),this._abort.raise(new Error("IFrame removed from DOM"))},!0),null==(e=this._frame.contentWindow)||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},Te=class{constructor(e){this._settings=e,this._logger=new D("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new Ie({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),Ie.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},Re=class extends ye{constructor({popupWindowTarget:e=ve,popupWindowFeatures:t={},popupSignal:i,popupAbortOnClose:s}){super(),this._logger=new D("PopupWindow");const r=j.center({...Se,...t});this._window=window.open(void 0,e,j.serialize(r)),this.abortOnClose=Boolean(s),i&&i.addEventListener("abort",()=>{var e;this._abort.raise(new Error(null!=(e=i.reason)?e:"Popup aborted"))}),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{this._window&&"boolean"==typeof this._window.closed&&!this._window.closed?this.close():this._abort.raise(new Error("Popup blocked by user"))},1e3*t.closePopupWindowAfterInSeconds)}async navigate(e){var t;null==(t=this._window)||t.focus();const i=setInterval(()=>{this._window&&!this._window.closed||(this._logger.debug("Popup closed by user or isolated by redirect"),s(),this._disposeHandlers.delete(s),this.abortOnClose&&this._abort.raise(new Error("Popup closed by user")))},500),s=()=>clearInterval(i);return this._disposeHandlers.add(s),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){super._notifyParent(window.opener,e,t),t||window.opener||window.close()}},Ae=class{constructor(e){this._settings=e,this._logger=new D("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget,popupSignal:i,popupAbortOnClose:s}){return new Re({popupWindowFeatures:e,popupWindowTarget:t,popupSignal:i,popupAbortOnClose:s})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),Re.notifyOpener(e,t)}},Pe=class{constructor(e){this._settings=e,this._logger=new D("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var i;this._logger.create("prepare");let s=window.self;"top"===t&&(s=null!=(i=window.top)?i:window.self);const r=s.location[e].bind(s.location);let n;return{navigate:async e=>{this._logger.create("navigate");const t=new Promise((t,i)=>{n=i,window.addEventListener("pageshow",()=>t(window.location.href)),r(e.url)});return await t},close:()=>{this._logger.create("close"),null==n||n(new Error("Redirect aborted")),s.stop()}}}async callback(){}},Ce=class extends J{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new D("UserManagerEvents"),this._userLoaded=new $("User loaded"),this._userUnloaded=new $("User unloaded"),this._silentRenewError=new $("Silent renew error"),this._userSignedIn=new $("User signed in"),this._userSignedOut=new $("User signed out"),this._userSessionChanged=new $("User session changed")}async load(e,t=!0){await super.load(e),t&&await this._userLoaded.raise(e)}async unload(){await super.unload(),await this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}async _raiseSilentRenewError(e){await this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}async _raiseUserSignedIn(){await this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}async _raiseUserSignedOut(){await this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}async _raiseUserSessionChanged(){await this._userSessionChanged.raise()}},xe=class{constructor(e){this._userManager=e,this._logger=new D("SilentRenewService"),this._isStarted=!1,this._retryTimer=new G("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(t){if(t instanceof K)return e.warn("ErrorTimeout from signinSilent:",t,"retry in 5s"),void this._retryTimer.init(5);e.error("Error from signinSilent:",t),await this._userManager.events._raiseSilentRenewError(t)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},Oe=class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}},Ue=class{constructor(e,t,i,s){this._logger=new D("UserManager"),this.settings=new ke(e),this._client=new _e(e),this._redirectNavigator=null!=t?t:new Pe(this.settings),this._popupNavigator=null!=i?i:new Ae(this.settings),this._iframeNavigator=null!=s?s:new Te(this.settings),this._events=new Ce(this.settings),this._silentRenewService=new xe(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new we(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(e=!1){const t=this._logger.create("getUser"),i=await this._loadUser();return i?(t.info("user loaded"),await this._events.load(i,e),i):(t.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),await this._events.unload()}async signinRedirect(e={}){var t;this._logger.create("signinRedirect");const{redirectMethod:i,...s}=e;let r;(null==(t=this.settings.dpop)?void 0:t.bind_authorization_code)&&(r=await this.generateDPoPJkt(this.settings.dpop));const n=await this._redirectNavigator.prepare({redirectMethod:i});await this._signinStart({request_type:"si:r",dpopJkt:r,...s},n)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),i=await this._signinEnd(e);return i.profile&&i.profile.sub?t.info("success, signed in subject",i.profile.sub):t.info("no subject"),i}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:i=!1}){const s=this._logger.create("signinResourceOwnerCredential"),r=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:i,extraTokenParams:this.settings.extraTokenParams});s.debug("got signin response");const n=await this._buildUser(r);return n.profile&&n.profile.sub?s.info("success, signed in subject",n.profile.sub):s.info("no subject"),n}async signinPopup(e={}){var t;const i=this._logger.create("signinPopup");let s;(null==(t=this.settings.dpop)?void 0:t.bind_authorization_code)&&(s=await this.generateDPoPJkt(this.settings.dpop));const{popupWindowFeatures:r,popupWindowTarget:n,popupSignal:o,popupAbortOnClose:a,...c}=e,d=this.settings.popup_redirect_uri;d||i.throw(new Error("No popup_redirect_uri configured"));const l=await this._popupNavigator.prepare({popupWindowFeatures:r,popupWindowTarget:n,popupSignal:o,popupAbortOnClose:a}),g=await this._signin({request_type:"si:p",redirect_uri:d,display:"popup",dpopJkt:s,...c},l);return g&&(g.profile&&g.profile.sub?i.info("success, signed in subject",g.profile.sub):i.info("no subject")),g}async signinPopupCallback(e=window.location.href,t=!1){const i=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),i.info("success")}async signinSilent(e={}){var t,i;const s=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...n}=e;let o,a=await this._loadUser();if(!e.forceIframeAuth&&(null==a?void 0:a.refresh_token)){s.debug("using refresh token");const e=new Oe(a);return await this._useRefreshToken({state:e,redirect_uri:n.redirect_uri,resource:n.resource,extraTokenParams:n.extraTokenParams,timeoutInSeconds:r})}(null==(t=this.settings.dpop)?void 0:t.bind_authorization_code)&&(o=await this.generateDPoPJkt(this.settings.dpop));const c=this.settings.silent_redirect_uri;let d;c||s.throw(new Error("No silent_redirect_uri configured")),a&&this.settings.validateSubOnSilentRenew&&(s.debug("subject prior to silent renew:",a.profile.sub),d=a.profile.sub);const l=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return a=await this._signin({request_type:"si:s",redirect_uri:c,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==a?void 0:a.id_token:void 0,dpopJkt:o,...n},l,d),a&&((null==(i=a.profile)?void 0:i.sub)?s.info("success, signed in subject",a.profile.sub):s.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds,...e}),i=new me({...e.state,...t});return await this.storeUser(i),await this._events.load(i),i}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":await this.signinPopupCallback(e);break;case"si:s":await this.signinSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:i}=await this._client.readSignoutResponseState(e);if(i)switch(i.request_type){case"so:r":return await this.signoutRedirectCallback(e);case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:i,...s}=e,r=this.settings.silent_redirect_uri;r||t.throw(new Error("No silent_redirect_uri configured"));const n=await this._loadUser(),o=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:i}),a=await this._signinStart({request_type:"si:s",redirect_uri:r,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==n?void 0:n.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...s},o);try{const e={},i=await this._client.processSigninResponse(a.url,e);return t.debug("got signin response"),i.session_state&&i.profile.sub?(t.info("success for subject",i.profile.sub),{session_state:i.session_state,sub:i.profile.sub}):(t.info("success, user not authenticated"),null)}catch(e){if(this.settings.monitorAnonymousSession&&e instanceof F)switch(e.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:e.session_state}}throw e}}async _signin(e,t,i){const s=await this._signinStart(e,t);return await this._signinEnd(s.url,i)}async _signinStart(e,t){const i=this._logger.create("_signinStart");try{const s=await this._client.createSigninRequest(e);return i.debug("got signin request"),await t.navigate({url:s.url,state:s.state.id,response_mode:s.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw i.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signinEnd(e,t){const i=this._logger.create("_signinEnd"),s=await this._client.processSigninResponse(e,{});return i.debug("got signin response"),await this._buildUser(s,t)}async _buildUser(e,t){const i=this._logger.create("_buildUser"),s=new me(e);if(t){if(t!==s.profile.sub)throw i.debug("current user does not match user returned from signin. sub from signin:",s.profile.sub),new F({...e,error:"login_required"});i.debug("current user matches user returned from signin")}return await this.storeUser(s),i.debug("user stored"),await this._events.load(s),s}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:i,...s}=e,r=await this._redirectNavigator.prepare({redirectMethod:i});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...s},r),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),i=await this._signoutEnd(e);return t.info("success"),i}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:i,popupWindowTarget:s,popupSignal:r,...n}=e,o=this.settings.popup_post_logout_redirect_uri,a=await this._popupNavigator.prepare({popupWindowFeatures:i,popupWindowTarget:s,popupSignal:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:null==o?void 0:{},...n},a),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const i=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),i.info("success")}async _signout(e,t){const i=await this._signoutStart(e,t);return await this._signoutEnd(i.url)}async _signoutStart(e={},t){var i;const s=this._logger.create("_signoutStart");try{const r=await this._loadUser();s.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(r);const n=e.id_token_hint||r&&r.id_token;n&&(s.debug("setting id_token_hint in signout request"),e.id_token_hint=n),await this.removeUser(),s.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return s.debug("got signout request"),await t.navigate({url:o.url,state:null==(i=o.state)?void 0:i.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw s.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),i=await this._client.processSignoutResponse(e);return t.debug("got signout response"),i}async signoutSilent(e={}){var t;const i=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:s,...r}=e,n=this.settings.includeIdTokenInSilentSignout?null==(t=await this._loadUser())?void 0:t.id_token:void 0,o=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:s});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:n,...r},a),i.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const i=this._logger.create("_revokeInternal");if(!e)return;const s=t.filter(t=>"string"==typeof e[t]);if(s.length){for(const t of s)await this._client.revokeToken(e[t],t),i.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),i.debug("user stored"),await this._events.load(e)}else i.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),me.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const i=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,i)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey),this.settings.dpop&&await this.settings.dpop.store.remove(this.settings.client_id)}async clearStaleState(){await this._client.clearStaleState()}async dpopProof(e,t,i,s){var r,n;const o=await(null==(n=null==(r=this.settings.dpop)?void 0:r.store)?void 0:n.get(this.settings.client_id));if(o)return await H.generateDPoPProof({url:e,accessToken:null==t?void 0:t.access_token,httpMethod:i,keyPair:o.keys,nonce:s})}async generateDPoPJkt(e){let t=await e.store.get(this.settings.client_id);if(!t){const i=await H.generateDPoPKeys();t=new pe(i),await e.store.set(this.settings.client_id,t)}return await H.generateDPoPJkt(t.keys)}};const Le="OAUTH2_LOGIN_FLOW_COMPLETE_EVENT",De="OAUTH_GET_TOP_URL",Ne="OAUTH_REDIRECT_TOP_WINDOW",qe="OAUTH_UPDATE_URL",Me="OAUTH2_CHECK_PENDING",He="oauth2_top_origin",$e="oauth2_login_success",je="oauth2_state",Ge=60,ze=Math.max(Ge-15,20),We=d("oidc-auth",{color:"green"}),Fe=e=>We.extend(e);d("oidc-auth-utils");const Ke=()=>"undefined"==typeof window?"":new URLSearchParams(window.location.search).get("origin")||"";class Je{static instance=null;settings=null;constructor(){}static getInstance(){return Je.instance||(Je.instance=new Je),Je.instance}configure(e){this.settings=e}isConfigured(){return null!==this.settings}getSettings(){if(!this.settings)throw new Error("OidcAuthConfig not configured. Call configure() or pass settings to OidcAuthClient.initialize().");return this.settings}getAuthOrigin(){const{authOrigin:e,authEndpoint:t}=this.getSettings();return e||new URL(t).origin}isAccessTokenProactiveRefreshEnabled(){return this.settings?.accessTokenProactiveRefreshEnabled??!0}getOidcSettings(){const e="undefined"==typeof window?"":window.location.origin,{clientId:t,authEndpoint:i}=this.getSettings(),s=this.getAuthOrigin(),r="undefined"!=typeof window?new Z({store:window.localStorage}):void 0,{accessTokenExpiringNotificationTimeInSeconds:n=Ge}=this.getSettings();return{client_id:t,authority:s,redirect_uri:`${e}/login/oauth-callback`,post_logout_redirect_uri:e,response_type:"code",scope:"openid offline_access",automaticSilentRenew:!1,accessTokenExpiringNotificationTimeInSeconds:n,stateStore:r,userStore:r,metadata:{issuer:s,authorization_endpoint:i,token_endpoint:`${s}/connect/api/v1/oauth2/token`,end_session_endpoint:`${s}/logout/`}}}getAccessTokenExpiringNotificationTimeInSeconds(){return this.getSettings().accessTokenExpiringNotificationTimeInSeconds??Ge}getAccessTokenFreshnessThresholdInSeconds(){return this.getSettings().accessTokenFreshnessThresholdInSeconds??ze}getAllowedParentOrigins(){return this.settings?.allowedParentOrigins}}const Be=Je.getInstance(),Qe=Fe("oidc-auth:host-api"),Ve=async e=>new Promise((t,i)=>{const s=new MessageChannel;let r=!1;const n=()=>{r=!0,s.port1.close()},o=setTimeout(()=>{r||(n(),i(new Error(`Host message timeout: ${e.type}`)))},1e4);s.port1.onmessage=e=>{clearTimeout(o),n(),"success"!==e.data.status?i(e.data.payload):t(e.data.payload)};const a=new URLSearchParams(window.location.search).get("origin")||"";if(!function(e){if(!e.startsWith("http://")&&!e.startsWith("https://"))return!1;const t=Be.getAllowedParentOrigins();return!t||0===t.length||t.includes(e)}(a))return clearTimeout(o),n(),void i(new Error("Origin not allowed"));Qe.log("posting message to host",e),window.top.postMessage({type:e.type,payload:e.payload,...e.data||{}},a,[s.port2])}),Xe=Fe("oidc-auth:OidcAuthTimer");class Ye{timerHandle=null;expiration=null;initialized=!1;callback=()=>{};constructor(){this.timerHandle=null}init(e,t,i){const s=e-this.getEpochTime(),r=Math.max(s-t,10);this.cancel(),this.expiration=r,this.callback=i,Xe.debug("OIDC: timer - using expiration",r,s,t,e,s-t),this.timerHandle=setTimeout(this.callback,1e3*r),this.initialized=!0}cancel(){this.timerHandle&&(clearTimeout(this.timerHandle),this.timerHandle=null),this.expiration=null}getEpochTime(){return Math.floor(Date.now()/1e3)}isInitialized(){return this.initialized}}const Ze=Fe("oidc-auth:OidcAuthClient");class et{static instance=null;userManager=null;initialized=!1;accessTokenExpiringTimer=null;retryTimers=new Set;constructor(){}static getInstance(){return et.instance||(et.instance=new et),et.instance}isInitialized(){return this.initialized}ensureInitialized(){if(!this.userManager)throw new Error("OidcAuthClient not initialized. Call initialize() first.");return this.userManager}initialize(e){if(e&&(this.initialized=!1,Be.configure(e)),this.initialized)Ze.info("OIDC: initialize() - already initialized, skipping");else if("undefined"!=typeof window)if(Be.isConfigured())try{Ze.info("OIDC: initialize() - starting initialization");const e=Be.getOidcSettings();this.userManager=new Ue(e),L.setLogger(Ze),L.setLevel(L.ERROR),this.initAccessTokenExpiringTimer(),this.initialized=!0}catch(e){throw Ze.error("OIDC: initialize() - FAILED:",e),e}else Ze.warn("OIDC: initialize() - skipped, config not set");else Ze.warn("OidcAuthClient cannot initialize on server side")}async initAccessTokenExpiringTimer(){Be.isAccessTokenProactiveRefreshEnabled()?this.getUser().then(e=>{const t=e?.expires_at;t&&(this.accessTokenExpiringTimer||(this.accessTokenExpiringTimer=new Ye),this.accessTokenExpiringTimer.init(t,Be.getAccessTokenExpiringNotificationTimeInSeconds(),async()=>{Ze.info("OIDC: timer proactive refresh access token expiring timer fired",t),this.proactiveRefreshWithRetry()}))}).catch(e=>{Ze.error("OIDC: initAccessTokenExpiringTimer - FAILED:",e)}):Ze.warn("OIDC: timer - not starting, access token proactive refresh is disabled")}async getUser(){if(!this.userManager)return null;try{return await this.userManager.getUser()}catch(e){return Ze.error("OIDC: getUser - FAILED:",e),null}}async storeUser(e){const t=this.ensureInitialized();await t.storeUser(e)}async getAccessToken(){const e=await this.getUser();if(!e)return Ze.info("OIDC: getAccessToken - no user found"),null;if(e.expired)try{const e=await this.signinSilent();return e?.access_token||null}catch(e){return Ze.error("OIDC: getAccessToken - silent renew failed:",e),null}return this.isTokenFresh(e)||this.signinSilent().catch(e=>{Ze.error("OIDC: getAccessToken - background refresh failed:",e)}),e.access_token}getUserData(){if("undefined"==typeof window)return null;try{const e=Be.getOidcSettings(),t=`oidc.user:${e.authority}:${e.client_id}`,i=localStorage.getItem(t);if(!i)return null;const s=JSON.parse(i),r=s?.profile;return r?.sub?(Ze.info("OIDC: USER:",{profile:r}),{id:r.sub,email:r.email||"",first_name:r.given_name,last_name:r.family_name}):null}catch(e){return Ze.error("OIDC: getUserData - FAILED:",e),null}}async isAuthenticated(){const e=await this.getUser();return null!==e&&!e.expired}async signinRedirect(e){const t=this.ensureInitialized();await t.signinRedirect({state:e?{data:e}:void 0,prompt:"login"})}async signinCallback(){const e=this.ensureInitialized(),t=await e.signinCallback();if(!t)throw Ze.error("OIDC: signinCallback - FAILED: no user returned"),new Error("Signin callback failed: no user returned");return t}async signinSilent(e){return this.ensureInitialized(),"undefined"!=typeof navigator&&navigator.locks?navigator.locks.request("oidc-token-refresh",async()=>{const t=await this.getUser();return t&&this.isTokenFresh(t,e)?t:this.doSigninSilent()}):(Ze.warn("OIDC: signinSilent - navigator.locks not available, proceeding without lock"),this.doSigninSilent())}isTokenFresh(e,t){if(!e.expires_at)return!1;const i=t??Be.getAccessTokenFreshnessThresholdInSeconds(),s=Math.floor(Date.now()/1e3);return e.expires_at-s>i}async doSigninSilent(){const e=this.ensureInitialized();try{return await e.signinSilent()}catch(e){throw Ze.error("OIDC: doSigninSilent - FAILED:",e),e}}proactiveRefreshWithRetry(e=1){if("undefined"!=typeof document&&"hidden"===document.visibilityState){Ze.info("OIDC: tab is hidden, deferring proactive refresh until visible");const t=()=>{"visible"===document.visibilityState&&(document.removeEventListener("visibilitychange",t),this.proactiveRefreshWithRetry(e))};return void document.addEventListener("visibilitychange",t)}this.signinSilent(Be.getAccessTokenExpiringNotificationTimeInSeconds()).then(()=>{this.initAccessTokenExpiringTimer()}).catch(t=>{if(Ze.error(`OIDC: proactive refresh failed (attempt ${e}/2):`,t),e<2){const t=setTimeout(()=>{this.retryTimers.delete(t),this.proactiveRefreshWithRetry(e+1)},3e3);this.retryTimers.add(t)}else Ze.error("OIDC: proactive refresh exhausted all retries")})}async removeUser(){const e=this.ensureInitialized();this.accessTokenExpiringTimer?.cancel(),this.retryTimers.forEach(clearTimeout),this.retryTimers.clear(),await e.removeUser()}onUserLoaded(e){this.ensureInitialized().events.addUserLoaded(e)}offUserLoaded(e){this.ensureInitialized().events.removeUserLoaded(e)}onUserUnloaded(e){this.ensureInitialized().events.addUserUnloaded(e)}offUserUnloaded(e){this.ensureInitialized().events.removeUserUnloaded(e)}onSilentRenewError(e){this.ensureInitialized().events.addSilentRenewError(e)}offSilentRenewError(e){this.ensureInitialized().events.removeSilentRenewError(e)}onAccessTokenExpiring(e){this.ensureInitialized().events.addAccessTokenExpiring(e)}offAccessTokenExpiring(e){this.ensureInitialized().events.removeAccessTokenExpiring(e)}onAccessTokenExpired(e){this.ensureInitialized().events.addAccessTokenExpired(e)}offAccessTokenExpired(e){this.ensureInitialized().events.removeAccessTokenExpired(e)}getLogoutUrl(e,t){const i=new URL(function(e){return`${Be.getAuthOrigin()}${e.logoutPath}`}(e));return t&&i.searchParams.set("redirect_to",t),i.toString()}getWindowOriginParam(){const e=new URL(window.location.href).searchParams.get("origin");if(!e)throw new Error("iframe origin param is required");return e}async getTopUrl(){return(await Ve({type:De})).topUrl}async isOAuthFlowPending(){try{return(await Ve({type:Me})).isPending}catch(e){return Ze.warn("OIDC: isOAuthFlowPending() - failed to check, assuming not pending:",e),!1}}async triggerLoginFlowViaParent({loginPath:e,windowPath:t}){Ze.info("OIDC: triggerLoginFlowViaParent() - starting");const i=await this.getTopUrl(),s=new URL(i).origin,r=`${s}${t}`,n=new URL(`${window.location.origin}${e}`);n.searchParams.set(He,s),n.searchParams.set("oauth2_top_wp_url",r),Ze.info("OIDC: triggerLoginFlowViaParent() - redirecting parent to:",n.toString()),await Ve({type:Ne,payload:{url:n.toString()}})}async handleLoginFlowComplete(e,t){if(!t)throw new Error("oauthUserState is required");const i=this.getWindowOriginParam(),s=t.state,r=s?.data?.[He];if(i!==r)throw Ze.error("OIDC: handleLoginFlowComplete - origin mismatch:",i,"!==",r),new Error("Invalid origin in OAuth state");try{const e=new me(t);await this.storeUser(e),this.initAccessTokenExpiringTimer(),window.dispatchEvent(new CustomEvent("oidc-auth-completed"))}catch(t){Ze.error("OIDC: handleLoginFlowComplete - FAILED to store user:",t),await this.triggerLoginFlowViaParent(e)}}async triggerLogoutViaParent(e,t=!0){const i=await this.getTopUrl(),s=new URL(i).origin,r=t?`${s}${e.windowPath}`:s;await this.removeUser();const n=this.getLogoutUrl(e,r);await Ve({type:Ne,payload:{url:n}})}async cleanOAuthParamsFromUrl(){try{const e=await this.getTopUrl(),t=new URL(e);t.searchParams.delete("oauth_code"),t.searchParams.delete("oauth_state"),t.searchParams.delete("start-oauth"),t.searchParams.delete($e),t.searchParams.delete(je),await Ve({type:qe,payload:{url:t.toString()}})}catch(e){Ze.warn("Failed to clean OAuth params from URL:",e)}}setupLoginFlowMessageListener(e){let t=!1;const i=i=>{if(i.data?.type!==Le)return;if(i.origin!==Ke())return void Ze.error("OIDC: origin mismatch - expected:",Ke(),"received:",i.origin);if(t)return void Ze.debug("OIDC: LOGIN_FLOW_COMPLETE already processed, ignoring duplicate");const s=i.data.payload;s?.oauthState?(t=!0,this.handleLoginFlowComplete(e,s.oauthState).catch(e=>{Ze.error("OIDC: Failed to handle login flow complete:",e),t=!1})):Ze.warn("OIDC: LOGIN_FLOW_COMPLETE but no oauthState in payload")};return window.addEventListener("message",i),()=>{window.removeEventListener("message",i)}}async getTokenExpirationInfo(){const e=await this.getUser();if(!e||!e.expires_at)return{expiresAt:null,expiresInSeconds:null,isExpired:!0};const t=new Date(1e3*e.expires_at),i=Date.now(),s=Math.floor((1e3*e.expires_at-i)/1e3);return{expiresAt:t,expiresInSeconds:s,isExpired:s<=0}}async forceTokenRefresh(){return Ze.info("OIDC: forceTokenRefresh() - manually triggering token refresh"),this.signinSilent()}}const tt=et.getInstance();"undefined"!=typeof window&&(window.oidcAuthClient=tt);const it=Fe("oidc-auth:oidc-auth-redirect");function st(e,t){e.postMessage({status:"success",payload:t})}function rt(e,t){e.postMessage({status:"error",payload:t})}function nt({targets:e,onSuccess:t,attempt:i=1}){const s=new URLSearchParams(window.location.search);if(!s.get($e))return void it.warn("OIDC: No login_success param found, skipping");const r=s.get(je);if(r){if(!e.window?.contentWindow||!e.windowURL)return it.warn("Cannot forward OIDC state: iframe not available"),void(i<5?setTimeout(()=>{nt({targets:e,onSuccess:t,attempt:i+1})},500):it.error("OIDC: Failed to forward login flow after",5,"attempts - iframe never became available"));try{const i=JSON.parse(r),s=i.state?.data?.[He];if(s&&s!==window.location.origin)return void it.error("Origin mismatch in OIDC state:",s,"vs",window.location.origin);!function(e,t){const i=t.window?.contentWindow,s=t.windowURL?.origin;i&&s?i.postMessage({type:Le,payload:e},s):it.warn("Cannot send OIDC state: window or origin not available")}({oauthState:i},e);const n=new URL(window.location.href);n.searchParams.delete($e),n.searchParams.delete(je),history.replaceState({},"",n.toString()),t?.()}catch(e){it.error("Failed to parse or forward OIDC state:",e)}}else it.warn("OIDC login complete but no state found in URL")}const ot="angie_return_url",at=g("referrer-redirect");function ct(e){try{return new URL(e,window.location.origin).origin===window.location.origin}catch{return!1}}function dt(e,t){if(!ct(e))return at.warn("Invalid redirect URL rejected:",e),!1;try{const i={url:e};return t&&(i.prompt=t),localStorage.setItem(ot,JSON.stringify(i)),!0}catch(e){return at.warn("localStorage not available"),!1}}function lt(){try{const e=localStorage.getItem(ot);if(!e)return null;let t;try{t=JSON.parse(e)}catch{return at.warn("Stored redirect data is not valid JSON, returning null"),null}return t.url&&"string"==typeof t.url?ct(t.url)?t:(at.warn("Stored redirect URL is invalid, returning null:",t.url),null):(at.warn("Stored redirect data missing url field, returning null"),null)}catch(e){return at.warn("localStorage not available"),null}}function gt(){try{localStorage.removeItem(ot)}catch(e){at.warn("localStorage not available")}}function ht(e,t){return t?`${e}#angie-prompt=${encodeURIComponent(t)}`:e}function ut(){const e=lt();return!!e&&(gt(),window.location.href=ht(e.url,e.prompt),!0)}const pt=g("oauth");function _t(){const e=lt();if(e)return gt(),void(window.location.href=ht(e.url,e.prompt));try{localStorage.setItem("angie_sidebar_state","open")}catch(e){pt.warn("localStorage not available")}setTimeout(()=>{window.toggleAngieSidebar(!0)},500)}const wt=(e,t)=>{const i=document.getElementById(A.containerId);i&&i.setAttribute("aria-hidden",t?"false":"true"),t?e.removeAttribute("tabindex"):e.setAttribute("tabindex","-1")},mt=(e,t)=>{e.postMessage({status:"success",payload:t})},ft=()=>new Promise(e=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e(null)}),yt=g("sdk");var St;(St||(St={})).POST_MESSAGE="postMessage";const vt=g("sidebar");let bt=!1;const Et="open",kt="closed";function It(){if("undefined"==typeof window)return 370;try{const e=window.localStorage.getItem("angie_sidebar_width");if(e){const t=parseInt(e,10);if(t>=350&&t<=590)return t}}catch(e){vt.warn("localStorage not available")}return 370}function Tt(){return"undefined"==typeof window?null:localStorage.getItem("angie_sidebar_state")}function Rt(e){try{localStorage.setItem("angie_sidebar_state",e)}catch(e){vt.warn("localStorage not available")}}function At(e){try{localStorage.setItem("angie_sidebar_width",e.toString())}catch(e){vt.warn("localStorage not available")}}function Pt(e){document.documentElement.style.setProperty("--angie-sidebar-width",`${e}px`)}function Ct(){!function(){if("undefined"==typeof window)return!1;const e=new URLSearchParams(window.location.search);return e.has($e)||e.has(je)||e.has(He)}()?xt(Tt()||Et):function(){xt(kt);try{localStorage.setItem("angie_sidebar_state",kt)}catch(e){vt.warn("localStorage not available")}}()}function xt(e){"undefined"!=typeof window&&window.toggleAngieSidebar&&window.toggleAngieSidebar(e===Et,!0)}function Ot(){const e=document.getElementById(A.containerId);if(!e)return;let t=!1,i=0,s=0;e.addEventListener("mousedown",r=>{const n=e.getBoundingClientRect();("rtl"===document.documentElement.dir?r.clientX<=n.left+4:r.clientX>=n.right-4)&&(t=!0,i=r.clientX,s=n.width,e.classList.add("angie-resizing"),document.body.style.cursor="ew-resize",document.body.style.userSelect="none",r.preventDefault(),r.stopPropagation())}),document.addEventListener("mousemove",e=>{if(!t)return;let r;r="rtl"===document.documentElement.dir?i-e.clientX:e.clientX-i,Pt(Math.max(350,Math.min(590,s+r))),e.preventDefault(),e.stopPropagation()}),document.addEventListener("mouseup",i=>{if(t){t=!1,e.classList.remove("angie-resizing"),document.body.style.cursor="",document.body.style.userSelect="";const r=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--angie-sidebar-width"),10);At(r),_({type:S.ANGIE_SIDEBAR_RESIZED,payload:{initialWidth:s,width:r}}),i.preventDefault(),i.stopPropagation()}}),Pt(It())}function Ut(e){var t;e?.skipDefaultCss||function(){if("undefined"==typeof document||bt)return;const e="angie-sidebar-styles";if(document.getElementById(e))return void(bt=!0);const t=document.createElement("style");t.id=e,t.textContent="/* Angie Sidebar - CSS Variables */\n:root {\n --angie-sidebar-z-index: 1200; /* below MUI popups, elementor popups and media library modal */\n --angie-sidebar-width: 330px;\n --angie-sidebar-transition: margin 0.3s ease-in-out, transform 0.3s ease-in-out;\n /* Direction-aware transform values for sidebar positioning */\n --angie-sidebar-hide-transform: translateX(-100%); /* LTR: hide to the left */\n --angie-sidebar-show-transform: translateX(0);\n}\n\n/* RTL-specific transform values */\n[dir=\"rtl\"] {\n --angie-sidebar-hide-transform: translateX(100%); /* RTL: hide to the right */\n}\n\n/* Respect user's motion preferences */\n@media (prefers-reduced-motion: reduce) {\n :root {\n --angie-sidebar-transition: none;\n }\n}\n\n/* Apply transitions only when user is actively toggling */\nbody.angie-sidebar-transitioning {\n transition: var(--angie-sidebar-transition) !important;\n}\n\nbody.angie-sidebar-transitioning #angie-sidebar-container {\n transition: var(--angie-sidebar-transition) !important;\n}\n\n/* Layout (default) - Push content */\n@media (min-width: 768px) {\n body.angie-sidebar-active {\n padding-inline-start: var(--angie-sidebar-width) !important;\n }\n\n #angie-sidebar-container {\n position: fixed;\n top: 0;\n inset-inline-start: 0;\n width: var(--angie-sidebar-width);\n height: 100vh;\n z-index: var(--angie-sidebar-z-index) !important; /* below elementor popups and media library modal */\n background: #FCFCFC;\n transform: var(--angie-sidebar-hide-transform);\n outline: none;\n overflow: hidden;\n /* No default transition - only when transitioning */\n }\n\n /* Resize handle */\n #angie-sidebar-container::after {\n content: '';\n position: absolute;\n top: 0;\n inset-inline-end: 0;\n width: 4px;\n height: 100%;\n cursor: ew-resize;\n background: transparent;\n z-index: 1000001;\n }\n\n /* Pink border during resize */\n #angie-sidebar-container.angie-resizing {\n border-inline-end-color: #ff69b4 !important;\n border-inline-end-width: 2px !important;\n }\n\n /* Disable iframe pointer events during resize */\n #angie-sidebar-container.angie-resizing iframe#angie-iframe {\n pointer-events: none !important;\n }\n}\n\n/* Active states */\nbody.angie-sidebar-active #angie-sidebar-container {\n transform: var(--angie-sidebar-show-transform);\n}\n\n/* Studio mode - sidebar takes full width */\n@media (min-width: 768px) {\n html.angie-studio-active body.angie-sidebar-active #angie-sidebar-container {\n width: 100%;\n }\n}\n\n/* High contrast mode support */\n@media (prefers-contrast: high) {\n #angie-sidebar-container {\n border-color: #000;\n box-shadow: none;\n }\n}\n\n/* Screen reader only class */\n.angie-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Plugin conflict resolution */\nbody.angie-sidebar-active {\n /* Reset common conflicting styles */\n box-sizing: border-box !important;\n position: relative !important;\n}\n\n#angie-sidebar-toggle {\n z-index: 99999 !important;\n}\n";const i=document.head||document.getElementsByTagName("head")[0];i.insertBefore(t,i.firstChild),bt=!0}(),"undefined"!=typeof window&&(window.toggleAngieSidebar=(t=e?.onToggle,function(e,i){const s=document.body,r=document.getElementById(A.containerId);if(!r)return void vt.warn("Required elements not found!");const n=s.classList.contains("angie-sidebar-active"),o=void 0!==e?e:!n;i||(s.classList.add("angie-sidebar-transitioning"),setTimeout(function(){s.classList.remove("angie-sidebar-transitioning")},300)),o?s.classList.add("angie-sidebar-active"):s.classList.remove("angie-sidebar-active"),o&&setTimeout(function(){_({type:"focusInput"})},i?0:300),t&&t(o,r,i),Rt(o?Et:kt);const a=new CustomEvent("angieSidebarToggle",{detail:{isOpen:o,sidebar:r,skipTransition:i}});document.dispatchEvent(a),_({type:S.ANGIE_SIDEBAR_TOGGLED,payload:{state:o?"opened":"closed"}})}),window.addEventListener("message",function(e){if(e.data&&"toggleAngieSidebar"===e.data.type){const{force:t,skipTransition:i}=e.data.payload||{};window.toggleAngieSidebar&&window.toggleAngieSidebar(t,i)}}))}const Lt=g("iframe"),Dt=e=>{if(e.includes("://")||e.startsWith("//"))return!1;try{const t="https://test.com";return new URL(e,t).origin===t}catch{return!1}},Nt=async()=>{if(A.iframe?.contentWindow&&A.iframeUrlObject)try{Lt.log("Disabling navigation prevention in Angie iframe"),A.iframe.contentWindow.postMessage({type:S.ANGIE_DISABLE_NAVIGATION_PREVENTION},A.iframeUrlObject.origin),await new Promise(e=>setTimeout(e,100))}catch(e){throw Lt.error("Failed to disable navigation prevention:",e),e}else Lt.warn("Cannot disable navigation prevention: iframe or origin not available")},qt=async e=>{if(window.screen.availWidth<=768)return void Lt.log("Mobile detected, skipping iframe injection");let t=document.getElementById(A.containerId);if(!t){const e=performance.now();if(Lt.log("⏱️ Waiting for sidebar container..."),await new Promise(e=>{let i=0;const s=setInterval(()=>{t=document.getElementById(A.containerId),i++,(t||i>20)&&(clearInterval(s),t&&e())},100);setTimeout(()=>{if(clearInterval(s),t)return void e();const i=new MutationObserver(()=>{t=document.getElementById(A.containerId),t&&(i.disconnect(),e())});i.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{i.disconnect(),e()},8e3)},2e3)}),Lt.log(`⏱️ Sidebar container detection took: ${(performance.now()-e).toFixed(2)}ms`),!t)return void Lt.error("Sidebar container not found")}const{iframe:i,iframeUrlObject:s}=await(async e=>{const t=e.origin,i=new URL(e.path,t),s=i.pathname.slice(1).replace(/\//,"--")+"-"+Math.random().toString(36).substring(7);return new Promise(r=>{const n=new URL(t);n.pathname=i.pathname;const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(n.searchParams.append("colorScheme",e.uiTheme||o||"light"),n.searchParams.append("sdkVersion",e.sdkVersion),n.searchParams.append("instanceId",s),n.searchParams.append("origin",window.location.origin),e.isRTL&&n.searchParams.append("isRTL",e.isRTL?"true":"false"),"localhost"===window.location.hostname&&window.location.search.includes("debug_error")){const e=new URLSearchParams(window.location.search).get("debug_error");e&&n.searchParams.append("debug_error",e)}i.searchParams.forEach((e,t)=>{n.searchParams.set(t,e)}),n.searchParams.set("ver",(new Date).getTime().toString());const a=e.parent||document,c=a.createElement("iframe"),d={"background-color":"transparent","color-scheme":"normal",...e.css};window.addEventListener("message",async e=>{if(e.origin===n.origin)switch(e.data.type){case b.ANGIE_READY:r({iframe:c,iframeUrlObject:n});break;case b.ANGIE_LOADED:c.contentWindow?.postMessage({type:b.HOST_READY,instanceId:s},n.origin)}}),c.setAttribute("src",n.href),c.id="angie-iframe",c.setAttribute("frameborder","0"),c.setAttribute("scrolling","no"),c.setAttribute("style",Object.entries(d).map(([e,t])=>`${e}: ${t}`).join("; ")),c.setAttribute("allow","clipboard-write; clipboard-read"),e.insertCallback?e.insertCallback(c):a.body.appendChild(c)})})({origin:e.origin||"https://angie.elementor.com",path:e.path&&Dt(e.path)?e.path:"angie/wp-admin",insertCallback:e=>{Lt.log("Injecting Angie iframe into sidebar container"),e.setAttribute("title","Angie AI Assistant"),e.setAttribute("role","application"),e.setAttribute("aria-label","Angie AI Assistant Interface");const i=document.getElementById("angie-sidebar-loading");i&&(i.textContent=""),t?.appendChild(e),wt(e,!0),e.addEventListener("load",()=>{e.focus()})},css:{width:"100%",height:"100%",border:"none",outline:"none"},uiTheme:e.uiTheme,isRTL:e.isRTL,sdkVersion:"1.4.5"});A.iframe=i,A.iframeUrlObject=s,window.addEventListener("message",e=>{if(e.origin===A.iframeUrlObject?.origin)switch(e.data.type){case v.SET:window.localStorage.setItem(e.data.key,e.data.value);break;case v.GET:{const t=e.ports[0],i=window.localStorage.getItem(e.data.key);t.postMessage({value:i});break}}}),(e=>{window.addEventListener("message",async t=>{const i=t.origin===window.location.origin,s=t.origin===e.iframeUrlObject?.origin;if(i||s)switch(t?.data?.type){case S.SDK_ANGIE_ALL_SERVERS_REGISTERED:break;case S.SDK_ANGIE_READY_PING:{const e=t.ports[0];yt.log("Angie is ready",t),mt(e,{message:"Angie is ready"});break}case S.SDK_REQUEST_CLIENT_CREATION:{const i=t.data.payload;try{const s=t.ports[0],r=new MessageChannel;r.port1.onmessage=e=>{s.postMessage({success:!0,data:e.data})};const n={type:S.SDK_REQUEST_CLIENT_CREATION,payload:{success:!0,...i,clientId:`dynamic-client-${i.serverName}-${i.serverVersion}-${Date.now()}`,requestId:t.data.payload.requestId},timestamp:Date.now()};if(!e.iframe)throw new Error("Iframe not found");e.iframe.contentWindow?.postMessage(n,e.iframeUrlObject?.origin||"",[r.port2])}catch(e){yt.error(`Failed to create client for SDK server "${i.serverName}":`,e)}break}case S.SDK_TRIGGER_ANGIE:yt.log("SDK Trigger Angie received",t.data);try{const{requestId:i,prompt:s,context:r}=t.data.payload;if(!e.iframe)throw new Error("Iframe not found");e.iframe.contentWindow?.postMessage({type:S.SDK_TRIGGER_ANGIE,payload:{requestId:i,prompt:s,context:r}},e.iframeUrlObject?.origin||""),window.postMessage({type:S.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!0,requestId:i,response:"Angie triggered successfully"}},window.location.origin)}catch(e){yt.error("Failed to trigger Angie:",e),window.postMessage({type:S.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!1,requestId:t.data.payload?.requestId,error:e instanceof Error?e.message:"Unknown error"}},window.location.origin)}}})})(A),function({trustedOrigin:e,onOAuthParamsCleared:t}){window.addEventListener("message",i=>{if(i.origin!==e)return;const s=i.ports?.[0];switch(i.data.type){case De:if(!s)return;st(s,{topUrl:window.location.href});break;case Ne:window.location.href=i.data.payload.url;break;case qe:{if(!s)return;const e=i.data.payload.url;if(!history?.replaceState)return void rt(s,{message:"URL update not supported in this browser"});try{const i=window.location.href;history.replaceState({},"",e),function(e,t){const i=new URL(e).searchParams,s=new URL(t).searchParams,r=[$e,je,He];return r.some(e=>i.has(e))&&!r.some(e=>s.has(e))}(i,e)&&t?.(),st(s,{message:"URL updated successfully"})}catch(e){rt(s,{message:"URL update failed: "+(e instanceof Error?e.message:"Unknown error")})}break}case Me:if(!s)return;st(s,{isPending:"true"===new URLSearchParams(window.location.search).get($e)})}})}({trustedOrigin:A.iframeUrlObject?.origin??"",onOAuthParamsCleared:_t}),(()=>{const e={window:A.iframe,windowURL:A.iframeUrlObject};window.addEventListener("load",()=>{pt.log("OIDC: Window load event fired, forwarding OIDC state if present"),nt({targets:e,onSuccess:_t})}),nt({targets:e,onSuccess:_t})})(),new URLSearchParams(window.location.search).has("start-oauth")&&(pt.log("Post-consent flow detected, checking for referrer redirect"),ut()),window.addEventListener("message",async t=>{if([window.location.origin,e.origin||"https://angie.elementor.com"].includes(t.origin))if(t?.data?.type===S.ANGIE_CHAT_TOGGLE)A.open=t.data.open,A.iframe&&wt(A.iframe,A.open);else if(t?.data?.type===S.ANGIE_STUDIO_TOGGLE){const e=t.data.isStudioOpen;if(!A.iframe)return;if(e)document.documentElement.classList.add("angie-studio-active");else{const e=It();document.documentElement.style.setProperty("--angie-sidebar-width",`${e}px`),document.documentElement.classList.remove("angie-studio-active")}}else if(t?.data?.type===S.ANGIE_NAVIGATE_TO_URL){const{url:e="",confirmed:i=!1}=t.data.payload||{};if(!i)return void Lt.log("Navigation requires user confirmation");if(!((e,t=[])=>{const i=0===t.length&&"undefined"!=typeof window?[window.location.origin]:t;if(!e.startsWith("http"))return!1;try{const t=new URL(e);return i.includes(t.origin)}catch{return!1}})(e))return void Lt.error("Navigation blocked: Invalid or unsafe URL",{url:e});await Nt(),window.location.assign(e)}else if(t?.data?.type===S.ANGIE_PAGE_RELOAD){const{confirmed:e=!1}=t.data.payload||{};if(!e)return void Lt.log("Page reload requires user confirmation");Lt.log("Page reload confirmed - disabling navigation prevention and reloading"),await Nt(),setTimeout(()=>{window.location.reload()},50)}else t?.data?.type===b.RESET_HASH&&(window.location.hash="",mt(t.ports[0],{message:"Hash reset successfully"}))})},Mt=g("registration-queue");class Ht{queue=[];isProcessing=!1;add(e){const t={id:this.generateId(e),config:e,timestamp:Date.now(),status:"pending"};return this.queue.push(t),Mt.log(`Added server "${e.name}" to queue`),t}getAll(){return[...this.queue]}getPending(){return this.queue.filter(e=>"pending"===e.status)}updateStatus(e,t,i){const s=this.queue.find(t=>t.id===e);s&&(s.status=t,i?s.error=i:"pending"!==t&&"registered"!==t||delete s.error,Mt.log(`Updated server ${e} status to ${t}`))}async processQueue(e){if(this.isProcessing)return void Mt.log("Already processing queue");this.isProcessing=!0;const t=this.getPending();Mt.log(`Processing ${t.length} pending registrations`);try{for(const i of t)try{await e(i),this.updateStatus(i.id,"registered")}catch(e){const t=e instanceof Error?e.message:String(e);this.updateStatus(i.id,"failed",t),Mt.error(`Failed to process registration ${i.id}:`,t)}}finally{this.isProcessing=!1}}clear(){this.queue=[],Mt.log("Cleared all registrations")}resetAllToPending(){if(this.isProcessing)return Mt.log("Cannot reset to pending - processing in progress"),!1;const e=this.queue.filter(e=>"registered"===e.status).length,t=this.queue.filter(e=>"failed"===e.status).length;return this.queue.forEach(e=>{"pending"!==e.status&&(e.status="pending",delete e.error)}),Mt.log(`Reset ${e+t} registrations to pending`),!0}remove(e){const t=this.queue.findIndex(t=>t.id===e);return-1!==t&&(this.queue.splice(t,1),Mt.log(`Removed registration ${e}`),!0)}generateId(e){return`reg_${e.name}_${e.version}_${Date.now()}`}}const $t={origin:"https://angie.elementor.com",uiTheme:"light",isRTL:!1,containerId:R,skipDefaultCss:!1,path:"angie/wp-admin"};class jt{angieDetector;clientManager;logger;registrationQueue;isInitialized=!1;instanceId;constructor(){this.instanceId=Math.random().toString(36).substring(2,8),this.logger=g({instanceId:this.instanceId}),this.logger.log("Constructor called - initializing SDK"),this.angieDetector=new k,this.registrationQueue=new Ht,this.clientManager=new T,this.logger.log("Setting up event handlers"),this.setupAngieReadyHandler(),this.setupServerInitHandler(),this.setupReRegistrationHandler(),this.logger.log("SDK initialization complete")}async loadSidebar(e){const{widgetConfig:t,...i}=e||{},s={...$t,...i};A.containerId=s.containerId,Ut({skipDefaultCss:s.skipDefaultCss}),await qt(s),t&&_({type:"sdk-widget-config",payload:t}),this.setupPromptHashDetection()}setupReRegistrationHandler(){window.addEventListener("message",e=>{if(e.data?.type===S.SDK_ANGIE_REFRESH_PING)if(this.logger.log("Angie refresh ping received"),this.registrationQueue.resetAllToPending()){const e=this.registrationQueue.getPending().length;this.logger.log(`Successfully reset ${e} registrations, processing queue`),this.handleAngieReady()}else this.logger.log("Skipping queue reset - processing already in progress")})}setupAngieReadyHandler(){this.angieDetector.waitForReady().then(e=>{e.isReady?this.handleAngieReady():this.logger.warn("Angie not detected - servers will remain queued")}).catch(e=>{this.logger.error("Error waiting for Angie:",e)})}async handleAngieReady(){this.logger.log("Angie is ready, processing queued registrations");try{await this.registrationQueue.processQueue(async e=>{this.logger.log(`processQueue callback called for "${e.config.name}"`),await this.processRegistration(e)}),this.isInitialized=!0,this.logger.log("Initialization complete")}catch(e){this.logger.error("Error processing registration queue:",e)}}async processRegistration(e){this.logger.log(`Processing registration for server "${e.config.name}" (ID: ${e.id})`);try{this.logger.log(`Calling clientManager.requestClientCreation for "${e.config.name}"`);const t={...e,instanceId:this.instanceId};await this.clientManager.requestClientCreation(t),this.logger.log(`Successfully registered server "${e.config.name}"`)}catch(t){throw this.logger.error(`Failed to register server "${e.config.name}":`,t),t}}registerLocalServer(e){return e.type=y.LOCAL,e.transport=m.POST_MESSAGE,this.registerServer(e)}registerRemoteServer(e){return e.type=y.REMOTE,this.registerServer(e)}isLocalServerConfig(e){return e.type===y.LOCAL||!e.type&&"server"in e}isRemoteServerConfig(e){return e.type===y.REMOTE&&"url"in e}async registerServer(e){if(!e.type)return this.logger.warn("For a local server, please use registerLocalServer instead of registerServer"),void this.registerLocalServer(e);if(this.logger.log(`registerServer called for "${e.name}"`),!e.name)throw new Error("Server name is required");if(!e.description)throw new Error("Server description is required");if(this.isLocalServerConfig(e)&&!e.server)throw new Error("Server instance is required for local servers");this.logger.log(`Registering server "${e.name}"`);const t=this.registrationQueue.add(e);if(this.logger.log(`Added registration to queue: ${t.id}`),this.angieDetector.isReady())try{await this.processRegistration(t),this.registrationQueue.updateStatus(t.id,"registered"),this.logger.log(`Server "${e.name}" registered successfully`)}catch(e){const i=e instanceof Error?e.message:String(e);throw this.registrationQueue.updateStatus(t.id,"failed",i),e}else this.logger.log(`Server "${e.name}" queued until Angie is ready`)}getRegistrations(){return this.registrationQueue.getAll()}getPendingRegistrations(){return this.registrationQueue.getPending()}isAngieReady(){return this.angieDetector.isReady()}isReady(){return this.isInitialized}async waitForReady(){if(!(await this.angieDetector.waitForReady()).isReady)throw new Error("Angie is not available");for(;!this.isInitialized;)await new Promise(e=>setTimeout(e,100))}async triggerAngie(e){if(!this.isAngieReady())throw new Error("Angie is not ready. Please wait for Angie to be available before triggering.");const t=this.generateRequestId(),i=e.options?.timeout||3e4;return new Promise((s,r)=>{const n=setTimeout(()=>{r(new Error("Angie trigger request timed out"))},i),o=e=>{e.data?.type===S.SDK_TRIGGER_ANGIE_RESPONSE&&e.data?.payload?.requestId===t&&(clearTimeout(n),window.removeEventListener("message",o),s(e.data.payload))};window.addEventListener("message",o);const a={type:S.SDK_TRIGGER_ANGIE,payload:{requestId:t,prompt:e.prompt,options:e.options,context:{pageUrl:window.location.href,pageTitle:document.title,...e.context}},timestamp:Date.now()};this.logger.log(`Triggering Angie with prompt (Request ID: ${t})`),window.postMessage(a,window.location.origin)})}destroy(){this.registrationQueue.clear(),this.logger.log("SDK destroyed")}setupServerInitHandler(){window.addEventListener("message",e=>{e.data?.type===S.SDK_REQUEST_INIT_SERVER&&(this.logger.log("Server init request received"),this.handleServerInitRequest(e))})}handleServerInitRequest(e){const{clientId:t,serverId:i,instanceId:s}=e.data.payload||{};if(t&&i)if(this.logger.log(`Server init request received - Request instanceId: ${s}, This instanceId: ${this.instanceId}`),s&&s!==this.instanceId)this.logger.log(`Ignoring server init request for different instance. Request instanceId: ${s}, this instanceId: ${this.instanceId}`);else{this.logger.log(`Handling server init request for clientId: ${t}, serverId: ${i}`);try{const t=this.registrationQueue.getAll().find(e=>e.id===i);if(!t)return void this.logger.error(`No registration found for serverId: ${i}`);if("type"in t.config&&"remote"===t.config.type)return void this.logger.log("Remote server registration detected; skipping local connect");const s=e.ports[0];if(!s)return void this.logger.error("No port provided in server init request");const r=t.config.server;this.migrateInstructionsCompat(r);const n=new I(s);r.connect(n),this.logger.log(`Server "${t.config.name}" initialized successfully`)}catch(e){this.logger.error(`Error initializing server for clientId ${t}:`,e)}}else this.logger.error("Invalid server init request - missing clientId or serverId")}migrateInstructionsCompat(e){try{const t="server"in e&&e.server?e.server:e,i=t._serverInfo,s=t._instructions;i?.instructions&&!s&&(t._instructions=i.instructions,this.logger.log("Migrated instructions from serverInfo to serverOptions (backward compat)"))}catch{}}generateRequestId(){return`${this.instanceId}-${Date.now()}-${Math.random().toString(36).substring(2,8)}`}async handlePromptHash(){const e=window.location.hash;if(e.startsWith("#angie-prompt="))try{const t=e.replace("#angie-prompt=",""),i=decodeURIComponent(t);if(!i)return void this.logger.warn("Empty prompt detected in hash");this.logger.log("Detected prompt in hash:",i),await this.waitForReady();const s=await this.triggerAngie({prompt:i,context:{source:"hash-parameter",pageUrl:window.location.href,timestamp:(new Date).toISOString()}});this.logger.log("Triggered successfully from hash:",s),window.location.hash=""}catch(e){this.logger.error("Failed to trigger from hash:",e)}}setupPromptHashDetection(){this.handlePromptHash(),window.addEventListener("hashchange",()=>this.handlePromptHash())}}const Gt=g("navigation"),zt=(e,t)=>{if(p()){t.isOpen&&window.toggleAngieSidebar&&window.toggleAngieSidebar(!0);const i=_({type:"angie-route-navigation",path:e,payload:t});return i||Gt.error("Failed to post navigation message to Angie iframe"),i}return Gt.error("Angie iframe not found"),!1},Wt="angie/requiredResources",Ft="angie/modelPreferences",Kt="angie/extendedTimeout",Jt="readOnlyHint";var Bt;!function(e){e.Inline="inline",e.EndOfTurn="end-of-turn"}(Bt||(Bt={}));
29800 -
29801 -/***/ }),
29802 -
29803 -/***/ "./packages/packages/libs/editor-mcp/src/adapters/angie-adapter.ts":
29804 -/*!*************************************************************************!*\
29805 - !*** ./packages/packages/libs/editor-mcp/src/adapters/angie-adapter.ts ***!
29806 - \*************************************************************************/
29807 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
29808 -
29809 -__webpack_require__.r(__webpack_exports__);
29810 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
29811 -/* harmony export */ AngieMcpAdapter: function() { return /* binding */ AngieMcpAdapter; }
29812 -/* harmony export */ });
29813 -/* harmony import */ var _utils_to_mcp_title__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils/to-mcp-title */ "./packages/packages/libs/editor-mcp/src/utils/to-mcp-title.ts");
29814 -
29815 -const MAX_RETRIES = 3;
29816 -class AngieMcpAdapter {
29817 - constructor(sdk, getRegisteredMcpServers) {
29818 - this.sdk = sdk;
29819 - this.getRegisteredMcpServers = getRegisteredMcpServers;
29820 - }
29821 - async activate() {
29822 - await this.sdk.waitForReady();
29823 - await this.registerEntries(this.getRegisteredMcpServers(), MAX_RETRIES);
29824 - }
29825 - async registerEntries(entries, retry) {
29826 - if (retry === 0) {
29827 - /* eslint-disable-next-line no-console */
29828 - console.error('Failed to register MCP after 3 retries. failed entries: ', entries.map(([key]) => key));
29829 - return;
29830 - }
29831 - const failed = [];
29832 - for (const [key, mcpServer, description] of entries) {
29833 - try {
29834 - await this.sdk.registerLocalServer({
29835 - title: (0,_utils_to_mcp_title__WEBPACK_IMPORTED_MODULE_0__.toMCPTitle)(key),
29836 - name: `editor-${key}`,
29837 - server: mcpServer,
29838 - version: '1.0.0',
29839 - description
29840 - });
29841 - } catch {
29842 - failed.push([key, mcpServer, description]);
29843 - }
29844 - }
29845 - if (failed.length > 0) {
29846 - return this.registerEntries(failed, retry - 1);
29847 - }
29848 - }
29849 - onToolRegistered() {
29850 - // Angie tools are registered via McpServer (at activate time).
29851 - }
29852 - onResourceRegistered() {
29853 - // Resources are registered on the McpServer instance directly.
29854 - }
29855 - sendResourceUpdated() {
29856 - // Resource update notifications are sent via MCPRegistryEntry.sendResourceUpdated.
29857 - }
29858 -}
29859 -
29860 -/***/ }),
29861 -
29862 -/***/ "./packages/packages/libs/editor-mcp/src/adapters/web-mcp-adapter.ts":
29863 -/*!***************************************************************************!*\
29864 - !*** ./packages/packages/libs/editor-mcp/src/adapters/web-mcp-adapter.ts ***!
29865 - \***************************************************************************/
29866 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
29867 -
29868 -__webpack_require__.r(__webpack_exports__);
29869 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
29870 -/* harmony export */ WebMCPAdapter: function() { return /* binding */ WebMCPAdapter; }
29871 -/* harmony export */ });
29872 -/* harmony import */ var zod_to_json_schema__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! zod-to-json-schema */ "./node_modules/zod-to-json-schema/dist/esm/index.js");
29873 -/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @elementor/schema */ "@elementor/schema");
29874 -/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_elementor_schema__WEBPACK_IMPORTED_MODULE_1__);
29875 -/* harmony import */ var _utils_register_model_context_tool__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/register-model-context-tool */ "./packages/packages/libs/editor-mcp/src/utils/register-model-context-tool.ts");
29876 -
29877 -
29878 -
29879 -class WebMCPAdapter {
29880 - registeredToolNames = new Set();
29881 - resourceEntries = [];
29882 - activated = false;
29883 - constructor(ctx) {
29884 - this.ctx = ctx;
29885 - }
29886 - activate() {
29887 - if (this.activated) {
29888 - return Promise.resolve();
29889 - }
29890 - this.activated = true;
29891 - return (0,_utils_register_model_context_tool__WEBPACK_IMPORTED_MODULE_2__.registerModelContextTool)(this.ctx.registerTool, {
29892 - name: 'editor-resource-getter',
29893 - description: 'Get an editor resource by URI, or search for available resources by partial URI. Pass a full URI to retrieve content, or a partial string to discover matching patterns.',
29894 - inputSchema: {
29895 - type: 'object',
29896 - properties: {
29897 - uri: {
29898 - type: 'string',
29899 - description: 'A full resource URI (e.g. elementor://styles/best-practices) or a partial string to search across available resource patterns.'
29900 - }
29901 - },
29902 - required: ['uri']
29903 - },
29904 - execute: async params => {
29905 - const query = params.uri;
29906 - const entries = this.resourceEntries;
29907 - if (entries.length === 0) {
29908 - return 'No resources are registered yet.';
29909 - }
29910 -
29911 - // Exact URI match
29912 - for (const entry of entries) {
29913 - const variables = entry.match(query);
29914 - if (variables !== null) {
29915 - let resourceUrl;
29916 - try {
29917 - resourceUrl = new URL(query);
29918 - } catch {
29919 - return `Invalid URI '${query}'. Provide a valid resource URI or a partial string to search patterns.`;
29920 - }
29921 - const result = await entry.handler(resourceUrl, variables);
29922 - return result.contents?.[0]?.text ?? JSON.stringify(result);
29923 - }
29924 - }
29925 -
29926 - // Partial search fallback
29927 - const matches = entries.map(e => e.pattern).filter(pattern => pattern.includes(query));
29928 - if (matches.length > 0) {
29929 - return `Found ${matches.length} matching resource pattern(s):\n${matches.join('\n')}\n\nProvide a full URI to retrieve the resource content.`;
29930 - }
29931 - const available = entries.map(e => e.pattern).join('\n');
29932 - throw new Error(`No resource matched '${query}'.\n\nAvailable patterns:\n${available}`);
29933 - }
29934 - });
29935 - }
29936 - onToolRegistered(tool, extraData) {
29937 - let jsonSchema;
29938 - try {
29939 - jsonSchema = (0,zod_to_json_schema__WEBPACK_IMPORTED_MODULE_0__.zodToJsonSchema)(_elementor_schema__WEBPACK_IMPORTED_MODULE_1__.z.object(tool.inputSchema));
29940 - } catch {
29941 - jsonSchema = tool.inputSchema;
29942 - }
29943 - if (this.registeredToolNames.has(tool.name)) {
29944 - this.ctx.unregisterTool?.(tool.name);
29945 - this.registeredToolNames.delete(tool.name);
29946 - }
29947 - let resourcesDescription = '';
29948 - if (extraData) {
29949 - if (extraData.resources?.length > 0) {
29950 - resourcesDescription += `#Resources:\n${extraData.resources?.join('\n')}\n\n`;
29951 - }
29952 - if (extraData.requiredResources?.length > 0) {
29953 - resourcesDescription += `#Required Resources:\n${extraData.requiredResources?.join('\n')}\n\n`;
29954 - }
29955 - resourcesDescription += `To read resources, use editor-resource-getter tool.\n\n`;
29956 - }
29957 - void (0,_utils_register_model_context_tool__WEBPACK_IMPORTED_MODULE_2__.registerModelContextTool)(this.ctx.registerTool, {
29958 - name: tool.name,
29959 - description: `${resourcesDescription}${tool.description}`,
29960 - inputSchema: jsonSchema,
29961 - execute: tool.execute
29962 - }).then(() => {
29963 - this.registeredToolNames.add(tool.name);
29964 - });
29965 - }
29966 - onResourceRegistered(_name, uriOrTemplate, handler) {
29967 - if (typeof uriOrTemplate === 'string') {
29968 - this.resourceEntries.push({
29969 - pattern: uriOrTemplate,
29970 - match: uri => uri === uriOrTemplate ? {} : null,
29971 - handler
29972 - });
29973 - } else {
29974 - const template = uriOrTemplate.uriTemplate;
29975 - this.resourceEntries.push({
29976 - pattern: template.toString(),
29977 - match: uri => template.match(uri),
29978 - handler
29979 - });
29980 - }
29981 - }
29982 - sendResourceUpdated() {
29983 - // WebMCP has no server-push mechanism — no-op
29984 - }
29985 -}
29986 -
29987 -/***/ }),
29988 -
29989 -/***/ "./packages/packages/libs/editor-mcp/src/angie-annotations.ts":
29990 -/*!********************************************************************!*\
29991 - !*** ./packages/packages/libs/editor-mcp/src/angie-annotations.ts ***!
29992 - \********************************************************************/
29993 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
29994 -
29995 -__webpack_require__.r(__webpack_exports__);
29996 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
29997 -/* harmony export */ ANGIE_MODEL_PREFERENCES: function() { return /* binding */ ANGIE_MODEL_PREFERENCES; },
29998 -/* harmony export */ ANGIE_REQUIRED_RESOURCES: function() { return /* binding */ ANGIE_REQUIRED_RESOURCES; },
29999 -/* harmony export */ createDefaultModelPreferences: function() { return /* binding */ createDefaultModelPreferences; }
30000 -/* harmony export */ });
30001 -const ANGIE_MODEL_PREFERENCES = 'angie/modelPreferences';
30002 -const ANGIE_REQUIRED_RESOURCES = 'angie/requiredResources';
30003 -function createDefaultModelPreferences() {
30004 - return {
30005 - hints: [{
30006 - name: 'claude-sonnet-4-5'
30007 - }],
30008 - intelligencePriority: 0.8,
30009 - speedPriority: 0.7
30010 - };
30011 -}
30012 -
30013 -/***/ }),
30014 -
30015 -/***/ "./packages/packages/libs/editor-mcp/src/events/mcp-styles-applied-event.ts":
30016 -/*!**********************************************************************************!*\
30017 - !*** ./packages/packages/libs/editor-mcp/src/events/mcp-styles-applied-event.ts ***!
30018 - \**********************************************************************************/
30019 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30020 -
30021 -__webpack_require__.r(__webpack_exports__);
30022 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30023 -/* harmony export */ MCP_STYLES_APPLIED_EVENT: function() { return /* binding */ MCP_STYLES_APPLIED_EVENT; },
30024 -/* harmony export */ dispatchMcpStylesAppliedEvent: function() { return /* binding */ dispatchMcpStylesAppliedEvent; }
30025 -/* harmony export */ });
30026 -const MCP_STYLES_APPLIED_EVENT = 'elementor/mcp/styles-applied';
30027 -function dispatchMcpStylesAppliedEvent(payload) {
30028 - window.dispatchEvent(new CustomEvent(MCP_STYLES_APPLIED_EVENT, {
30029 - detail: payload
30030 - }));
30031 -}
30032 -
30033 -/***/ }),
30034 -
30035 -/***/ "./packages/packages/libs/editor-mcp/src/init.ts":
30036 -/*!*******************************************************!*\
30037 - !*** ./packages/packages/libs/editor-mcp/src/init.ts ***!
30038 - \*******************************************************/
30039 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30040 -
30041 -__webpack_require__.r(__webpack_exports__);
30042 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30043 -/* harmony export */ startMCPServer: function() { return /* binding */ startMCPServer; }
30044 -/* harmony export */ });
30045 -/* harmony import */ var _mcp_registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mcp-registry */ "./packages/packages/libs/editor-mcp/src/mcp-registry.ts");
30046 -
30047 -let isInitialized = false;
30048 -async function startMCPServer() {
30049 - if (isInitialized) {
30050 - return;
30051 - }
30052 - isInitialized = true;
30053 - try {
30054 - await (0,_mcp_registry__WEBPACK_IMPORTED_MODULE_0__.createAndRegisterAdapters)();
30055 - } catch (error) {
30056 - /* eslint-disable-next-line no-console */
30057 - console.error('MCP adapter activation failed:', error);
30058 - } finally {
30059 - (0,_mcp_registry__WEBPACK_IMPORTED_MODULE_0__.signalMcpReady)();
30060 - }
30061 -}
30062 -if (typeof document !== 'undefined') {
30063 - document.addEventListener('DOMContentLoaded', () => void startMCPServer(), {
30064 - once: true
30065 - });
30066 -} else {
30067 - void startMCPServer();
30068 -}
30069 -
30070 -/***/ }),
30071 -
30072 -/***/ "./packages/packages/libs/editor-mcp/src/mcp-registry.ts":
30073 -/*!***************************************************************!*\
30074 - !*** ./packages/packages/libs/editor-mcp/src/mcp-registry.ts ***!
30075 - \***************************************************************/
30076 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30077 -
30078 -__webpack_require__.r(__webpack_exports__);
30079 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30080 -/* harmony export */ createAndRegisterAdapters: function() { return /* binding */ createAndRegisterAdapters; },
30081 -/* harmony export */ getMCPByDomain: function() { return /* binding */ getMCPByDomain; },
30082 -/* harmony export */ getRegisteredMcpServers: function() { return /* binding */ getRegisteredMcpServers; },
30083 -/* harmony export */ registerMcp: function() { return /* binding */ registerMcp; },
30084 -/* harmony export */ registerMcpAdapter: function() { return /* binding */ registerMcpAdapter; },
30085 -/* harmony export */ signalMcpReady: function() { return /* binding */ signalMcpReady; }
30086 -/* harmony export */ });
30087 -/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor/schema */ "@elementor/schema");
30088 -/* harmony import */ var _elementor_schema__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_elementor_schema__WEBPACK_IMPORTED_MODULE_0__);
30089 -/* harmony import */ var _modelcontextprotocol_sdk_server_mcp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @modelcontextprotocol/sdk/server/mcp.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js");
30090 -/* harmony import */ var _adapters_angie_adapter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./adapters/angie-adapter */ "./packages/packages/libs/editor-mcp/src/adapters/angie-adapter.ts");
30091 -/* harmony import */ var _adapters_web_mcp_adapter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./adapters/web-mcp-adapter */ "./packages/packages/libs/editor-mcp/src/adapters/web-mcp-adapter.ts");
30092 -/* harmony import */ var _angie_annotations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./angie-annotations */ "./packages/packages/libs/editor-mcp/src/angie-annotations.ts");
30093 -/* harmony import */ var _test_utils_mock_mcp_registry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./test-utils/mock-mcp-registry */ "./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts");
30094 -/* harmony import */ var _utils_get_model_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/get-model-context */ "./packages/packages/libs/editor-mcp/src/utils/get-model-context.ts");
30095 -/* harmony import */ var _utils_get_sdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/get-sdk */ "./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts");
30096 -/* harmony import */ var _utils_is_angie_available__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/is-angie-available */ "./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts");
30097 -/* harmony import */ var _utils_merge_required_resources__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/merge-required-resources */ "./packages/packages/libs/editor-mcp/src/utils/merge-required-resources.ts");
30098 -/* harmony import */ var _utils_register_server_docs_resource__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/register-server-docs-resource */ "./packages/packages/libs/editor-mcp/src/utils/register-server-docs-resource.ts");
30099 -/* harmony import */ var _utils_to_mcp_title__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/to-mcp-title */ "./packages/packages/libs/editor-mcp/src/utils/to-mcp-title.ts");
30100 -
30101 -
30102 -
30103 -
30104 -
30105 -
30106 -
30107 -
30108 -
30109 -
30110 -
30111 -
30112 -const mcpRegistry = {};
30113 -const mcpDescriptions = {};
30114 -// @ts-ignore - QUnit fails this
30115 -const isMcpRegistrationActivated = false || typeof globalThis.jest !== 'undefined';
30116 -const registrationAdapters = [];
30117 -const bufferedTools = [];
30118 -const bufferedResources = [];
30119 -let resolveReady;
30120 -const readyPromise = new Promise(resolve => {
30121 - resolveReady = resolve;
30122 -});
30123 -const registerMcpAdapter = adapter => {
30124 - registrationAdapters.push(adapter);
30125 - for (const tool of bufferedTools) {
30126 - try {
30127 - adapter.onToolRegistered(tool[0], tool[1]);
30128 - } catch {
30129 - // exit quietly
30130 - }
30131 - }
30132 - for (const resource of bufferedResources) {
30133 - try {
30134 - adapter.onResourceRegistered(...resource);
30135 - } catch {
30136 - // exit quietly
30137 - }
30138 - }
30139 -};
30140 -const signalMcpReady = () => {
30141 - resolveReady();
30142 -};
30143 -const createAndRegisterAdapters = async () => {
30144 - const modelContext = (0,_utils_get_model_context__WEBPACK_IMPORTED_MODULE_6__.getModelContext)();
30145 - if (modelContext) {
30146 - registerMcpAdapter(new _adapters_web_mcp_adapter__WEBPACK_IMPORTED_MODULE_3__.WebMCPAdapter(modelContext));
30147 - }
30148 - if ((0,_utils_is_angie_available__WEBPACK_IMPORTED_MODULE_8__.isAngieAvailable)()) {
30149 - registerMcpAdapter(new _adapters_angie_adapter__WEBPACK_IMPORTED_MODULE_2__.AngieMcpAdapter((0,_utils_get_sdk__WEBPACK_IMPORTED_MODULE_7__.getSDK)(), getRegisteredMcpServers));
30150 - }
30151 - await Promise.all(registrationAdapters.map(adapter => adapter.activate()));
30152 -};
30153 -
30154 -// utility function to run a callback on all MCP interfaces
30155 -async function callAdapters(fn) {
30156 - for await (const adapter of registrationAdapters) {
30157 - try {
30158 - await Promise.resolve(fn(adapter));
30159 - } catch {
30160 - // adapter failed — exit quietly, continue to next
30161 - }
30162 - }
30163 -}
30164 -const registerMcp = (mcp, name) => {
30165 - const mcpName = isAlphabet(name);
30166 - mcpRegistry[mcpName] = mcp;
30167 -};
30168 -const getRegisteredMcpServers = () => {
30169 - return Object.entries(mcpRegistry).map(([key, server]) => [key, server, mcpDescriptions[key] || key]);
30170 -};
30171 -const isAlphabet = str => {
30172 - const passes = !!str && /^[a-z_]+$/.test(str);
30173 - if (!passes) {
30174 - throw new Error('Not alphabet');
30175 - }
30176 - return str;
30177 -};
30178 -
30179 -/**
30180 - * @param namespace The namespace of the MCP server. It should contain only lowercase alphabetic characters.
30181 - * @param options
30182 - * @param options.instructions Short hint about the MCP and its toolset (MCP SDK `instructions`; keeps payload small).
30183 - * @param options.docs Full documentation registered as a lazy-loaded resource.
30184 - * When provided, it is registered at elementor://{namespace}/server-docs
30185 - * and auto-injected into every tool's requiredResources.
30186 - */
30187 -const getMCPByDomain = (namespace, options) => {
30188 - const mcpName = `editor-${isAlphabet(namespace)}`;
30189 - const title = (0,_utils_to_mcp_title__WEBPACK_IMPORTED_MODULE_11__.toMCPTitle)(namespace);
30190 - // @ts-ignore - QUnit fails this
30191 - if (typeof globalThis.jest !== 'undefined') {
30192 - return (0,_test_utils_mock_mcp_registry__WEBPACK_IMPORTED_MODULE_5__.mockMcpRegistry)();
30193 - }
30194 - if (!mcpRegistry[namespace]) {
30195 - mcpRegistry[namespace] = new _modelcontextprotocol_sdk_server_mcp_js__WEBPACK_IMPORTED_MODULE_1__.McpServer({
30196 - name: mcpName,
30197 - title,
30198 - version: '1.0.0'
30199 - }, {
30200 - instructions: options?.instructions,
30201 - capabilities: {
30202 - resources: {
30203 - subscribe: true
30204 - }
30205 - }
30206 - });
30207 - if (options?.docs) {
30208 - (0,_utils_register_server_docs_resource__WEBPACK_IMPORTED_MODULE_10__.registerServerDocsResource)(mcpRegistry[namespace], namespace, title, options.docs, (...args) => {
30209 - bufferedResources.push(args);
30210 - callAdapters(adapter => adapter.onResourceRegistered(...args));
30211 - });
30212 - }
30213 - }
30214 - const mcpServer = mcpRegistry[namespace];
30215 - const serverDocsUri = options?.docs ? `elementor://${namespace}/server-docs` : undefined;
30216 - const {
30217 - addTool
30218 - } = createToolRegistry(mcpServer, mcpName, serverDocsUri);
30219 - return {
30220 - waitForReady: () => readyPromise,
30221 - // @ts-expect-error: TS is unable to infer the type here
30222 - resource: async (...args) => {
30223 - const [name, uriOrTemplate, ...rest] = args;
30224 - const handler = rest[rest.length - 1];
30225 - const resourceArgs = [name, uriOrTemplate, handler];
30226 - bufferedResources.push(resourceArgs);
30227 - callAdapters(adapter => adapter.onResourceRegistered(...resourceArgs));
30228 - return mcpServer.registerResource(...args);
30229 - },
30230 - sendResourceUpdated: (...args) => {
30231 - callAdapters(adapter => adapter.sendResourceUpdated({
30232 - uri: args[0].uri
30233 - }));
30234 - return Promise.resolve(mcpServer.server.sendResourceUpdated(...args)).catch(error => {
30235 - if (error?.message?.includes('Not connected')) {
30236 - return; // Expected when no MCP client is connected yet
30237 - }
30238 - if (error?.message?.includes('does not support notifying about resources')) {
30239 - return; // Server capability not declared — safe to ignore
30240 - }
30241 - throw error;
30242 - });
30243 - },
30244 - addTool,
30245 - setMCPDescription: description => {
30246 - mcpDescriptions[namespace] = description;
30247 - }
30248 - };
30249 -};
30250 -function createToolRegistry(server, serverName, serverDocsUri) {
30251 - function addTool(opts) {
30252 - const outputSchema = opts.outputSchema;
30253 - if (outputSchema) {
30254 - Object.assign(outputSchema, outputSchema.errors ?? {
30255 - errors: _elementor_schema__WEBPACK_IMPORTED_MODULE_0__.z.string().optional().describe('Error message if the tool failed')
30256 - });
30257 - }
30258 - // @ts-ignore: TS is unable to infer the type here
30259 - const inputSchema = opts.schema ? opts.schema : {};
30260 - const toolCallback = async function (args, extra) {
30261 - try {
30262 - const invocationResult = await opts.handler(opts.schema ? args : {}, extra);
30263 - return {
30264 - // structuredContent: typeof invocationResult === 'string' ? undefined : invocationResult,
30265 - content: [{
30266 - type: 'text',
30267 - text: typeof invocationResult === 'string' ? invocationResult : JSON.stringify(invocationResult)
30268 - }]
30269 - };
30270 - } catch (error) {
30271 - return {
30272 - isError: true,
30273 - structuredContent: {
30274 - errors: error.message || 'Unknown error'
30275 - },
30276 - content: [{
30277 - type: 'text',
30278 - text: error.message || 'Unknown error'
30279 - }]
30280 - };
30281 - }
30282 - };
30283 - const annotations = {
30284 - destructiveHint: opts.isDestructive,
30285 - readOnlyHint: opts.isDestructive ? false : undefined,
30286 - title: opts.name
30287 - };
30288 - const mergedResources = (0,_utils_merge_required_resources__WEBPACK_IMPORTED_MODULE_9__.mergeRequiredResources)(opts.requiredResources, serverDocsUri);
30289 - const angieAnnotations = {
30290 - [_angie_annotations__WEBPACK_IMPORTED_MODULE_4__.ANGIE_MODEL_PREFERENCES]: opts.modelPreferences ?? (0,_angie_annotations__WEBPACK_IMPORTED_MODULE_4__.createDefaultModelPreferences)(),
30291 - [_angie_annotations__WEBPACK_IMPORTED_MODULE_4__.ANGIE_REQUIRED_RESOURCES]: mergedResources
30292 - };
30293 - server.registerTool(opts.name, {
30294 - description: opts.description,
30295 - inputSchema,
30296 - // TODO: Uncomment this when the outputSchema is stable
30297 - // outputSchema,
30298 - title: opts.name,
30299 - annotations,
30300 - _meta: angieAnnotations
30301 - }, toolCallback);
30302 - const toolDescriptor = {
30303 - name: opts.name,
30304 - description: opts.description,
30305 - inputSchema: inputSchema,
30306 - execute: params => Promise.resolve(toolCallback(params, /* WebMCP: no protocol session — handlers must not rely on `extra` here */
30307 - {}))
30308 - };
30309 - const extraData = {
30310 - resources: [`Server resource name: ${serverName}, Required to fetch!`],
30311 - requiredResources: mergedResources?.map(resource => resource.uri) ?? []
30312 - };
30313 - bufferedTools.push([toolDescriptor, extraData]);
30314 - callAdapters(adapter => adapter.onToolRegistered(toolDescriptor, extraData));
30315 - if (isMcpRegistrationActivated) {
30316 - server.sendToolListChanged();
30317 - }
30318 - }
30319 - return {
30320 - addTool
30321 - };
30322 -}
30323 -
30324 -/***/ }),
30325 -
30326 -/***/ "./packages/packages/libs/editor-mcp/src/sampler.ts":
30327 -/*!**********************************************************!*\
30328 - !*** ./packages/packages/libs/editor-mcp/src/sampler.ts ***!
30329 - \**********************************************************/
30330 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30331 -
30332 -__webpack_require__.r(__webpack_exports__);
30333 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30334 -/* harmony export */ createSampler: function() { return /* binding */ createSampler; }
30335 -/* harmony export */ });
30336 -/* harmony import */ var _modelcontextprotocol_sdk_types_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @modelcontextprotocol/sdk/types.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");
30337 -
30338 -const DEFAULT_OPTS = {
30339 - maxTokens: 10000,
30340 - modelPreferences: 'openai',
30341 - model: 'gpt-4o'
30342 -};
30343 -const DEFAULT_STRUCTURED_OUTPUT = {
30344 - type: 'object',
30345 - properties: {
30346 - content: {
30347 - type: 'string',
30348 - description: 'Result'
30349 - }
30350 - },
30351 - required: ['content'],
30352 - additionalProperties: false
30353 -};
30354 -const createSampler = (server, opts = DEFAULT_OPTS) => {
30355 - const {
30356 - maxTokens = 1000,
30357 - modelPreferences = 'openai',
30358 - model = 'gpt-4o'
30359 - } = opts;
30360 - const exec = async payload => {
30361 - const systemPromptObject = {
30362 - ...(payload.systemPrompt ? {
30363 - systemPrompt: payload.systemPrompt
30364 - } : {})
30365 - };
30366 - const requestParams = payload.requestParams || {};
30367 - const result = await server.sendRequest({
30368 - method: 'sampling/createMessage',
30369 - params: {
30370 - ...requestParams,
30371 - maxTokens,
30372 - modelPreferences: {
30373 - hints: [{
30374 - name: modelPreferences
30375 - }]
30376 - },
30377 - metadata: {
30378 - model,
30379 - ...systemPromptObject,
30380 - ...{
30381 - structured_output: payload.structuredOutput || DEFAULT_STRUCTURED_OUTPUT
30382 - }
30383 - },
30384 - messages: payload.messages
30385 - }
30386 - // ...systemPromptObject,
30387 - }, _modelcontextprotocol_sdk_types_js__WEBPACK_IMPORTED_MODULE_0__.SamplingMessageSchema);
30388 - return result.content;
30389 - };
30390 - return exec;
30391 -};
30392 -
30393 -/***/ }),
30394 -
30395 -/***/ "./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts":
30396 -/*!*******************************************************************************!*\
30397 - !*** ./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts ***!
30398 - \*******************************************************************************/
30399 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30400 -
30401 -__webpack_require__.r(__webpack_exports__);
30402 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30403 -/* harmony export */ mockMcpRegistry: function() { return /* binding */ mockMcpRegistry; }
30404 -/* harmony export */ });
30405 -const mock = new Proxy({}, {
30406 - get: () => {
30407 - // eslint-disable-next-line @typescript-eslint/no-unused-vars
30408 - function mockedFn(..._) {}
30409 - return mockedFn;
30410 - }
30411 -});
30412 -const mockMcpRegistry = () => {
30413 - return {
30414 - // @ts-ignore
30415 - resource: async () => {},
30416 - // @ts-ignore
30417 - sendResourceUpdated: () => {},
30418 - addTool: () => {},
30419 - setMCPDescription: () => {},
30420 - mcpServer: mock
30421 - };
30422 -};
30423 -
30424 -/***/ }),
30425 -
30426 -/***/ "./packages/packages/libs/editor-mcp/src/utils/create-simple-resource-handler.ts":
30427 -/*!***************************************************************************************!*\
30428 - !*** ./packages/packages/libs/editor-mcp/src/utils/create-simple-resource-handler.ts ***!
30429 - \***************************************************************************************/
30430 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30431 -
30432 -__webpack_require__.r(__webpack_exports__);
30433 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30434 -/* harmony export */ createSimpleResourceHandler: function() { return /* binding */ createSimpleResourceHandler; }
30435 -/* harmony export */ });
30436 -const createSimpleResourceHandler = text => async uri => ({
30437 - contents: [{
30438 - uri: uri.href,
30439 - mimeType: 'text/plain',
30440 - text
30441 - }]
30442 -});
30443 -
30444 -/***/ }),
30445 -
30446 -/***/ "./packages/packages/libs/editor-mcp/src/utils/get-active-chat-info.ts":
30447 -/*!*****************************************************************************!*\
30448 - !*** ./packages/packages/libs/editor-mcp/src/utils/get-active-chat-info.ts ***!
30449 - \*****************************************************************************/
30450 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30451 -
30452 -__webpack_require__.r(__webpack_exports__);
30453 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30454 -/* harmony export */ getActiveChatInfo: function() { return /* binding */ getActiveChatInfo; }
30455 -/* harmony export */ });
30456 -const getActiveChatInfo = () => {
30457 - const info = localStorage.getItem('angie_active_chat_id');
30458 - if (!info) {
30459 - return {
30460 - expiresAt: 0,
30461 - sessionId: ''
30462 - };
30463 - }
30464 - const rawData = JSON.parse(info);
30465 - return {
30466 - expiresAt: rawData.expiresAt,
30467 - sessionId: rawData.sessionId
30468 - };
30469 -};
30470 -
30471 -/***/ }),
30472 -
30473 -/***/ "./packages/packages/libs/editor-mcp/src/utils/get-model-context.ts":
30474 -/*!**************************************************************************!*\
30475 - !*** ./packages/packages/libs/editor-mcp/src/utils/get-model-context.ts ***!
30476 - \**************************************************************************/
30477 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30478 -
30479 -__webpack_require__.r(__webpack_exports__);
30480 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30481 -/* harmony export */ getModelContext: function() { return /* binding */ getModelContext; }
30482 -/* harmony export */ });
30483 -function bindModelContextMethods(host) {
30484 - return {
30485 - registerTool: host.registerTool.bind(host),
30486 - unregisterTool: host.unregisterTool ? host.unregisterTool.bind(host) : undefined
30487 - };
30488 -}
30489 -function getModelContext() {
30490 - const documentModelContext = typeof document !== 'undefined' ? document.modelContext : undefined;
30491 - if (documentModelContext?.registerTool) {
30492 - return bindModelContextMethods(documentModelContext);
30493 - }
30494 - const navigatorModelContext = typeof navigator !== 'undefined' ? navigator.modelContext : undefined;
30495 - if (navigatorModelContext?.registerTool) {
30496 - return bindModelContextMethods(navigatorModelContext);
30497 - }
30498 - return undefined;
30499 -}
30500 -
30501 -/***/ }),
30502 -
30503 -/***/ "./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts":
30504 -/*!****************************************************************!*\
30505 - !*** ./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts ***!
30506 - \****************************************************************/
30507 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30508 -
30509 -__webpack_require__.r(__webpack_exports__);
30510 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30511 -/* harmony export */ MessageEventType: function() { return /* reexport safe */ _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.MessageEventType; },
30512 -/* harmony export */ getAngieIframe: function() { return /* reexport safe */ _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.getAngieIframe; },
30513 -/* harmony export */ getSDK: function() { return /* binding */ getSDK; }
30514 -/* harmony export */ });
30515 -/* harmony import */ var _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor-external/angie-sdk */ "./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");
30516 -
30517 -
30518 -let sdk;
30519 -class RetriableAngieSDK extends _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.AngieMcpSdk {
30520 - async waitForReady() {
30521 - let retryCount = 3;
30522 - while (retryCount > 0) {
30523 - try {
30524 - await super.waitForReady();
30525 - return;
30526 - } catch {
30527 - retryCount--;
30528 - await sleep();
30529 - }
30530 - }
30531 - return new Promise(() => {}); // never resolves
30532 - }
30533 -}
30534 -const sleep = (ms = 10_000) => new Promise(resolve => {
30535 - setTimeout(resolve, ms);
30536 -});
30537 -const getSDK = () => {
30538 - // @ts-ignore - QUnit fails this
30539 - const isMCPDisabled = !!globalThis.__ELEMENTOR_MCP_DISABLED__;
30540 - if (isMCPDisabled) {
30541 - return {};
30542 - }
30543 - if (!sdk) {
30544 - sdk = new RetriableAngieSDK();
30545 - }
30546 - return sdk;
30547 -};
30548 -
30549 -/***/ }),
30550 -
30551 -/***/ "./packages/packages/libs/editor-mcp/src/utils/install-angie-plugin.ts":
30552 -/*!*****************************************************************************!*\
30553 - !*** ./packages/packages/libs/editor-mcp/src/utils/install-angie-plugin.ts ***!
30554 - \*****************************************************************************/
30555 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30556 -
30557 -__webpack_require__.r(__webpack_exports__);
30558 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30559 -/* harmony export */ installAngiePlugin: function() { return /* binding */ installAngiePlugin; }
30560 -/* harmony export */ });
30561 -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
30562 -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);
30563 -
30564 -const ANGIE_SLUG = 'angie';
30565 -const isPluginErrorResponse = response => {
30566 - return typeof response === 'object' && response !== null && 'code' in response && 'message' in response;
30567 -};
30568 -const activatePlugin = async pluginPath => {
30569 - return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
30570 - path: `/wp/v2/plugins/${pluginPath}`,
30571 - method: 'POST',
30572 - data: {
30573 - status: 'active'
30574 - }
30575 - });
30576 -};
30577 -const installPlugin = async () => {
30578 - try {
30579 - return await _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
30580 - path: '/wp/v2/plugins',
30581 - method: 'POST',
30582 - data: {
30583 - slug: ANGIE_SLUG,
30584 - status: 'active'
30585 - }
30586 - });
30587 - } catch (error) {
30588 - if (isPluginErrorResponse(error) && error.code === 'folder_exists') {
30589 - return activatePlugin(`${ANGIE_SLUG}/${ANGIE_SLUG}`);
30590 - }
30591 - throw error;
30592 - }
30593 -};
30594 -const installAngiePlugin = async () => {
30595 - try {
30596 - await installPlugin();
30597 - return {
30598 - success: true
30599 - };
30600 - } catch (error) {
30601 - if (isPluginErrorResponse(error)) {
30602 - return {
30603 - success: false,
30604 - error: error.message,
30605 - code: error.code
30606 - };
30607 - }
30608 - return {
30609 - success: false,
30610 - error: 'Unknown error occurred'
30611 - };
30612 - }
30613 -};
30614 -
30615 -/***/ }),
30616 -
30617 -/***/ "./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts":
30618 -/*!***************************************************************************!*\
30619 - !*** ./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts ***!
30620 - \***************************************************************************/
30621 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30622 -
30623 -__webpack_require__.r(__webpack_exports__);
30624 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30625 -/* harmony export */ isAngieAvailable: function() { return /* binding */ isAngieAvailable; }
30626 -/* harmony export */ });
30627 -/* harmony import */ var _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor-external/angie-sdk */ "./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");
30628 -
30629 -const isAngieAvailable = () => {
30630 - return !!(0,_elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.getAngieIframe)();
30631 -};
30632 -
30633 -/***/ }),
30634 -
30635 -/***/ "./packages/packages/libs/editor-mcp/src/utils/is-angie-sidebar-open.ts":
30636 -/*!******************************************************************************!*\
30637 - !*** ./packages/packages/libs/editor-mcp/src/utils/is-angie-sidebar-open.ts ***!
30638 - \******************************************************************************/
30639 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30640 -
30641 -__webpack_require__.r(__webpack_exports__);
30642 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30643 -/* harmony export */ isAngieSidebarOpen: function() { return /* binding */ isAngieSidebarOpen; }
30644 -/* harmony export */ });
30645 -/* harmony import */ var _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor-external/angie-sdk */ "./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");
30646 -
30647 -const isAngieSidebarOpen = () => {
30648 - return (0,_elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.getAngieSidebarSavedState)() === _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.ANGIE_SIDEBAR_STATE_OPEN;
30649 -};
30650 -
30651 -/***/ }),
30652 -
30653 -/***/ "./packages/packages/libs/editor-mcp/src/utils/merge-required-resources.ts":
30654 -/*!*********************************************************************************!*\
30655 - !*** ./packages/packages/libs/editor-mcp/src/utils/merge-required-resources.ts ***!
30656 - \*********************************************************************************/
30657 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30658 -
30659 -__webpack_require__.r(__webpack_exports__);
30660 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30661 -/* harmony export */ mergeRequiredResources: function() { return /* binding */ mergeRequiredResources; }
30662 -/* harmony export */ });
30663 -const mergeRequiredResources = (toolResources, serverDocsUri) => {
30664 - if (!serverDocsUri) {
30665 - return toolResources;
30666 - }
30667 - if (toolResources?.some(r => r.uri === serverDocsUri)) {
30668 - return toolResources;
30669 - }
30670 - return [...(toolResources ?? []), {
30671 - uri: serverDocsUri,
30672 - description: 'Server docs'
30673 - }];
30674 -};
30675 -
30676 -/***/ }),
30677 -
30678 -/***/ "./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts":
30679 -/*!***********************************************************************!*\
30680 - !*** ./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts ***!
30681 - \***********************************************************************/
30682 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30683 -
30684 -__webpack_require__.r(__webpack_exports__);
30685 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30686 -/* harmony export */ toolPrompts: function() { return /* binding */ toolPrompts; }
30687 -/* harmony export */ });
30688 -class ToolPrompts {
30689 - _description = '';
30690 - _parameters = {};
30691 - _examples = [];
30692 - _furtherInstructions = [];
30693 - constructor(name) {
30694 - this.name = name;
30695 - }
30696 - description(desc) {
30697 - if (typeof desc === 'undefined') {
30698 - return this._description;
30699 - }
30700 - this._description = desc;
30701 - return this;
30702 - }
30703 - parameter(key, description) {
30704 - if (typeof description === 'undefined') {
30705 - return this._parameters[key];
30706 - }
30707 - this._parameters[key] = `**${key}**:\n${description}`;
30708 - return this;
30709 - }
30710 - instruction(instruction) {
30711 - this._furtherInstructions.push(instruction);
30712 - return this;
30713 - }
30714 - example(example) {
30715 - this._examples.push(example);
30716 - return this;
30717 - }
30718 - get examples() {
30719 - return this._examples.join('\n\n');
30720 - }
30721 - prompt() {
30722 - return `# ${this.name}
30723 -# Description
30724 -${this._description}
30725 -${this._parameters.length ? '# Parameters\n' + Object.values(this._parameters).join('\n\n') : ''}
30726 -${this._examples.length ? '# Examples\n' + this.examples : ''}
30727 -${this._furtherInstructions.length ? '# Further Instructions\n' + this._furtherInstructions.join('\n\n') : ''}
30728 -`.trim();
30729 - }
30730 -}
30731 -const toolPrompts = name => {
30732 - return new ToolPrompts(name);
30733 -};
30734 -
30735 -/***/ }),
30736 -
30737 -/***/ "./packages/packages/libs/editor-mcp/src/utils/redirect-to-app-admin.ts":
30738 -/*!******************************************************************************!*\
30739 - !*** ./packages/packages/libs/editor-mcp/src/utils/redirect-to-app-admin.ts ***!
30740 - \******************************************************************************/
30741 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30742 -
30743 -__webpack_require__.r(__webpack_exports__);
30744 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30745 -/* harmony export */ redirectToAppAdmin: function() { return /* binding */ redirectToAppAdmin; }
30746 -/* harmony export */ });
30747 -/* harmony import */ var _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor-external/angie-sdk */ "./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");
30748 -
30749 -const ANGIE_APP_URL = '/wp-admin/admin.php?page=angie-app';
30750 -const redirectToAppAdmin = prompt => {
30751 - (0,_elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.setReferrerRedirect)(window.location.href, prompt);
30752 - (0,_elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.saveState)(_elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.ANGIE_SIDEBAR_STATE_OPEN);
30753 - window.location.href = ANGIE_APP_URL;
30754 -};
30755 -
30756 -/***/ }),
30757 -
30758 -/***/ "./packages/packages/libs/editor-mcp/src/utils/redirect-to-installation.ts":
30759 -/*!*********************************************************************************!*\
30760 - !*** ./packages/packages/libs/editor-mcp/src/utils/redirect-to-installation.ts ***!
30761 - \*********************************************************************************/
30762 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30763 -
30764 -__webpack_require__.r(__webpack_exports__);
30765 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30766 -/* harmony export */ redirectToInstallation: function() { return /* binding */ redirectToInstallation; }
30767 -/* harmony export */ });
30768 -/* harmony import */ var _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor-external/angie-sdk */ "./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");
30769 -
30770 -const ANGIE_INSTALL_URL = '/wp-admin/plugin-install.php?s=angie&tab=search&type=term';
30771 -const redirectToInstallation = prompt => {
30772 - (0,_elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.setReferrerRedirect)(window.location.href, prompt);
30773 - window.location.href = ANGIE_INSTALL_URL;
30774 -};
30775 -
30776 -/***/ }),
30777 -
30778 -/***/ "./packages/packages/libs/editor-mcp/src/utils/register-model-context-tool.ts":
30779 -/*!************************************************************************************!*\
30780 - !*** ./packages/packages/libs/editor-mcp/src/utils/register-model-context-tool.ts ***!
30781 - \************************************************************************************/
30782 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30783 -
30784 -__webpack_require__.r(__webpack_exports__);
30785 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30786 -/* harmony export */ registerModelContextTool: function() { return /* binding */ registerModelContextTool; }
30787 -/* harmony export */ });
30788 -async function registerModelContextTool(registerTool, tool) {
30789 - try {
30790 - await Promise.resolve(registerTool(tool));
30791 - } catch (error) {
30792 - /* eslint-disable-next-line no-console */
30793 - console.error('Tool registration failed:', error);
30794 - }
30795 -}
30796 -
30797 -/***/ }),
30798 -
30799 -/***/ "./packages/packages/libs/editor-mcp/src/utils/register-server-docs-resource.ts":
30800 -/*!**************************************************************************************!*\
30801 - !*** ./packages/packages/libs/editor-mcp/src/utils/register-server-docs-resource.ts ***!
30802 - \**************************************************************************************/
30803 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30804 -
30805 -__webpack_require__.r(__webpack_exports__);
30806 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30807 -/* harmony export */ registerServerDocsResource: function() { return /* binding */ registerServerDocsResource; }
30808 -/* harmony export */ });
30809 -/* harmony import */ var _create_simple_resource_handler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create-simple-resource-handler */ "./packages/packages/libs/editor-mcp/src/utils/create-simple-resource-handler.ts");
30810 -
30811 -const registerServerDocsResource = (server, namespace, title, docs, onRegistered) => {
30812 - const uri = `elementor://${namespace}/server-docs`;
30813 - const name = `${namespace}-server-docs`;
30814 - const handler = (0,_create_simple_resource_handler__WEBPACK_IMPORTED_MODULE_0__.createSimpleResourceHandler)(docs);
30815 - server.registerResource(name, uri, {
30816 - title: `${title} server docs`,
30817 - description: 'Full MCP documentation (lazy-loaded)',
30818 - mimeType: 'text/plain'
30819 - }, handler);
30820 - onRegistered(name, uri, handler);
30821 -};
30822 -
30823 -/***/ }),
30824 -
30825 -/***/ "./packages/packages/libs/editor-mcp/src/utils/save-angie-consent.ts":
30826 -/*!***************************************************************************!*\
30827 - !*** ./packages/packages/libs/editor-mcp/src/utils/save-angie-consent.ts ***!
30828 - \***************************************************************************/
30829 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30830 -
30831 -__webpack_require__.r(__webpack_exports__);
30832 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30833 -/* harmony export */ saveAngieConsent: function() { return /* binding */ saveAngieConsent; }
30834 -/* harmony export */ });
30835 -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch");
30836 -/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__);
30837 -
30838 -const saveAngieConsent = async () => {
30839 - await _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({
30840 - path: '/elementor/v1/angie/consent',
30841 - method: 'POST'
30842 - });
30843 -};
30844 -
30845 -/***/ }),
30846 -
30847 -/***/ "./packages/packages/libs/editor-mcp/src/utils/send-prompt-to-angie.ts":
30848 -/*!*****************************************************************************!*\
30849 - !*** ./packages/packages/libs/editor-mcp/src/utils/send-prompt-to-angie.ts ***!
30850 - \*****************************************************************************/
30851 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30852 -
30853 -__webpack_require__.r(__webpack_exports__);
30854 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30855 -/* harmony export */ sendPromptToAngie: function() { return /* binding */ sendPromptToAngie; }
30856 -/* harmony export */ });
30857 -/* harmony import */ var _elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @elementor-external/angie-sdk */ "./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");
30858 -
30859 -const sendPromptToAngie = prompt => {
30860 - const angieSidebar = (0,_elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.getAngieIframe)();
30861 - if (!angieSidebar) {
30862 - return;
30863 - }
30864 - (0,_elementor_external_angie_sdk__WEBPACK_IMPORTED_MODULE_0__.toggleAngieSidebar)(angieSidebar, true);
30865 - if (!prompt) {
30866 - return;
30867 - }
30868 - window.location.hash = `angie-prompt=${encodeURIComponent(prompt)}`;
30869 -};
30870 -
30871 -/***/ }),
30872 -
30873 -/***/ "./packages/packages/libs/editor-mcp/src/utils/to-mcp-title.ts":
30874 -/*!*********************************************************************!*\
30875 - !*** ./packages/packages/libs/editor-mcp/src/utils/to-mcp-title.ts ***!
30876 - \*********************************************************************/
30877 -/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
30878 -
30879 -__webpack_require__.r(__webpack_exports__);
30880 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30881 -/* harmony export */ toMCPTitle: function() { return /* binding */ toMCPTitle; }
30882 -/* harmony export */ });
30883 -const toMCPTitle = namespace => {
30884 - const capitalized = namespace.charAt(0).toUpperCase() + namespace.slice(1);
30885 - return `Editor ${capitalized}`;
30886 -};
30887 -
30888 -/***/ }),
30889 -
30890 -/***/ "@elementor/schema":
30891 -/*!*****************************************!*\
30892 - !*** external ["elementorV2","schema"] ***!
30893 - \*****************************************/
30894 -/***/ (function(module) {
30895 -
30896 -module.exports = window["elementorV2"]["schema"];
30897 -
30898 -/***/ }),
30899 -
30900 -/***/ "@wordpress/api-fetch":
30901 -/*!**********************************!*\
30902 - !*** external ["wp","apiFetch"] ***!
30903 - \**********************************/
30904 -/***/ (function(module) {
30905 -
30906 -module.exports = window["wp"]["apiFetch"];
30907 -
30908 -/***/ })
30909 -
30910 -/******/ });
30911 -/************************************************************************/
30912 -/******/ // The module cache
30913 -/******/ var __webpack_module_cache__ = {};
30914 -/******/
30915 -/******/ // The require function
30916 -/******/ function __webpack_require__(moduleId) {
30917 -/******/ // Check if module is in cache
30918 -/******/ var cachedModule = __webpack_module_cache__[moduleId];
30919 -/******/ if (cachedModule !== undefined) {
30920 -/******/ return cachedModule.exports;
30921 -/******/ }
30922 -/******/ // Create a new module (and put it into the cache)
30923 -/******/ var module = __webpack_module_cache__[moduleId] = {
30924 -/******/ // no module.id needed
30925 -/******/ // no module.loaded needed
30926 -/******/ exports: {}
30927 -/******/ };
30928 -/******/
30929 -/******/ // Execute the module function
30930 -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
30931 -/******/
30932 -/******/ // Return the exports of the module
30933 -/******/ return module.exports;
30934 -/******/ }
30935 -/******/
30936 -/************************************************************************/
30937 -/******/ /* webpack/runtime/compat get default export */
30938 -/******/ !function() {
30939 -/******/ // getDefaultExport function for compatibility with non-harmony modules
30940 -/******/ __webpack_require__.n = function(module) {
30941 -/******/ var getter = module && module.__esModule ?
30942 -/******/ function() { return module['default']; } :
30943 -/******/ function() { return module; };
30944 -/******/ __webpack_require__.d(getter, { a: getter });
30945 -/******/ return getter;
30946 -/******/ };
30947 -/******/ }();
30948 -/******/
30949 -/******/ /* webpack/runtime/define property getters */
30950 -/******/ !function() {
30951 -/******/ // define getter functions for harmony exports
30952 -/******/ __webpack_require__.d = function(exports, definition) {
30953 -/******/ for(var key in definition) {
30954 -/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
30955 -/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
30956 -/******/ }
30957 -/******/ }
30958 -/******/ };
30959 -/******/ }();
30960 -/******/
30961 -/******/ /* webpack/runtime/hasOwnProperty shorthand */
30962 -/******/ !function() {
30963 -/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
30964 -/******/ }();
30965 -/******/
30966 -/******/ /* webpack/runtime/make namespace object */
30967 -/******/ !function() {
30968 -/******/ // define __esModule on exports
30969 -/******/ __webpack_require__.r = function(exports) {
30970 -/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
30971 -/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
30972 -/******/ }
30973 -/******/ Object.defineProperty(exports, '__esModule', { value: true });
30974 -/******/ };
30975 -/******/ }();
30976 -/******/
30977 -/************************************************************************/
30978 -var __webpack_exports__ = {};
30979 -// This entry needs to be wrapped in an IIFE because it needs to be isolated against other modules in the chunk.
30980 -!function() {
30981 -/*!********************************************************!*\
30982 - !*** ./packages/packages/libs/editor-mcp/src/index.ts ***!
30983 - \********************************************************/
30984 -__webpack_require__.r(__webpack_exports__);
30985 -/* harmony export */ __webpack_require__.d(__webpack_exports__, {
30986 -/* harmony export */ ANGIE_MODEL_PREFERENCES: function() { return /* reexport safe */ _angie_annotations__WEBPACK_IMPORTED_MODULE_8__.ANGIE_MODEL_PREFERENCES; },
30987 -/* harmony export */ ANGIE_REQUIRED_RESOURCES: function() { return /* reexport safe */ _angie_annotations__WEBPACK_IMPORTED_MODULE_8__.ANGIE_REQUIRED_RESOURCES; },
30988 -/* harmony export */ AngieMessageEvenetType: function() { return /* reexport safe */ _utils_get_sdk__WEBPACK_IMPORTED_MODULE_0__.MessageEventType; },
30989 -/* harmony export */ MCP_STYLES_APPLIED_EVENT: function() { return /* reexport safe */ _events_mcp_styles_applied_event__WEBPACK_IMPORTED_MODULE_16__.MCP_STYLES_APPLIED_EVENT; },
30990 -/* harmony export */ McpServer: function() { return /* reexport safe */ _modelcontextprotocol_sdk_server_mcp_js__WEBPACK_IMPORTED_MODULE_1__.McpServer; },
30991 -/* harmony export */ ResourceTemplate: function() { return /* reexport safe */ _modelcontextprotocol_sdk_server_mcp_js__WEBPACK_IMPORTED_MODULE_1__.ResourceTemplate; },
30992 -/* harmony export */ SamplingMessageSchema: function() { return /* reexport safe */ _modelcontextprotocol_sdk_types_js__WEBPACK_IMPORTED_MODULE_2__.SamplingMessageSchema; },
30993 -/* harmony export */ createAndRegisterAdapters: function() { return /* reexport safe */ _mcp_registry__WEBPACK_IMPORTED_MODULE_5__.createAndRegisterAdapters; },
30994 -/* harmony export */ createSampler: function() { return /* reexport safe */ _sampler__WEBPACK_IMPORTED_MODULE_6__.createSampler; },
30995 -/* harmony export */ dispatchMcpStylesAppliedEvent: function() { return /* reexport safe */ _events_mcp_styles_applied_event__WEBPACK_IMPORTED_MODULE_16__.dispatchMcpStylesAppliedEvent; },
30996 -/* harmony export */ getActiveChatInfo: function() { return /* reexport safe */ _utils_get_active_chat_info__WEBPACK_IMPORTED_MODULE_9__.getActiveChatInfo; },
30997 -/* harmony export */ getAngieIframe: function() { return /* reexport safe */ _utils_get_sdk__WEBPACK_IMPORTED_MODULE_0__.getAngieIframe; },
30998 -/* harmony export */ getAngieSdk: function() { return /* binding */ getAngieSdk; },
30999 -/* harmony export */ getMCPByDomain: function() { return /* reexport safe */ _mcp_registry__WEBPACK_IMPORTED_MODULE_5__.getMCPByDomain; },
31000 -/* harmony export */ getRegisteredMcpServers: function() { return /* reexport safe */ _mcp_registry__WEBPACK_IMPORTED_MODULE_5__.getRegisteredMcpServers; },
31001 -/* harmony export */ installAngiePlugin: function() { return /* reexport safe */ _utils_install_angie_plugin__WEBPACK_IMPORTED_MODULE_13__.installAngiePlugin; },
31002 -/* harmony export */ isAngieAvailable: function() { return /* reexport safe */ _utils_is_angie_available__WEBPACK_IMPORTED_MODULE_3__.isAngieAvailable; },
31003 -/* harmony export */ isAngieSidebarOpen: function() { return /* reexport safe */ _utils_is_angie_sidebar_open__WEBPACK_IMPORTED_MODULE_4__.isAngieSidebarOpen; },
31004 -/* harmony export */ redirectToAppAdmin: function() { return /* reexport safe */ _utils_redirect_to_app_admin__WEBPACK_IMPORTED_MODULE_12__.redirectToAppAdmin; },
31005 -/* harmony export */ redirectToInstallation: function() { return /* reexport safe */ _utils_redirect_to_installation__WEBPACK_IMPORTED_MODULE_11__.redirectToInstallation; },
31006 -/* harmony export */ registerMcp: function() { return /* reexport safe */ _mcp_registry__WEBPACK_IMPORTED_MODULE_5__.registerMcp; },
31007 -/* harmony export */ registerMcpAdapter: function() { return /* reexport safe */ _mcp_registry__WEBPACK_IMPORTED_MODULE_5__.registerMcpAdapter; },
31008 -/* harmony export */ saveAngieConsent: function() { return /* reexport safe */ _utils_save_angie_consent__WEBPACK_IMPORTED_MODULE_14__.saveAngieConsent; },
31009 -/* harmony export */ sendPromptToAngie: function() { return /* reexport safe */ _utils_send_prompt_to_angie__WEBPACK_IMPORTED_MODULE_10__.sendPromptToAngie; },
31010 -/* harmony export */ signalMcpReady: function() { return /* reexport safe */ _mcp_registry__WEBPACK_IMPORTED_MODULE_5__.signalMcpReady; },
31011 -/* harmony export */ startMCPServer: function() { return /* reexport safe */ _init__WEBPACK_IMPORTED_MODULE_15__.startMCPServer; },
31012 -/* harmony export */ toolPrompts: function() { return /* reexport safe */ _utils_prompt_builder__WEBPACK_IMPORTED_MODULE_7__.toolPrompts; }
31013 -/* harmony export */ });
31014 -/* harmony import */ var _utils_get_sdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/get-sdk */ "./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts");
31015 -/* harmony import */ var _modelcontextprotocol_sdk_server_mcp_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @modelcontextprotocol/sdk/server/mcp.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js");
31016 -/* harmony import */ var _modelcontextprotocol_sdk_types_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @modelcontextprotocol/sdk/types.js */ "./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");
31017 -/* harmony import */ var _utils_is_angie_available__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/is-angie-available */ "./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts");
31018 -/* harmony import */ var _utils_is_angie_sidebar_open__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/is-angie-sidebar-open */ "./packages/packages/libs/editor-mcp/src/utils/is-angie-sidebar-open.ts");
31019 -/* harmony import */ var _mcp_registry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mcp-registry */ "./packages/packages/libs/editor-mcp/src/mcp-registry.ts");
31020 -/* harmony import */ var _sampler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./sampler */ "./packages/packages/libs/editor-mcp/src/sampler.ts");
31021 -/* harmony import */ var _utils_prompt_builder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils/prompt-builder */ "./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts");
31022 -/* harmony import */ var _angie_annotations__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./angie-annotations */ "./packages/packages/libs/editor-mcp/src/angie-annotations.ts");
31023 -/* harmony import */ var _utils_get_active_chat_info__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/get-active-chat-info */ "./packages/packages/libs/editor-mcp/src/utils/get-active-chat-info.ts");
31024 -/* harmony import */ var _utils_send_prompt_to_angie__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/send-prompt-to-angie */ "./packages/packages/libs/editor-mcp/src/utils/send-prompt-to-angie.ts");
31025 -/* harmony import */ var _utils_redirect_to_installation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/redirect-to-installation */ "./packages/packages/libs/editor-mcp/src/utils/redirect-to-installation.ts");
31026 -/* harmony import */ var _utils_redirect_to_app_admin__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/redirect-to-app-admin */ "./packages/packages/libs/editor-mcp/src/utils/redirect-to-app-admin.ts");
31027 -/* harmony import */ var _utils_install_angie_plugin__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/install-angie-plugin */ "./packages/packages/libs/editor-mcp/src/utils/install-angie-plugin.ts");
31028 -/* harmony import */ var _utils_save_angie_consent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/save-angie-consent */ "./packages/packages/libs/editor-mcp/src/utils/save-angie-consent.ts");
31029 -/* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./init */ "./packages/packages/libs/editor-mcp/src/init.ts");
31030 -/* harmony import */ var _events_mcp_styles_applied_event__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./events/mcp-styles-applied-event */ "./packages/packages/libs/editor-mcp/src/events/mcp-styles-applied-event.ts");
31031 -
31032 -
31033 -
31034 -
31035 -
31036 -
31037 -
31038 -
31039 -
31040 -
31041 -
31042 -
31043 -
31044 -
31045 -
31046 -
31047 -const getAngieSdk = () => (0,_utils_get_sdk__WEBPACK_IMPORTED_MODULE_0__.getSDK)();
31048 -
31049 -
31050 -}();
31051 -(window.elementorV2 = window.elementorV2 || {}).editorMcp = __webpack_exports__;
31052 -/******/ })()
31053 -;
31054 -window.elementorV2.editorMcp?.init?.();
1 +/*! For license information please see editor-mcp.js.LICENSE.txt */
2 +!function(){"use strict";var u={"./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js":function(u,l,m){function assertToolsCallTaskCapability(u,l,m){if(!u)throw new Error(`${m} does not support task creation (required for ${l})`);if("tools/call"===l)if(!u.tools?.call)throw new Error(`${m} does not support task creation for tools/call (required for ${l})`)}function assertClientRequestTaskCapability(u,l,m){if(!u)throw new Error(`${m} does not support task creation (required for ${l})`);switch(l){case"sampling/createMessage":if(!u.sampling?.createMessage)throw new Error(`${m} does not support task creation for sampling/createMessage (required for ${l})`);break;case"elicitation/create":if(!u.elicitation?.create)throw new Error(`${m} does not support task creation for elicitation/create (required for ${l})`)}}m.r(l),m.d(l,{assertClientRequestTaskCapability:function(){return assertClientRequestTaskCapability},assertToolsCallTaskCapability:function(){return assertToolsCallTaskCapability}})},"./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js":function(u,l,m){function isTerminal(u){return"completed"===u||"failed"===u||"cancelled"===u}m.r(l),m.d(l,{isTerminal:function(){return isTerminal}})},"./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js":function(u,l,m){m.r(l),m.d(l,{ExperimentalMcpServerTasks:function(){return ExperimentalMcpServerTasks}});class ExperimentalMcpServerTasks{constructor(u){this._mcpServer=u}registerToolTask(u,l,m){const f={taskSupport:"required",...l.execution};if("forbidden"===f.taskSupport)throw new Error(`Cannot register task-based tool '${u}' with taskSupport 'forbidden'. Use registerTool() instead.`);return this._mcpServer._createRegisteredTool(u,l.title,l.description,l.inputSchema,l.outputSchema,l.annotations,f,l._meta,m)}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js":function(u,l,m){m.r(l),m.d(l,{ExperimentalServerTasks:function(){return ExperimentalServerTasks}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");class ExperimentalServerTasks{constructor(u){this._server=u}requestStream(u,l,m){return this._server.requestStream(u,l,m)}createMessageStream(u,l){const m=this._server.getClientCapabilities();if((u.tools||u.toolChoice)&&!m?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(u.messages.length>0){const l=u.messages[u.messages.length-1],m=Array.isArray(l.content)?l.content:[l.content],f=m.some(u=>"tool_result"===u.type),h=u.messages.length>1?u.messages[u.messages.length-2]:void 0,y=h?Array.isArray(h.content)?h.content:[h.content]:[],v=y.some(u=>"tool_use"===u.type);if(f){if(m.some(u=>"tool_result"!==u.type))throw new Error("The last message must contain only tool_result content if any is present");if(!v)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(v){const u=new Set(y.filter(u=>"tool_use"===u.type).map(u=>u.id)),l=new Set(m.filter(u=>"tool_result"===u.type).map(u=>u.toolUseId));if(u.size!==l.size||![...u].every(u=>l.has(u)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return this.requestStream({method:"sampling/createMessage",params:u},f.CreateMessageResultSchema,l)}elicitInputStream(u,l){const m=this._server.getClientCapabilities(),h=u.mode??"form";switch(h){case"url":if(!m?.elicitation?.url)throw new Error("Client does not support url elicitation.");break;case"form":if(!m?.elicitation?.form)throw new Error("Client does not support form elicitation.")}const y="form"===h&&void 0===u.mode?{...u,mode:"form"}:u;return this.requestStream({method:"elicitation/create",params:y},f.ElicitResultSchema,l)}async getTask(u,l){return this._server.getTask({taskId:u},l)}async getTaskResult(u,l,m){return this._server.getTaskResult({taskId:u},l,m)}async listTasks(u,l){return this._server.listTasks(u?{cursor:u}:void 0,l)}async cancelTask(u,l){return this._server.cancelTask({taskId:u},l)}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js":function(u,l,m){m.r(l),m.d(l,{COMPLETABLE_SYMBOL:function(){return f},McpZodTypeKind:function(){return h},completable:function(){return completable},getCompleter:function(){return getCompleter},isCompletable:function(){return isCompletable},unwrapCompletable:function(){return unwrapCompletable}});const f=Symbol.for("mcp.completable");function completable(u,l){return Object.defineProperty(u,f,{value:{complete:l},enumerable:!1,writable:!1,configurable:!1}),u}function isCompletable(u){return!!u&&"object"==typeof u&&f in u}function getCompleter(u){const l=u[f];return l?.complete}function unwrapCompletable(u){return u}var h;!function(u){u.Completable="McpCompletable"}(h||(h={}))},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js":function(u,l,m){m.r(l),m.d(l,{Server:function(){return Server}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),y=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js"),v=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js"),w=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js"),b=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js");class Server extends f.Protocol{constructor(u,l){super(l),this._serverInfo=u,this._loggingLevels=new Map,this.LOG_LEVEL_SEVERITY=new Map(h.LoggingLevelSchema.options.map((u,l)=>[u,l])),this.isMessageIgnored=(u,l)=>{const m=this._loggingLevels.get(l);return!!m&&this.LOG_LEVEL_SEVERITY.get(u)<this.LOG_LEVEL_SEVERITY.get(m)},this._capabilities=l?.capabilities??{},this._instructions=l?.instructions,this._jsonSchemaValidator=l?.jsonSchemaValidator??new y.AjvJsonSchemaValidator,this.setRequestHandler(h.InitializeRequestSchema,u=>this._oninitialize(u)),this.setNotificationHandler(h.InitializedNotificationSchema,()=>this.oninitialized?.()),this._capabilities.logging&&this.setRequestHandler(h.SetLevelRequestSchema,async(u,l)=>{const m=l.sessionId||l.requestInfo?.headers["mcp-session-id"]||void 0,{level:f}=u.params,y=h.LoggingLevelSchema.safeParse(f);return y.success&&this._loggingLevels.set(m,y.data),{}})}get experimental(){return this._experimental||(this._experimental={tasks:new w.ExperimentalServerTasks(this)}),this._experimental}registerCapabilities(u){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=(0,f.mergeCapabilities)(this._capabilities,u)}setRequestHandler(u,l){const m=(0,v.getObjectShape)(u),f=m?.method;if(!f)throw new Error("Schema is missing a method literal");let y;if((0,v.isZ4Schema)(f)){const u=f,l=u._zod?.def;y=l?.value??u.value}else{const u=f,l=u._def;y=l?.value??u.value}if("string"!=typeof y)throw new Error("Schema method literal must be a string");if("tools/call"===y){const wrappedHandler=async(u,m)=>{const f=(0,v.safeParse)(h.CallToolRequestSchema,u);if(!f.success){const u=f.error instanceof Error?f.error.message:String(f.error);throw new h.McpError(h.ErrorCode.InvalidParams,`Invalid tools/call request: ${u}`)}const{params:y}=f.data,w=await Promise.resolve(l(u,m));if(y.task){const u=(0,v.safeParse)(h.CreateTaskResultSchema,w);if(!u.success){const l=u.error instanceof Error?u.error.message:String(u.error);throw new h.McpError(h.ErrorCode.InvalidParams,`Invalid task creation result: ${l}`)}return u.data}const b=(0,v.safeParse)(h.CallToolResultSchema,w);if(!b.success){const u=b.error instanceof Error?b.error.message:String(b.error);throw new h.McpError(h.ErrorCode.InvalidParams,`Invalid tools/call result: ${u}`)}return b.data};return super.setRequestHandler(u,wrappedHandler)}return super.setRequestHandler(u,l)}assertCapabilityForMethod(u){switch(u){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Error(`Client does not support sampling (required for ${u})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Error(`Client does not support elicitation (required for ${u})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new Error(`Client does not support listing roots (required for ${u})`)}}assertNotificationCapability(u){switch(u){case"notifications/message":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${u})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new Error(`Server does not support notifying about resources (required for ${u})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new Error(`Server does not support notifying of tool list changes (required for ${u})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Error(`Server does not support notifying of prompt list changes (required for ${u})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Error(`Client does not support URL elicitation (required for ${u})`)}}assertRequestHandlerCapability(u){if(this._capabilities)switch(u){case"completion/complete":if(!this._capabilities.completions)throw new Error(`Server does not support completions (required for ${u})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new Error(`Server does not support logging (required for ${u})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new Error(`Server does not support prompts (required for ${u})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new Error(`Server does not support resources (required for ${u})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new Error(`Server does not support tools (required for ${u})`);break;case"tasks/get":case"tasks/list":case"tasks/result":case"tasks/cancel":if(!this._capabilities.tasks)throw new Error(`Server does not support tasks capability (required for ${u})`)}}assertTaskCapability(u){(0,b.assertClientRequestTaskCapability)(this._clientCapabilities?.tasks?.requests,u,"Client")}assertTaskHandlerCapability(u){this._capabilities&&(0,b.assertToolsCallTaskCapability)(this._capabilities.tasks?.requests,u,"Server")}async _oninitialize(u){const l=u.params.protocolVersion;this._clientCapabilities=u.params.capabilities,this._clientVersion=u.params.clientInfo;return{protocolVersion:h.SUPPORTED_PROTOCOL_VERSIONS.includes(l)?l:h.LATEST_PROTOCOL_VERSION,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},h.EmptyResultSchema)}async createMessage(u,l){if((u.tools||u.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Error("Client does not support sampling tools capability.");if(u.messages.length>0){const l=u.messages[u.messages.length-1],m=Array.isArray(l.content)?l.content:[l.content],f=m.some(u=>"tool_result"===u.type),h=u.messages.length>1?u.messages[u.messages.length-2]:void 0,y=h?Array.isArray(h.content)?h.content:[h.content]:[],v=y.some(u=>"tool_use"===u.type);if(f){if(m.some(u=>"tool_result"!==u.type))throw new Error("The last message must contain only tool_result content if any is present");if(!v)throw new Error("tool_result blocks are not matching any tool_use from the previous message")}if(v){const u=new Set(y.filter(u=>"tool_use"===u.type).map(u=>u.id)),l=new Set(m.filter(u=>"tool_result"===u.type).map(u=>u.toolUseId));if(u.size!==l.size||![...u].every(u=>l.has(u)))throw new Error("ids of tool_result blocks and tool_use blocks from previous message do not match")}}return u.tools?this.request({method:"sampling/createMessage",params:u},h.CreateMessageResultWithToolsSchema,l):this.request({method:"sampling/createMessage",params:u},h.CreateMessageResultSchema,l)}async elicitInput(u,l){switch(u.mode??"form"){case"url":{if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support url elicitation.");const m=u;return this.request({method:"elicitation/create",params:m},h.ElicitResultSchema,l)}case"form":{if(!this._clientCapabilities?.elicitation?.form)throw new Error("Client does not support form elicitation.");const m="form"===u.mode?u:{...u,mode:"form"},f=await this.request({method:"elicitation/create",params:m},h.ElicitResultSchema,l);if("accept"===f.action&&f.content&&m.requestedSchema)try{const u=this._jsonSchemaValidator.getValidator(m.requestedSchema)(f.content);if(!u.valid)throw new h.McpError(h.ErrorCode.InvalidParams,`Elicitation response content does not match requested schema: ${u.errorMessage}`)}catch(u){if(u instanceof h.McpError)throw u;throw new h.McpError(h.ErrorCode.InternalError,`Error validating elicitation response: ${u instanceof Error?u.message:String(u)}`)}return f}}}createElicitationCompletionNotifier(u,l){if(!this._clientCapabilities?.elicitation?.url)throw new Error("Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:u}},l)}async listRoots(u,l){return this.request({method:"roots/list",params:u},h.ListRootsResultSchema,l)}async sendLoggingMessage(u,l){if(this._capabilities.logging&&!this.isMessageIgnored(u.level,l))return this.notification({method:"notifications/message",params:u})}async sendResourceUpdated(u){return this.notification({method:"notifications/resources/updated",params:u})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js":function(u,l,m){m.r(l),m.d(l,{McpServer:function(){return McpServer},ResourceTemplate:function(){return ResourceTemplate}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js"),y=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js"),v=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),w=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js"),b=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js"),S=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js"),j=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js"),$=m("./node_modules/zod/v3/types.js");class McpServer{constructor(u,l){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new f.Server(u,l)}get experimental(){return this._experimental||(this._experimental={tasks:new j.ExperimentalMcpServerTasks(this)}),this._experimental}async connect(u){return await this.server.connect(u)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(getMethodValue(v.ListToolsRequestSchema)),this.server.assertCanSetRequestHandler(getMethodValue(v.CallToolRequestSchema)),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(v.ListToolsRequestSchema,()=>({tools:Object.entries(this._registeredTools).filter(([,u])=>u.enabled).map(([u,l])=>{const m={name:u,title:l.title,description:l.description,inputSchema:(()=>{const u=(0,h.normalizeObjectSchema)(l.inputSchema);return u?(0,y.toJsonSchemaCompat)(u,{strictUnions:!0,pipeStrategy:"input"}):x})(),annotations:l.annotations,execution:l.execution,_meta:l._meta};if(l.outputSchema){const u=(0,h.normalizeObjectSchema)(l.outputSchema);u&&(m.outputSchema=(0,y.toJsonSchemaCompat)(u,{strictUnions:!0,pipeStrategy:"output"}))}return m})})),this.server.setRequestHandler(v.CallToolRequestSchema,async(u,l)=>{try{const m=this._registeredTools[u.params.name];if(!m)throw new v.McpError(v.ErrorCode.InvalidParams,`Tool ${u.params.name} not found`);if(!m.enabled)throw new v.McpError(v.ErrorCode.InvalidParams,`Tool ${u.params.name} disabled`);const f=!!u.params.task,h=m.execution?.taskSupport,y="createTask"in m.handler;if(("required"===h||"optional"===h)&&!y)throw new v.McpError(v.ErrorCode.InternalError,`Tool ${u.params.name} has taskSupport '${h}' but was not registered with registerToolTask`);if("required"===h&&!f)throw new v.McpError(v.ErrorCode.MethodNotFound,`Tool ${u.params.name} requires task augmentation (taskSupport: 'required')`);if("optional"===h&&!f&&y)return await this.handleAutomaticTaskPolling(m,u,l);const w=await this.validateToolInput(m,u.params.arguments,u.params.name),b=await this.executeToolHandler(m,w,l);return f||await this.validateToolOutput(m,b,u.params.name),b}catch(u){if(u instanceof v.McpError&&u.code===v.ErrorCode.UrlElicitationRequired)throw u;return this.createToolError(u instanceof Error?u.message:String(u))}}),this._toolHandlersInitialized=!0)}createToolError(u){return{content:[{type:"text",text:u}],isError:!0}}async validateToolInput(u,l,m){if(!u.inputSchema)return;const f=(0,h.normalizeObjectSchema)(u.inputSchema)??u.inputSchema,y=await(0,h.safeParseAsync)(f,l);if(!y.success){const u="error"in y?y.error:"Unknown error",l=(0,h.getParseErrorMessage)(u);throw new v.McpError(v.ErrorCode.InvalidParams,`Input validation error: Invalid arguments for tool ${m}: ${l}`)}return y.data}async validateToolOutput(u,l,m){if(!u.outputSchema)return;if(!("content"in l))return;if(l.isError)return;if(!l.structuredContent)throw new v.McpError(v.ErrorCode.InvalidParams,`Output validation error: Tool ${m} has an output schema but no structured content was provided`);const f=(0,h.normalizeObjectSchema)(u.outputSchema),y=await(0,h.safeParseAsync)(f,l.structuredContent);if(!y.success){const u="error"in y?y.error:"Unknown error",l=(0,h.getParseErrorMessage)(u);throw new v.McpError(v.ErrorCode.InvalidParams,`Output validation error: Invalid structured content for tool ${m}: ${l}`)}}async executeToolHandler(u,l,m){const f=u.handler;if("createTask"in f){if(!m.taskStore)throw new Error("No task store provided.");const h={...m,taskStore:m.taskStore};if(u.inputSchema){const u=f;return await Promise.resolve(u.createTask(l,h))}{const u=f;return await Promise.resolve(u.createTask(h))}}if(u.inputSchema){const u=f;return await Promise.resolve(u(l,m))}{const u=f;return await Promise.resolve(u(m))}}async handleAutomaticTaskPolling(u,l,m){if(!m.taskStore)throw new Error("No task store provided for task-capable tool.");const f=await this.validateToolInput(u,l.params.arguments,l.params.name),h=u.handler,y={...m,taskStore:m.taskStore},w=f?await Promise.resolve(h.createTask(f,y)):await Promise.resolve(h.createTask(y)),b=w.task.taskId;let S=w.task;const j=S.pollInterval??5e3;for(;"completed"!==S.status&&"failed"!==S.status&&"cancelled"!==S.status;){await new Promise(u=>setTimeout(u,j));const u=await m.taskStore.getTask(b);if(!u)throw new v.McpError(v.ErrorCode.InternalError,`Task ${b} not found during polling`);S=u}return await m.taskStore.getTaskResult(b)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(getMethodValue(v.CompleteRequestSchema)),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(v.CompleteRequestSchema,async u=>{switch(u.params.ref.type){case"ref/prompt":return(0,v.assertCompleteRequestPrompt)(u),this.handlePromptCompletion(u,u.params.ref);case"ref/resource":return(0,v.assertCompleteRequestResourceTemplate)(u),this.handleResourceCompletion(u,u.params.ref);default:throw new v.McpError(v.ErrorCode.InvalidParams,`Invalid completion reference: ${u.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(u,l){const m=this._registeredPrompts[l.name];if(!m)throw new v.McpError(v.ErrorCode.InvalidParams,`Prompt ${l.name} not found`);if(!m.enabled)throw new v.McpError(v.ErrorCode.InvalidParams,`Prompt ${l.name} disabled`);if(!m.argsSchema)return E;const f=(0,h.getObjectShape)(m.argsSchema),y=f?.[u.params.argument.name];if(!(0,w.isCompletable)(y))return E;const b=(0,w.getCompleter)(y);if(!b)return E;return createCompletionResult(await b(u.params.argument.value,u.params.context))}async handleResourceCompletion(u,l){const m=Object.values(this._registeredResourceTemplates).find(u=>u.resourceTemplate.uriTemplate.toString()===l.uri);if(!m){if(this._registeredResources[l.uri])return E;throw new v.McpError(v.ErrorCode.InvalidParams,`Resource template ${u.params.ref.uri} not found`)}const f=m.resourceTemplate.completeCallback(u.params.argument.name);if(!f)return E;return createCompletionResult(await f(u.params.argument.value,u.params.context))}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(getMethodValue(v.ListResourcesRequestSchema)),this.server.assertCanSetRequestHandler(getMethodValue(v.ListResourceTemplatesRequestSchema)),this.server.assertCanSetRequestHandler(getMethodValue(v.ReadResourceRequestSchema)),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(v.ListResourcesRequestSchema,async(u,l)=>{const m=Object.entries(this._registeredResources).filter(([u,l])=>l.enabled).map(([u,l])=>({uri:u,name:l.name,...l.metadata})),f=[];for(const u of Object.values(this._registeredResourceTemplates)){if(!u.resourceTemplate.listCallback)continue;const m=await u.resourceTemplate.listCallback(l);for(const l of m.resources)f.push({...u.metadata,...l})}return{resources:[...m,...f]}}),this.server.setRequestHandler(v.ListResourceTemplatesRequestSchema,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([u,l])=>({name:u,uriTemplate:l.resourceTemplate.uriTemplate.toString(),...l.metadata}))})),this.server.setRequestHandler(v.ReadResourceRequestSchema,async(u,l)=>{const m=new URL(u.params.uri),f=this._registeredResources[m.toString()];if(f){if(!f.enabled)throw new v.McpError(v.ErrorCode.InvalidParams,`Resource ${m} disabled`);return f.readCallback(m,l)}for(const u of Object.values(this._registeredResourceTemplates)){const f=u.resourceTemplate.uriTemplate.match(m.toString());if(f)return u.readCallback(m,f,l)}throw new v.McpError(v.ErrorCode.InvalidParams,`Resource ${m} not found`)}),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(getMethodValue(v.ListPromptsRequestSchema)),this.server.assertCanSetRequestHandler(getMethodValue(v.GetPromptRequestSchema)),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(v.ListPromptsRequestSchema,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,u])=>u.enabled).map(([u,l])=>({name:u,title:l.title,description:l.description,arguments:l.argsSchema?promptArgumentsFromSchema(l.argsSchema):void 0}))})),this.server.setRequestHandler(v.GetPromptRequestSchema,async(u,l)=>{const m=this._registeredPrompts[u.params.name];if(!m)throw new v.McpError(v.ErrorCode.InvalidParams,`Prompt ${u.params.name} not found`);if(!m.enabled)throw new v.McpError(v.ErrorCode.InvalidParams,`Prompt ${u.params.name} disabled`);if(m.argsSchema){const f=(0,h.normalizeObjectSchema)(m.argsSchema),y=await(0,h.safeParseAsync)(f,u.params.arguments);if(!y.success){const l="error"in y?y.error:"Unknown error",m=(0,h.getParseErrorMessage)(l);throw new v.McpError(v.ErrorCode.InvalidParams,`Invalid arguments for prompt ${u.params.name}: ${m}`)}const w=y.data,b=m.callback;return await Promise.resolve(b(w,l))}{const u=m.callback;return await Promise.resolve(u(l))}}),this._promptHandlersInitialized=!0)}resource(u,l,...m){let f;"object"==typeof m[0]&&(f=m.shift());const h=m[0];if("string"==typeof l){if(this._registeredResources[l])throw new Error(`Resource ${l} is already registered`);const m=this._createRegisteredResource(u,void 0,l,f,h);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),m}{if(this._registeredResourceTemplates[u])throw new Error(`Resource template ${u} is already registered`);const m=this._createRegisteredResourceTemplate(u,void 0,l,f,h);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),m}}registerResource(u,l,m,f){if("string"==typeof l){if(this._registeredResources[l])throw new Error(`Resource ${l} is already registered`);const h=this._createRegisteredResource(u,m.title,l,m,f);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),h}{if(this._registeredResourceTemplates[u])throw new Error(`Resource template ${u} is already registered`);const h=this._createRegisteredResourceTemplate(u,m.title,l,m,f);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),h}}_createRegisteredResource(u,l,m,f,h){const y={name:u,title:l,metadata:f,readCallback:h,enabled:!0,disable:()=>y.update({enabled:!1}),enable:()=>y.update({enabled:!0}),remove:()=>y.update({uri:null}),update:u=>{void 0!==u.uri&&u.uri!==m&&(delete this._registeredResources[m],u.uri&&(this._registeredResources[u.uri]=y)),void 0!==u.name&&(y.name=u.name),void 0!==u.title&&(y.title=u.title),void 0!==u.metadata&&(y.metadata=u.metadata),void 0!==u.callback&&(y.readCallback=u.callback),void 0!==u.enabled&&(y.enabled=u.enabled),this.sendResourceListChanged()}};return this._registeredResources[m]=y,y}_createRegisteredResourceTemplate(u,l,m,f,h){const y={resourceTemplate:m,title:l,metadata:f,readCallback:h,enabled:!0,disable:()=>y.update({enabled:!1}),enable:()=>y.update({enabled:!0}),remove:()=>y.update({name:null}),update:l=>{void 0!==l.name&&l.name!==u&&(delete this._registeredResourceTemplates[u],l.name&&(this._registeredResourceTemplates[l.name]=y)),void 0!==l.title&&(y.title=l.title),void 0!==l.template&&(y.resourceTemplate=l.template),void 0!==l.metadata&&(y.metadata=l.metadata),void 0!==l.callback&&(y.readCallback=l.callback),void 0!==l.enabled&&(y.enabled=l.enabled),this.sendResourceListChanged()}};this._registeredResourceTemplates[u]=y;const v=m.uriTemplate.variableNames;return Array.isArray(v)&&v.some(u=>!!m.completeCallback(u))&&this.setCompletionRequestHandler(),y}_createRegisteredPrompt(u,l,m,f,y){const v={title:l,description:m,argsSchema:void 0===f?void 0:(0,h.objectFromShape)(f),callback:y,enabled:!0,disable:()=>v.update({enabled:!1}),enable:()=>v.update({enabled:!0}),remove:()=>v.update({name:null}),update:l=>{void 0!==l.name&&l.name!==u&&(delete this._registeredPrompts[u],l.name&&(this._registeredPrompts[l.name]=v)),void 0!==l.title&&(v.title=l.title),void 0!==l.description&&(v.description=l.description),void 0!==l.argsSchema&&(v.argsSchema=(0,h.objectFromShape)(l.argsSchema)),void 0!==l.callback&&(v.callback=l.callback),void 0!==l.enabled&&(v.enabled=l.enabled),this.sendPromptListChanged()}};if(this._registeredPrompts[u]=v,f){Object.values(f).some(u=>{const l=u instanceof $.ZodOptional?u._def?.innerType:u;return(0,w.isCompletable)(l)})&&this.setCompletionRequestHandler()}return v}_createRegisteredTool(u,l,m,f,y,v,w,b,j){(0,S.validateAndWarnToolName)(u);const $={title:l,description:m,inputSchema:getZodSchemaObject(f),outputSchema:getZodSchemaObject(y),annotations:v,execution:w,_meta:b,handler:j,enabled:!0,disable:()=>$.update({enabled:!1}),enable:()=>$.update({enabled:!0}),remove:()=>$.update({name:null}),update:l=>{void 0!==l.name&&l.name!==u&&("string"==typeof l.name&&(0,S.validateAndWarnToolName)(l.name),delete this._registeredTools[u],l.name&&(this._registeredTools[l.name]=$)),void 0!==l.title&&($.title=l.title),void 0!==l.description&&($.description=l.description),void 0!==l.paramsSchema&&($.inputSchema=(0,h.objectFromShape)(l.paramsSchema)),void 0!==l.outputSchema&&($.outputSchema=(0,h.objectFromShape)(l.outputSchema)),void 0!==l.callback&&($.handler=l.callback),void 0!==l.annotations&&($.annotations=l.annotations),void 0!==l._meta&&($._meta=l._meta),void 0!==l.enabled&&($.enabled=l.enabled),this.sendToolListChanged()}};return this._registeredTools[u]=$,this.setToolRequestHandlers(),this.sendToolListChanged(),$}tool(u,...l){if(this._registeredTools[u])throw new Error(`Tool ${u} is already registered`);let m,f,h;if("string"==typeof l[0]&&(m=l.shift()),l.length>1){const u=l[0];isZodRawShapeCompat(u)?(f=l.shift(),l.length>1&&"object"==typeof l[0]&&null!==l[0]&&!isZodRawShapeCompat(l[0])&&(h=l.shift())):"object"==typeof u&&null!==u&&(h=l.shift())}const y=l[0];return this._createRegisteredTool(u,void 0,m,f,undefined,h,{taskSupport:"forbidden"},void 0,y)}registerTool(u,l,m){if(this._registeredTools[u])throw new Error(`Tool ${u} is already registered`);const{title:f,description:h,inputSchema:y,outputSchema:v,annotations:w,_meta:b}=l;return this._createRegisteredTool(u,f,h,y,v,w,{taskSupport:"forbidden"},b,m)}prompt(u,...l){if(this._registeredPrompts[u])throw new Error(`Prompt ${u} is already registered`);let m,f;"string"==typeof l[0]&&(m=l.shift()),l.length>1&&(f=l.shift());const h=l[0],y=this._createRegisteredPrompt(u,void 0,m,f,h);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),y}registerPrompt(u,l,m){if(this._registeredPrompts[u])throw new Error(`Prompt ${u} is already registered`);const{title:f,description:h,argsSchema:y}=l,v=this._createRegisteredPrompt(u,f,h,y,m);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),v}isConnected(){return void 0!==this.server.transport}async sendLoggingMessage(u,l){return this.server.sendLoggingMessage(u,l)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}class ResourceTemplate{constructor(u,l){this._callbacks=l,this._uriTemplate="string"==typeof u?new b.UriTemplate(u):u}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(u){return this._callbacks.complete?.[u]}}const x={type:"object",properties:{}};function isZodTypeLike(u){return null!==u&&"object"==typeof u&&"parse"in u&&"function"==typeof u.parse&&"safeParse"in u&&"function"==typeof u.safeParse}function isZodRawShapeCompat(u){return"object"==typeof u&&null!==u&&(!function isZodSchemaInstance(u){return"_def"in u||"_zod"in u||isZodTypeLike(u)}(u)&&(0===Object.keys(u).length||Object.values(u).some(isZodTypeLike)))}function getZodSchemaObject(u){if(u)return isZodRawShapeCompat(u)?(0,h.objectFromShape)(u):u}function promptArgumentsFromSchema(u){const l=(0,h.getObjectShape)(u);return l?Object.entries(l).map(([u,l])=>({name:u,description:(0,h.getSchemaDescription)(l),required:!(0,h.isSchemaOptional)(l)})):[]}function getMethodValue(u){const l=(0,h.getObjectShape)(u),m=l?.method;if(!m)throw new Error("Schema is missing a method literal");const f=(0,h.getLiteralValue)(m);if("string"==typeof f)return f;throw new Error("Schema method literal must be a string")}function createCompletionResult(u){return{completion:{values:u.slice(0,100),total:u.length,hasMore:u.length>100}}}const E={completion:{values:[],hasMore:!1}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js":function(u,l,m){m.r(l),m.d(l,{getLiteralValue:function(){return getLiteralValue},getObjectShape:function(){return getObjectShape},getParseErrorMessage:function(){return getParseErrorMessage},getSchemaDescription:function(){return getSchemaDescription},isSchemaOptional:function(){return isSchemaOptional},isZ4Schema:function(){return isZ4Schema},normalizeObjectSchema:function(){return normalizeObjectSchema},objectFromShape:function(){return objectFromShape},safeParse:function(){return safeParse},safeParseAsync:function(){return safeParseAsync}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/zod/v4/core/parse.js"),y=m("./node_modules/zod/v4/mini/schemas.js");function isZ4Schema(u){return!!u._zod}function objectFromShape(u){const l=Object.values(u);if(0===l.length)return y.object({});const m=l.every(isZ4Schema),h=l.every(u=>!isZ4Schema(u));if(m)return y.object(u);if(h)return f.object(u);throw new Error("Mixed Zod versions detected in object shape.")}function safeParse(u,l){if(isZ4Schema(u)){return h.safeParse(u,l)}return u.safeParse(l)}async function safeParseAsync(u,l){if(isZ4Schema(u)){return await h.safeParseAsync(u,l)}const m=u;return await m.safeParseAsync(l)}function getObjectShape(u){if(!u)return;let l;if(isZ4Schema(u)){const m=u;l=m._zod?.def?.shape}else{l=u.shape}if(l){if("function"==typeof l)try{return l()}catch{return}return l}}function normalizeObjectSchema(u){if(u){if("object"==typeof u){const l=u;if(!u._def&&!l._zod){const l=Object.values(u);if(l.length>0&&l.every(u=>"object"==typeof u&&null!==u&&(void 0!==u._def||void 0!==u._zod||"function"==typeof u.parse)))return objectFromShape(u)}}if(isZ4Schema(u)){const l=u,m=l._zod?.def;if(m&&("object"===m.type||void 0!==m.shape))return u}else{if(void 0!==u.shape)return u}}}function getParseErrorMessage(u){if(u&&"object"==typeof u){if("message"in u&&"string"==typeof u.message)return u.message;if("issues"in u&&Array.isArray(u.issues)&&u.issues.length>0){const l=u.issues[0];if(l&&"object"==typeof l&&"message"in l)return String(l.message)}try{return JSON.stringify(u)}catch{return String(u)}}return String(u)}function getSchemaDescription(u){return u.description}function isSchemaOptional(u){if(isZ4Schema(u)){const l=u;return"optional"===l._zod?.def?.type}const l=u;return"function"==typeof u.isOptional?u.isOptional():"ZodOptional"===l._def?.typeName}function getLiteralValue(u){if(isZ4Schema(u)){const l=u,m=l._zod?.def;if(m){if(void 0!==m.value)return m.value;if(Array.isArray(m.values)&&m.values.length>0)return m.values[0]}}const l=u._def;if(l){if(void 0!==l.value)return l.value;if(Array.isArray(l.values)&&l.values.length>0)return l.values[0]}const m=u.value;if(void 0!==m)return m}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js":function(u,l,m){m.r(l),m.d(l,{getMethodLiteral:function(){return getMethodLiteral},parseWithCompat:function(){return parseWithCompat},toJsonSchemaCompat:function(){return toJsonSchemaCompat}});var f=m("./node_modules/zod/v4/core/to-json-schema.js"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/index.js");function toJsonSchemaCompat(u,l){return(0,h.isZ4Schema)(u)?f.toJSONSchema(u,{target:(m=l?.target,m?"jsonSchema7"===m||"draft-7"===m?"draft-7":"jsonSchema2019-09"===m||"draft-2020-12"===m?"draft-2020-12":"draft-7":"draft-7"),io:l?.pipeStrategy??"input"}):(0,y.zodToJsonSchema)(u,{strictUnions:l?.strictUnions??!0,pipeStrategy:l?.pipeStrategy??"input"});var m}function getMethodLiteral(u){const l=(0,h.getObjectShape)(u),m=l?.method;if(!m)throw new Error("Schema is missing a method literal");const f=(0,h.getLiteralValue)(m);if("string"!=typeof f)throw new Error("Schema method literal must be a string");return f}function parseWithCompat(u,l){const m=(0,h.safeParse)(u,l);if(!m.success)throw m.error;return m.data}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js":function(u,l,m){m.r(l),m.d(l,{DEFAULT_REQUEST_TIMEOUT_MSEC:function(){return w},Protocol:function(){return Protocol},mergeCapabilities:function(){return mergeCapabilities}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),y=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js"),v=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js");const w=6e4;class Protocol{constructor(u){this._options=u,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(h.CancelledNotificationSchema,u=>{this._oncancel(u)}),this.setNotificationHandler(h.ProgressNotificationSchema,u=>{this._onprogress(u)}),this.setRequestHandler(h.PingRequestSchema,u=>({})),this._taskStore=u?.taskStore,this._taskMessageQueue=u?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(h.GetTaskRequestSchema,async(u,l)=>{const m=await this._taskStore.getTask(u.params.taskId,l.sessionId);if(!m)throw new h.McpError(h.ErrorCode.InvalidParams,"Failed to retrieve task: Task not found");return{...m}}),this.setRequestHandler(h.GetTaskPayloadRequestSchema,async(u,l)=>{const handleTaskResult=async()=>{const m=u.params.taskId;if(this._taskMessageQueue){let u;for(;u=await this._taskMessageQueue.dequeue(m,l.sessionId);){if("response"===u.type||"error"===u.type){const l=u.message,m=l.id,f=this._requestResolvers.get(m);if(f)if(this._requestResolvers.delete(m),"response"===u.type)f(l);else{const u=l;f(new h.McpError(u.error.code,u.error.message,u.error.data))}else{const l="response"===u.type?"Response":"Error";this._onerror(new Error(`${l} handler missing for request ${m}`))}continue}await(this._transport?.send(u.message,{relatedRequestId:l.requestId}))}}const f=await this._taskStore.getTask(m,l.sessionId);if(!f)throw new h.McpError(h.ErrorCode.InvalidParams,`Task not found: ${m}`);if(!(0,y.isTerminal)(f.status))return await this._waitForTaskUpdate(m,l.signal),await handleTaskResult();if((0,y.isTerminal)(f.status)){const u=await this._taskStore.getTaskResult(m,l.sessionId);return this._clearTaskQueue(m),{...u,_meta:{...u._meta,[h.RELATED_TASK_META_KEY]:{taskId:m}}}}return await handleTaskResult()};return await handleTaskResult()}),this.setRequestHandler(h.ListTasksRequestSchema,async(u,l)=>{try{const{tasks:m,nextCursor:f}=await this._taskStore.listTasks(u.params?.cursor,l.sessionId);return{tasks:m,nextCursor:f,_meta:{}}}catch(u){throw new h.McpError(h.ErrorCode.InvalidParams,`Failed to list tasks: ${u instanceof Error?u.message:String(u)}`)}}),this.setRequestHandler(h.CancelTaskRequestSchema,async(u,l)=>{try{const m=await this._taskStore.getTask(u.params.taskId,l.sessionId);if(!m)throw new h.McpError(h.ErrorCode.InvalidParams,`Task not found: ${u.params.taskId}`);if((0,y.isTerminal)(m.status))throw new h.McpError(h.ErrorCode.InvalidParams,`Cannot cancel task in terminal status: ${m.status}`);await this._taskStore.updateTaskStatus(u.params.taskId,"cancelled","Client cancelled task execution.",l.sessionId),this._clearTaskQueue(u.params.taskId);const f=await this._taskStore.getTask(u.params.taskId,l.sessionId);if(!f)throw new h.McpError(h.ErrorCode.InvalidParams,`Task not found after cancellation: ${u.params.taskId}`);return{_meta:{},...f}}catch(u){if(u instanceof h.McpError)throw u;throw new h.McpError(h.ErrorCode.InvalidRequest,`Failed to cancel task: ${u instanceof Error?u.message:String(u)}`)}}))}async _oncancel(u){if(!u.params.requestId)return;const l=this._requestHandlerAbortControllers.get(u.params.requestId);l?.abort(u.params.reason)}_setupTimeout(u,l,m,f,h=!1){this._timeoutInfo.set(u,{timeoutId:setTimeout(f,l),startTime:Date.now(),timeout:l,maxTotalTimeout:m,resetTimeoutOnProgress:h,onTimeout:f})}_resetTimeout(u){const l=this._timeoutInfo.get(u);if(!l)return!1;const m=Date.now()-l.startTime;if(l.maxTotalTimeout&&m>=l.maxTotalTimeout)throw this._timeoutInfo.delete(u),h.McpError.fromError(h.ErrorCode.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:l.maxTotalTimeout,totalElapsed:m});return clearTimeout(l.timeoutId),l.timeoutId=setTimeout(l.onTimeout,l.timeout),!0}_cleanupTimeout(u){const l=this._timeoutInfo.get(u);l&&(clearTimeout(l.timeoutId),this._timeoutInfo.delete(u))}async connect(u){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=u;const l=this.transport?.onclose;this._transport.onclose=()=>{l?.(),this._onclose()};const m=this.transport?.onerror;this._transport.onerror=u=>{m?.(u),this._onerror(u)};const f=this._transport?.onmessage;this._transport.onmessage=(u,l)=>{f?.(u,l),(0,h.isJSONRPCResultResponse)(u)||(0,h.isJSONRPCErrorResponse)(u)?this._onresponse(u):(0,h.isJSONRPCRequest)(u)?this._onrequest(u,l):(0,h.isJSONRPCNotification)(u)?this._onnotification(u):this._onerror(new Error(`Unknown message type: ${JSON.stringify(u)}`))},await this._transport.start()}_onclose(){const u=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const u of this._requestHandlerAbortControllers.values())u.abort();this._requestHandlerAbortControllers.clear();const l=h.McpError.fromError(h.ErrorCode.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(const m of u.values())m(l)}_onerror(u){this.onerror?.(u)}_onnotification(u){const l=this._notificationHandlers.get(u.method)??this.fallbackNotificationHandler;void 0!==l&&Promise.resolve().then(()=>l(u)).catch(u=>this._onerror(new Error(`Uncaught error in notification handler: ${u}`)))}_onrequest(u,l){const m=this._requestHandlers.get(u.method)??this.fallbackRequestHandler,f=this._transport,y=u.params?._meta?.[h.RELATED_TASK_META_KEY]?.taskId;if(void 0===m){const l={jsonrpc:"2.0",id:u.id,error:{code:h.ErrorCode.MethodNotFound,message:"Method not found"}};return void(y&&this._taskMessageQueue?this._enqueueTaskMessage(y,{type:"error",message:l,timestamp:Date.now()},f?.sessionId).catch(u=>this._onerror(new Error(`Failed to enqueue error response: ${u}`))):f?.send(l).catch(u=>this._onerror(new Error(`Failed to send an error response: ${u}`))))}const v=new AbortController;this._requestHandlerAbortControllers.set(u.id,v);const w=(0,h.isTaskAugmentedRequestParams)(u.params)?u.params.task:void 0,b=this._taskStore?this.requestTaskStore(u,f?.sessionId):void 0,S={signal:v.signal,sessionId:f?.sessionId,_meta:u.params?._meta,sendNotification:async l=>{if(v.signal.aborted)return;const m={relatedRequestId:u.id};y&&(m.relatedTask={taskId:y}),await this.notification(l,m)},sendRequest:async(l,m,f)=>{if(v.signal.aborted)throw new h.McpError(h.ErrorCode.ConnectionClosed,"Request was cancelled");const w={...f,relatedRequestId:u.id};y&&!w.relatedTask&&(w.relatedTask={taskId:y});const S=w.relatedTask?.taskId??y;return S&&b&&await b.updateTaskStatus(S,"input_required"),await this.request(l,m,w)},authInfo:l?.authInfo,requestId:u.id,requestInfo:l?.requestInfo,taskId:y,taskStore:b,taskRequestedTtl:w?.ttl,closeSSEStream:l?.closeSSEStream,closeStandaloneSSEStream:l?.closeStandaloneSSEStream};Promise.resolve().then(()=>{w&&this.assertTaskHandlerCapability(u.method)}).then(()=>m(u,S)).then(async l=>{if(v.signal.aborted)return;const m={result:l,jsonrpc:"2.0",id:u.id};y&&this._taskMessageQueue?await this._enqueueTaskMessage(y,{type:"response",message:m,timestamp:Date.now()},f?.sessionId):await(f?.send(m))},async l=>{if(v.signal.aborted)return;const m={jsonrpc:"2.0",id:u.id,error:{code:Number.isSafeInteger(l.code)?l.code:h.ErrorCode.InternalError,message:l.message??"Internal error",...void 0!==l.data&&{data:l.data}}};y&&this._taskMessageQueue?await this._enqueueTaskMessage(y,{type:"error",message:m,timestamp:Date.now()},f?.sessionId):await(f?.send(m))}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(u.id)})}_onprogress(u){const{progressToken:l,...m}=u.params,f=Number(l),h=this._progressHandlers.get(f);if(!h)return void this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(u)}`));const y=this._responseHandlers.get(f),v=this._timeoutInfo.get(f);if(v&&y&&v.resetTimeoutOnProgress)try{this._resetTimeout(f)}catch(u){return this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),void y(u)}h(m)}_onresponse(u){const l=Number(u.id),m=this._requestResolvers.get(l);if(m){if(this._requestResolvers.delete(l),(0,h.isJSONRPCResultResponse)(u))m(u);else{m(new h.McpError(u.error.code,u.error.message,u.error.data))}return}const f=this._responseHandlers.get(l);if(void 0===f)return void this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(u)}`));this._responseHandlers.delete(l),this._cleanupTimeout(l);let y=!1;if((0,h.isJSONRPCResultResponse)(u)&&u.result&&"object"==typeof u.result){const m=u.result;if(m.task&&"object"==typeof m.task){const u=m.task;"string"==typeof u.taskId&&(y=!0,this._taskProgressTokens.set(u.taskId,l))}}if(y||this._progressHandlers.delete(l),(0,h.isJSONRPCResultResponse)(u))f(u);else{f(h.McpError.fromError(u.error.code,u.error.message,u.error.data))}}get transport(){return this._transport}async close(){await(this._transport?.close())}async*requestStream(u,l,m){const{task:f}=m??{};if(!f){try{const f=await this.request(u,l,m);yield{type:"result",result:f}}catch(u){yield{type:"error",error:u instanceof h.McpError?u:new h.McpError(h.ErrorCode.InternalError,String(u))}}return}let v;try{const f=await this.request(u,h.CreateTaskResultSchema,m);if(!f.task)throw new h.McpError(h.ErrorCode.InternalError,"Task creation did not return a task");for(v=f.task.taskId,yield{type:"taskCreated",task:f.task};;){const u=await this.getTask({taskId:v},m);if(yield{type:"taskStatus",task:u},(0,y.isTerminal)(u.status)){if("completed"===u.status){const u=await this.getTaskResult({taskId:v},l,m);yield{type:"result",result:u}}else"failed"===u.status?yield{type:"error",error:new h.McpError(h.ErrorCode.InternalError,`Task ${v} failed`)}:"cancelled"===u.status&&(yield{type:"error",error:new h.McpError(h.ErrorCode.InternalError,`Task ${v} was cancelled`)});return}if("input_required"===u.status){const u=await this.getTaskResult({taskId:v},l,m);return void(yield{type:"result",result:u})}const f=u.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,f)),m?.signal?.throwIfAborted()}}catch(u){yield{type:"error",error:u instanceof h.McpError?u:new h.McpError(h.ErrorCode.InternalError,String(u))}}}request(u,l,m){const{relatedRequestId:y,resumptionToken:v,onresumptiontoken:b,task:S,relatedTask:j}=m??{};return new Promise(($,x)=>{const earlyReject=u=>{x(u)};if(!this._transport)return void earlyReject(new Error("Not connected"));if(!0===this._options?.enforceStrictCapabilities)try{this.assertCapabilityForMethod(u.method),S&&this.assertTaskCapability(u.method)}catch(u){return void earlyReject(u)}m?.signal?.throwIfAborted();const E=this._requestMessageId++,R={...u,jsonrpc:"2.0",id:E};m?.onprogress&&(this._progressHandlers.set(E,m.onprogress),R.params={...u.params,_meta:{...u.params?._meta||{},progressToken:E}}),S&&(R.params={...R.params,task:S}),j&&(R.params={...R.params,_meta:{...R.params?._meta||{},[h.RELATED_TASK_META_KEY]:j}});const cancel=u=>{this._responseHandlers.delete(E),this._progressHandlers.delete(E),this._cleanupTimeout(E),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:E,reason:String(u)}},{relatedRequestId:y,resumptionToken:v,onresumptiontoken:b}).catch(u=>this._onerror(new Error(`Failed to send cancellation: ${u}`)));const l=u instanceof h.McpError?u:new h.McpError(h.ErrorCode.RequestTimeout,String(u));x(l)};this._responseHandlers.set(E,u=>{if(!m?.signal?.aborted){if(u instanceof Error)return x(u);try{const m=(0,f.safeParse)(l,u.result);m.success?$(m.data):x(m.error)}catch(u){x(u)}}}),m?.signal?.addEventListener("abort",()=>{cancel(m?.signal?.reason)});const Z=m?.timeout??w;this._setupTimeout(E,Z,m?.maxTotalTimeout,()=>cancel(h.McpError.fromError(h.ErrorCode.RequestTimeout,"Request timed out",{timeout:Z})),m?.resetTimeoutOnProgress??!1);const C=j?.taskId;if(C){const responseResolver=u=>{const l=this._responseHandlers.get(E);l?l(u):this._onerror(new Error(`Response handler missing for side-channeled request ${E}`))};this._requestResolvers.set(E,responseResolver),this._enqueueTaskMessage(C,{type:"request",message:R,timestamp:Date.now()}).catch(u=>{this._cleanupTimeout(E),x(u)})}else this._transport.send(R,{relatedRequestId:y,resumptionToken:v,onresumptiontoken:b}).catch(u=>{this._cleanupTimeout(E),x(u)})})}async getTask(u,l){return this.request({method:"tasks/get",params:u},h.GetTaskResultSchema,l)}async getTaskResult(u,l,m){return this.request({method:"tasks/result",params:u},l,m)}async listTasks(u,l){return this.request({method:"tasks/list",params:u},h.ListTasksResultSchema,l)}async cancelTask(u,l){return this.request({method:"tasks/cancel",params:u},h.CancelTaskResultSchema,l)}async notification(u,l){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(u.method);const m=l?.relatedTask?.taskId;if(m){const f={...u,jsonrpc:"2.0",params:{...u.params,_meta:{...u.params?._meta||{},[h.RELATED_TASK_META_KEY]:l.relatedTask}}};return void await this._enqueueTaskMessage(m,{type:"notification",message:f,timestamp:Date.now()})}if((this._options?.debouncedNotificationMethods??[]).includes(u.method)&&!u.params&&!l?.relatedRequestId&&!l?.relatedTask){if(this._pendingDebouncedNotifications.has(u.method))return;return this._pendingDebouncedNotifications.add(u.method),void Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(u.method),!this._transport)return;let m={...u,jsonrpc:"2.0"};l?.relatedTask&&(m={...m,params:{...m.params,_meta:{...m.params?._meta||{},[h.RELATED_TASK_META_KEY]:l.relatedTask}}}),this._transport?.send(m,l).catch(u=>this._onerror(u))})}let f={...u,jsonrpc:"2.0"};l?.relatedTask&&(f={...f,params:{...f.params,_meta:{...f.params?._meta||{},[h.RELATED_TASK_META_KEY]:l.relatedTask}}}),await this._transport.send(f,l)}setRequestHandler(u,l){const m=(0,v.getMethodLiteral)(u);this.assertRequestHandlerCapability(m),this._requestHandlers.set(m,(m,f)=>{const h=(0,v.parseWithCompat)(u,m);return Promise.resolve(l(h,f))})}removeRequestHandler(u){this._requestHandlers.delete(u)}assertCanSetRequestHandler(u){if(this._requestHandlers.has(u))throw new Error(`A request handler for ${u} already exists, which would be overridden`)}setNotificationHandler(u,l){const m=(0,v.getMethodLiteral)(u);this._notificationHandlers.set(m,m=>{const f=(0,v.parseWithCompat)(u,m);return Promise.resolve(l(f))})}removeNotificationHandler(u){this._notificationHandlers.delete(u)}_cleanupTaskProgressHandler(u){const l=this._taskProgressTokens.get(u);void 0!==l&&(this._progressHandlers.delete(l),this._taskProgressTokens.delete(u))}async _enqueueTaskMessage(u,l,m){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const f=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(u,l,m,f)}async _clearTaskQueue(u,l){if(this._taskMessageQueue){const m=await this._taskMessageQueue.dequeueAll(u,l);for(const l of m)if("request"===l.type&&(0,h.isJSONRPCRequest)(l.message)){const m=l.message.id,f=this._requestResolvers.get(m);f?(f(new h.McpError(h.ErrorCode.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(m)):this._onerror(new Error(`Resolver missing for request ${m} during task ${u} cleanup`))}}}async _waitForTaskUpdate(u,l){let m=this._options?.defaultTaskPollInterval??1e3;try{const l=await(this._taskStore?.getTask(u));l?.pollInterval&&(m=l.pollInterval)}catch{}return new Promise((u,f)=>{if(l.aborted)return void f(new h.McpError(h.ErrorCode.InvalidRequest,"Request cancelled"));const y=setTimeout(u,m);l.addEventListener("abort",()=>{clearTimeout(y),f(new h.McpError(h.ErrorCode.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(u,l){const m=this._taskStore;if(!m)throw new Error("No task store configured");return{createTask:async f=>{if(!u)throw new Error("No request provided");return await m.createTask(f,u.id,{method:u.method,params:u.params},l)},getTask:async u=>{const f=await m.getTask(u,l);if(!f)throw new h.McpError(h.ErrorCode.InvalidParams,"Failed to retrieve task: Task not found");return f},storeTaskResult:async(u,f,v)=>{await m.storeTaskResult(u,f,v,l);const w=await m.getTask(u,l);if(w){const l=h.TaskStatusNotificationSchema.parse({method:"notifications/tasks/status",params:w});await this.notification(l),(0,y.isTerminal)(w.status)&&this._cleanupTaskProgressHandler(u)}},getTaskResult:u=>m.getTaskResult(u,l),updateTaskStatus:async(u,f,v)=>{const w=await m.getTask(u,l);if(!w)throw new h.McpError(h.ErrorCode.InvalidParams,`Task "${u}" not found - it may have been cleaned up`);if((0,y.isTerminal)(w.status))throw new h.McpError(h.ErrorCode.InvalidParams,`Cannot update task "${u}" from terminal status "${w.status}" to "${f}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await m.updateTaskStatus(u,f,v,l);const b=await m.getTask(u,l);if(b){const l=h.TaskStatusNotificationSchema.parse({method:"notifications/tasks/status",params:b});await this.notification(l),(0,y.isTerminal)(b.status)&&this._cleanupTaskProgressHandler(u)}},listTasks:u=>m.listTasks(u,l)}}}function isPlainObject(u){return null!==u&&"object"==typeof u&&!Array.isArray(u)}function mergeCapabilities(u,l){const m={...u};for(const u in l){const f=u,h=l[f];if(void 0===h)continue;const y=m[f];isPlainObject(y)&&isPlainObject(h)?m[f]={...y,...h}:m[f]=h}return m}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js":function(u,l,m){m.r(l),m.d(l,{issueToolNameWarning:function(){return issueToolNameWarning},validateAndWarnToolName:function(){return validateAndWarnToolName},validateToolName:function(){return validateToolName}});const f=/^[A-Za-z0-9._-]{1,128}$/;function validateToolName(u){const l=[];if(0===u.length)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(u.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${u.length})`]};if(u.includes(" ")&&l.push("Tool name contains spaces, which may cause parsing issues"),u.includes(",")&&l.push("Tool name contains commas, which may cause parsing issues"),(u.startsWith("-")||u.endsWith("-"))&&l.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(u.startsWith(".")||u.endsWith("."))&&l.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!f.test(u)){const m=u.split("").filter(u=>!/[A-Za-z0-9._-]/.test(u)).filter((u,l,m)=>m.indexOf(u)===l);return l.push(`Tool name contains invalid characters: ${m.map(u=>`"${u}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:l}}return{isValid:!0,warnings:l}}function issueToolNameWarning(u,l){if(l.length>0){console.warn(`Tool name validation warning for "${u}":`);for(const u of l)console.warn(` - ${u}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function validateAndWarnToolName(u){const l=validateToolName(u);return issueToolNameWarning(u,l.warnings),l.isValid}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.js":function(u,l,m){m.r(l),m.d(l,{UriTemplate:function(){return UriTemplate}});const f=1e6,h=1e6;class UriTemplate{static isTemplate(u){return/\{[^}\s]+\}/.test(u)}static validateLength(u,l,m){if(u.length>l)throw new Error(`${m} exceeds maximum length of ${l} characters (got ${u.length})`)}get variableNames(){return this.parts.flatMap(u=>"string"==typeof u?[]:u.names)}constructor(u){UriTemplate.validateLength(u,f,"Template"),this.template=u,this.parts=this.parse(u)}toString(){return this.template}parse(u){const l=[];let m="",f=0,y=0;for(;f<u.length;)if("{"===u[f]){m&&(l.push(m),m="");const v=u.indexOf("}",f);if(-1===v)throw new Error("Unclosed template expression");if(y++,y>1e4)throw new Error("Template contains too many expressions (max 10000)");const w=u.slice(f+1,v),b=this.getOperator(w),S=w.includes("*"),j=this.getNames(w),$=j[0];for(const u of j)UriTemplate.validateLength(u,h,"Variable name");l.push({name:$,operator:b,names:j,exploded:S}),f=v+1}else m+=u[f],f++;return m&&l.push(m),l}getOperator(u){return["+","#",".","/","?","&"].find(l=>u.startsWith(l))||""}getNames(u){const l=this.getOperator(u);return u.slice(l.length).split(",").map(u=>u.replace("*","").trim()).filter(u=>u.length>0)}encodeValue(u,l){return UriTemplate.validateLength(u,h,"Variable value"),"+"===l||"#"===l?encodeURI(u):encodeURIComponent(u)}expandPart(u,l){if("?"===u.operator||"&"===u.operator){const m=u.names.map(m=>{const f=l[m];if(void 0===f)return"";return`${m}=${Array.isArray(f)?f.map(l=>this.encodeValue(l,u.operator)).join(","):this.encodeValue(f.toString(),u.operator)}`}).filter(u=>u.length>0);if(0===m.length)return"";return("?"===u.operator?"?":"&")+m.join("&")}if(u.names.length>1){const m=u.names.map(u=>l[u]).filter(u=>void 0!==u);return 0===m.length?"":m.map(u=>Array.isArray(u)?u[0]:u).join(",")}const m=l[u.name];if(void 0===m)return"";const f=(Array.isArray(m)?m:[m]).map(l=>this.encodeValue(l,u.operator));switch(u.operator){case"":case"+":default:return f.join(",");case"#":return"#"+f.join(",");case".":return"."+f.join(".");case"/":return"/"+f.join("/")}}expand(u){let l="",m=!1;for(const f of this.parts){if("string"==typeof f){l+=f;continue}const h=this.expandPart(f,u);h&&("?"!==f.operator&&"&"!==f.operator||!m?l+=h:l+=h.replace("?","&"),"?"!==f.operator&&"&"!==f.operator||(m=!0))}return l}escapeRegExp(u){return u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}partToRegExp(u){const l=[];for(const l of u.names)UriTemplate.validateLength(l,h,"Variable name");if("?"===u.operator||"&"===u.operator){for(let m=0;m<u.names.length;m++){const f=u.names[m],h=0===m?"\\"+u.operator:"&";l.push({pattern:h+this.escapeRegExp(f)+"=([^&]+)",name:f})}return l}let m;const f=u.name;switch(u.operator){case"":m=u.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":m="(.+)";break;case".":m="\\.([^/,]+)";break;case"/":m="/"+(u.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:m="([^/]+)"}return l.push({pattern:m,name:f}),l}match(u){UriTemplate.validateLength(u,f,"URI");let l="^";const m=[];for(const u of this.parts)if("string"==typeof u)l+=this.escapeRegExp(u);else{const f=this.partToRegExp(u);for(const{pattern:h,name:y}of f)l+=h,m.push({name:y,exploded:u.exploded})}l+="$",UriTemplate.validateLength(l,1e6,"Generated regex pattern");const h=new RegExp(l),y=u.match(h);if(!y)return null;const v={};for(let u=0;u<m.length;u++){const{name:l,exploded:f}=m[u],h=y[u+1],w=l.replace("*","");f&&h.includes(",")?v[w]=h.split(","):v[w]=h}return v}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js":function(u,l,m){m.r(l),m.d(l,{AnnotationsSchema:function(){return Ue},AudioContentSchema:function(){return Vt},BaseMetadataSchema:function(){return re},BlobResourceContentsSchema:function(){return Ne},BooleanSchemaSchema:function(){return Tn},CallToolRequestParamsSchema:function(){return an},CallToolRequestSchema:function(){return dn},CallToolResultSchema:function(){return on},CancelTaskRequestSchema:function(){return Ce},CancelTaskResultSchema:function(){return ze},CancelledNotificationParamsSchema:function(){return X},CancelledNotificationSchema:function(){return ee},ClientCapabilitiesSchema:function(){return ce},ClientNotificationSchema:function(){return rr},ClientRequestSchema:function(){return nr},ClientResultSchema:function(){return sr},ClientTasksCapabilitySchema:function(){return ae},CompatibilityCallToolResultSchema:function(){return sn},CompleteRequestParamsSchema:function(){return Wn},CompleteRequestSchema:function(){return Gn},CompleteResultSchema:function(){return Qn},ContentBlockSchema:function(){return Wt},CreateMessageRequestParamsSchema:function(){return Sn},CreateMessageRequestSchema:function(){return jn},CreateMessageResultSchema:function(){return Pn},CreateMessageResultWithToolsSchema:function(){return $n},CreateTaskResultSchema:function(){return je},CursorSchema:function(){return x},DEFAULT_NEGOTIATED_PROTOCOL_VERSION:function(){return v},ElicitRequestFormParamsSchema:function(){return Mn},ElicitRequestParamsSchema:function(){return Ln},ElicitRequestSchema:function(){return qn},ElicitRequestURLParamsSchema:function(){return Un},ElicitResultSchema:function(){return Kn},ElicitationCompleteNotificationParamsSchema:function(){return Fn},ElicitationCompleteNotificationSchema:function(){return Vn},EmbeddedResourceSchema:function(){return Bt},EmptyResultSchema:function(){return Y},EnumSchemaSchema:function(){return Dn},ErrorCode:function(){return H},GetPromptRequestParamsSchema:function(){return Mt},GetPromptRequestSchema:function(){return Lt},GetPromptResultSchema:function(){return Qt},GetTaskPayloadRequestSchema:function(){return Ee},GetTaskPayloadResultSchema:function(){return Ie},GetTaskRequestSchema:function(){return Te},GetTaskResultSchema:function(){return xe},IconSchema:function(){return te},IconsSchema:function(){return ne},ImageContentSchema:function(){return Ft},ImplementationSchema:function(){return oe},InitializeRequestParamsSchema:function(){return ue},InitializeRequestSchema:function(){return le},InitializeResultSchema:function(){return me},InitializedNotificationSchema:function(){return fe},JSONRPCErrorResponseSchema:function(){return B},JSONRPCErrorSchema:function(){return J},JSONRPCMessageSchema:function(){return G},JSONRPCNotificationSchema:function(){return F},JSONRPCRequestSchema:function(){return L},JSONRPCResponseSchema:function(){return Q},JSONRPCResultResponseSchema:function(){return V},JSONRPC_VERSION:function(){return S},LATEST_PROTOCOL_VERSION:function(){return y},LegacyTitledEnumSchemaSchema:function(){return Zn},ListChangedOptionsBaseSchema:function(){return un},ListPromptsRequestSchema:function(){return Et},ListPromptsResultSchema:function(){return Zt},ListResourceTemplatesRequestSchema:function(){return We},ListResourceTemplatesResultSchema:function(){return Ge},ListResourcesRequestSchema:function(){return He},ListResourcesResultSchema:function(){return Be},ListRootsRequestSchema:function(){return Xn},ListRootsResultSchema:function(){return er},ListTasksRequestSchema:function(){return Re},ListTasksResultSchema:function(){return Ze},ListToolsRequestSchema:function(){return nn},ListToolsResultSchema:function(){return rn},LoggingLevelSchema:function(){return ln},LoggingMessageNotificationParamsSchema:function(){return fn},LoggingMessageNotificationSchema:function(){return hn},McpError:function(){return McpError},ModelHintSchema:function(){return gn},ModelPreferencesSchema:function(){return _n},MultiSelectEnumSchemaSchema:function(){return On},NotificationSchema:function(){return N},NumberSchemaSchema:function(){return En},PaginatedRequestParamsSchema:function(){return ve},PaginatedRequestSchema:function(){return we},PaginatedResultSchema:function(){return be},PingRequestSchema:function(){return he},PrimitiveSchemaDefinitionSchema:function(){return Nn},ProgressNotificationParamsSchema:function(){return _e},ProgressNotificationSchema:function(){return ye},ProgressSchema:function(){return ge},ProgressTokenSchema:function(){return $},PromptArgumentSchema:function(){return St},PromptListChangedNotificationSchema:function(){return Yt},PromptMessageSchema:function(){return Gt},PromptReferenceSchema:function(){return Jn},PromptSchema:function(){return $t},RELATED_TASK_META_KEY:function(){return b},ReadResourceRequestParamsSchema:function(){return Xe},ReadResourceRequestSchema:function(){return tt},ReadResourceResultSchema:function(){return ot},RelatedTaskMetadataSchema:function(){return Z},RequestIdSchema:function(){return U},RequestSchema:function(){return O},ResourceContentsSchema:function(){return Ae},ResourceLinkSchema:function(){return Jt},ResourceListChangedNotificationSchema:function(){return it},ResourceReferenceSchema:function(){return Bn},ResourceRequestParamsSchema:function(){return Qe},ResourceSchema:function(){return Le},ResourceTemplateReferenceSchema:function(){return Hn},ResourceTemplateSchema:function(){return qe},ResourceUpdatedNotificationParamsSchema:function(){return bt},ResourceUpdatedNotificationSchema:function(){return kt},ResultSchema:function(){return M},RoleSchema:function(){return Me},RootSchema:function(){return Yn},RootsListChangedNotificationSchema:function(){return tr},SUPPORTED_PROTOCOL_VERSIONS:function(){return w},SamplingContentSchema:function(){return wn},SamplingMessageContentBlockSchema:function(){return bn},SamplingMessageSchema:function(){return kn},ServerCapabilitiesSchema:function(){return pe},ServerNotificationSchema:function(){return ar},ServerRequestSchema:function(){return ir},ServerResultSchema:function(){return dr},ServerTasksCapabilitySchema:function(){return de},SetLevelRequestParamsSchema:function(){return pn},SetLevelRequestSchema:function(){return mn},SingleSelectEnumSchemaSchema:function(){return Cn},StringSchemaSchema:function(){return xn},SubscribeRequestParamsSchema:function(){return at},SubscribeRequestSchema:function(){return pt},TaskAugmentedRequestParamsSchema:function(){return A},TaskCreationParamsSchema:function(){return E},TaskMetadataSchema:function(){return R},TaskSchema:function(){return Se},TaskStatusNotificationParamsSchema:function(){return Pe},TaskStatusNotificationSchema:function(){return $e},TaskStatusSchema:function(){return ke},TextContentSchema:function(){return qt},TextResourceContentsSchema:function(){return Oe},TitledMultiSelectEnumSchemaSchema:function(){return An},TitledSingleSelectEnumSchemaSchema:function(){return Rn},ToolAnnotationsSchema:function(){return Xt},ToolChoiceSchema:function(){return yn},ToolExecutionSchema:function(){return en},ToolListChangedNotificationSchema:function(){return cn},ToolResultContentSchema:function(){return vn},ToolSchema:function(){return tn},ToolUseContentSchema:function(){return Kt},UnsubscribeRequestParamsSchema:function(){return yt},UnsubscribeRequestSchema:function(){return vt},UntitledMultiSelectEnumSchemaSchema:function(){return zn},UntitledSingleSelectEnumSchemaSchema:function(){return In},UrlElicitationRequiredError:function(){return UrlElicitationRequiredError},assertCompleteRequestPrompt:function(){return assertCompleteRequestPrompt},assertCompleteRequestResourceTemplate:function(){return assertCompleteRequestResourceTemplate},isInitializeRequest:function(){return isInitializeRequest},isInitializedNotification:function(){return isInitializedNotification},isJSONRPCError:function(){return W},isJSONRPCErrorResponse:function(){return isJSONRPCErrorResponse},isJSONRPCNotification:function(){return isJSONRPCNotification},isJSONRPCRequest:function(){return isJSONRPCRequest},isJSONRPCResponse:function(){return K},isJSONRPCResultResponse:function(){return isJSONRPCResultResponse},isTaskAugmentedRequestParams:function(){return isTaskAugmentedRequestParams}});var f=m("./node_modules/zod/v4/classic/schemas.js"),h=m("./node_modules/zod/v4/classic/iso.js");const y="2025-11-25",v="2025-03-26",w=[y,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],b="io.modelcontextprotocol/related-task",S="2.0",j=f.custom(u=>null!==u&&("object"==typeof u||"function"==typeof u)),$=f.union([f.string(),f.number().int()]),x=f.string(),E=f.looseObject({ttl:f.union([f.number(),f.null()]).optional(),pollInterval:f.number().optional()}),R=f.object({ttl:f.number().optional()}),Z=f.object({taskId:f.string()}),C=f.looseObject({progressToken:$.optional(),[b]:Z.optional()}),z=f.object({_meta:C.optional()}),A=z.extend({task:R.optional()}),isTaskAugmentedRequestParams=u=>A.safeParse(u).success,O=f.object({method:f.string(),params:z.loose().optional()}),D=f.object({_meta:C.optional()}),N=f.object({method:f.string(),params:D.loose().optional()}),M=f.looseObject({_meta:C.optional()}),U=f.union([f.string(),f.number().int()]),L=f.object({jsonrpc:f.literal(S),id:U,...O.shape}).strict(),isJSONRPCRequest=u=>L.safeParse(u).success,F=f.object({jsonrpc:f.literal(S),...N.shape}).strict(),isJSONRPCNotification=u=>F.safeParse(u).success,V=f.object({jsonrpc:f.literal(S),id:U,result:M}).strict(),isJSONRPCResultResponse=u=>V.safeParse(u).success,K=isJSONRPCResultResponse;var H;!function(u){u[u.ConnectionClosed=-32e3]="ConnectionClosed",u[u.RequestTimeout=-32001]="RequestTimeout",u[u.ParseError=-32700]="ParseError",u[u.InvalidRequest=-32600]="InvalidRequest",u[u.MethodNotFound=-32601]="MethodNotFound",u[u.InvalidParams=-32602]="InvalidParams",u[u.InternalError=-32603]="InternalError",u[u.UrlElicitationRequired=-32042]="UrlElicitationRequired"}(H||(H={}));const B=f.object({jsonrpc:f.literal(S),id:U.optional(),error:f.object({code:f.number().int(),message:f.string(),data:f.unknown().optional()})}).strict(),J=B,isJSONRPCErrorResponse=u=>B.safeParse(u).success,W=isJSONRPCErrorResponse,G=f.union([L,F,V,B]),Q=f.union([V,B]),Y=M.strict(),X=D.extend({requestId:U.optional(),reason:f.string().optional()}),ee=N.extend({method:f.literal("notifications/cancelled"),params:X}),te=f.object({src:f.string(),mimeType:f.string().optional(),sizes:f.array(f.string()).optional(),theme:f.enum(["light","dark"]).optional()}),ne=f.object({icons:f.array(te).optional()}),re=f.object({name:f.string(),title:f.string().optional()}),oe=re.extend({...re.shape,...ne.shape,version:f.string(),websiteUrl:f.string().optional(),description:f.string().optional()}),se=f.intersection(f.object({applyDefaults:f.boolean().optional()}),f.record(f.string(),f.unknown())),ie=f.preprocess(u=>u&&"object"==typeof u&&!Array.isArray(u)&&0===Object.keys(u).length?{form:{}}:u,f.intersection(f.object({form:se.optional(),url:j.optional()}),f.record(f.string(),f.unknown()).optional())),ae=f.looseObject({list:j.optional(),cancel:j.optional(),requests:f.looseObject({sampling:f.looseObject({createMessage:j.optional()}).optional(),elicitation:f.looseObject({create:j.optional()}).optional()}).optional()}),de=f.looseObject({list:j.optional(),cancel:j.optional(),requests:f.looseObject({tools:f.looseObject({call:j.optional()}).optional()}).optional()}),ce=f.object({experimental:f.record(f.string(),j).optional(),sampling:f.object({context:j.optional(),tools:j.optional()}).optional(),elicitation:ie.optional(),roots:f.object({listChanged:f.boolean().optional()}).optional(),tasks:ae.optional()}),ue=z.extend({protocolVersion:f.string(),capabilities:ce,clientInfo:oe}),le=O.extend({method:f.literal("initialize"),params:ue}),isInitializeRequest=u=>le.safeParse(u).success,pe=f.object({experimental:f.record(f.string(),j).optional(),logging:j.optional(),completions:j.optional(),prompts:f.object({listChanged:f.boolean().optional()}).optional(),resources:f.object({subscribe:f.boolean().optional(),listChanged:f.boolean().optional()}).optional(),tools:f.object({listChanged:f.boolean().optional()}).optional(),tasks:de.optional()}),me=M.extend({protocolVersion:f.string(),capabilities:pe,serverInfo:oe,instructions:f.string().optional()}),fe=N.extend({method:f.literal("notifications/initialized"),params:D.optional()}),isInitializedNotification=u=>fe.safeParse(u).success,he=O.extend({method:f.literal("ping"),params:z.optional()}),ge=f.object({progress:f.number(),total:f.optional(f.number()),message:f.optional(f.string())}),_e=f.object({...D.shape,...ge.shape,progressToken:$}),ye=N.extend({method:f.literal("notifications/progress"),params:_e}),ve=z.extend({cursor:x.optional()}),we=O.extend({params:ve.optional()}),be=M.extend({nextCursor:x.optional()}),ke=f.enum(["working","input_required","completed","failed","cancelled"]),Se=f.object({taskId:f.string(),status:ke,ttl:f.union([f.number(),f.null()]),createdAt:f.string(),lastUpdatedAt:f.string(),pollInterval:f.optional(f.number()),statusMessage:f.optional(f.string())}),je=M.extend({task:Se}),Pe=D.merge(Se),$e=N.extend({method:f.literal("notifications/tasks/status"),params:Pe}),Te=O.extend({method:f.literal("tasks/get"),params:z.extend({taskId:f.string()})}),xe=M.merge(Se),Ee=O.extend({method:f.literal("tasks/result"),params:z.extend({taskId:f.string()})}),Ie=M.loose(),Re=we.extend({method:f.literal("tasks/list")}),Ze=be.extend({tasks:f.array(Se)}),Ce=O.extend({method:f.literal("tasks/cancel"),params:z.extend({taskId:f.string()})}),ze=M.merge(Se),Ae=f.object({uri:f.string(),mimeType:f.optional(f.string()),_meta:f.record(f.string(),f.unknown()).optional()}),Oe=Ae.extend({text:f.string()}),De=f.string().refine(u=>{try{return atob(u),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ne=Ae.extend({blob:De}),Me=f.enum(["user","assistant"]),Ue=f.object({audience:f.array(Me).optional(),priority:f.number().min(0).max(1).optional(),lastModified:h.datetime({offset:!0}).optional()}),Le=f.object({...re.shape,...ne.shape,uri:f.string(),description:f.optional(f.string()),mimeType:f.optional(f.string()),annotations:Ue.optional(),_meta:f.optional(f.looseObject({}))}),qe=f.object({...re.shape,...ne.shape,uriTemplate:f.string(),description:f.optional(f.string()),mimeType:f.optional(f.string()),annotations:Ue.optional(),_meta:f.optional(f.looseObject({}))}),He=we.extend({method:f.literal("resources/list")}),Be=be.extend({resources:f.array(Le)}),We=we.extend({method:f.literal("resources/templates/list")}),Ge=be.extend({resourceTemplates:f.array(qe)}),Qe=z.extend({uri:f.string()}),Xe=Qe,tt=O.extend({method:f.literal("resources/read"),params:Xe}),ot=M.extend({contents:f.array(f.union([Oe,Ne]))}),it=N.extend({method:f.literal("notifications/resources/list_changed"),params:D.optional()}),at=Qe,pt=O.extend({method:f.literal("resources/subscribe"),params:at}),yt=Qe,vt=O.extend({method:f.literal("resources/unsubscribe"),params:yt}),bt=D.extend({uri:f.string()}),kt=N.extend({method:f.literal("notifications/resources/updated"),params:bt}),St=f.object({name:f.string(),description:f.optional(f.string()),required:f.optional(f.boolean())}),$t=f.object({...re.shape,...ne.shape,description:f.optional(f.string()),arguments:f.optional(f.array(St)),_meta:f.optional(f.looseObject({}))}),Et=we.extend({method:f.literal("prompts/list")}),Zt=be.extend({prompts:f.array($t)}),Mt=z.extend({name:f.string(),arguments:f.record(f.string(),f.string()).optional()}),Lt=O.extend({method:f.literal("prompts/get"),params:Mt}),qt=f.object({type:f.literal("text"),text:f.string(),annotations:Ue.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Ft=f.object({type:f.literal("image"),data:De,mimeType:f.string(),annotations:Ue.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Vt=f.object({type:f.literal("audio"),data:De,mimeType:f.string(),annotations:Ue.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Kt=f.object({type:f.literal("tool_use"),name:f.string(),id:f.string(),input:f.record(f.string(),f.unknown()),_meta:f.record(f.string(),f.unknown()).optional()}),Bt=f.object({type:f.literal("resource"),resource:f.union([Oe,Ne]),annotations:Ue.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Jt=Le.extend({type:f.literal("resource_link")}),Wt=f.union([qt,Ft,Vt,Jt,Bt]),Gt=f.object({role:Me,content:Wt}),Qt=M.extend({description:f.string().optional(),messages:f.array(Gt)}),Yt=N.extend({method:f.literal("notifications/prompts/list_changed"),params:D.optional()}),Xt=f.object({title:f.string().optional(),readOnlyHint:f.boolean().optional(),destructiveHint:f.boolean().optional(),idempotentHint:f.boolean().optional(),openWorldHint:f.boolean().optional()}),en=f.object({taskSupport:f.enum(["required","optional","forbidden"]).optional()}),tn=f.object({...re.shape,...ne.shape,description:f.string().optional(),inputSchema:f.object({type:f.literal("object"),properties:f.record(f.string(),j).optional(),required:f.array(f.string()).optional()}).catchall(f.unknown()),outputSchema:f.object({type:f.literal("object"),properties:f.record(f.string(),j).optional(),required:f.array(f.string()).optional()}).catchall(f.unknown()).optional(),annotations:Xt.optional(),execution:en.optional(),_meta:f.record(f.string(),f.unknown()).optional()}),nn=we.extend({method:f.literal("tools/list")}),rn=be.extend({tools:f.array(tn)}),on=M.extend({content:f.array(Wt).default([]),structuredContent:f.record(f.string(),f.unknown()).optional(),isError:f.boolean().optional()}),sn=on.or(M.extend({toolResult:f.unknown()})),an=A.extend({name:f.string(),arguments:f.record(f.string(),f.unknown()).optional()}),dn=O.extend({method:f.literal("tools/call"),params:an}),cn=N.extend({method:f.literal("notifications/tools/list_changed"),params:D.optional()}),un=f.object({autoRefresh:f.boolean().default(!0),debounceMs:f.number().int().nonnegative().default(300)}),ln=f.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),pn=z.extend({level:ln}),mn=O.extend({method:f.literal("logging/setLevel"),params:pn}),fn=D.extend({level:ln,logger:f.string().optional(),data:f.unknown()}),hn=N.extend({method:f.literal("notifications/message"),params:fn}),gn=f.object({name:f.string().optional()}),_n=f.object({hints:f.array(gn).optional(),costPriority:f.number().min(0).max(1).optional(),speedPriority:f.number().min(0).max(1).optional(),intelligencePriority:f.number().min(0).max(1).optional()}),yn=f.object({mode:f.enum(["auto","required","none"]).optional()}),vn=f.object({type:f.literal("tool_result"),toolUseId:f.string().describe("The unique identifier for the corresponding tool call."),content:f.array(Wt).default([]),structuredContent:f.object({}).loose().optional(),isError:f.boolean().optional(),_meta:f.record(f.string(),f.unknown()).optional()}),wn=f.discriminatedUnion("type",[qt,Ft,Vt]),bn=f.discriminatedUnion("type",[qt,Ft,Vt,Kt,vn]),kn=f.object({role:Me,content:f.union([bn,f.array(bn)]),_meta:f.record(f.string(),f.unknown()).optional()}),Sn=A.extend({messages:f.array(kn),modelPreferences:_n.optional(),systemPrompt:f.string().optional(),includeContext:f.enum(["none","thisServer","allServers"]).optional(),temperature:f.number().optional(),maxTokens:f.number().int(),stopSequences:f.array(f.string()).optional(),metadata:j.optional(),tools:f.array(tn).optional(),toolChoice:yn.optional()}),jn=O.extend({method:f.literal("sampling/createMessage"),params:Sn}),Pn=M.extend({model:f.string(),stopReason:f.optional(f.enum(["endTurn","stopSequence","maxTokens"]).or(f.string())),role:Me,content:wn}),$n=M.extend({model:f.string(),stopReason:f.optional(f.enum(["endTurn","stopSequence","maxTokens","toolUse"]).or(f.string())),role:Me,content:f.union([bn,f.array(bn)])}),Tn=f.object({type:f.literal("boolean"),title:f.string().optional(),description:f.string().optional(),default:f.boolean().optional()}),xn=f.object({type:f.literal("string"),title:f.string().optional(),description:f.string().optional(),minLength:f.number().optional(),maxLength:f.number().optional(),format:f.enum(["email","uri","date","date-time"]).optional(),default:f.string().optional()}),En=f.object({type:f.enum(["number","integer"]),title:f.string().optional(),description:f.string().optional(),minimum:f.number().optional(),maximum:f.number().optional(),default:f.number().optional()}),In=f.object({type:f.literal("string"),title:f.string().optional(),description:f.string().optional(),enum:f.array(f.string()),default:f.string().optional()}),Rn=f.object({type:f.literal("string"),title:f.string().optional(),description:f.string().optional(),oneOf:f.array(f.object({const:f.string(),title:f.string()})),default:f.string().optional()}),Zn=f.object({type:f.literal("string"),title:f.string().optional(),description:f.string().optional(),enum:f.array(f.string()),enumNames:f.array(f.string()).optional(),default:f.string().optional()}),Cn=f.union([In,Rn]),zn=f.object({type:f.literal("array"),title:f.string().optional(),description:f.string().optional(),minItems:f.number().optional(),maxItems:f.number().optional(),items:f.object({type:f.literal("string"),enum:f.array(f.string())}),default:f.array(f.string()).optional()}),An=f.object({type:f.literal("array"),title:f.string().optional(),description:f.string().optional(),minItems:f.number().optional(),maxItems:f.number().optional(),items:f.object({anyOf:f.array(f.object({const:f.string(),title:f.string()}))}),default:f.array(f.string()).optional()}),On=f.union([zn,An]),Dn=f.union([Zn,Cn,On]),Nn=f.union([Dn,Tn,xn,En]),Mn=A.extend({mode:f.literal("form").optional(),message:f.string(),requestedSchema:f.object({type:f.literal("object"),properties:f.record(f.string(),Nn),required:f.array(f.string()).optional()})}),Un=A.extend({mode:f.literal("url"),message:f.string(),elicitationId:f.string(),url:f.string().url()}),Ln=f.union([Mn,Un]),qn=O.extend({method:f.literal("elicitation/create"),params:Ln}),Fn=D.extend({elicitationId:f.string()}),Vn=N.extend({method:f.literal("notifications/elicitation/complete"),params:Fn}),Kn=M.extend({action:f.enum(["accept","decline","cancel"]),content:f.preprocess(u=>null===u?void 0:u,f.record(f.string(),f.union([f.string(),f.number(),f.boolean(),f.array(f.string())])).optional())}),Hn=f.object({type:f.literal("ref/resource"),uri:f.string()}),Bn=Hn,Jn=f.object({type:f.literal("ref/prompt"),name:f.string()}),Wn=z.extend({ref:f.union([Jn,Hn]),argument:f.object({name:f.string(),value:f.string()}),context:f.object({arguments:f.record(f.string(),f.string()).optional()}).optional()}),Gn=O.extend({method:f.literal("completion/complete"),params:Wn});function assertCompleteRequestPrompt(u){if("ref/prompt"!==u.params.ref.type)throw new TypeError(`Expected CompleteRequestPrompt, but got ${u.params.ref.type}`)}function assertCompleteRequestResourceTemplate(u){if("ref/resource"!==u.params.ref.type)throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${u.params.ref.type}`)}const Qn=M.extend({completion:f.looseObject({values:f.array(f.string()).max(100),total:f.optional(f.number().int()),hasMore:f.optional(f.boolean())})}),Yn=f.object({uri:f.string().startsWith("file://"),name:f.string().optional(),_meta:f.record(f.string(),f.unknown()).optional()}),Xn=O.extend({method:f.literal("roots/list"),params:z.optional()}),er=M.extend({roots:f.array(Yn)}),tr=N.extend({method:f.literal("notifications/roots/list_changed"),params:D.optional()}),nr=f.union([he,le,Gn,mn,Lt,Et,He,We,tt,pt,vt,dn,nn,Te,Ee,Re,Ce]),rr=f.union([ee,ye,fe,tr,$e]),sr=f.union([Y,Pn,$n,Kn,er,xe,Ze,je]),ir=f.union([he,jn,qn,Xn,Te,Ee,Re,Ce]),ar=f.union([ee,ye,hn,kt,it,cn,Yt,$e,Vn]),dr=f.union([Y,me,Qn,Qt,Zt,Be,Ge,ot,on,rn,xe,Ze,je]);class McpError extends Error{constructor(u,l,m){super(`MCP error ${u}: ${l}`),this.code=u,this.data=m,this.name="McpError"}static fromError(u,l,m){if(u===H.UrlElicitationRequired&&m){const u=m;if(u.elicitations)return new UrlElicitationRequiredError(u.elicitations,l)}return new McpError(u,l,m)}}class UrlElicitationRequiredError extends McpError{constructor(u,l=`URL elicitation${u.length>1?"s":""} required`){super(H.UrlElicitationRequired,l,{elicitations:u})}get elicitations(){return this.data?.elicitations??[]}}},"./node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js":function(u,l,m){m.r(l),m.d(l,{AjvJsonSchemaValidator:function(){return AjvJsonSchemaValidator}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/index.js");class AjvJsonSchemaValidator{constructor(u){this._ajv=u??function createDefaultAjvInstance(){const u=new f({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return h(u),u}()}getValidator(u){const l="$id"in u&&"string"==typeof u.$id?this._ajv.getSchema(u.$id)??this._ajv.compile(u):this._ajv.compile(u);return u=>l(u)?{valid:!0,data:u,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(l.errors)}}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/formats.js":function(u,l){function fmtDef(u,l){return{validate:u,compare:l}}Object.defineProperty(l,"__esModule",{value:!0}),l.formatNames=l.fastFormats=l.fullFormats=void 0,l.fullFormats={date:fmtDef(date,compareDate),time:fmtDef(getTime(!0),compareTime),"date-time":fmtDef(getDateTime(!0),compareDateTime),"iso-time":fmtDef(getTime(),compareIsoTime),"iso-date-time":fmtDef(getDateTime(),compareIsoDateTime),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function uri(u){return v.test(u)&&w.test(u)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function regex(u){if($.test(u))return!1;try{return new RegExp(u),!0}catch(u){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function byte(u){return b.lastIndex=0,b.test(u)},int32:{type:"number",validate:function validateInt32(u){return Number.isInteger(u)&&u<=j&&u>=S}},int64:{type:"number",validate:function validateInt64(u){return Number.isInteger(u)}},float:{type:"number",validate:validateNumber},double:{type:"number",validate:validateNumber},password:!0,binary:!0},l.fastFormats={...l.fullFormats,date:fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,compareDate),time:fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareTime),"date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,compareDateTime),"iso-time":fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoTime),"iso-date-time":fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,compareIsoDateTime),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},l.formatNames=Object.keys(l.fullFormats);const m=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,f=[0,31,28,31,30,31,30,31,31,30,31,30,31];function date(u){const l=m.exec(u);if(!l)return!1;const h=+l[1],y=+l[2],v=+l[3];return y>=1&&y<=12&&v>=1&&v<=(2===y&&function isLeapYear(u){return u%4==0&&(u%100!=0||u%400==0)}(h)?29:f[y])}function compareDate(u,l){if(u&&l)return u>l?1:u<l?-1:0}const h=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function getTime(u){return function time(l){const m=h.exec(l);if(!m)return!1;const f=+m[1],y=+m[2],v=+m[3],w=m[4],b="-"===m[5]?-1:1,S=+(m[6]||0),j=+(m[7]||0);if(S>23||j>59||u&&!w)return!1;if(f<=23&&y<=59&&v<60)return!0;const $=y-j*b,x=f-S*b-($<0?1:0);return(23===x||-1===x)&&(59===$||-1===$)&&v<61}}function compareTime(u,l){if(!u||!l)return;const m=new Date("2020-01-01T"+u).valueOf(),f=new Date("2020-01-01T"+l).valueOf();return m&&f?m-f:void 0}function compareIsoTime(u,l){if(!u||!l)return;const m=h.exec(u),f=h.exec(l);return m&&f?(u=m[1]+m[2]+m[3])>(l=f[1]+f[2]+f[3])?1:u<l?-1:0:void 0}const y=/t|\s/i;function getDateTime(u){const l=getTime(u);return function date_time(u){const m=u.split(y);return 2===m.length&&date(m[0])&&l(m[1])}}function compareDateTime(u,l){if(!u||!l)return;const m=new Date(u).valueOf(),f=new Date(l).valueOf();return m&&f?m-f:void 0}function compareIsoDateTime(u,l){if(!u||!l)return;const[m,f]=u.split(y),[h,v]=l.split(y),w=compareDate(m,h);return void 0!==w?w||compareTime(f,v):void 0}const v=/\/|:/,w=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;const b=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;const S=-(2**31),j=2**31-1;function validateNumber(){return!0}const $=/[^\\]\\Z/},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/formats.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/limit.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),v=new y.Name("fullFormats"),w=new y.Name("fastFormats"),formatsPlugin=(u,l={keywords:!0})=>{if(Array.isArray(l))return addFormats(u,l,f.fullFormats,v),u;const[m,y]="fast"===l.mode?[f.fastFormats,w]:[f.fullFormats,v];return addFormats(u,l.formats||f.formatNames,m,y),l.keywords&&(0,h.default)(u),u};function addFormats(u,l,m,f){var h,v;null!==(h=(v=u.opts.code).formats)&&void 0!==h||(v.formats=y._`require("ajv-formats/dist/formats").${f}`);for(const f of l)u.addFormat(f,m[f])}formatsPlugin.get=(u,l="full")=>{const m=("fast"===l?f.fastFormats:f.fullFormats)[u];if(!m)throw new Error(`Unknown format "${u}"`);return m},u.exports=l=formatsPlugin,Object.defineProperty(l,"__esModule",{value:!0}),l.default=formatsPlugin},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv-formats/dist/limit.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.formatLimitDefinition=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=h.operators,v={formatMaximum:{okStr:"<=",ok:y.LTE,fail:y.GT},formatMinimum:{okStr:">=",ok:y.GTE,fail:y.LT},formatExclusiveMaximum:{okStr:"<",ok:y.LT,fail:y.GTE},formatExclusiveMinimum:{okStr:">",ok:y.GT,fail:y.LTE}},w={message:({keyword:u,schemaCode:l})=>h.str`should be ${v[u].okStr} ${l}`,params:({keyword:u,schemaCode:l})=>h._`{comparison: ${v[u].okStr}, limit: ${l}}`};l.formatLimitDefinition={keyword:Object.keys(v),type:"string",schemaType:"string",$data:!0,error:w,code(u){const{gen:l,data:m,schemaCode:y,keyword:w,it:b}=u,{opts:S,self:j}=b;if(!S.validateFormats)return;const $=new f.KeywordCxt(b,j.RULES.all.format.definition,"format");function compareCode(u){return h._`${u}.compare(${m}, ${y}) ${v[w].fail} 0`}$.$data?function validate$DataFormat(){const m=l.scopeValue("formats",{ref:j.formats,code:S.code.formats}),f=l.const("fmt",h._`${m}[${$.schemaCode}]`);u.fail$data((0,h.or)(h._`typeof ${f} != "object"`,h._`${f} instanceof RegExp`,h._`typeof ${f}.compare != "function"`,compareCode(f)))}():function validateFormat(){const m=$.schema,f=j.formats[m];if(!f||!0===f)return;if("object"!=typeof f||f instanceof RegExp||"function"!=typeof f.compare)throw new Error(`"${w}": format "${m}" does not define "compare" function`);const y=l.scopeValue("formats",{key:m,ref:f,code:S.code.formats?h._`${S.code.formats}${(0,h.getProperty)(m)}`:void 0});u.fail$data(compareCode(y))}()},dependencies:["format"]};l.default=u=>(u.addKeyword(l.formatLimitDefinition),u)},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/ajv.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.MissingRefError=l.ValidationError=l.CodeGen=l.Name=l.nil=l.stringify=l.str=l._=l.KeywordCxt=l.Ajv=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json"),w=["/properties"],b="http://json-schema.org/draft-07/schema";class Ajv extends f.default{_addVocabularies(){super._addVocabularies(),h.default.forEach(u=>this.addVocabulary(u)),this.opts.discriminator&&this.addKeyword(y.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const u=this.opts.$data?this.$dataMetaSchema(v,w):v;this.addMetaSchema(u,b,!1),this.refs["http://json-schema.org/schema"]=b}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(b)?b:void 0)}}l.Ajv=Ajv,u.exports=l=Ajv,u.exports.Ajv=Ajv,Object.defineProperty(l,"__esModule",{value:!0}),l.default=Ajv;var S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");Object.defineProperty(l,"KeywordCxt",{enumerable:!0,get:function(){return S.KeywordCxt}});var j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");Object.defineProperty(l,"_",{enumerable:!0,get:function(){return j._}}),Object.defineProperty(l,"str",{enumerable:!0,get:function(){return j.str}}),Object.defineProperty(l,"stringify",{enumerable:!0,get:function(){return j.stringify}}),Object.defineProperty(l,"nil",{enumerable:!0,get:function(){return j.nil}}),Object.defineProperty(l,"Name",{enumerable:!0,get:function(){return j.Name}}),Object.defineProperty(l,"CodeGen",{enumerable:!0,get:function(){return j.CodeGen}});var $=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js");Object.defineProperty(l,"ValidationError",{enumerable:!0,get:function(){return $.default}});var x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js");Object.defineProperty(l,"MissingRefError",{enumerable:!0,get:function(){return x.default}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0}),l.regexpCode=l.getEsmExportName=l.getProperty=l.safeStringify=l.stringify=l.strConcat=l.addCodeArg=l.str=l._=l.nil=l._Code=l.Name=l.IDENTIFIER=l._CodeOrName=void 0;class _CodeOrName{}l._CodeOrName=_CodeOrName,l.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Name extends _CodeOrName{constructor(u){if(super(),!l.IDENTIFIER.test(u))throw new Error("CodeGen: name must be a valid identifier");this.str=u}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}l.Name=Name;class _Code extends _CodeOrName{constructor(u){super(),this._items="string"==typeof u?[u]:u}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const u=this._items[0];return""===u||'""'===u}get str(){var u;return null!==(u=this._str)&&void 0!==u?u:this._str=this._items.reduce((u,l)=>`${u}${l}`,"")}get names(){var u;return null!==(u=this._names)&&void 0!==u?u:this._names=this._items.reduce((u,l)=>(l instanceof Name&&(u[l.str]=(u[l.str]||0)+1),u),{})}}function _(u,...l){const m=[u[0]];let f=0;for(;f<l.length;)addCodeArg(m,l[f]),m.push(u[++f]);return new _Code(m)}l._Code=_Code,l.nil=new _Code(""),l._=_;const m=new _Code("+");function str(u,...l){const f=[safeStringify(u[0])];let h=0;for(;h<l.length;)f.push(m),addCodeArg(f,l[h]),f.push(m,safeStringify(u[++h]));return function optimize(u){let l=1;for(;l<u.length-1;){if(u[l]===m){const m=mergeExprItems(u[l-1],u[l+1]);if(void 0!==m){u.splice(l-1,3,m);continue}u[l++]="+"}l++}}(f),new _Code(f)}function addCodeArg(u,l){l instanceof _Code?u.push(...l._items):l instanceof Name?u.push(l):u.push(function interpolate(u){return"number"==typeof u||"boolean"==typeof u||null===u?u:safeStringify(Array.isArray(u)?u.join(","):u)}(l))}function mergeExprItems(u,l){if('""'===l)return u;if('""'===u)return l;if("string"==typeof u){if(l instanceof Name||'"'!==u[u.length-1])return;return"string"!=typeof l?`${u.slice(0,-1)}${l}"`:'"'===l[0]?u.slice(0,-1)+l.slice(1):void 0}return"string"!=typeof l||'"'!==l[0]||u instanceof Name?void 0:`"${u}${l.slice(1)}`}function safeStringify(u){return JSON.stringify(u).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}l.str=str,l.addCodeArg=addCodeArg,l.strConcat=function strConcat(u,l){return l.emptyStr()?u:u.emptyStr()?l:str`${u}${l}`},l.stringify=function stringify(u){return new _Code(safeStringify(u))},l.safeStringify=safeStringify,l.getProperty=function getProperty(u){return"string"==typeof u&&l.IDENTIFIER.test(u)?new _Code(`.${u}`):_`[${u}]`},l.getEsmExportName=function getEsmExportName(u){if("string"==typeof u&&l.IDENTIFIER.test(u))return new _Code(`${u}`);throw new Error(`CodeGen: invalid export name: ${u}, use explicit $id name mapping`)},l.regexpCode=function regexpCode(u){return new _Code(u.toString())}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.or=l.and=l.not=l.CodeGen=l.operators=l.varKinds=l.ValueScopeName=l.ValueScope=l.Scope=l.Name=l.regexpCode=l.stringify=l.getProperty=l.nil=l.strConcat=l.str=l._=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js");var y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");Object.defineProperty(l,"_",{enumerable:!0,get:function(){return y._}}),Object.defineProperty(l,"str",{enumerable:!0,get:function(){return y.str}}),Object.defineProperty(l,"strConcat",{enumerable:!0,get:function(){return y.strConcat}}),Object.defineProperty(l,"nil",{enumerable:!0,get:function(){return y.nil}}),Object.defineProperty(l,"getProperty",{enumerable:!0,get:function(){return y.getProperty}}),Object.defineProperty(l,"stringify",{enumerable:!0,get:function(){return y.stringify}}),Object.defineProperty(l,"regexpCode",{enumerable:!0,get:function(){return y.regexpCode}}),Object.defineProperty(l,"Name",{enumerable:!0,get:function(){return y.Name}});var v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js");Object.defineProperty(l,"Scope",{enumerable:!0,get:function(){return v.Scope}}),Object.defineProperty(l,"ValueScope",{enumerable:!0,get:function(){return v.ValueScope}}),Object.defineProperty(l,"ValueScopeName",{enumerable:!0,get:function(){return v.ValueScopeName}}),Object.defineProperty(l,"varKinds",{enumerable:!0,get:function(){return v.varKinds}}),l.operators={GT:new f._Code(">"),GTE:new f._Code(">="),LT:new f._Code("<"),LTE:new f._Code("<="),EQ:new f._Code("==="),NEQ:new f._Code("!=="),NOT:new f._Code("!"),OR:new f._Code("||"),AND:new f._Code("&&"),ADD:new f._Code("+")};class Node{optimizeNodes(){return this}optimizeNames(u,l){return this}}class Def extends Node{constructor(u,l,m){super(),this.varKind=u,this.name=l,this.rhs=m}render({es5:u,_n:l}){const m=u?h.varKinds.var:this.varKind,f=void 0===this.rhs?"":` = ${this.rhs}`;return`${m} ${this.name}${f};`+l}optimizeNames(u,l){if(u[this.name.str])return this.rhs&&(this.rhs=optimizeExpr(this.rhs,u,l)),this}get names(){return this.rhs instanceof f._CodeOrName?this.rhs.names:{}}}class Assign extends Node{constructor(u,l,m){super(),this.lhs=u,this.rhs=l,this.sideEffects=m}render({_n:u}){return`${this.lhs} = ${this.rhs};`+u}optimizeNames(u,l){if(!(this.lhs instanceof f.Name)||u[this.lhs.str]||this.sideEffects)return this.rhs=optimizeExpr(this.rhs,u,l),this}get names(){return addExprNames(this.lhs instanceof f.Name?{}:{...this.lhs.names},this.rhs)}}class AssignOp extends Assign{constructor(u,l,m,f){super(u,m,f),this.op=l}render({_n:u}){return`${this.lhs} ${this.op}= ${this.rhs};`+u}}class Label extends Node{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`${this.label}:`+u}}class Break extends Node{constructor(u){super(),this.label=u,this.names={}}render({_n:u}){return`break${this.label?` ${this.label}`:""};`+u}}class Throw extends Node{constructor(u){super(),this.error=u}render({_n:u}){return`throw ${this.error};`+u}get names(){return this.error.names}}class AnyCode extends Node{constructor(u){super(),this.code=u}render({_n:u}){return`${this.code};`+u}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(u,l){return this.code=optimizeExpr(this.code,u,l),this}get names(){return this.code instanceof f._CodeOrName?this.code.names:{}}}class ParentNode extends Node{constructor(u=[]){super(),this.nodes=u}render(u){return this.nodes.reduce((l,m)=>l+m.render(u),"")}optimizeNodes(){const{nodes:u}=this;let l=u.length;for(;l--;){const m=u[l].optimizeNodes();Array.isArray(m)?u.splice(l,1,...m):m?u[l]=m:u.splice(l,1)}return u.length>0?this:void 0}optimizeNames(u,l){const{nodes:m}=this;let f=m.length;for(;f--;){const h=m[f];h.optimizeNames(u,l)||(subtractNames(u,h.names),m.splice(f,1))}return m.length>0?this:void 0}get names(){return this.nodes.reduce((u,l)=>addNames(u,l.names),{})}}class BlockNode extends ParentNode{render(u){return"{"+u._n+super.render(u)+"}"+u._n}}class Root extends ParentNode{}class Else extends BlockNode{}Else.kind="else";class If extends BlockNode{constructor(u,l){super(l),this.condition=u}render(u){let l=`if(${this.condition})`+super.render(u);return this.else&&(l+="else "+this.else.render(u)),l}optimizeNodes(){super.optimizeNodes();const u=this.condition;if(!0===u)return this.nodes;let l=this.else;if(l){const u=l.optimizeNodes();l=this.else=Array.isArray(u)?new Else(u):u}return l?!1===u?l instanceof If?l:l.nodes:this.nodes.length?this:new If(not(u),l instanceof If?[l]:l.nodes):!1!==u&&this.nodes.length?this:void 0}optimizeNames(u,l){var m;if(this.else=null===(m=this.else)||void 0===m?void 0:m.optimizeNames(u,l),super.optimizeNames(u,l)||this.else)return this.condition=optimizeExpr(this.condition,u,l),this}get names(){const u=super.names;return addExprNames(u,this.condition),this.else&&addNames(u,this.else.names),u}}If.kind="if";class For extends BlockNode{}For.kind="for";class ForLoop extends For{constructor(u){super(),this.iteration=u}render(u){return`for(${this.iteration})`+super.render(u)}optimizeNames(u,l){if(super.optimizeNames(u,l))return this.iteration=optimizeExpr(this.iteration,u,l),this}get names(){return addNames(super.names,this.iteration.names)}}class ForRange extends For{constructor(u,l,m,f){super(),this.varKind=u,this.name=l,this.from=m,this.to=f}render(u){const l=u.es5?h.varKinds.var:this.varKind,{name:m,from:f,to:y}=this;return`for(${l} ${m}=${f}; ${m}<${y}; ${m}++)`+super.render(u)}get names(){const u=addExprNames(super.names,this.from);return addExprNames(u,this.to)}}class ForIter extends For{constructor(u,l,m,f){super(),this.loop=u,this.varKind=l,this.name=m,this.iterable=f}render(u){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(u)}optimizeNames(u,l){if(super.optimizeNames(u,l))return this.iterable=optimizeExpr(this.iterable,u,l),this}get names(){return addNames(super.names,this.iterable.names)}}class Func extends BlockNode{constructor(u,l,m){super(),this.name=u,this.args=l,this.async=m}render(u){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(u)}}Func.kind="func";class Return extends ParentNode{render(u){return"return "+super.render(u)}}Return.kind="return";class Try extends BlockNode{render(u){let l="try"+super.render(u);return this.catch&&(l+=this.catch.render(u)),this.finally&&(l+=this.finally.render(u)),l}optimizeNodes(){var u,l;return super.optimizeNodes(),null===(u=this.catch)||void 0===u||u.optimizeNodes(),null===(l=this.finally)||void 0===l||l.optimizeNodes(),this}optimizeNames(u,l){var m,f;return super.optimizeNames(u,l),null===(m=this.catch)||void 0===m||m.optimizeNames(u,l),null===(f=this.finally)||void 0===f||f.optimizeNames(u,l),this}get names(){const u=super.names;return this.catch&&addNames(u,this.catch.names),this.finally&&addNames(u,this.finally.names),u}}class Catch extends BlockNode{constructor(u){super(),this.error=u}render(u){return`catch(${this.error})`+super.render(u)}}Catch.kind="catch";class Finally extends BlockNode{render(u){return"finally"+super.render(u)}}Finally.kind="finally";function addNames(u,l){for(const m in l)u[m]=(u[m]||0)+(l[m]||0);return u}function addExprNames(u,l){return l instanceof f._CodeOrName?addNames(u,l.names):u}function optimizeExpr(u,l,m){return u instanceof f.Name?replaceName(u):function canOptimize(u){return u instanceof f._Code&&u._items.some(u=>u instanceof f.Name&&1===l[u.str]&&void 0!==m[u.str])}(u)?new f._Code(u._items.reduce((u,l)=>(l instanceof f.Name&&(l=replaceName(l)),l instanceof f._Code?u.push(...l._items):u.push(l),u),[])):u;function replaceName(u){const f=m[u.str];return void 0===f||1!==l[u.str]?u:(delete l[u.str],f)}}function subtractNames(u,l){for(const m in l)u[m]=(u[m]||0)-(l[m]||0)}function not(u){return"boolean"==typeof u||"number"==typeof u||null===u?!u:f._`!${par(u)}`}l.CodeGen=class CodeGen{constructor(u,l={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...l,_n:l.lines?"\n":""},this._extScope=u,this._scope=new h.Scope({parent:u}),this._nodes=[new Root]}toString(){return this._root.render(this.opts)}name(u){return this._scope.name(u)}scopeName(u){return this._extScope.name(u)}scopeValue(u,l){const m=this._extScope.value(u,l);return(this._values[m.prefix]||(this._values[m.prefix]=new Set)).add(m),m}getScopeValue(u,l){return this._extScope.getValue(u,l)}scopeRefs(u){return this._extScope.scopeRefs(u,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(u,l,m,f){const h=this._scope.toName(l);return void 0!==m&&f&&(this._constants[h.str]=m),this._leafNode(new Def(u,h,m)),h}const(u,l,m){return this._def(h.varKinds.const,u,l,m)}let(u,l,m){return this._def(h.varKinds.let,u,l,m)}var(u,l,m){return this._def(h.varKinds.var,u,l,m)}assign(u,l,m){return this._leafNode(new Assign(u,l,m))}add(u,m){return this._leafNode(new AssignOp(u,l.operators.ADD,m))}code(u){return"function"==typeof u?u():u!==f.nil&&this._leafNode(new AnyCode(u)),this}object(...u){const l=["{"];for(const[m,h]of u)l.length>1&&l.push(","),l.push(m),(m!==h||this.opts.es5)&&(l.push(":"),(0,f.addCodeArg)(l,h));return l.push("}"),new f._Code(l)}if(u,l,m){if(this._blockNode(new If(u)),l&&m)this.code(l).else().code(m).endIf();else if(l)this.code(l).endIf();else if(m)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(u){return this._elseNode(new If(u))}else(){return this._elseNode(new Else)}endIf(){return this._endBlockNode(If,Else)}_for(u,l){return this._blockNode(u),l&&this.code(l).endFor(),this}for(u,l){return this._for(new ForLoop(u),l)}forRange(u,l,m,f,y=(this.opts.es5?h.varKinds.var:h.varKinds.let)){const v=this._scope.toName(u);return this._for(new ForRange(y,v,l,m),()=>f(v))}forOf(u,l,m,y=h.varKinds.const){const v=this._scope.toName(u);if(this.opts.es5){const u=l instanceof f.Name?l:this.var("_arr",l);return this.forRange("_i",0,f._`${u}.length`,l=>{this.var(v,f._`${u}[${l}]`),m(v)})}return this._for(new ForIter("of",y,v,l),()=>m(v))}forIn(u,l,m,y=(this.opts.es5?h.varKinds.var:h.varKinds.const)){if(this.opts.ownProperties)return this.forOf(u,f._`Object.keys(${l})`,m);const v=this._scope.toName(u);return this._for(new ForIter("in",y,v,l),()=>m(v))}endFor(){return this._endBlockNode(For)}label(u){return this._leafNode(new Label(u))}break(u){return this._leafNode(new Break(u))}return(u){const l=new Return;if(this._blockNode(l),this.code(u),1!==l.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Return)}try(u,l,m){if(!l&&!m)throw new Error('CodeGen: "try" without "catch" and "finally"');const f=new Try;if(this._blockNode(f),this.code(u),l){const u=this.name("e");this._currNode=f.catch=new Catch(u),l(u)}return m&&(this._currNode=f.finally=new Finally,this.code(m)),this._endBlockNode(Catch,Finally)}throw(u){return this._leafNode(new Throw(u))}block(u,l){return this._blockStarts.push(this._nodes.length),u&&this.code(u).endBlock(l),this}endBlock(u){const l=this._blockStarts.pop();if(void 0===l)throw new Error("CodeGen: not in self-balancing block");const m=this._nodes.length-l;if(m<0||void 0!==u&&m!==u)throw new Error(`CodeGen: wrong number of nodes: ${m} vs ${u} expected`);return this._nodes.length=l,this}func(u,l=f.nil,m,h){return this._blockNode(new Func(u,l,m)),h&&this.code(h).endFunc(),this}endFunc(){return this._endBlockNode(Func)}optimize(u=1){for(;u-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(u){return this._currNode.nodes.push(u),this}_blockNode(u){this._currNode.nodes.push(u),this._nodes.push(u)}_endBlockNode(u,l){const m=this._currNode;if(m instanceof u||l&&m instanceof l)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${l?`${u.kind}/${l.kind}`:u.kind}"`)}_elseNode(u){const l=this._currNode;if(!(l instanceof If))throw new Error('CodeGen: "else" without "if"');return this._currNode=l.else=u,this}get _root(){return this._nodes[0]}get _currNode(){const u=this._nodes;return u[u.length-1]}set _currNode(u){const l=this._nodes;l[l.length-1]=u}},l.not=not;const w=mappend(l.operators.AND);l.and=function and(...u){return u.reduce(w)};const b=mappend(l.operators.OR);function mappend(u){return(l,m)=>l===f.nil?m:m===f.nil?l:f._`${par(l)} ${u} ${par(m)}`}function par(u){return u instanceof f.Name?u:f._`(${u})`}l.or=function or(...u){return u.reduce(b)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/scope.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.ValueScope=l.ValueScopeName=l.Scope=l.varKinds=l.UsedValueState=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");class ValueError extends Error{constructor(u){super(`CodeGen: "code" for ${u} not defined`),this.value=u.value}}var h;!function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"}(h||(l.UsedValueState=h={})),l.varKinds={const:new f.Name("const"),let:new f.Name("let"),var:new f.Name("var")};class Scope{constructor({prefixes:u,parent:l}={}){this._names={},this._prefixes=u,this._parent=l}toName(u){return u instanceof f.Name?u:this.name(u)}name(u){return new f.Name(this._newName(u))}_newName(u){return`${u}${(this._names[u]||this._nameGroup(u)).index++}`}_nameGroup(u){var l,m;if((null===(m=null===(l=this._parent)||void 0===l?void 0:l._prefixes)||void 0===m?void 0:m.has(u))||this._prefixes&&!this._prefixes.has(u))throw new Error(`CodeGen: prefix "${u}" is not allowed in this scope`);return this._names[u]={prefix:u,index:0}}}l.Scope=Scope;class ValueScopeName extends f.Name{constructor(u,l){super(l),this.prefix=u}setValue(u,{property:l,itemIndex:m}){this.value=u,this.scopePath=f._`.${new f.Name(l)}[${m}]`}}l.ValueScopeName=ValueScopeName;const y=f._`\n`;l.ValueScope=class ValueScope extends Scope{constructor(u){super(u),this._values={},this._scope=u.scope,this.opts={...u,_n:u.lines?y:f.nil}}get(){return this._scope}name(u){return new ValueScopeName(u,this._newName(u))}value(u,l){var m;if(void 0===l.ref)throw new Error("CodeGen: ref must be passed in value");const f=this.toName(u),{prefix:h}=f,y=null!==(m=l.key)&&void 0!==m?m:l.ref;let v=this._values[h];if(v){const u=v.get(y);if(u)return u}else v=this._values[h]=new Map;v.set(y,f);const w=this._scope[h]||(this._scope[h]=[]),b=w.length;return w[b]=l.ref,f.setValue(l,{property:h,itemIndex:b}),f}getValue(u,l){const m=this._values[u];if(m)return m.get(l)}scopeRefs(u,l=this._values){return this._reduceValues(l,l=>{if(void 0===l.scopePath)throw new Error(`CodeGen: name "${l}" has no value`);return f._`${u}${l.scopePath}`})}scopeCode(u=this._values,l,m){return this._reduceValues(u,u=>{if(void 0===u.value)throw new Error(`CodeGen: name "${u}" has no value`);return u.value.code},l,m)}_reduceValues(u,m,y={},v){let w=f.nil;for(const b in u){const S=u[b];if(!S)continue;const j=y[b]=y[b]||new Map;S.forEach(u=>{if(j.has(u))return;j.set(u,h.Started);let y=m(u);if(y){const m=this.opts.es5?l.varKinds.var:l.varKinds.const;w=f._`${w}${m} ${u} = ${y};${this.opts._n}`}else{if(!(y=null==v?void 0:v(u)))throw new ValueError(u);w=f._`${w}${y}${this.opts._n}`}j.set(u,h.Completed)})}return w}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.extendErrors=l.resetErrorsCount=l.reportExtraError=l.reportError=l.keyword$DataError=l.keywordError=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js");function addError(u,l){const m=u.const("err",l);u.if(f._`${y.default.vErrors} === null`,()=>u.assign(y.default.vErrors,f._`[${m}]`),f._`${y.default.vErrors}.push(${m})`),u.code(f._`${y.default.errors}++`)}function returnErrors(u,l){const{gen:m,validateName:h,schemaEnv:y}=u;y.$async?m.throw(f._`new ${u.ValidationError}(${l})`):(m.assign(f._`${h}.errors`,l),m.return(!1))}l.keywordError={message:({keyword:u})=>f.str`must pass "${u}" keyword validation`},l.keyword$DataError={message:({keyword:u,schemaType:l})=>l?f.str`"${u}" keyword must be ${l} ($data)`:f.str`"${u}" keyword is invalid ($data)`},l.reportError=function reportError(u,m=l.keywordError,h,y){const{it:v}=u,{gen:w,compositeRule:b,allErrors:S}=v,j=errorObjectCode(u,m,h);(null!=y?y:b||S)?addError(w,j):returnErrors(v,f._`[${j}]`)},l.reportExtraError=function reportExtraError(u,m=l.keywordError,f){const{it:h}=u,{gen:v,compositeRule:w,allErrors:b}=h;addError(v,errorObjectCode(u,m,f)),w||b||returnErrors(h,y.default.vErrors)},l.resetErrorsCount=function resetErrorsCount(u,l){u.assign(y.default.errors,l),u.if(f._`${y.default.vErrors} !== null`,()=>u.if(l,()=>u.assign(f._`${y.default.vErrors}.length`,l),()=>u.assign(y.default.vErrors,null)))},l.extendErrors=function extendErrors({gen:u,keyword:l,schemaValue:m,data:h,errsCount:v,it:w}){if(void 0===v)throw new Error("ajv implementation error");const b=u.name("err");u.forRange("i",v,y.default.errors,v=>{u.const(b,f._`${y.default.vErrors}[${v}]`),u.if(f._`${b}.instancePath === undefined`,()=>u.assign(f._`${b}.instancePath`,(0,f.strConcat)(y.default.instancePath,w.errorPath))),u.assign(f._`${b}.schemaPath`,f.str`${w.errSchemaPath}/${l}`),w.opts.verbose&&(u.assign(f._`${b}.schema`,m),u.assign(f._`${b}.data`,h))})};const v={keyword:new f.Name("keyword"),schemaPath:new f.Name("schemaPath"),params:new f.Name("params"),propertyName:new f.Name("propertyName"),message:new f.Name("message"),schema:new f.Name("schema"),parentSchema:new f.Name("parentSchema")};function errorObjectCode(u,l,m){const{createErrors:h}=u.it;return!1===h?f._`{}`:function errorObject(u,l,m={}){const{gen:h,it:w}=u,b=[errorInstancePath(w,m),errorSchemaPath(u,m)];return function extraErrorProps(u,{params:l,message:m},h){const{keyword:w,data:b,schemaValue:S,it:j}=u,{opts:$,propertyName:x,topSchemaRef:E,schemaPath:R}=j;h.push([v.keyword,w],[v.params,"function"==typeof l?l(u):l||f._`{}`]),$.messages&&h.push([v.message,"function"==typeof m?m(u):m]);$.verbose&&h.push([v.schema,S],[v.parentSchema,f._`${E}${R}`],[y.default.data,b]);x&&h.push([v.propertyName,x])}(u,l,b),h.object(...b)}(u,l,m)}function errorInstancePath({errorPath:u},{instancePath:l}){const m=l?f.str`${u}${(0,h.getErrorPath)(l,h.Type.Str)}`:u;return[y.default.instancePath,(0,f.strConcat)(y.default.instancePath,m)]}function errorSchemaPath({keyword:u,it:{errSchemaPath:l}},{schemaPath:m,parentSchema:y}){let w=y?l:f.str`${l}/${u}`;return m&&(w=f.str`${w}${(0,h.getErrorPath)(m,h.Type.Str)}`),[v.schemaPath,w]}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.resolveSchema=l.getCompilingSchema=l.resolveRef=l.compileSchema=l.SchemaEnv=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");class SchemaEnv{constructor(u){var l;let m;this.refs={},this.dynamicAnchors={},"object"==typeof u.schema&&(m=u.schema),this.schema=u.schema,this.schemaId=u.schemaId,this.root=u.root||this,this.baseId=null!==(l=u.baseId)&&void 0!==l?l:(0,v.normalizeId)(null==m?void 0:m[u.schemaId||"$id"]),this.schemaPath=u.schemaPath,this.localRefs=u.localRefs,this.meta=u.meta,this.$async=null==m?void 0:m.$async,this.refs={}}}function compileSchema(u){const l=getCompilingSchema.call(this,u);if(l)return l;const m=(0,v.getFullPath)(this.opts.uriResolver,u.root.baseId),{es5:w,lines:S}=this.opts.code,{ownProperties:j}=this.opts,$=new f.CodeGen(this.scope,{es5:w,lines:S,ownProperties:j});let x;u.$async&&(x=$.scopeValue("Error",{ref:h.default,code:f._`require("ajv/dist/runtime/validation_error").default`}));const E=$.scopeName("validate");u.validateName=E;const R={gen:$,allErrors:this.opts.allErrors,data:y.default.data,parentData:y.default.parentData,parentDataProperty:y.default.parentDataProperty,dataNames:[y.default.data],dataPathArr:[f.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:$.scopeValue("schema",!0===this.opts.code.source?{ref:u.schema,code:(0,f.stringify)(u.schema)}:{ref:u.schema}),validateName:E,ValidationError:x,schema:u.schema,schemaEnv:u,rootId:m,baseId:u.baseId||m,schemaPath:f.nil,errSchemaPath:u.schemaPath||(this.opts.jtd?"":"#"),errorPath:f._`""`,opts:this.opts,self:this};let Z;try{this._compilations.add(u),(0,b.validateFunctionCode)(R),$.optimize(this.opts.code.optimize);const l=$.toString();Z=`${$.scopeRefs(y.default.scope)}return ${l}`,this.opts.code.process&&(Z=this.opts.code.process(Z,u));const m=new Function(`${y.default.self}`,`${y.default.scope}`,Z)(this,this.scope.get());if(this.scope.value(E,{ref:m}),m.errors=null,m.schema=u.schema,m.schemaEnv=u,u.$async&&(m.$async=!0),!0===this.opts.code.source&&(m.source={validateName:E,validateCode:l,scopeValues:$._values}),this.opts.unevaluated){const{props:u,items:l}=R;m.evaluated={props:u instanceof f.Name?void 0:u,items:l instanceof f.Name?void 0:l,dynamicProps:u instanceof f.Name,dynamicItems:l instanceof f.Name},m.source&&(m.source.evaluated=(0,f.stringify)(m.evaluated))}return u.validate=m,u}catch(l){throw delete u.validate,delete u.validateName,Z&&this.logger.error("Error compiling schema, function code:",Z),l}finally{this._compilations.delete(u)}}function inlineOrCompile(u){return(0,v.inlineRef)(u.schema,this.opts.inlineRefs)?u.schema:u.validate?u:compileSchema.call(this,u)}function getCompilingSchema(u){for(const l of this._compilations)if(sameSchemaEnv(l,u))return l}function sameSchemaEnv(u,l){return u.schema===l.schema&&u.root===l.root&&u.baseId===l.baseId}function resolve(u,l){let m;for(;"string"==typeof(m=this.refs[l]);)l=m;return m||this.schemas[l]||resolveSchema.call(this,u,l)}function resolveSchema(u,l){const m=this.opts.uriResolver.parse(l),f=(0,v._getFullPath)(this.opts.uriResolver,m);let h=(0,v.getFullPath)(this.opts.uriResolver,u.baseId,void 0);if(Object.keys(u.schema).length>0&&f===h)return getJsonPointer.call(this,m,u);const y=(0,v.normalizeId)(f),w=this.refs[y]||this.schemas[y];if("string"==typeof w){const l=resolveSchema.call(this,u,w);if("object"!=typeof(null==l?void 0:l.schema))return;return getJsonPointer.call(this,m,l)}if("object"==typeof(null==w?void 0:w.schema)){if(w.validate||compileSchema.call(this,w),y===(0,v.normalizeId)(l)){const{schema:l}=w,{schemaId:m}=this.opts,f=l[m];return f&&(h=(0,v.resolveUrl)(this.opts.uriResolver,h,f)),new SchemaEnv({schema:l,schemaId:m,root:u,baseId:h})}return getJsonPointer.call(this,m,w)}}l.SchemaEnv=SchemaEnv,l.compileSchema=compileSchema,l.resolveRef=function resolveRef(u,l,m){var f;m=(0,v.resolveUrl)(this.opts.uriResolver,l,m);const h=u.refs[m];if(h)return h;let y=resolve.call(this,u,m);if(void 0===y){const h=null===(f=u.localRefs)||void 0===f?void 0:f[m],{schemaId:v}=this.opts;h&&(y=new SchemaEnv({schema:h,schemaId:v,root:u,baseId:l}))}return void 0!==y?u.refs[m]=inlineOrCompile.call(this,y):void 0},l.getCompilingSchema=getCompilingSchema,l.resolveSchema=resolveSchema;const S=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function getJsonPointer(u,{baseId:l,schema:m,root:f}){var h;if("/"!==(null===(h=u.fragment)||void 0===h?void 0:h[0]))return;for(const f of u.fragment.slice(1).split("/")){if("boolean"==typeof m)return;const u=m[(0,w.unescapeFragment)(f)];if(void 0===u)return;const h="object"==typeof(m=u)&&m[this.opts.schemaId];!S.has(f)&&h&&(l=(0,v.resolveUrl)(this.opts.uriResolver,l,h))}let y;if("boolean"!=typeof m&&m.$ref&&!(0,w.schemaHasRulesButRef)(m,this.RULES)){const u=(0,v.resolveUrl)(this.opts.uriResolver,l,m.$ref);y=resolveSchema.call(this,f,u)}const{schemaId:b}=this.opts;return y=y||new SchemaEnv({schema:m,schemaId:b,root:f,baseId:l}),y.schema!==y.root.schema?y:void 0}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={data:new f.Name("data"),valCxt:new f.Name("valCxt"),instancePath:new f.Name("instancePath"),parentData:new f.Name("parentData"),parentDataProperty:new f.Name("parentDataProperty"),rootData:new f.Name("rootData"),dynamicAnchors:new f.Name("dynamicAnchors"),vErrors:new f.Name("vErrors"),errors:new f.Name("errors"),this:new f.Name("this"),self:new f.Name("self"),scope:new f.Name("scope"),json:new f.Name("json"),jsonPos:new f.Name("jsonPos"),jsonLen:new f.Name("jsonLen"),jsonPart:new f.Name("jsonPart")};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js");class MissingRefError extends Error{constructor(u,l,m,h){super(h||`can't resolve reference ${m} from id ${l}`),this.missingRef=(0,f.resolveUrl)(u,l,m),this.missingSchema=(0,f.normalizeId)((0,f.getFullPath)(u,this.missingRef))}}l.default=MissingRefError},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.getSchemaRefs=l.resolveUrl=l.normalizeId=l._getFullPath=l.getFullPath=l.inlineRef=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),h=m("./node_modules/fast-deep-equal/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js"),v=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);l.inlineRef=function inlineRef(u,l=!0){return"boolean"==typeof u||(!0===l?!hasRef(u):!!l&&countKeys(u)<=l)};const w=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function hasRef(u){for(const l in u){if(w.has(l))return!0;const m=u[l];if(Array.isArray(m)&&m.some(hasRef))return!0;if("object"==typeof m&&hasRef(m))return!0}return!1}function countKeys(u){let l=0;for(const m in u){if("$ref"===m)return 1/0;if(l++,!v.has(m)&&("object"==typeof u[m]&&(0,f.eachItem)(u[m],u=>l+=countKeys(u)),l===1/0))return 1/0}return l}function getFullPath(u,l="",m){!1!==m&&(l=normalizeId(l));const f=u.parse(l);return _getFullPath(u,f)}function _getFullPath(u,l){return u.serialize(l).split("#")[0]+"#"}l.getFullPath=getFullPath,l._getFullPath=_getFullPath;const b=/#\/?$/;function normalizeId(u){return u?u.replace(b,""):""}l.normalizeId=normalizeId,l.resolveUrl=function resolveUrl(u,l,m){return m=normalizeId(m),u.resolve(l,m)};const S=/^[a-z_][-a-z0-9._]*$/i;l.getSchemaRefs=function getSchemaRefs(u,l){if("boolean"==typeof u)return{};const{schemaId:m,uriResolver:f}=this.opts,v=normalizeId(u[m]||l),w={"":v},b=getFullPath(f,v,!1),j={},$=new Set;return y(u,{allKeys:!0},(u,l,f,h)=>{if(void 0===h)return;const y=b+l;let v=w[h];function addRef(l){const m=this.opts.uriResolver.resolve;if(l=normalizeId(v?m(v,l):l),$.has(l))throw ambiguos(l);$.add(l);let f=this.refs[l];return"string"==typeof f&&(f=this.refs[f]),"object"==typeof f?checkAmbiguosRef(u,f.schema,l):l!==normalizeId(y)&&("#"===l[0]?(checkAmbiguosRef(u,j[l],l),j[l]=u):this.refs[l]=y),l}function addAnchor(u){if("string"==typeof u){if(!S.test(u))throw new Error(`invalid anchor "${u}"`);addRef.call(this,`#${u}`)}}"string"==typeof u[m]&&(v=addRef.call(this,u[m])),addAnchor.call(this,u.$anchor),addAnchor.call(this,u.$dynamicAnchor),w[l]=v}),j;function checkAmbiguosRef(u,l,m){if(void 0!==l&&!h(u,l))throw ambiguos(m)}function ambiguos(u){return new Error(`reference "${u}" resolves to more than one schema`)}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0}),l.getRules=l.isJSONType=void 0;const m=new Set(["string","number","integer","boolean","null","object","array"]);l.isJSONType=function isJSONType(u){return"string"==typeof u&&m.has(u)},l.getRules=function getRules(){const u={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...u,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},u.number,u.string,u.array,u.object],post:{rules:[]},all:{},keywords:{}}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.checkStrictMode=l.getErrorPath=l.Type=l.useFunc=l.setEvaluated=l.evaluatedPropsToName=l.mergeEvaluated=l.eachItem=l.unescapeJsonPointer=l.escapeJsonPointer=l.escapeFragment=l.unescapeFragment=l.schemaRefOrVal=l.schemaHasRulesButRef=l.schemaHasRules=l.checkUnknownRules=l.alwaysValidSchema=l.toHash=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js");function checkUnknownRules(u,l=u.schema){const{opts:m,self:f}=u;if(!m.strictSchema)return;if("boolean"==typeof l)return;const h=f.RULES.keywords;for(const m in l)h[m]||checkStrictMode(u,`unknown keyword: "${m}"`)}function schemaHasRules(u,l){if("boolean"==typeof u)return!u;for(const m in u)if(l[m])return!0;return!1}function escapeJsonPointer(u){return"number"==typeof u?`${u}`:u.replace(/~/g,"~0").replace(/\//g,"~1")}function unescapeJsonPointer(u){return u.replace(/~1/g,"/").replace(/~0/g,"~")}function makeMergeEvaluated({mergeNames:u,mergeToName:l,mergeValues:m,resultToName:h}){return(y,v,w,b)=>{const S=void 0===w?v:w instanceof f.Name?(v instanceof f.Name?u(y,v,w):l(y,v,w),w):v instanceof f.Name?(l(y,w,v),v):m(v,w);return b!==f.Name||S instanceof f.Name?S:h(y,S)}}function evaluatedPropsToName(u,l){if(!0===l)return u.var("props",!0);const m=u.var("props",f._`{}`);return void 0!==l&&setEvaluated(u,m,l),m}function setEvaluated(u,l,m){Object.keys(m).forEach(m=>u.assign(f._`${l}${(0,f.getProperty)(m)}`,!0))}l.toHash=function toHash(u){const l={};for(const m of u)l[m]=!0;return l},l.alwaysValidSchema=function alwaysValidSchema(u,l){return"boolean"==typeof l?l:0===Object.keys(l).length||(checkUnknownRules(u,l),!schemaHasRules(l,u.self.RULES.all))},l.checkUnknownRules=checkUnknownRules,l.schemaHasRules=schemaHasRules,l.schemaHasRulesButRef=function schemaHasRulesButRef(u,l){if("boolean"==typeof u)return!u;for(const m in u)if("$ref"!==m&&l.all[m])return!0;return!1},l.schemaRefOrVal=function schemaRefOrVal({topSchemaRef:u,schemaPath:l},m,h,y){if(!y){if("number"==typeof m||"boolean"==typeof m)return m;if("string"==typeof m)return f._`${m}`}return f._`${u}${l}${(0,f.getProperty)(h)}`},l.unescapeFragment=function unescapeFragment(u){return unescapeJsonPointer(decodeURIComponent(u))},l.escapeFragment=function escapeFragment(u){return encodeURIComponent(escapeJsonPointer(u))},l.escapeJsonPointer=escapeJsonPointer,l.unescapeJsonPointer=unescapeJsonPointer,l.eachItem=function eachItem(u,l){if(Array.isArray(u))for(const m of u)l(m);else l(u)},l.mergeEvaluated={props:makeMergeEvaluated({mergeNames:(u,l,m)=>u.if(f._`${m} !== true && ${l} !== undefined`,()=>{u.if(f._`${l} === true`,()=>u.assign(m,!0),()=>u.assign(m,f._`${m} || {}`).code(f._`Object.assign(${m}, ${l})`))}),mergeToName:(u,l,m)=>u.if(f._`${m} !== true`,()=>{!0===l?u.assign(m,!0):(u.assign(m,f._`${m} || {}`),setEvaluated(u,m,l))}),mergeValues:(u,l)=>!0===u||{...u,...l},resultToName:evaluatedPropsToName}),items:makeMergeEvaluated({mergeNames:(u,l,m)=>u.if(f._`${m} !== true && ${l} !== undefined`,()=>u.assign(m,f._`${l} === true ? true : ${m} > ${l} ? ${m} : ${l}`)),mergeToName:(u,l,m)=>u.if(f._`${m} !== true`,()=>u.assign(m,!0===l||f._`${m} > ${l} ? ${m} : ${l}`)),mergeValues:(u,l)=>!0===u||Math.max(u,l),resultToName:(u,l)=>u.var("items",l)})},l.evaluatedPropsToName=evaluatedPropsToName,l.setEvaluated=setEvaluated;const y={};var v;function checkStrictMode(u,l,m=u.opts.strictSchema){if(m){if(l=`strict mode: ${l}`,!0===m)throw new Error(l);u.self.logger.warn(l)}}l.useFunc=function useFunc(u,l){return u.scopeValue("func",{ref:l,code:y[l.code]||(y[l.code]=new h._Code(l.code))})},function(u){u[u.Num=0]="Num",u[u.Str=1]="Str"}(v||(l.Type=v={})),l.getErrorPath=function getErrorPath(u,l,m){if(u instanceof f.Name){const h=l===v.Num;return m?h?f._`"[" + ${u} + "]"`:f._`"['" + ${u} + "']"`:h?f._`"/" + ${u}`:f._`"/" + ${u}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return m?(0,f.getProperty)(u).toString():"/"+escapeJsonPointer(u)},l.checkStrictMode=checkStrictMode},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js":function(u,l){function shouldUseGroup(u,l){return l.rules.some(l=>shouldUseRule(u,l))}function shouldUseRule(u,l){var m;return void 0!==u[l.keyword]||(null===(m=l.definition.implements)||void 0===m?void 0:m.some(l=>void 0!==u[l]))}Object.defineProperty(l,"__esModule",{value:!0}),l.shouldUseRule=l.shouldUseGroup=l.schemaHasRulesForType=void 0,l.schemaHasRulesForType=function schemaHasRulesForType({schema:u,self:l},m){const f=l.RULES.types[m];return f&&!0!==f&&shouldUseGroup(u,f)},l.shouldUseGroup=shouldUseGroup,l.shouldUseRule=shouldUseRule},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.boolOrEmptySchema=l.topBoolOrEmptySchema=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),v={message:"boolean schema is false"};function falseSchemaError(u,l){const{gen:m,data:h}=u,y={gen:m,keyword:"false schema",data:h,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:u};(0,f.reportError)(y,v,void 0,l)}l.topBoolOrEmptySchema=function topBoolOrEmptySchema(u){const{gen:l,schema:m,validateName:f}=u;!1===m?falseSchemaError(u,!1):"object"==typeof m&&!0===m.$async?l.return(y.default.data):(l.assign(h._`${f}.errors`,null),l.return(!0))},l.boolOrEmptySchema=function boolOrEmptySchema(u,l){const{gen:m,schema:f}=u;!1===f?(m.var(l,!1),falseSchemaError(u)):m.var(l,!0)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.reportTypeError=l.checkDataTypes=l.checkDataType=l.coerceAndCheckDataType=l.getJSONTypes=l.getSchemaTypes=l.DataType=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");var b;function getJSONTypes(u){const l=Array.isArray(u)?u:u?[u]:[];if(l.every(f.isJSONType))return l;throw new Error("type must be JSONType or JSONType[]: "+l.join(","))}!function(u){u[u.Correct=0]="Correct",u[u.Wrong=1]="Wrong"}(b||(l.DataType=b={})),l.getSchemaTypes=function getSchemaTypes(u){const l=getJSONTypes(u.type);if(l.includes("null")){if(!1===u.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!l.length&&void 0!==u.nullable)throw new Error('"nullable" cannot be used without "type"');!0===u.nullable&&l.push("null")}return l},l.getJSONTypes=getJSONTypes,l.coerceAndCheckDataType=function coerceAndCheckDataType(u,l){const{gen:m,data:f,opts:y}=u,w=function coerceToTypes(u,l){return l?u.filter(u=>S.has(u)||"array"===l&&"array"===u):[]}(l,y.coerceTypes),j=l.length>0&&!(0===w.length&&1===l.length&&(0,h.schemaHasRulesForType)(u,l[0]));if(j){const h=checkDataTypes(l,f,y.strictNumbers,b.Wrong);m.if(h,()=>{w.length?function coerceData(u,l,m){const{gen:f,data:h,opts:y}=u,w=f.let("dataType",v._`typeof ${h}`),b=f.let("coerced",v._`undefined`);"array"===y.coerceTypes&&f.if(v._`${w} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>f.assign(h,v._`${h}[0]`).assign(w,v._`typeof ${h}`).if(checkDataTypes(l,h,y.strictNumbers),()=>f.assign(b,h)));f.if(v._`${b} !== undefined`);for(const u of m)(S.has(u)||"array"===u&&"array"===y.coerceTypes)&&coerceSpecificType(u);function coerceSpecificType(u){switch(u){case"string":return void f.elseIf(v._`${w} == "number" || ${w} == "boolean"`).assign(b,v._`"" + ${h}`).elseIf(v._`${h} === null`).assign(b,v._`""`);case"number":return void f.elseIf(v._`${w} == "boolean" || ${h} === null
3 + || (${w} == "string" && ${h} && ${h} == +${h})`).assign(b,v._`+${h}`);case"integer":return void f.elseIf(v._`${w} === "boolean" || ${h} === null
4 + || (${w} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(b,v._`+${h}`);case"boolean":return void f.elseIf(v._`${h} === "false" || ${h} === 0 || ${h} === null`).assign(b,!1).elseIf(v._`${h} === "true" || ${h} === 1`).assign(b,!0);case"null":return f.elseIf(v._`${h} === "" || ${h} === 0 || ${h} === false`),void f.assign(b,null);case"array":f.elseIf(v._`${w} === "string" || ${w} === "number"
5 + || ${w} === "boolean" || ${h} === null`).assign(b,v._`[${h}]`)}}f.else(),reportTypeError(u),f.endIf(),f.if(v._`${b} !== undefined`,()=>{f.assign(h,b),function assignParentData({gen:u,parentData:l,parentDataProperty:m},f){u.if(v._`${l} !== undefined`,()=>u.assign(v._`${l}[${m}]`,f))}(u,b)})}(u,l,w):reportTypeError(u)})}return j};const S=new Set(["string","number","integer","boolean","null"]);function checkDataType(u,l,m,f=b.Correct){const h=f===b.Correct?v.operators.EQ:v.operators.NEQ;let y;switch(u){case"null":return v._`${l} ${h} null`;case"array":y=v._`Array.isArray(${l})`;break;case"object":y=v._`${l} && typeof ${l} == "object" && !Array.isArray(${l})`;break;case"integer":y=numCond(v._`!(${l} % 1) && !isNaN(${l})`);break;case"number":y=numCond();break;default:return v._`typeof ${l} ${h} ${u}`}return f===b.Correct?y:(0,v.not)(y);function numCond(u=v.nil){return(0,v.and)(v._`typeof ${l} == "number"`,u,m?v._`isFinite(${l})`:v.nil)}}function checkDataTypes(u,l,m,f){if(1===u.length)return checkDataType(u[0],l,m,f);let h;const y=(0,w.toHash)(u);if(y.array&&y.object){const u=v._`typeof ${l} != "object"`;h=y.null?u:v._`!${l} || ${u}`,delete y.null,delete y.array,delete y.object}else h=v.nil;y.number&&delete y.integer;for(const u in y)h=(0,v.and)(h,checkDataType(u,l,m,f));return h}l.checkDataType=checkDataType,l.checkDataTypes=checkDataTypes;const j={message:({schema:u})=>`must be ${u}`,params:({schema:u,schemaValue:l})=>"string"==typeof u?v._`{type: ${u}}`:v._`{type: ${l}}`};function reportTypeError(u){const l=function getTypeErrorContext(u){const{gen:l,data:m,schema:f}=u,h=(0,w.schemaRefOrVal)(u,f,"type");return{gen:l,keyword:"type",data:m,schema:f.type,schemaCode:h,schemaValue:h,parentSchema:f,params:{},it:u}}(u);(0,y.reportError)(l,j)}l.reportTypeError=reportTypeError},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.assignDefaults=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");function assignDefault(u,l,m){const{gen:y,compositeRule:v,data:w,opts:b}=u;if(void 0===m)return;const S=f._`${w}${(0,f.getProperty)(l)}`;if(v)return void(0,h.checkStrictMode)(u,`default is ignored for: ${S}`);let j=f._`${S} === undefined`;"empty"===b.useDefaults&&(j=f._`${j} || ${S} === null || ${S} === ""`),y.if(j,f._`${S} = ${(0,f.stringify)(m)}`)}l.assignDefaults=function assignDefaults(u,l){const{properties:m,items:f}=u.schema;if("object"===l&&m)for(const l in m)assignDefault(u,l,m[l].default);else"array"===l&&Array.isArray(f)&&f.forEach((l,m)=>assignDefault(u,m,l.default))}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.getData=l.KeywordCxt=l.validateFunctionCode=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/boolSchema.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/applicability.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/defaults.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js");function validateFunction({gen:u,validateName:l,schema:m,schemaEnv:f,opts:h},y){h.code.es5?u.func(l,j._`${$.default.data}, ${$.default.valCxt}`,f.$async,()=>{u.code(j._`"use strict"; ${funcSourceUrl(m,h)}`),function destructureValCxtES5(u,l){u.if($.default.valCxt,()=>{u.var($.default.instancePath,j._`${$.default.valCxt}.${$.default.instancePath}`),u.var($.default.parentData,j._`${$.default.valCxt}.${$.default.parentData}`),u.var($.default.parentDataProperty,j._`${$.default.valCxt}.${$.default.parentDataProperty}`),u.var($.default.rootData,j._`${$.default.valCxt}.${$.default.rootData}`),l.dynamicRef&&u.var($.default.dynamicAnchors,j._`${$.default.valCxt}.${$.default.dynamicAnchors}`)},()=>{u.var($.default.instancePath,j._`""`),u.var($.default.parentData,j._`undefined`),u.var($.default.parentDataProperty,j._`undefined`),u.var($.default.rootData,$.default.data),l.dynamicRef&&u.var($.default.dynamicAnchors,j._`{}`)})}(u,h),u.code(y)}):u.func(l,j._`${$.default.data}, ${function destructureValCxt(u){return j._`{${$.default.instancePath}="", ${$.default.parentData}, ${$.default.parentDataProperty}, ${$.default.rootData}=${$.default.data}${u.dynamicRef?j._`, ${$.default.dynamicAnchors}={}`:j.nil}}={}`}(h)}`,f.$async,()=>u.code(funcSourceUrl(m,h)).code(y))}function funcSourceUrl(u,l){const m="object"==typeof u&&u[l.schemaId];return m&&(l.code.source||l.code.process)?j._`/*# sourceURL=${m} */`:j.nil}function subschemaCode(u,l){isSchemaObj(u)&&(checkKeywords(u),schemaCxtHasRules(u))?function subSchemaObjCode(u,l){const{schema:m,gen:f,opts:h}=u;h.$comment&&m.$comment&&commentKeyword(u);(function updateContext(u){const l=u.schema[u.opts.schemaId];l&&(u.baseId=(0,x.resolveUrl)(u.opts.uriResolver,u.baseId,l))})(u),function checkAsyncSchema(u){if(u.schema.$async&&!u.schemaEnv.$async)throw new Error("async schema in sync schema")}(u);const y=f.const("_errs",$.default.errors);typeAndKeywords(u,y),f.var(l,j._`${y} === ${$.default.errors}`)}(u,l):(0,f.boolOrEmptySchema)(u,l)}function schemaCxtHasRules({schema:u,self:l}){if("boolean"==typeof u)return!u;for(const m in u)if(l.RULES.all[m])return!0;return!1}function isSchemaObj(u){return"boolean"!=typeof u.schema}function checkKeywords(u){(0,E.checkUnknownRules)(u),function checkRefsAndKeywords(u){const{schema:l,errSchemaPath:m,opts:f,self:h}=u;l.$ref&&f.ignoreKeywordsWithRef&&(0,E.schemaHasRulesButRef)(l,h.RULES)&&h.logger.warn(`$ref: keywords ignored in schema at path "${m}"`)}(u)}function typeAndKeywords(u,l){if(u.opts.jtd)return schemaKeywords(u,[],!1,l);const m=(0,h.getSchemaTypes)(u.schema);schemaKeywords(u,m,!(0,h.coerceAndCheckDataType)(u,m),l)}function commentKeyword({gen:u,schemaEnv:l,schema:m,errSchemaPath:f,opts:h}){const y=m.$comment;if(!0===h.$comment)u.code(j._`${$.default.self}.logger.log(${y})`);else if("function"==typeof h.$comment){const m=j.str`${f}/$comment`,h=u.scopeValue("root",{ref:l.root});u.code(j._`${$.default.self}.opts.$comment(${y}, ${m}, ${h}.schema)`)}}function schemaKeywords(u,l,m,f){const{gen:h,schema:w,data:b,allErrors:S,opts:x,self:R}=u,{RULES:Z}=R;function groupKeywords(E){(0,y.shouldUseGroup)(w,E)&&(E.type?(h.if((0,v.checkDataType)(E.type,b,x.strictNumbers)),iterateKeywords(u,E),1===l.length&&l[0]===E.type&&m&&(h.else(),(0,v.reportTypeError)(u)),h.endIf()):iterateKeywords(u,E),S||h.if(j._`${$.default.errors} === ${f||0}`))}!w.$ref||!x.ignoreKeywordsWithRef&&(0,E.schemaHasRulesButRef)(w,Z)?(x.jtd||function checkStrictTypes(u,l){if(u.schemaEnv.meta||!u.opts.strictTypes)return;(function checkContextTypes(u,l){if(!l.length)return;if(!u.dataTypes.length)return void(u.dataTypes=l);l.forEach(l=>{includesType(u.dataTypes,l)||strictTypesError(u,`type "${l}" not allowed by context "${u.dataTypes.join(",")}"`)}),function narrowSchemaTypes(u,l){const m=[];for(const f of u.dataTypes)includesType(l,f)?m.push(f):l.includes("integer")&&"number"===f&&m.push("integer");u.dataTypes=m}(u,l)})(u,l),u.opts.allowUnionTypes||function checkMultipleTypes(u,l){l.length>1&&(2!==l.length||!l.includes("null"))&&strictTypesError(u,"use allowUnionTypes to allow union type keyword")}(u,l);!function checkKeywordTypes(u,l){const m=u.self.RULES.all;for(const f in m){const h=m[f];if("object"==typeof h&&(0,y.shouldUseRule)(u.schema,h)){const{type:m}=h.definition;m.length&&!m.some(u=>hasApplicableType(l,u))&&strictTypesError(u,`missing type "${m.join(",")}" for keyword "${f}"`)}}}(u,u.dataTypes)}(u,l),h.block(()=>{for(const u of Z.rules)groupKeywords(u);groupKeywords(Z.post)})):h.block(()=>keywordCode(u,"$ref",Z.all.$ref.definition))}function iterateKeywords(u,l){const{gen:m,schema:f,opts:{useDefaults:h}}=u;h&&(0,w.assignDefaults)(u,l.type),m.block(()=>{for(const m of l.rules)(0,y.shouldUseRule)(f,m)&&keywordCode(u,m.keyword,m.definition,l.type)})}function hasApplicableType(u,l){return u.includes(l)||"number"===l&&u.includes("integer")}function includesType(u,l){return u.includes(l)||"integer"===l&&u.includes("number")}function strictTypesError(u,l){l+=` at "${u.schemaEnv.baseId+u.errSchemaPath}" (strictTypes)`,(0,E.checkStrictMode)(u,l,u.opts.strictTypes)}l.validateFunctionCode=function validateFunctionCode(u){isSchemaObj(u)&&(checkKeywords(u),schemaCxtHasRules(u))?function topSchemaObjCode(u){const{schema:l,opts:m,gen:f}=u;return void validateFunction(u,()=>{m.$comment&&l.$comment&&commentKeyword(u),function checkNoDefault(u){const{schema:l,opts:m}=u;void 0!==l.default&&m.useDefaults&&m.strictSchema&&(0,E.checkStrictMode)(u,"default is ignored in the schema root")}(u),f.let($.default.vErrors,null),f.let($.default.errors,0),m.unevaluated&&function resetEvaluated(u){const{gen:l,validateName:m}=u;u.evaluated=l.const("evaluated",j._`${m}.evaluated`),l.if(j._`${u.evaluated}.dynamicProps`,()=>l.assign(j._`${u.evaluated}.props`,j._`undefined`)),l.if(j._`${u.evaluated}.dynamicItems`,()=>l.assign(j._`${u.evaluated}.items`,j._`undefined`))}(u),typeAndKeywords(u),function returnResults(u){const{gen:l,schemaEnv:m,validateName:f,ValidationError:h,opts:y}=u;m.$async?l.if(j._`${$.default.errors} === 0`,()=>l.return($.default.data),()=>l.throw(j._`new ${h}(${$.default.vErrors})`)):(l.assign(j._`${f}.errors`,$.default.vErrors),y.unevaluated&&function assignEvaluated({gen:u,evaluated:l,props:m,items:f}){m instanceof j.Name&&u.assign(j._`${l}.props`,m);f instanceof j.Name&&u.assign(j._`${l}.items`,f)}(u),l.return(j._`${$.default.errors} === 0`))}(u)})}(u):validateFunction(u,()=>(0,f.topBoolOrEmptySchema)(u))};class KeywordCxt{constructor(u,l,m){if((0,b.validateKeywordUsage)(u,l,m),this.gen=u.gen,this.allErrors=u.allErrors,this.keyword=m,this.data=u.data,this.schema=u.schema[m],this.$data=l.$data&&u.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,E.schemaRefOrVal)(u,this.schema,m,this.$data),this.schemaType=l.schemaType,this.parentSchema=u.schema,this.params={},this.it=u,this.def=l,this.$data)this.schemaCode=u.gen.const("vSchema",getData(this.$data,u));else if(this.schemaCode=this.schemaValue,!(0,b.validSchemaType)(this.schema,l.schemaType,l.allowUndefined))throw new Error(`${m} value must be ${JSON.stringify(l.schemaType)}`);("code"in l?l.trackErrors:!1!==l.errors)&&(this.errsCount=u.gen.const("_errs",$.default.errors))}result(u,l,m){this.failResult((0,j.not)(u),l,m)}failResult(u,l,m){this.gen.if(u),m?m():this.error(),l?(this.gen.else(),l(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(u,l){this.failResult((0,j.not)(u),void 0,l)}fail(u){if(void 0===u)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(u),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(u){if(!this.$data)return this.fail(u);const{schemaCode:l}=this;this.fail(j._`${l} !== undefined && (${(0,j.or)(this.invalid$data(),u)})`)}error(u,l,m){if(l)return this.setParams(l),this._error(u,m),void this.setParams({});this._error(u,m)}_error(u,l){(u?R.reportExtraError:R.reportError)(this,this.def.error,l)}$dataError(){(0,R.reportError)(this,this.def.$dataError||R.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,R.resetErrorsCount)(this.gen,this.errsCount)}ok(u){this.allErrors||this.gen.if(u)}setParams(u,l){l?Object.assign(this.params,u):this.params=u}block$data(u,l,m=j.nil){this.gen.block(()=>{this.check$data(u,m),l()})}check$data(u=j.nil,l=j.nil){if(!this.$data)return;const{gen:m,schemaCode:f,schemaType:h,def:y}=this;m.if((0,j.or)(j._`${f} === undefined`,l)),u!==j.nil&&m.assign(u,!0),(h.length||y.validateSchema)&&(m.elseIf(this.invalid$data()),this.$dataError(),u!==j.nil&&m.assign(u,!1)),m.else()}invalid$data(){const{gen:u,schemaCode:l,schemaType:m,def:f,it:h}=this;return(0,j.or)(function wrong$DataType(){if(m.length){if(!(l instanceof j.Name))throw new Error("ajv implementation error");const u=Array.isArray(m)?m:[m];return j._`${(0,v.checkDataTypes)(u,l,h.opts.strictNumbers,v.DataType.Wrong)}`}return j.nil}(),function invalid$DataSchema(){if(f.validateSchema){const m=u.scopeValue("validate$data",{ref:f.validateSchema});return j._`!${m}(${l})`}return j.nil}())}subschema(u,l){const m=(0,S.getSubschema)(this.it,u);(0,S.extendSubschemaData)(m,this.it,u),(0,S.extendSubschemaMode)(m,u);const f={...this.it,...m,items:void 0,props:void 0};return subschemaCode(f,l),f}mergeEvaluated(u,l){const{it:m,gen:f}=this;m.opts.unevaluated&&(!0!==m.props&&void 0!==u.props&&(m.props=E.mergeEvaluated.props(f,u.props,m.props,l)),!0!==m.items&&void 0!==u.items&&(m.items=E.mergeEvaluated.items(f,u.items,m.items,l)))}mergeValidEvaluated(u,l){const{it:m,gen:f}=this;if(m.opts.unevaluated&&(!0!==m.props||!0!==m.items))return f.if(l,()=>this.mergeEvaluated(u,j.Name)),!0}}function keywordCode(u,l,m,f){const h=new KeywordCxt(u,m,l);"code"in m?m.code(h,f):h.$data&&m.validate?(0,b.funcKeywordCode)(h,m):"macro"in m?(0,b.macroKeywordCode)(h,m):(m.compile||m.validate)&&(0,b.funcKeywordCode)(h,m)}l.KeywordCxt=KeywordCxt;const Z=/^\/(?:[^~]|~0|~1)*$/,C=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function getData(u,{dataLevel:l,dataNames:m,dataPathArr:f}){let h,y;if(""===u)return $.default.rootData;if("/"===u[0]){if(!Z.test(u))throw new Error(`Invalid JSON-pointer: ${u}`);h=u,y=$.default.rootData}else{const v=C.exec(u);if(!v)throw new Error(`Invalid JSON-pointer: ${u}`);const w=+v[1];if(h=v[2],"#"===h){if(w>=l)throw new Error(errorMsg("property/index",w));return f[l-w]}if(w>l)throw new Error(errorMsg("data",w));if(y=m[l-w],!h)return y}let v=y;const w=h.split("/");for(const u of w)u&&(y=j._`${y}${(0,j.getProperty)((0,E.unescapeJsonPointer)(u))}`,v=j._`${v} && ${y}`);return v;function errorMsg(u,m){return`Cannot access ${u} ${m} levels up, current level is ${l}`}}l.getData=getData},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/keyword.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateKeywordUsage=l.validSchemaType=l.funcKeywordCode=l.macroKeywordCode=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/errors.js");function modifyData(u){const{gen:l,data:m,it:h}=u;l.if(h.parentData,()=>l.assign(m,f._`${h.parentData}[${h.parentDataProperty}]`))}function useKeyword(u,l,m){if(void 0===m)throw new Error(`keyword "${l}" failed to compile`);return u.scopeValue("keyword","function"==typeof m?{ref:m}:{ref:m,code:(0,f.stringify)(m)})}l.macroKeywordCode=function macroKeywordCode(u,l){const{gen:m,keyword:h,schema:y,parentSchema:v,it:w}=u,b=l.macro.call(w.self,y,v,w),S=useKeyword(m,h,b);!1!==w.opts.validateSchema&&w.self.validateSchema(b,!0);const j=m.name("valid");u.subschema({schema:b,schemaPath:f.nil,errSchemaPath:`${w.errSchemaPath}/${h}`,topSchemaRef:S,compositeRule:!0},j),u.pass(j,()=>u.error(!0))},l.funcKeywordCode=function funcKeywordCode(u,l){var m;const{gen:w,keyword:b,schema:S,parentSchema:j,$data:$,it:x}=u;!function checkAsyncKeyword({schemaEnv:u},l){if(l.async&&!u.$async)throw new Error("async keyword in sync schema")}(x,l);const E=!$&&l.compile?l.compile.call(x.self,S,j,x):l.validate,R=useKeyword(w,b,E),Z=w.let("valid");function assignValid(m=(l.async?f._`await `:f.nil)){const v=x.opts.passContext?h.default.this:h.default.self,b=!("compile"in l&&!$||!1===l.schema);w.assign(Z,f._`${m}${(0,y.callValidateCode)(u,R,v,b)}`,l.modifying)}function reportErrs(u){var m;w.if((0,f.not)(null!==(m=l.valid)&&void 0!==m?m:Z),u)}u.block$data(Z,function validateKeyword(){if(!1===l.errors)assignValid(),l.modifying&&modifyData(u),reportErrs(()=>u.error());else{const m=l.async?function validateAsync(){const u=w.let("ruleErrs",null);return w.try(()=>assignValid(f._`await `),l=>w.assign(Z,!1).if(f._`${l} instanceof ${x.ValidationError}`,()=>w.assign(u,f._`${l}.errors`),()=>w.throw(l))),u}():function validateSync(){const u=f._`${R}.errors`;return w.assign(u,null),assignValid(f.nil),u}();l.modifying&&modifyData(u),reportErrs(()=>function addErrs(u,l){const{gen:m}=u;m.if(f._`Array.isArray(${l})`,()=>{m.assign(h.default.vErrors,f._`${h.default.vErrors} === null ? ${l} : ${h.default.vErrors}.concat(${l})`).assign(h.default.errors,f._`${h.default.vErrors}.length`),(0,v.extendErrors)(u)},()=>u.error())}(u,m))}}),u.ok(null!==(m=l.valid)&&void 0!==m?m:Z)},l.validSchemaType=function validSchemaType(u,l,m=!1){return!l.length||l.some(l=>"array"===l?Array.isArray(u):"object"===l?u&&"object"==typeof u&&!Array.isArray(u):typeof u==l||m&&void 0===u)},l.validateKeywordUsage=function validateKeywordUsage({schema:u,opts:l,self:m,errSchemaPath:f},h,y){if(Array.isArray(h.keyword)?!h.keyword.includes(y):h.keyword!==y)throw new Error("ajv implementation error");const v=h.dependencies;if(null==v?void 0:v.some(l=>!Object.prototype.hasOwnProperty.call(u,l)))throw new Error(`parent schema must have dependencies of ${y}: ${v.join(",")}`);if(h.validateSchema){if(!h.validateSchema(u[y])){const u=`keyword "${y}" value is invalid at path "${f}": `+m.errorsText(h.validateSchema.errors);if("log"!==l.validateSchema)throw new Error(u);m.logger.error(u)}}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/subschema.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.extendSubschemaMode=l.extendSubschemaData=l.getSubschema=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");l.getSubschema=function getSubschema(u,{keyword:l,schemaProp:m,schema:y,schemaPath:v,errSchemaPath:w,topSchemaRef:b}){if(void 0!==l&&void 0!==y)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==l){const y=u.schema[l];return void 0===m?{schema:y,schemaPath:f._`${u.schemaPath}${(0,f.getProperty)(l)}`,errSchemaPath:`${u.errSchemaPath}/${l}`}:{schema:y[m],schemaPath:f._`${u.schemaPath}${(0,f.getProperty)(l)}${(0,f.getProperty)(m)}`,errSchemaPath:`${u.errSchemaPath}/${l}/${(0,h.escapeFragment)(m)}`}}if(void 0!==y){if(void 0===v||void 0===w||void 0===b)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:y,schemaPath:v,topSchemaRef:b,errSchemaPath:w}}throw new Error('either "keyword" or "schema" must be passed')},l.extendSubschemaData=function extendSubschemaData(u,l,{dataProp:m,dataPropType:y,data:v,dataTypes:w,propertyName:b}){if(void 0!==v&&void 0!==m)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:S}=l;if(void 0!==m){const{errorPath:v,dataPathArr:w,opts:b}=l;dataContextProps(S.let("data",f._`${l.data}${(0,f.getProperty)(m)}`,!0)),u.errorPath=f.str`${v}${(0,h.getErrorPath)(m,y,b.jsPropertySyntax)}`,u.parentDataProperty=f._`${m}`,u.dataPathArr=[...w,u.parentDataProperty]}if(void 0!==v){dataContextProps(v instanceof f.Name?v:S.let("data",v,!0)),void 0!==b&&(u.propertyName=b)}function dataContextProps(m){u.data=m,u.dataLevel=l.dataLevel+1,u.dataTypes=[],l.definedProperties=new Set,u.parentData=l.data,u.dataNames=[...l.dataNames,m]}w&&(u.dataTypes=w)},l.extendSubschemaMode=function extendSubschemaMode(u,{jtdDiscriminator:l,jtdMetadata:m,compositeRule:f,createErrors:h,allErrors:y}){void 0!==f&&(u.compositeRule=f),void 0!==h&&(u.createErrors=h),void 0!==y&&(u.allErrors=y),u.jtdDiscriminator=l,u.jtdMetadata=m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/core.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.CodeGen=l.Name=l.nil=l.stringify=l.str=l._=l.KeywordCxt=void 0;var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js");Object.defineProperty(l,"KeywordCxt",{enumerable:!0,get:function(){return f.KeywordCxt}});var h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js");Object.defineProperty(l,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(l,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(l,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(l,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(l,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(l,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});const y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/rules.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/resolve.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js"),defaultRegExp=(u,l)=>new RegExp(u,l);defaultRegExp.code="new RegExp";const Z=["removeAdditional","useDefaults","coerceTypes"],C=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),z={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},A={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function requiredOptions(u){var l,m,f,h,y,v,w,b,S,j,$,x,E,Z,C,z,A,O,D,N,M,U,L,F,V;const K=u.strict,H=null===(l=u.code)||void 0===l?void 0:l.optimize,B=!0===H||void 0===H?1:H||0,J=null!==(f=null===(m=u.code)||void 0===m?void 0:m.regExp)&&void 0!==f?f:defaultRegExp,W=null!==(h=u.uriResolver)&&void 0!==h?h:R.default;return{strictSchema:null===(v=null!==(y=u.strictSchema)&&void 0!==y?y:K)||void 0===v||v,strictNumbers:null===(b=null!==(w=u.strictNumbers)&&void 0!==w?w:K)||void 0===b||b,strictTypes:null!==(j=null!==(S=u.strictTypes)&&void 0!==S?S:K)&&void 0!==j?j:"log",strictTuples:null!==(x=null!==($=u.strictTuples)&&void 0!==$?$:K)&&void 0!==x?x:"log",strictRequired:null!==(Z=null!==(E=u.strictRequired)&&void 0!==E?E:K)&&void 0!==Z&&Z,code:u.code?{...u.code,optimize:B,regExp:J}:{optimize:B,regExp:J},loopRequired:null!==(C=u.loopRequired)&&void 0!==C?C:200,loopEnum:null!==(z=u.loopEnum)&&void 0!==z?z:200,meta:null===(A=u.meta)||void 0===A||A,messages:null===(O=u.messages)||void 0===O||O,inlineRefs:null===(D=u.inlineRefs)||void 0===D||D,schemaId:null!==(N=u.schemaId)&&void 0!==N?N:"$id",addUsedSchema:null===(M=u.addUsedSchema)||void 0===M||M,validateSchema:null===(U=u.validateSchema)||void 0===U||U,validateFormats:null===(L=u.validateFormats)||void 0===L||L,unicodeRegExp:null===(F=u.unicodeRegExp)||void 0===F||F,int32range:null===(V=u.int32range)||void 0===V||V,uriResolver:W}}class Ajv{constructor(u={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,u=this.opts={...u,...requiredOptions(u)};const{es5:l,lines:m}=this.opts.code;this.scope=new S.ValueScope({scope:{},prefixes:C,es5:l,lines:m}),this.logger=function getLogger(u){if(!1===u)return O;if(void 0===u)return console;if(u.log&&u.warn&&u.error)return u;throw new Error("logger must implement log, warn and error methods")}(u.logger);const f=u.validateFormats;u.validateFormats=!1,this.RULES=(0,w.getRules)(),checkOptions.call(this,z,u,"NOT SUPPORTED"),checkOptions.call(this,A,u,"DEPRECATED","warn"),this._metaOpts=getMetaSchemaOptions.call(this),u.formats&&addInitialFormats.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),u.keywords&&addInitialKeywords.call(this,u.keywords),"object"==typeof u.meta&&this.addMetaSchema(u.meta),addInitialSchemas.call(this),u.validateFormats=f}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:u,meta:l,schemaId:m}=this.opts;let f=E;"id"===m&&(f={...E},f.id=f.$id,delete f.$id),l&&u&&this.addMetaSchema(f,f[m],!1)}defaultMeta(){const{meta:u,schemaId:l}=this.opts;return this.opts.defaultMeta="object"==typeof u?u[l]||u:void 0}validate(u,l){let m;if("string"==typeof u){if(m=this.getSchema(u),!m)throw new Error(`no schema with key or ref "${u}"`)}else m=this.compile(u);const f=m(l);return"$async"in m||(this.errors=m.errors),f}compile(u,l){const m=this._addSchema(u,l);return m.validate||this._compileSchemaEnv(m)}compileAsync(u,l){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:m}=this.opts;return runCompileAsync.call(this,u,l);async function runCompileAsync(u,l){await loadMetaSchema.call(this,u.$schema);const m=this._addSchema(u,l);return m.validate||_compileAsync.call(this,m)}async function loadMetaSchema(u){u&&!this.getSchema(u)&&await runCompileAsync.call(this,{$ref:u},!0)}async function _compileAsync(u){try{return this._compileSchemaEnv(u)}catch(l){if(!(l instanceof v.default))throw l;return checkLoaded.call(this,l),await loadMissingSchema.call(this,l.missingSchema),_compileAsync.call(this,u)}}function checkLoaded({missingSchema:u,missingRef:l}){if(this.refs[u])throw new Error(`AnySchema ${u} is loaded but ${l} cannot be resolved`)}async function loadMissingSchema(u){const m=await _loadSchema.call(this,u);this.refs[u]||await loadMetaSchema.call(this,m.$schema),this.refs[u]||this.addSchema(m,u,l)}async function _loadSchema(u){const l=this._loading[u];if(l)return l;try{return await(this._loading[u]=m(u))}finally{delete this._loading[u]}}}addSchema(u,l,m,f=this.opts.validateSchema){if(Array.isArray(u)){for(const l of u)this.addSchema(l,void 0,m,f);return this}let h;if("object"==typeof u){const{schemaId:l}=this.opts;if(h=u[l],void 0!==h&&"string"!=typeof h)throw new Error(`schema ${l} must be string`)}return l=(0,j.normalizeId)(l||h),this._checkUnique(l),this.schemas[l]=this._addSchema(u,m,l,f,!0),this}addMetaSchema(u,l,m=this.opts.validateSchema){return this.addSchema(u,l,!0,m),this}validateSchema(u,l){if("boolean"==typeof u)return!0;let m;if(m=u.$schema,void 0!==m&&"string"!=typeof m)throw new Error("$schema must be a string");if(m=m||this.opts.defaultMeta||this.defaultMeta(),!m)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const f=this.validate(m,u);if(!f&&l){const u="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(u);this.logger.error(u)}return f}getSchema(u){let l;for(;"string"==typeof(l=getSchEnv.call(this,u));)u=l;if(void 0===l){const{schemaId:m}=this.opts,f=new b.SchemaEnv({schema:{},schemaId:m});if(l=b.resolveSchema.call(this,f,u),!l)return;this.refs[u]=l}return l.validate||this._compileSchemaEnv(l)}removeSchema(u){if(u instanceof RegExp)return this._removeAllSchemas(this.schemas,u),this._removeAllSchemas(this.refs,u),this;switch(typeof u){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const l=getSchEnv.call(this,u);return"object"==typeof l&&this._cache.delete(l.schema),delete this.schemas[u],delete this.refs[u],this}case"object":{const l=u;this._cache.delete(l);let m=u[this.opts.schemaId];return m&&(m=(0,j.normalizeId)(m),delete this.schemas[m],delete this.refs[m]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(u){for(const l of u)this.addKeyword(l);return this}addKeyword(u,l){let m;if("string"==typeof u)m=u,"object"==typeof l&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),l.keyword=m);else{if("object"!=typeof u||void 0!==l)throw new Error("invalid addKeywords parameters");if(m=(l=u).keyword,Array.isArray(m)&&!m.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(checkKeyword.call(this,m,l),!l)return(0,x.eachItem)(m,u=>addRule.call(this,u)),this;keywordMetaschema.call(this,l);const f={...l,type:(0,$.getJSONTypes)(l.type),schemaType:(0,$.getJSONTypes)(l.schemaType)};return(0,x.eachItem)(m,0===f.type.length?u=>addRule.call(this,u,f):u=>f.type.forEach(l=>addRule.call(this,u,f,l))),this}getKeyword(u){const l=this.RULES.all[u];return"object"==typeof l?l.definition:!!l}removeKeyword(u){const{RULES:l}=this;delete l.keywords[u],delete l.all[u];for(const m of l.rules){const l=m.rules.findIndex(l=>l.keyword===u);l>=0&&m.rules.splice(l,1)}return this}addFormat(u,l){return"string"==typeof l&&(l=new RegExp(l)),this.formats[u]=l,this}errorsText(u=this.errors,{separator:l=", ",dataVar:m="data"}={}){return u&&0!==u.length?u.map(u=>`${m}${u.instancePath} ${u.message}`).reduce((u,m)=>u+l+m):"No errors"}$dataMetaSchema(u,l){const m=this.RULES.all;u=JSON.parse(JSON.stringify(u));for(const f of l){const l=f.split("/").slice(1);let h=u;for(const u of l)h=h[u];for(const u in m){const l=m[u];if("object"!=typeof l)continue;const{$data:f}=l.definition,y=h[u];f&&y&&(h[u]=schemaOrData(y))}}return u}_removeAllSchemas(u,l){for(const m in u){const f=u[m];l&&!l.test(m)||("string"==typeof f?delete u[m]:f&&!f.meta&&(this._cache.delete(f.schema),delete u[m]))}}_addSchema(u,l,m,f=this.opts.validateSchema,h=this.opts.addUsedSchema){let y;const{schemaId:v}=this.opts;if("object"==typeof u)y=u[v];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof u)throw new Error("schema must be object or boolean")}let w=this._cache.get(u);if(void 0!==w)return w;m=(0,j.normalizeId)(y||m);const S=j.getSchemaRefs.call(this,u,m);return w=new b.SchemaEnv({schema:u,schemaId:v,meta:l,baseId:m,localRefs:S}),this._cache.set(w.schema,w),h&&!m.startsWith("#")&&(m&&this._checkUnique(m),this.refs[m]=w),f&&this.validateSchema(u,!0),w}_checkUnique(u){if(this.schemas[u]||this.refs[u])throw new Error(`schema with key or id "${u}" already exists`)}_compileSchemaEnv(u){if(u.meta?this._compileMetaSchema(u):b.compileSchema.call(this,u),!u.validate)throw new Error("ajv implementation error");return u.validate}_compileMetaSchema(u){const l=this.opts;this.opts=this._metaOpts;try{b.compileSchema.call(this,u)}finally{this.opts=l}}}function checkOptions(u,l,m,f="error"){for(const h in u){const y=h;y in l&&this.logger[f](`${m}: option ${h}. ${u[y]}`)}}function getSchEnv(u){return u=(0,j.normalizeId)(u),this.schemas[u]||this.refs[u]}function addInitialSchemas(){const u=this.opts.schemas;if(u)if(Array.isArray(u))this.addSchema(u);else for(const l in u)this.addSchema(u[l],l)}function addInitialFormats(){for(const u in this.opts.formats){const l=this.opts.formats[u];l&&this.addFormat(u,l)}}function addInitialKeywords(u){if(Array.isArray(u))this.addVocabulary(u);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const l in u){const m=u[l];m.keyword||(m.keyword=l),this.addKeyword(m)}}}function getMetaSchemaOptions(){const u={...this.opts};for(const l of Z)delete u[l];return u}Ajv.ValidationError=y.default,Ajv.MissingRefError=v.default,l.default=Ajv;const O={log(){},warn(){},error(){}};const D=/^[a-z_$][a-z0-9_$:-]*$/i;function checkKeyword(u,l){const{RULES:m}=this;if((0,x.eachItem)(u,u=>{if(m.keywords[u])throw new Error(`Keyword ${u} is already defined`);if(!D.test(u))throw new Error(`Keyword ${u} has invalid name`)}),l&&l.$data&&!("code"in l)&&!("validate"in l))throw new Error('$data keyword must have "code" or "validate" function')}function addRule(u,l,m){var f;const h=null==l?void 0:l.post;if(m&&h)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:y}=this;let v=h?y.post:y.rules.find(({type:u})=>u===m);if(v||(v={type:m,rules:[]},y.rules.push(v)),y.keywords[u]=!0,!l)return;const w={keyword:u,definition:{...l,type:(0,$.getJSONTypes)(l.type),schemaType:(0,$.getJSONTypes)(l.schemaType)}};l.before?addBeforeRule.call(this,v,w,l.before):v.rules.push(w),y.all[u]=w,null===(f=l.implements)||void 0===f||f.forEach(u=>this.addKeyword(u))}function addBeforeRule(u,l,m){const f=u.rules.findIndex(u=>u.keyword===m);f>=0?u.rules.splice(f,0,l):(u.rules.push(l),this.logger.warn(`rule ${m} is not defined`))}function keywordMetaschema(u){let{metaSchema:l}=u;void 0!==l&&(u.$data&&this.opts.$data&&(l=schemaOrData(l)),u.validateSchema=this.compile(l,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function schemaOrData(u){return{anyOf:[u,N]}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/data.json":function(u){u.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/refs/json-schema-draft-07.json":function(u){u.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/fast-deep-equal/index.js");f.code='require("ajv/dist/runtime/equal").default',l.default=f},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js":function(u,l){function ucs2length(u){const l=u.length;let m,f=0,h=0;for(;h<l;)f++,m=u.charCodeAt(h++),m>=55296&&m<=56319&&h<l&&(m=u.charCodeAt(h),56320==(64512&m)&&h++);return f}Object.defineProperty(l,"__esModule",{value:!0}),l.default=ucs2length,ucs2length.code='require("ajv/dist/runtime/ucs2length").default'},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/uri.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/fast-uri/index.js");f.code='require("ajv/dist/runtime/uri").default',l.default=f},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/validation_error.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0});class ValidationError extends Error{constructor(u){super("validation failed"),this.errors=u,this.ajv=this.validation=!0}}l.default=ValidationError},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateAdditionalItems=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:u}})=>f.str`must NOT have more than ${u} items`,params:({params:{len:u}})=>f._`{limit: ${u}}`},code(u){const{parentSchema:l,it:m}=u,{items:f}=l;Array.isArray(f)?validateAdditionalItems(u,f):(0,h.checkStrictMode)(m,'"additionalItems" is ignored when "items" is not an array of schemas')}};function validateAdditionalItems(u,l){const{gen:m,schema:y,data:v,keyword:w,it:b}=u;b.items=!0;const S=m.const("len",f._`${v}.length`);if(!1===y)u.setParams({len:l.length}),u.pass(f._`${S} <= ${l.length}`);else if("object"==typeof y&&!(0,h.alwaysValidSchema)(b,y)){const y=m.var("valid",f._`${S} <= ${l.length}`);m.if((0,f.not)(y),()=>function validateItems(y){m.forRange("i",l.length,S,l=>{u.subschema({keyword:w,dataProp:l,dataPropType:h.Type.Num},y),b.allErrors||m.if((0,f.not)(y),()=>m.break())})}(y)),u.ok(y)}}l.validateAdditionalItems=validateAdditionalItems,l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),w={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:u})=>h._`{additionalProperty: ${u.additionalProperty}}`},code(u){const{gen:l,schema:m,parentSchema:w,data:b,errsCount:S,it:j}=u;if(!S)throw new Error("ajv implementation error");const{allErrors:$,opts:x}=j;if(j.props=!0,"all"!==x.removeAdditional&&(0,v.alwaysValidSchema)(j,m))return;const E=(0,f.allSchemaProperties)(w.properties),R=(0,f.allSchemaProperties)(w.patternProperties);function deleteAdditional(u){l.code(h._`delete ${b}[${u}]`)}function additionalPropertyCode(f){if("all"===x.removeAdditional||x.removeAdditional&&!1===m)deleteAdditional(f);else{if(!1===m)return u.setParams({additionalProperty:f}),u.error(),void($||l.break());if("object"==typeof m&&!(0,v.alwaysValidSchema)(j,m)){const m=l.name("valid");"failing"===x.removeAdditional?(applyAdditionalSchema(f,m,!1),l.if((0,h.not)(m),()=>{u.reset(),deleteAdditional(f)})):(applyAdditionalSchema(f,m),$||l.if((0,h.not)(m),()=>l.break()))}}}function applyAdditionalSchema(l,m,f){const h={keyword:"additionalProperties",dataProp:l,dataPropType:v.Type.Str};!1===f&&Object.assign(h,{compositeRule:!0,createErrors:!1,allErrors:!1}),u.subschema(h,m)}!function checkAdditionalProperties(){l.forIn("key",b,m=>{E.length||R.length?l.if(function isAdditional(m){let y;if(E.length>8){const u=(0,v.schemaRefOrVal)(j,w.properties,"properties");y=(0,f.isOwnProperty)(l,u,m)}else y=E.length?(0,h.or)(...E.map(u=>h._`${m} === ${u}`)):h.nil;R.length&&(y=(0,h.or)(y,...R.map(l=>h._`${(0,f.usePattern)(u,l)}.test(${m})`)));return(0,h.not)(y)}(m),()=>additionalPropertyCode(m)):additionalPropertyCode(m)})}(),u.ok(h._`${S} === ${y.default.errors}`)}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),h={keyword:"allOf",schemaType:"array",code(u){const{gen:l,schema:m,it:h}=u;if(!Array.isArray(m))throw new Error("ajv implementation error");const y=l.name("valid");m.forEach((l,m)=>{if((0,f.alwaysValidSchema)(h,l))return;const v=u.subschema({keyword:"allOf",schemaProp:m},y);u.ok(y),u.mergeEvaluated(v)})}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js").validateUnion,error:{message:"must match a schema in anyOf"}};l.default=f},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:u,max:l}})=>void 0===l?f.str`must contain at least ${u} valid item(s)`:f.str`must contain at least ${u} and no more than ${l} valid item(s)`,params:({params:{min:u,max:l}})=>void 0===l?f._`{minContains: ${u}}`:f._`{minContains: ${u}, maxContains: ${l}}`},code(u){const{gen:l,schema:m,parentSchema:y,data:v,it:w}=u;let b,S;const{minContains:j,maxContains:$}=y;w.opts.next?(b=void 0===j?1:j,S=$):b=1;const x=l.const("len",f._`${v}.length`);if(u.setParams({min:b,max:S}),void 0===S&&0===b)return void(0,h.checkStrictMode)(w,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==S&&b>S)return(0,h.checkStrictMode)(w,'"minContains" > "maxContains" is always invalid'),void u.fail();if((0,h.alwaysValidSchema)(w,m)){let l=f._`${x} >= ${b}`;return void 0!==S&&(l=f._`${l} && ${x} <= ${S}`),void u.pass(l)}w.items=!0;const E=l.name("valid");function validateItemsWithCount(){const u=l.name("_valid"),m=l.let("count",0);validateItems(u,()=>l.if(u,()=>function checkLimits(u){l.code(f._`${u}++`),void 0===S?l.if(f._`${u} >= ${b}`,()=>l.assign(E,!0).break()):(l.if(f._`${u} > ${S}`,()=>l.assign(E,!1).break()),1===b?l.assign(E,!0):l.if(f._`${u} >= ${b}`,()=>l.assign(E,!0)))}(m)))}function validateItems(m,f){l.forRange("i",0,x,l=>{u.subschema({keyword:"contains",dataProp:l,dataPropType:h.Type.Num,compositeRule:!0},m),f()})}void 0===S&&1===b?validateItems(E,()=>l.if(E,()=>l.break())):0===b?(l.let(E,!0),void 0!==S&&l.if(f._`${v}.length > 0`,validateItemsWithCount)):(l.let(E,!1),validateItemsWithCount()),u.result(E,()=>u.reset())}};l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateSchemaDeps=l.validatePropertyDeps=l.error=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js");l.error={message:({params:{property:u,depsCount:l,deps:m}})=>{const h=1===l?"property":"properties";return f.str`must have ${h} ${m} when property ${u} is present`},params:({params:{property:u,depsCount:l,deps:m,missingProperty:h}})=>f._`{property: ${u},
6 + missingProperty: ${h},
7 + depsCount: ${l},
8 + deps: ${m}}`};const v={keyword:"dependencies",type:"object",schemaType:"object",error:l.error,code(u){const[l,m]=function splitDependencies({schema:u}){const l={},m={};for(const f in u){if("__proto__"===f)continue;(Array.isArray(u[f])?l:m)[f]=u[f]}return[l,m]}(u);validatePropertyDeps(u,l),validateSchemaDeps(u,m)}};function validatePropertyDeps(u,l=u.schema){const{gen:m,data:h,it:v}=u;if(0===Object.keys(l).length)return;const w=m.let("missing");for(const b in l){const S=l[b];if(0===S.length)continue;const j=(0,y.propertyInData)(m,h,b,v.opts.ownProperties);u.setParams({property:b,depsCount:S.length,deps:S.join(", ")}),v.allErrors?m.if(j,()=>{for(const l of S)(0,y.checkReportMissingProp)(u,l)}):(m.if(f._`${j} && (${(0,y.checkMissingProp)(u,S,w)})`),(0,y.reportMissingProp)(u,w),m.else())}}function validateSchemaDeps(u,l=u.schema){const{gen:m,data:f,keyword:v,it:w}=u,b=m.name("valid");for(const S in l)(0,h.alwaysValidSchema)(w,l[S])||(m.if((0,y.propertyInData)(m,f,S,w.opts.ownProperties),()=>{const l=u.subschema({keyword:v,schemaProp:S},b);u.mergeValidEvaluated(l,b)},()=>m.var(b,!0)),u.ok(b))}l.validatePropertyDeps=validatePropertyDeps,l.validateSchemaDeps=validateSchemaDeps,l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:u})=>f.str`must match "${u.ifClause}" schema`,params:({params:u})=>f._`{failingKeyword: ${u.ifClause}}`},code(u){const{gen:l,parentSchema:m,it:y}=u;void 0===m.then&&void 0===m.else&&(0,h.checkStrictMode)(y,'"if" without "then" and "else" is ignored');const v=hasSchema(y,"then"),w=hasSchema(y,"else");if(!v&&!w)return;const b=l.let("valid",!0),S=l.name("_valid");if(function validateIf(){const l=u.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},S);u.mergeEvaluated(l)}(),u.reset(),v&&w){const m=l.let("ifClause");u.setParams({ifClause:m}),l.if(S,validateClause("then",m),validateClause("else",m))}else v?l.if(S,validateClause("then")):l.if((0,f.not)(S),validateClause("else"));function validateClause(m,h){return()=>{const y=u.subschema({keyword:m},S);l.assign(b,S),u.mergeValidEvaluated(y,b),h?l.assign(h,f._`${m}`):u.setParams({ifClause:m})}}u.pass(b,()=>u.error(!0))}};function hasSchema(u,l){const m=u.schema[l];return void 0!==m&&!(0,h.alwaysValidSchema)(u,m)}l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/contains.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/dependencies.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/anyOf.js"),Z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js"),C=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/allOf.js"),z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/if.js"),A=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js");l.default=function getApplicator(u=!1){const l=[E.default,R.default,Z.default,C.default,z.default,A.default,S.default,j.default,b.default,$.default,x.default];return u?l.push(h.default,v.default):l.push(f.default,y.default),l.push(w.default),l}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateTuple=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),v={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(u){const{schema:l,it:m}=u;if(Array.isArray(l))return validateTuple(u,"additionalItems",l);m.items=!0,(0,h.alwaysValidSchema)(m,l)||u.ok((0,y.validateArray)(u))}};function validateTuple(u,l,m=u.schema){const{gen:y,parentSchema:v,data:w,keyword:b,it:S}=u;!function checkStrictTuple(u){const{opts:f,errSchemaPath:y}=S,v=m.length,w=v===u.minItems&&(v===u.maxItems||!1===u[l]);if(f.strictTuples&&!w){const u=`"${b}" is ${v}-tuple, but minItems or maxItems/${l} are not specified or different at path "${y}"`;(0,h.checkStrictMode)(S,u,f.strictTuples)}}(v),S.opts.unevaluated&&m.length&&!0!==S.items&&(S.items=h.mergeEvaluated.items(y,m.length,S.items));const j=y.name("valid"),$=y.const("len",f._`${w}.length`);m.forEach((l,m)=>{(0,h.alwaysValidSchema)(S,l)||(y.if(f._`${$} > ${m}`,()=>u.subschema({keyword:b,schemaProp:m,dataProp:m},j)),u.ok(j))})}l.validateTuple=validateTuple,l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items2020.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js"),w={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:u}})=>f.str`must NOT have more than ${u} items`,params:({params:{len:u}})=>f._`{limit: ${u}}`},code(u){const{schema:l,parentSchema:m,it:f}=u,{prefixItems:w}=m;f.items=!0,(0,h.alwaysValidSchema)(f,l)||(w?(0,v.validateAdditionalItems)(u,w):u.ok((0,y.validateArray)(u)))}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/not.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),h={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(u){const{gen:l,schema:m,it:h}=u;if((0,f.alwaysValidSchema)(h,m))return void u.fail();const y=l.name("valid");u.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},y),u.failResult(y,()=>u.reset(),()=>u.error())},error:{message:"must NOT be valid"}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/oneOf.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:u})=>f._`{passingSchemas: ${u.passing}}`},code(u){const{gen:l,schema:m,parentSchema:y,it:v}=u;if(!Array.isArray(m))throw new Error("ajv implementation error");if(v.opts.discriminator&&y.discriminator)return;const w=m,b=l.let("valid",!1),S=l.let("passing",null),j=l.name("_valid");u.setParams({passing:S}),l.block(function validateOneOf(){w.forEach((m,y)=>{let w;(0,h.alwaysValidSchema)(v,m)?l.var(j,!0):w=u.subschema({keyword:"oneOf",schemaProp:y,compositeRule:!0},j),y>0&&l.if(f._`${j} && ${b}`).assign(b,!1).assign(S,f._`[${S}, ${y}]`).else(),l.if(j,()=>{l.assign(b,!0),l.assign(S,y),w&&u.mergeEvaluated(w,f.Name)})})}),u.result(b,()=>u.reset(),()=>u.error(!0))}};l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),w={keyword:"patternProperties",type:"object",schemaType:"object",code(u){const{gen:l,schema:m,data:w,parentSchema:b,it:S}=u,{opts:j}=S,$=(0,f.allSchemaProperties)(m),x=$.filter(u=>(0,y.alwaysValidSchema)(S,m[u]));if(0===$.length||x.length===$.length&&(!S.opts.unevaluated||!0===S.props))return;const E=j.strictSchema&&!j.allowMatchingProperties&&b.properties,R=l.name("valid");!0===S.props||S.props instanceof h.Name||(S.props=(0,v.evaluatedPropsToName)(l,S.props));const{props:Z}=S;function checkMatchingProperties(u){for(const l in E)new RegExp(u).test(l)&&(0,y.checkStrictMode)(S,`property ${l} matches pattern ${u} (use allowMatchingProperties)`)}function validateProperties(m){l.forIn("key",w,y=>{l.if(h._`${(0,f.usePattern)(u,m)}.test(${y})`,()=>{const f=x.includes(m);f||u.subschema({keyword:"patternProperties",schemaProp:m,dataProp:y,dataPropType:v.Type.Str},R),S.opts.unevaluated&&!0!==Z?l.assign(h._`${Z}[${y}]`,!0):f||S.allErrors||l.if((0,h.not)(R),()=>l.break())})})}!function validatePatternProperties(){for(const u of $)E&&checkMatchingProperties(u),S.allErrors?validateProperties(u):(l.var(R,!0),validateProperties(u),l.if(R))}()}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/items.js"),h={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:u=>(0,f.validateTuple)(u,"items")};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/properties.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js"),w={keyword:"properties",type:"object",schemaType:"object",code(u){const{gen:l,schema:m,parentSchema:w,data:b,it:S}=u;"all"===S.opts.removeAdditional&&void 0===w.additionalProperties&&v.default.code(new f.KeywordCxt(S,v.default,"additionalProperties"));const j=(0,h.allSchemaProperties)(m);for(const u of j)S.definedProperties.add(u);S.opts.unevaluated&&j.length&&!0!==S.props&&(S.props=y.mergeEvaluated.props(l,(0,y.toHash)(j),S.props));const $=j.filter(u=>!(0,y.alwaysValidSchema)(S,m[u]));if(0===$.length)return;const x=l.name("valid");for(const m of $)hasDefault(m)?applyPropertySchema(m):(l.if((0,h.propertyInData)(l,b,m,S.opts.ownProperties)),applyPropertySchema(m),S.allErrors||l.else().var(x,!0),l.endIf()),u.it.definedProperties.add(m),u.ok(x);function hasDefault(u){return S.opts.useDefaults&&!S.compositeRule&&void 0!==m[u].default}function applyPropertySchema(l){u.subschema({keyword:"properties",schemaProp:l,dataProp:l},x)}}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:u})=>f._`{propertyName: ${u.propertyName}}`},code(u){const{gen:l,schema:m,data:y,it:v}=u;if((0,h.alwaysValidSchema)(v,m))return;const w=l.name("valid");l.forIn("key",y,m=>{u.setParams({propertyName:m}),u.subschema({keyword:"propertyNames",data:m,dataTypes:["string"],propertyName:m,compositeRule:!0},w),l.if((0,f.not)(w),()=>{u.error(!0),v.allErrors||l.break()})}),u.ok(w)}};l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/thenElse.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),h={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:u,parentSchema:l,it:m}){void 0===l.if&&(0,f.checkStrictMode)(m,`"${u}" without "if" is ignored`)}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.validateUnion=l.validateArray=l.usePattern=l.callValidateCode=l.schemaProperties=l.allSchemaProperties=l.noPropertyInData=l.propertyInData=l.isOwnProperty=l.hasPropFunc=l.reportMissingProp=l.checkMissingProp=l.checkReportMissingProp=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js");function hasPropFunc(u){return u.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:f._`Object.prototype.hasOwnProperty`})}function isOwnProperty(u,l,m){return f._`${hasPropFunc(u)}.call(${l}, ${m})`}function noPropertyInData(u,l,m,h){const y=f._`${l}${(0,f.getProperty)(m)} === undefined`;return h?(0,f.or)(y,(0,f.not)(isOwnProperty(u,l,m))):y}function allSchemaProperties(u){return u?Object.keys(u).filter(u=>"__proto__"!==u):[]}l.checkReportMissingProp=function checkReportMissingProp(u,l){const{gen:m,data:h,it:y}=u;m.if(noPropertyInData(m,h,l,y.opts.ownProperties),()=>{u.setParams({missingProperty:f._`${l}`},!0),u.error()})},l.checkMissingProp=function checkMissingProp({gen:u,data:l,it:{opts:m}},h,y){return(0,f.or)(...h.map(h=>(0,f.and)(noPropertyInData(u,l,h,m.ownProperties),f._`${y} = ${h}`)))},l.reportMissingProp=function reportMissingProp(u,l){u.setParams({missingProperty:l},!0),u.error()},l.hasPropFunc=hasPropFunc,l.isOwnProperty=isOwnProperty,l.propertyInData=function propertyInData(u,l,m,h){const y=f._`${l}${(0,f.getProperty)(m)} !== undefined`;return h?f._`${y} && ${isOwnProperty(u,l,m)}`:y},l.noPropertyInData=noPropertyInData,l.allSchemaProperties=allSchemaProperties,l.schemaProperties=function schemaProperties(u,l){return allSchemaProperties(l).filter(m=>!(0,h.alwaysValidSchema)(u,l[m]))},l.callValidateCode=function callValidateCode({schemaCode:u,data:l,it:{gen:m,topSchemaRef:h,schemaPath:v,errorPath:w},it:b},S,j,$){const x=$?f._`${u}, ${l}, ${h}${v}`:l,E=[[y.default.instancePath,(0,f.strConcat)(y.default.instancePath,w)],[y.default.parentData,b.parentData],[y.default.parentDataProperty,b.parentDataProperty],[y.default.rootData,y.default.rootData]];b.opts.dynamicRef&&E.push([y.default.dynamicAnchors,y.default.dynamicAnchors]);const R=f._`${x}, ${m.object(...E)}`;return j!==f.nil?f._`${S}.call(${j}, ${R})`:f._`${S}(${R})`};const w=f._`new RegExp`;l.usePattern=function usePattern({gen:u,it:{opts:l}},m){const h=l.unicodeRegExp?"u":"",{regExp:y}=l.code,b=y(m,h);return u.scopeValue("pattern",{key:b.toString(),ref:b,code:f._`${"new RegExp"===y.code?w:(0,v.useFunc)(u,y)}(${m}, ${h})`})},l.validateArray=function validateArray(u){const{gen:l,data:m,keyword:y,it:v}=u,w=l.name("valid");if(v.allErrors){const u=l.let("valid",!0);return validateItems(()=>l.assign(u,!1)),u}return l.var(w,!0),validateItems(()=>l.break()),w;function validateItems(v){const b=l.const("len",f._`${m}.length`);l.forRange("i",0,b,m=>{u.subschema({keyword:y,dataProp:m,dataPropType:h.Type.Num},w),l.if((0,f.not)(w),v)})}},l.validateUnion=function validateUnion(u){const{gen:l,schema:m,keyword:y,it:v}=u;if(!Array.isArray(m))throw new Error("ajv implementation error");if(m.some(u=>(0,h.alwaysValidSchema)(v,u))&&!v.opts.unevaluated)return;const w=l.let("valid",!1),b=l.name("_valid");l.block(()=>m.forEach((m,h)=>{const v=u.subschema({keyword:y,schemaProp:h,compositeRule:!0},b);l.assign(w,f._`${w} || ${b}`);u.mergeValidEvaluated(v,b)||l.if((0,f.not)(w))})),u.result(w,()=>u.reset(),()=>u.error(!0))}},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0});const m={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};l.default=m},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/id.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js"),y=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",f.default,h.default];l.default=y},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/ref.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0}),l.callRef=l.getValidate=void 0;const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/names.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),S={keyword:"$ref",schemaType:"string",code(u){const{gen:l,schema:m,it:h}=u,{baseId:v,schemaEnv:b,validateName:S,opts:j,self:$}=h,{root:x}=b;if(("#"===m||"#/"===m)&&v===x.baseId)return function callRootRef(){if(b===x)return callRef(u,S,b,b.$async);const m=l.scopeValue("root",{ref:x});return callRef(u,y._`${m}.validate`,x,x.$async)}();const E=w.resolveRef.call($,x,v,m);if(void 0===E)throw new f.default(h.opts.uriResolver,v,m);return E instanceof w.SchemaEnv?function callValidate(l){const m=getValidate(u,l);callRef(u,m,l,l.$async)}(E):function inlineRefSchema(f){const h=l.scopeValue("schema",!0===j.code.source?{ref:f,code:(0,y.stringify)(f)}:{ref:f}),v=l.name("valid"),w=u.subschema({schema:f,dataTypes:[],schemaPath:y.nil,topSchemaRef:h,errSchemaPath:m},v);u.mergeEvaluated(w),u.ok(v)}(E)}};function getValidate(u,l){const{gen:m}=u;return l.validate?m.scopeValue("validate",{ref:l.validate}):y._`${m.scopeValue("wrapper",{ref:l})}.validate`}function callRef(u,l,m,f){const{gen:w,it:S}=u,{allErrors:j,schemaEnv:$,opts:x}=S,E=x.passContext?v.default.this:y.nil;function addErrorsFrom(u){const l=y._`${u}.errors`;w.assign(v.default.vErrors,y._`${v.default.vErrors} === null ? ${l} : ${v.default.vErrors}.concat(${l})`),w.assign(v.default.errors,y._`${v.default.vErrors}.length`)}function addEvaluatedFrom(u){var l;if(!S.opts.unevaluated)return;const f=null===(l=null==m?void 0:m.validate)||void 0===l?void 0:l.evaluated;if(!0!==S.props)if(f&&!f.dynamicProps)void 0!==f.props&&(S.props=b.mergeEvaluated.props(w,f.props,S.props));else{const l=w.var("props",y._`${u}.evaluated.props`);S.props=b.mergeEvaluated.props(w,l,S.props,y.Name)}if(!0!==S.items)if(f&&!f.dynamicItems)void 0!==f.items&&(S.items=b.mergeEvaluated.items(w,f.items,S.items));else{const l=w.var("items",y._`${u}.evaluated.items`);S.items=b.mergeEvaluated.items(w,l,S.items,y.Name)}}f?function callAsyncRef(){if(!$.$async)throw new Error("async schema referenced by sync schema");const m=w.let("valid");w.try(()=>{w.code(y._`await ${(0,h.callValidateCode)(u,l,E)}`),addEvaluatedFrom(l),j||w.assign(m,!0)},u=>{w.if(y._`!(${u} instanceof ${S.ValidationError})`,()=>w.throw(u)),addErrorsFrom(u),j||w.assign(m,!1)}),u.ok(m)}():function callSyncRef(){u.result((0,h.callValidateCode)(u,l,E),()=>addEvaluatedFrom(l),()=>addErrorsFrom(l))}()}l.getValidate=getValidate,l.callRef=callRef,l.default=S},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/index.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/ref_error.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),b={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:u,tagName:l}})=>u===h.DiscrError.Tag?`tag "${l}" must be string`:`value of tag "${l}" must be in oneOf`,params:({params:{discrError:u,tag:l,tagName:m}})=>f._`{error: ${u}, tag: ${m}, tagValue: ${l}}`},code(u){const{gen:l,data:m,schema:b,parentSchema:S,it:j}=u,{oneOf:$}=S;if(!j.opts.discriminator)throw new Error("discriminator: requires discriminator option");const x=b.propertyName;if("string"!=typeof x)throw new Error("discriminator: requires propertyName");if(b.mapping)throw new Error("discriminator: mapping is not supported");if(!$)throw new Error("discriminator: requires oneOf keyword");const E=l.let("valid",!1),R=l.const("tag",f._`${m}${(0,f.getProperty)(x)}`);function applyTagSchema(m){const h=l.name("valid"),y=u.subschema({keyword:"oneOf",schemaProp:m},h);return u.mergeEvaluated(y,f.Name),h}l.if(f._`typeof ${R} == "string"`,()=>function validateMapping(){const m=function getMapping(){var u;const l={},m=hasRequired(S);let f=!0;for(let l=0;l<$.length;l++){let h=$[l];if((null==h?void 0:h.$ref)&&!(0,w.schemaHasRulesButRef)(h,j.self.RULES)){const u=h.$ref;if(h=y.resolveRef.call(j.self,j.schemaEnv.root,j.baseId,u),h instanceof y.SchemaEnv&&(h=h.schema),void 0===h)throw new v.default(j.opts.uriResolver,j.baseId,u)}const b=null===(u=null==h?void 0:h.properties)||void 0===u?void 0:u[x];if("object"!=typeof b)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${x}"`);f=f&&(m||hasRequired(h)),addMappings(b,l)}if(!f)throw new Error(`discriminator: "${x}" must be required`);return l;function hasRequired({required:u}){return Array.isArray(u)&&u.includes(x)}function addMappings(u,l){if(u.const)addMapping(u.const,l);else{if(!u.enum)throw new Error(`discriminator: "properties/${x}" must have "const" or "enum"`);for(const m of u.enum)addMapping(m,l)}}function addMapping(u,m){if("string"!=typeof u||u in l)throw new Error(`discriminator: "${x}" values must be unique strings`);l[u]=m}}();l.if(!1);for(const u in m)l.elseIf(f._`${R} === ${u}`),l.assign(E,applyTagSchema(m[u]));l.else(),u.error(!1,{discrError:h.DiscrError.Mapping,tag:R,tagName:x}),l.endIf()}(),()=>u.error(!1,{discrError:h.DiscrError.Tag,tag:R,tagName:x})),u.ok(E)}};l.default=b},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/types.js":function(u,l){var m;Object.defineProperty(l,"__esModule",{value:!0}),l.DiscrError=void 0,function(u){u.Tag="tag",u.Mapping="mapping"}(m||(l.DiscrError=m={}))},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/draft7.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/core/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js"),b=[f.default,h.default,(0,y.default)(),v.default,w.metadataVocabulary,w.contentVocabulary];l.default=b},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:u})=>f.str`must match format "${u}"`,params:({schemaCode:u})=>f._`{format: ${u}}`},code(u,l){const{gen:m,data:h,$data:y,schema:v,schemaCode:w,it:b}=u,{opts:S,errSchemaPath:j,schemaEnv:$,self:x}=b;S.validateFormats&&(y?function validate$DataFormat(){const y=m.scopeValue("formats",{ref:x.formats,code:S.code.formats}),v=m.const("fDef",f._`${y}[${w}]`),b=m.let("fType"),j=m.let("format");m.if(f._`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>m.assign(b,f._`${v}.type || "string"`).assign(j,f._`${v}.validate`),()=>m.assign(b,f._`"string"`).assign(j,v)),u.fail$data((0,f.or)(function unknownFmt(){return!1===S.strictSchema?f.nil:f._`${w} && !${j}`}(),function invalidFmt(){const u=$.$async?f._`(${v}.async ? await ${j}(${h}) : ${j}(${h}))`:f._`${j}(${h})`,m=f._`(typeof ${j} == "function" ? ${u} : ${j}.test(${h}))`;return f._`${j} && ${j} !== true && ${b} === ${l} && !${m}`}()))}():function validateFormat(){const y=x.formats[v];if(!y)return void function unknownFormat(){if(!1===S.strictSchema)return void x.logger.warn(unknownMsg());throw new Error(unknownMsg());function unknownMsg(){return`unknown format "${v}" ignored in schema at path "${j}"`}}();if(!0===y)return;const[w,b,E]=function getFormat(u){const l=u instanceof RegExp?(0,f.regexpCode)(u):S.code.formats?f._`${S.code.formats}${(0,f.getProperty)(v)}`:void 0,h=m.scopeValue("formats",{key:v,ref:u,code:l});if("object"==typeof u&&!(u instanceof RegExp))return[u.type||"string",u.validate,f._`${h}.validate`];return["string",u,h]}(y);w===l&&u.pass(function validCondition(){if("object"==typeof y&&!(y instanceof RegExp)&&y.async){if(!$.$async)throw new Error("async format in sync schema");return f._`await ${E}(${h})`}return"function"==typeof b?f._`${E}(${h})`:f._`${E}.test(${h})`}())}())}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=[m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/format.js").default];l.default=f},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/metadata.js":function(u,l){Object.defineProperty(l,"__esModule",{value:!0}),l.contentVocabulary=l.metadataVocabulary=void 0,l.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],l.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js"),v={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:u})=>f._`{allowedValue: ${u}}`},code(u){const{gen:l,data:m,$data:v,schemaCode:w,schema:b}=u;v||b&&"object"==typeof b?u.fail$data(f._`!${(0,h.useFunc)(l,y.default)}(${m}, ${w})`):u.fail(f._`${b} !== ${m}`)}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js"),v={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:u})=>f._`{allowedValues: ${u}}`},code(u){const{gen:l,data:m,$data:v,schema:w,schemaCode:b,it:S}=u;if(!v&&0===w.length)throw new Error("enum must have non-empty array");const j=w.length>=S.opts.loopEnum;let $;const getEql=()=>null!=$?$:$=(0,h.useFunc)(l,y.default);let x;if(j||v)x=l.let("valid"),u.block$data(x,function loopEnum(){l.assign(x,!1),l.forOf("v",b,u=>l.if(f._`${getEql()}(${m}, ${u})`,()=>l.assign(x,!0).break()))});else{if(!Array.isArray(w))throw new Error("ajv implementation error");const u=l.const("vSchema",b);x=(0,f.or)(...w.map((l,h)=>function equalCode(u,l){const h=w[l];return"object"==typeof h&&null!==h?f._`${getEql()}(${m}, ${u}[${l}])`:f._`${m} === ${h}`}(u,h)))}u.pass(x)}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/index.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/const.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/enum.js"),E=[f.default,h.default,y.default,v.default,w.default,b.default,S.default,j.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},$.default,x.default];l.default=E},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitItems.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:l}){const m="maxItems"===u?"more":"fewer";return f.str`must NOT have ${m} than ${l} items`},params:({schemaCode:u})=>f._`{limit: ${u}}`},code(u){const{keyword:l,data:m,schemaCode:h}=u,y="maxItems"===l?f.operators.GT:f.operators.LT;u.fail$data(f._`${m}.length ${y} ${h}`)}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitLength.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/ucs2length.js"),v={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:l}){const m="maxLength"===u?"more":"fewer";return f.str`must NOT have ${m} than ${l} characters`},params:({schemaCode:u})=>f._`{limit: ${u}}`},code(u){const{keyword:l,data:m,schemaCode:v,it:w}=u,b="maxLength"===l?f.operators.GT:f.operators.LT,S=!1===w.opts.unicode?f._`${m}.length`:f._`${(0,h.useFunc)(u.gen,y.default)}(${m})`;u.fail$data(f._`${S} ${b} ${v}`)}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitNumber.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h=f.operators,y={maximum:{okStr:"<=",ok:h.LTE,fail:h.GT},minimum:{okStr:">=",ok:h.GTE,fail:h.LT},exclusiveMaximum:{okStr:"<",ok:h.LT,fail:h.GTE},exclusiveMinimum:{okStr:">",ok:h.GT,fail:h.LTE}},v={message:({keyword:u,schemaCode:l})=>f.str`must be ${y[u].okStr} ${l}`,params:({keyword:u,schemaCode:l})=>f._`{comparison: ${y[u].okStr}, limit: ${l}}`},w={keyword:Object.keys(y),type:"number",schemaType:"number",$data:!0,error:v,code(u){const{keyword:l,data:m,schemaCode:h}=u;u.fail$data(f._`${m} ${y[l].fail} ${h} || isNaN(${m})`)}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/limitProperties.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:u,schemaCode:l}){const m="maxProperties"===u?"more":"fewer";return f.str`must NOT have ${m} than ${l} properties`},params:({schemaCode:u})=>f._`{limit: ${u}}`},code(u){const{keyword:l,data:m,schemaCode:h}=u,y="maxProperties"===l?f.operators.GT:f.operators.LT;u.fail$data(f._`Object.keys(${m}).length ${y} ${h}`)}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/multipleOf.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),h={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:u})=>f.str`must be multiple of ${u}`,params:({schemaCode:u})=>f._`{multipleOf: ${u}}`},code(u){const{gen:l,data:m,schemaCode:h,it:y}=u,v=y.opts.multipleOfPrecision,w=l.let("res"),b=v?f._`Math.abs(Math.round(${w}) - ${w}) > 1e-${v}`:f._`${w} !== parseInt(${w})`;u.fail$data(f._`(${h} === 0 || (${w} = ${m}/${h}, ${b}))`)}};l.default=h},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/pattern.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),v={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:u})=>y.str`must match pattern "${u}"`,params:({schemaCode:u})=>y._`{pattern: ${u}}`},code(u){const{gen:l,data:m,$data:v,schema:w,schemaCode:b,it:S}=u,j=S.opts.unicodeRegExp?"u":"";if(v){const{regExp:f}=S.opts.code,v="new RegExp"===f.code?y._`new RegExp`:(0,h.useFunc)(l,f),w=l.let("valid");l.try(()=>l.assign(w,y._`${v}(${b}, ${j}).test(${m})`),()=>l.assign(w,!1)),u.fail$data(y._`!${w}`)}else{const l=(0,f.usePattern)(u,w);u.fail$data(y._`!${l}.test(${m})`)}}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/required.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/code.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),v={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:u}})=>h.str`must have required property '${u}'`,params:({params:{missingProperty:u}})=>h._`{missingProperty: ${u}}`},code(u){const{gen:l,schema:m,schemaCode:v,data:w,$data:b,it:S}=u,{opts:j}=S;if(!b&&0===m.length)return;const $=m.length>=j.loopRequired;if(S.allErrors?function allErrorsMode(){if($||b)u.block$data(h.nil,loopAllRequired);else for(const l of m)(0,f.checkReportMissingProp)(u,l)}():function exitOnErrorMode(){const y=l.let("missing");if($||b){const m=l.let("valid",!0);u.block$data(m,()=>function loopUntilMissing(m,y){u.setParams({missingProperty:m}),l.forOf(m,v,()=>{l.assign(y,(0,f.propertyInData)(l,w,m,j.ownProperties)),l.if((0,h.not)(y),()=>{u.error(),l.break()})},h.nil)}(y,m)),u.ok(m)}else l.if((0,f.checkMissingProp)(u,m,y)),(0,f.reportMissingProp)(u,y),l.else()}(),j.strictRequired){const l=u.parentSchema.properties,{definedProperties:f}=u.it;for(const u of m)if(void 0===(null==l?void 0:l[u])&&!f.has(u)){const l=`required property "${u}" is not defined at "${S.schemaEnv.baseId+S.errSchemaPath}" (strictRequired)`;(0,y.checkStrictMode)(S,l,S.opts.strictRequired)}}function loopAllRequired(){l.forOf("prop",v,m=>{u.setParams({missingProperty:m}),l.if((0,f.noPropertyInData)(l,w,m,j.ownProperties),()=>u.error())})}}};l.default=v},"./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js":function(u,l,m){Object.defineProperty(l,"__esModule",{value:!0});const f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/dataType.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/index.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/util.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/runtime/equal.js"),w={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:u,j:l}})=>h.str`must NOT have duplicate items (items ## ${l} and ${u} are identical)`,params:({params:{i:u,j:l}})=>h._`{i: ${u}, j: ${l}}`},code(u){const{gen:l,data:m,$data:w,schema:b,parentSchema:S,schemaCode:j,it:$}=u;if(!w&&!b)return;const x=l.let("valid"),E=S.items?(0,f.getSchemaTypes)(S.items):[];function loopN(y,v){const w=l.name("item"),b=(0,f.checkDataTypes)(E,w,$.opts.strictNumbers,f.DataType.Wrong),S=l.const("indices",h._`{}`);l.for(h._`;${y}--;`,()=>{l.let(w,h._`${m}[${y}]`),l.if(b,h._`continue`),E.length>1&&l.if(h._`typeof ${w} == "string"`,h._`${w} += "_"`),l.if(h._`typeof ${S}[${w}] == "number"`,()=>{l.assign(v,h._`${S}[${w}]`),u.error(),l.assign(x,!1).break()}).code(h._`${S}[${w}] = ${y}`)})}function loopN2(f,w){const b=(0,y.useFunc)(l,v.default),S=l.name("outer");l.label(S).for(h._`;${f}--;`,()=>l.for(h._`${w} = ${f}; ${w}--;`,()=>l.if(h._`${b}(${m}[${f}], ${m}[${w}])`,()=>{u.error(),l.assign(x,!1).break(S)})))}u.block$data(x,function validateUniqueItems(){const f=l.let("i",h._`${m}.length`),y=l.let("j");u.setParams({i:f,j:y}),l.assign(x,!0),l.if(h._`${f} > 1`,()=>(function canOptimize(){return E.length>0&&!E.some(u=>"object"===u||"array"===u)}()?loopN:loopN2)(f,y))},h._`${j} === false`),u.ok(x)}};l.default=w},"./node_modules/@modelcontextprotocol/sdk/node_modules/json-schema-traverse/index.js":function(u){var l=u.exports=function(u,l,m){"function"==typeof l&&(m=l,l={}),_traverse(l,"function"==typeof(m=l.cb||m)?m:m.pre||function(){},m.post||function(){},u,"",u)};function _traverse(u,m,f,h,y,v,w,b,S,j){if(h&&"object"==typeof h&&!Array.isArray(h)){for(var $ in m(h,y,v,w,b,S,j),h){var x=h[$];if(Array.isArray(x)){if($ in l.arrayKeywords)for(var E=0;E<x.length;E++)_traverse(u,m,f,x[E],y+"/"+$+"/"+E,v,y,$,h,E)}else if($ in l.propsKeywords){if(x&&"object"==typeof x)for(var R in x)_traverse(u,m,f,x[R],y+"/"+$+"/"+escapeJsonPtr(R),v,y,$,h,R)}else($ in l.keywords||u.allKeys&&!($ in l.skipKeywords))&&_traverse(u,m,f,x,y+"/"+$,v,y,$,h)}f(h,y,v,w,b,S,j)}}function escapeJsonPtr(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}l.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},l.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},l.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},l.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js":function(u,l,m){m.r(l),m.d(l,{defaultOptions:function(){return h},getDefaultOptions:function(){return getDefaultOptions},ignoreOverride:function(){return f},jsonDescription:function(){return jsonDescription}});const f=Symbol("Let zodToJsonSchema decide on which parser to use"),jsonDescription=(u,l)=>{if(l.description)try{return{...u,...JSON.parse(l.description)}}catch{}return u},h={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},getDefaultOptions=u=>"string"==typeof u?{...h,name:u}:{...h,...u}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js":function(u,l,m){m.r(l),m.d(l,{getRefs:function(){return getRefs}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js");const getRefs=u=>{const l=(0,f.getDefaultOptions)(u),m=void 0!==l.name?[...l.basePath,l.definitionPath,l.name]:l.basePath;return{...l,flags:{hasReferencedOpenAiAnyType:!1},currentPath:m,propertyPath:void 0,seen:new Map(Object.entries(l.definitions).map(([u,m])=>[m._def,{def:m._def,path:[...l.basePath,l.definitionPath,u],jsonSchema:void 0}]))}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js":function(u,l,m){function addErrorMessage(u,l,m,f){f?.errorMessages&&m&&(u.errorMessage={...u.errorMessage,[l]:m})}function setResponseValueAndErrors(u,l,m,f,h){u[l]=m,addErrorMessage(u,l,f,h)}m.r(l),m.d(l,{addErrorMessage:function(){return addErrorMessage},setResponseValueAndErrors:function(){return setResponseValueAndErrors}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js":function(u,l,m){m.r(l),m.d(l,{getRelativePath:function(){return getRelativePath}});const getRelativePath=(u,l)=>{let m=0;for(;m<u.length&&m<l.length&&u[m]===l[m];m++);return[(u.length-m).toString(),...l.slice(m)].join("/")}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/index.js":function(u,l,m){m.r(l),m.d(l,{addErrorMessage:function(){return y.addErrorMessage},defaultOptions:function(){return f.defaultOptions},getDefaultOptions:function(){return f.getDefaultOptions},getRefs:function(){return h.getRefs},getRelativePath:function(){return v.getRelativePath},ignoreOverride:function(){return f.ignoreOverride},jsonDescription:function(){return f.jsonDescription},parseAnyDef:function(){return b.parseAnyDef},parseArrayDef:function(){return S.parseArrayDef},parseBigintDef:function(){return j.parseBigintDef},parseBooleanDef:function(){return $.parseBooleanDef},parseBrandedDef:function(){return x.parseBrandedDef},parseCatchDef:function(){return E.parseCatchDef},parseDateDef:function(){return R.parseDateDef},parseDef:function(){return w.parseDef},parseDefaultDef:function(){return Z.parseDefaultDef},parseEffectsDef:function(){return C.parseEffectsDef},parseEnumDef:function(){return z.parseEnumDef},parseIntersectionDef:function(){return A.parseIntersectionDef},parseLiteralDef:function(){return O.parseLiteralDef},parseMapDef:function(){return D.parseMapDef},parseNativeEnumDef:function(){return N.parseNativeEnumDef},parseNeverDef:function(){return M.parseNeverDef},parseNullDef:function(){return U.parseNullDef},parseNullableDef:function(){return L.parseNullableDef},parseNumberDef:function(){return F.parseNumberDef},parseObjectDef:function(){return V.parseObjectDef},parseOptionalDef:function(){return K.parseOptionalDef},parsePipelineDef:function(){return H.parsePipelineDef},parsePromiseDef:function(){return B.parsePromiseDef},parseReadonlyDef:function(){return J.parseReadonlyDef},parseRecordDef:function(){return W.parseRecordDef},parseSetDef:function(){return G.parseSetDef},parseStringDef:function(){return Q.parseStringDef},parseTupleDef:function(){return Y.parseTupleDef},parseUndefinedDef:function(){return X.parseUndefinedDef},parseUnionDef:function(){return ee.parseUnionDef},parseUnknownDef:function(){return te.parseUnknownDef},primitiveMappings:function(){return ee.primitiveMappings},selectParser:function(){return ne.selectParser},setResponseValueAndErrors:function(){return y.setResponseValueAndErrors},zodPatterns:function(){return Q.zodPatterns},zodToJsonSchema:function(){return re.zodToJsonSchema}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),b=(m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseTypes.js"),m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js")),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),Z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),C=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),A=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),O=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),D=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),N=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),M=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),U=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),L=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),F=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),V=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),K=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),H=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),B=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),J=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js"),W=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),G=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),Q=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),Y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),X=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),ee=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),te=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),ne=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js"),re=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js");l.default=re.zodToJsonSchema},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js":function(u,l,m){m.r(l),m.d(l,{parseDef:function(){return parseDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Options.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseDef(u,l,m=!1){const y=l.seen.get(u);if(l.override){const h=l.override?.(u,l,y,m);if(h!==f.ignoreOverride)return h}if(y&&!m){const u=get$ref(y,l);if(void 0!==u)return u}const v={def:u,path:l.currentPath,jsonSchema:void 0};l.seen.set(u,v);const w=(0,h.selectParser)(u,u.typeName,l),b="function"==typeof w?parseDef(w(),l):w;if(b&&addMeta(u,l,b),l.postProcess){const m=l.postProcess(b,u,l);return v.jsonSchema=b,m}return v.jsonSchema=b,b}const get$ref=(u,l)=>{switch(l.$refStrategy){case"root":return{$ref:u.path.join("/")};case"relative":return{$ref:(0,y.getRelativePath)(l.currentPath,u.path)};case"none":case"seen":return u.path.length<l.currentPath.length&&u.path.every((u,m)=>l.currentPath[m]===u)?(console.warn(`Recursive reference detected at ${l.currentPath.join("/")}! Defaulting to any`),(0,v.parseAnyDef)(l)):"seen"===l.$refStrategy?(0,v.parseAnyDef)(l):void 0}},addMeta=(u,l,m)=>(u.description&&(m.description=u.description,l.markdownDescription&&(m.markdownDescription=u.description)),m)},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseTypes.js":function(u,l,m){m.r(l)},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js":function(u,l,m){m.r(l),m.d(l,{parseAnyDef:function(){return parseAnyDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");function parseAnyDef(u){if("openAi"!==u.target)return{};const l=[...u.basePath,u.definitionPath,u.openAiAnyTypeName];return u.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===u.$refStrategy?(0,f.getRelativePath)(l,u.currentPath):l.join("/")}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js":function(u,l,m){m.r(l),m.d(l,{parseArrayDef:function(){return parseArrayDef}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseArrayDef(u,l){const m={type:"array"};return u.type?._def&&u.type?._def?.typeName!==f.ZodFirstPartyTypeKind.ZodAny&&(m.items=(0,y.parseDef)(u.type._def,{...l,currentPath:[...l.currentPath,"items"]})),u.minLength&&(0,h.setResponseValueAndErrors)(m,"minItems",u.minLength.value,u.minLength.message,l),u.maxLength&&(0,h.setResponseValueAndErrors)(m,"maxItems",u.maxLength.value,u.maxLength.message,l),u.exactLength&&((0,h.setResponseValueAndErrors)(m,"minItems",u.exactLength.value,u.exactLength.message,l),(0,h.setResponseValueAndErrors)(m,"maxItems",u.exactLength.value,u.exactLength.message,l)),m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js":function(u,l,m){m.r(l),m.d(l,{parseBigintDef:function(){return parseBigintDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseBigintDef(u,l){const m={type:"integer",format:"int64"};if(!u.checks)return m;for(const h of u.checks)switch(h.kind){case"min":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMinimum",h.value,h.message,l):(h.inclusive||(m.exclusiveMinimum=!0),(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l));break;case"max":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMaximum",h.value,h.message,l):(h.inclusive||(m.exclusiveMaximum=!0),(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l));break;case"multipleOf":(0,f.setResponseValueAndErrors)(m,"multipleOf",h.value,h.message,l)}return m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js":function(u,l,m){function parseBooleanDef(){return{type:"boolean"}}m.r(l),m.d(l,{parseBooleanDef:function(){return parseBooleanDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js":function(u,l,m){m.r(l),m.d(l,{parseBrandedDef:function(){return parseBrandedDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseBrandedDef(u,l){return(0,f.parseDef)(u.type._def,l)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js":function(u,l,m){m.r(l),m.d(l,{parseCatchDef:function(){return parseCatchDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseCatchDef=(u,l)=>(0,f.parseDef)(u.innerType._def,l)},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js":function(u,l,m){m.r(l),m.d(l,{parseDateDef:function(){return parseDateDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseDateDef(u,l,m){const f=m??l.dateStrategy;if(Array.isArray(f))return{anyOf:f.map((m,f)=>parseDateDef(u,l,m))};switch(f){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return integerDateParser(u,l)}}const integerDateParser=(u,l)=>{const m={type:"integer",format:"unix-time"};if("openApi3"===l.target)return m;for(const h of u.checks)switch(h.kind){case"min":(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l);break;case"max":(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l)}return m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js":function(u,l,m){m.r(l),m.d(l,{parseDefaultDef:function(){return parseDefaultDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseDefaultDef(u,l){return{...(0,f.parseDef)(u.innerType._def,l),default:u.defaultValue()}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js":function(u,l,m){m.r(l),m.d(l,{parseEffectsDef:function(){return parseEffectsDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseEffectsDef(u,l){return"input"===l.effectStrategy?(0,f.parseDef)(u.schema._def,l):(0,h.parseAnyDef)(l)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js":function(u,l,m){function parseEnumDef(u){return{type:"string",enum:Array.from(u.values)}}m.r(l),m.d(l,{parseEnumDef:function(){return parseEnumDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js":function(u,l,m){m.r(l),m.d(l,{parseIntersectionDef:function(){return parseIntersectionDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const isJsonSchema7AllOfType=u=>(!("type"in u)||"string"!==u.type)&&"allOf"in u;function parseIntersectionDef(u,l){const m=[(0,f.parseDef)(u.left._def,{...l,currentPath:[...l.currentPath,"allOf","0"]}),(0,f.parseDef)(u.right._def,{...l,currentPath:[...l.currentPath,"allOf","1"]})].filter(u=>!!u);let h="jsonSchema2019-09"===l.target?{unevaluatedProperties:!1}:void 0;const y=[];return m.forEach(u=>{if(isJsonSchema7AllOfType(u))y.push(...u.allOf),void 0===u.unevaluatedProperties&&(h=void 0);else{let l=u;if("additionalProperties"in u&&!1===u.additionalProperties){const{additionalProperties:m,...f}=u;l=f}else h=void 0;y.push(l)}}),y.length?{allOf:y,...h}:void 0}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js":function(u,l,m){function parseLiteralDef(u,l){const m=typeof u.value;return"bigint"!==m&&"number"!==m&&"boolean"!==m&&"string"!==m?{type:Array.isArray(u.value)?"array":"object"}:"openApi3"===l.target?{type:"bigint"===m?"integer":m,enum:[u.value]}:{type:"bigint"===m?"integer":m,const:u.value}}m.r(l),m.d(l,{parseLiteralDef:function(){return parseLiteralDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js":function(u,l,m){m.r(l),m.d(l,{parseMapDef:function(){return parseMapDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseMapDef(u,l){if("record"===l.mapStrategy)return(0,h.parseRecordDef)(u,l);return{type:"array",maxItems:125,items:{type:"array",items:[(0,f.parseDef)(u.keyType._def,{...l,currentPath:[...l.currentPath,"items","items","0"]})||(0,y.parseAnyDef)(l),(0,f.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"items","items","1"]})||(0,y.parseAnyDef)(l)],minItems:2,maxItems:2}}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js":function(u,l,m){function parseNativeEnumDef(u){const l=u.values,m=Object.keys(u.values).filter(u=>"number"!=typeof l[l[u]]).map(u=>l[u]),f=Array.from(new Set(m.map(u=>typeof u)));return{type:1===f.length?"string"===f[0]?"string":"number":["string","number"],enum:m}}m.r(l),m.d(l,{parseNativeEnumDef:function(){return parseNativeEnumDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js":function(u,l,m){m.r(l),m.d(l,{parseNeverDef:function(){return parseNeverDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseNeverDef(u){return"openAi"===u.target?void 0:{not:(0,f.parseAnyDef)({...u,currentPath:[...u.currentPath,"not"]})}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js":function(u,l,m){function parseNullDef(u){return"openApi3"===u.target?{enum:["null"],nullable:!0}:{type:"null"}}m.r(l),m.d(l,{parseNullDef:function(){return parseNullDef}})},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js":function(u,l,m){m.r(l),m.d(l,{parseNullableDef:function(){return parseNullableDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js");function parseNullableDef(u,l){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(u.innerType._def.typeName)&&(!u.innerType._def.checks||!u.innerType._def.checks.length))return"openApi3"===l.target?{type:h.primitiveMappings[u.innerType._def.typeName],nullable:!0}:{type:[h.primitiveMappings[u.innerType._def.typeName],"null"]};if("openApi3"===l.target){const m=(0,f.parseDef)(u.innerType._def,{...l,currentPath:[...l.currentPath]});return m&&"$ref"in m?{allOf:[m],nullable:!0}:m&&{...m,nullable:!0}}const m=(0,f.parseDef)(u.innerType._def,{...l,currentPath:[...l.currentPath,"anyOf","0"]});return m&&{anyOf:[m,{type:"null"}]}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js":function(u,l,m){m.r(l),m.d(l,{parseNumberDef:function(){return parseNumberDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseNumberDef(u,l){const m={type:"number"};if(!u.checks)return m;for(const h of u.checks)switch(h.kind){case"int":m.type="integer",(0,f.addErrorMessage)(m,"type",h.message,l);break;case"min":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMinimum",h.value,h.message,l):(h.inclusive||(m.exclusiveMinimum=!0),(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l));break;case"max":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMaximum",h.value,h.message,l):(h.inclusive||(m.exclusiveMaximum=!0),(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l));break;case"multipleOf":(0,f.setResponseValueAndErrors)(m,"multipleOf",h.value,h.message,l)}return m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js":function(u,l,m){m.r(l),m.d(l,{parseObjectDef:function(){return parseObjectDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseObjectDef(u,l){const m="openAi"===l.target,h={type:"object",properties:{}},y=[],v=u.shape();for(const u in v){let w=v[u];if(void 0===w||void 0===w._def)continue;let b=safeIsOptional(w);b&&m&&("ZodOptional"===w._def.typeName&&(w=w._def.innerType),w.isNullable()||(w=w.nullable()),b=!1);const S=(0,f.parseDef)(w._def,{...l,currentPath:[...l.currentPath,"properties",u],propertyPath:[...l.currentPath,"properties",u]});void 0!==S&&(h.properties[u]=S,b||y.push(u))}y.length&&(h.required=y);const w=function decideAdditionalProperties(u,l){if("ZodNever"!==u.catchall._def.typeName)return(0,f.parseDef)(u.catchall._def,{...l,currentPath:[...l.currentPath,"additionalProperties"]});switch(u.unknownKeys){case"passthrough":return l.allowedAdditionalProperties;case"strict":return l.rejectedAdditionalProperties;case"strip":return"strict"===l.removeAdditionalStrategy?l.allowedAdditionalProperties:l.rejectedAdditionalProperties}}(u,l);return void 0!==w&&(h.additionalProperties=w),h}function safeIsOptional(u){try{return u.isOptional()}catch{return!0}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js":function(u,l,m){m.r(l),m.d(l,{parseOptionalDef:function(){return parseOptionalDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const parseOptionalDef=(u,l)=>{if(l.currentPath.toString()===l.propertyPath?.toString())return(0,f.parseDef)(u.innerType._def,l);const m=(0,f.parseDef)(u.innerType._def,{...l,currentPath:[...l.currentPath,"anyOf","1"]});return m?{anyOf:[{not:(0,h.parseAnyDef)(l)},m]}:(0,h.parseAnyDef)(l)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js":function(u,l,m){m.r(l),m.d(l,{parsePipelineDef:function(){return parsePipelineDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parsePipelineDef=(u,l)=>{if("input"===l.pipeStrategy)return(0,f.parseDef)(u.in._def,l);if("output"===l.pipeStrategy)return(0,f.parseDef)(u.out._def,l);const m=(0,f.parseDef)(u.in._def,{...l,currentPath:[...l.currentPath,"allOf","0"]});return{allOf:[m,(0,f.parseDef)(u.out._def,{...l,currentPath:[...l.currentPath,"allOf",m?"1":"0"]})].filter(u=>void 0!==u)}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js":function(u,l,m){m.r(l),m.d(l,{parsePromiseDef:function(){return parsePromiseDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parsePromiseDef(u,l){return(0,f.parseDef)(u.type._def,l)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js":function(u,l,m){m.r(l),m.d(l,{parseReadonlyDef:function(){return parseReadonlyDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseReadonlyDef=(u,l)=>(0,f.parseDef)(u.innerType._def,l)},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js":function(u,l,m){m.r(l),m.d(l,{parseRecordDef:function(){return parseRecordDef}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseRecordDef(u,l){if("openAi"===l.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===l.target&&u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:u.keyType._def.values,properties:u.keyType._def.values.reduce((m,f)=>({...m,[f]:(0,h.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"properties",f]})??(0,w.parseAnyDef)(l)}),{}),additionalProperties:l.rejectedAdditionalProperties};const m={type:"object",additionalProperties:(0,h.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"additionalProperties"]})??l.allowedAdditionalProperties};if("openApi3"===l.target)return m;if(u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodString&&u.keyType._def.checks?.length){const{type:f,...h}=(0,y.parseStringDef)(u.keyType._def,l);return{...m,propertyNames:h}}if(u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodEnum)return{...m,propertyNames:{enum:u.keyType._def.values}};if(u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodBranded&&u.keyType._def.type._def.typeName===f.ZodFirstPartyTypeKind.ZodString&&u.keyType._def.type._def.checks?.length){const{type:f,...h}=(0,v.parseBrandedDef)(u.keyType._def,l);return{...m,propertyNames:h}}return m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js":function(u,l,m){m.r(l),m.d(l,{parseSetDef:function(){return parseSetDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseSetDef(u,l){const m={type:"array",uniqueItems:!0,items:(0,h.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"items"]})};return u.minSize&&(0,f.setResponseValueAndErrors)(m,"minItems",u.minSize.value,u.minSize.message,l),u.maxSize&&(0,f.setResponseValueAndErrors)(m,"maxItems",u.maxSize.value,u.maxSize.message,l),m}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js":function(u,l,m){m.r(l),m.d(l,{parseStringDef:function(){return parseStringDef},zodPatterns:function(){return y}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/errorMessages.js");let h;const y={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===h&&(h=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),h),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function parseStringDef(u,l){const m={type:"string"};if(u.checks)for(const h of u.checks)switch(h.kind){case"min":(0,f.setResponseValueAndErrors)(m,"minLength","number"==typeof m.minLength?Math.max(m.minLength,h.value):h.value,h.message,l);break;case"max":(0,f.setResponseValueAndErrors)(m,"maxLength","number"==typeof m.maxLength?Math.min(m.maxLength,h.value):h.value,h.message,l);break;case"email":switch(l.emailStrategy){case"format:email":addFormat(m,"email",h.message,l);break;case"format:idn-email":addFormat(m,"idn-email",h.message,l);break;case"pattern:zod":addPattern(m,y.email,h.message,l)}break;case"url":addFormat(m,"uri",h.message,l);break;case"uuid":addFormat(m,"uuid",h.message,l);break;case"regex":addPattern(m,h.regex,h.message,l);break;case"cuid":addPattern(m,y.cuid,h.message,l);break;case"cuid2":addPattern(m,y.cuid2,h.message,l);break;case"startsWith":addPattern(m,RegExp(`^${escapeLiteralCheckValue(h.value,l)}`),h.message,l);break;case"endsWith":addPattern(m,RegExp(`${escapeLiteralCheckValue(h.value,l)}$`),h.message,l);break;case"datetime":addFormat(m,"date-time",h.message,l);break;case"date":addFormat(m,"date",h.message,l);break;case"time":addFormat(m,"time",h.message,l);break;case"duration":addFormat(m,"duration",h.message,l);break;case"length":(0,f.setResponseValueAndErrors)(m,"minLength","number"==typeof m.minLength?Math.max(m.minLength,h.value):h.value,h.message,l),(0,f.setResponseValueAndErrors)(m,"maxLength","number"==typeof m.maxLength?Math.min(m.maxLength,h.value):h.value,h.message,l);break;case"includes":addPattern(m,RegExp(escapeLiteralCheckValue(h.value,l)),h.message,l);break;case"ip":"v6"!==h.version&&addFormat(m,"ipv4",h.message,l),"v4"!==h.version&&addFormat(m,"ipv6",h.message,l);break;case"base64url":addPattern(m,y.base64url,h.message,l);break;case"jwt":addPattern(m,y.jwt,h.message,l);break;case"cidr":"v6"!==h.version&&addPattern(m,y.ipv4Cidr,h.message,l),"v4"!==h.version&&addPattern(m,y.ipv6Cidr,h.message,l);break;case"emoji":addPattern(m,y.emoji(),h.message,l);break;case"ulid":addPattern(m,y.ulid,h.message,l);break;case"base64":switch(l.base64Strategy){case"format:binary":addFormat(m,"binary",h.message,l);break;case"contentEncoding:base64":(0,f.setResponseValueAndErrors)(m,"contentEncoding","base64",h.message,l);break;case"pattern:zod":addPattern(m,y.base64,h.message,l)}break;case"nanoid":addPattern(m,y.nanoid,h.message,l);case"toLowerCase":case"toUpperCase":case"trim":break;default:(()=>{})()}return m}function escapeLiteralCheckValue(u,l){return"escape"===l.patternStrategy?function escapeNonAlphaNumeric(u){let l="";for(let m=0;m<u.length;m++)v.has(u[m])||(l+="\\"),l+=u[m];return l}(u):u}const v=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function addFormat(u,l,m,h){u.format||u.anyOf?.some(u=>u.format)?(u.anyOf||(u.anyOf=[]),u.format&&(u.anyOf.push({format:u.format,...u.errorMessage&&h.errorMessages&&{errorMessage:{format:u.errorMessage.format}}}),delete u.format,u.errorMessage&&(delete u.errorMessage.format,0===Object.keys(u.errorMessage).length&&delete u.errorMessage)),u.anyOf.push({format:l,...m&&h.errorMessages&&{errorMessage:{format:m}}})):(0,f.setResponseValueAndErrors)(u,"format",l,m,h)}function addPattern(u,l,m,h){u.pattern||u.allOf?.some(u=>u.pattern)?(u.allOf||(u.allOf=[]),u.pattern&&(u.allOf.push({pattern:u.pattern,...u.errorMessage&&h.errorMessages&&{errorMessage:{pattern:u.errorMessage.pattern}}}),delete u.pattern,u.errorMessage&&(delete u.errorMessage.pattern,0===Object.keys(u.errorMessage).length&&delete u.errorMessage)),u.allOf.push({pattern:stringifyRegExpWithFlags(l,h),...m&&h.errorMessages&&{errorMessage:{pattern:m}}})):(0,f.setResponseValueAndErrors)(u,"pattern",stringifyRegExpWithFlags(l,h),m,h)}function stringifyRegExpWithFlags(u,l){if(!l.applyRegexFlags||!u.flags)return u.source;const m=u.flags.includes("i"),f=u.flags.includes("m"),h=u.flags.includes("s"),y=m?u.source.toLowerCase():u.source;let v="",w=!1,b=!1,S=!1;for(let u=0;u<y.length;u++)if(w)v+=y[u],w=!1;else{if(m)if(b){if(y[u].match(/[a-z]/)){S?(v+=y[u],v+=`${y[u-2]}-${y[u]}`.toUpperCase(),S=!1):"-"===y[u+1]&&y[u+2]?.match(/[a-z]/)?(v+=y[u],S=!0):v+=`${y[u]}${y[u].toUpperCase()}`;continue}}else if(y[u].match(/[a-z]/)){v+=`[${y[u]}${y[u].toUpperCase()}]`;continue}if(f){if("^"===y[u]){v+="(^|(?<=[\r\n]))";continue}if("$"===y[u]){v+="($|(?=[\r\n]))";continue}}h&&"."===y[u]?v+=b?`${y[u]}\r\n`:`[${y[u]}\r\n]`:(v+=y[u],"\\"===y[u]?w=!0:b&&"]"===y[u]?b=!1:b||"["!==y[u]||(b=!0))}try{new RegExp(v)}catch{return console.warn(`Could not convert regex pattern at ${l.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),u.source}return v}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js":function(u,l,m){m.r(l),m.d(l,{parseTupleDef:function(){return parseTupleDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseTupleDef(u,l){return u.rest?{type:"array",minItems:u.items.length,items:u.items.map((u,m)=>(0,f.parseDef)(u._def,{...l,currentPath:[...l.currentPath,"items",`${m}`]})).reduce((u,l)=>void 0===l?u:[...u,l],[]),additionalItems:(0,f.parseDef)(u.rest._def,{...l,currentPath:[...l.currentPath,"additionalItems"]})}:{type:"array",minItems:u.items.length,maxItems:u.items.length,items:u.items.map((u,m)=>(0,f.parseDef)(u._def,{...l,currentPath:[...l.currentPath,"items",`${m}`]})).reduce((u,l)=>void 0===l?u:[...u,l],[])}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js":function(u,l,m){m.r(l),m.d(l,{parseUndefinedDef:function(){return parseUndefinedDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUndefinedDef(u){return{not:(0,f.parseAnyDef)(u)}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js":function(u,l,m){m.r(l),m.d(l,{parseUnionDef:function(){return parseUnionDef},primitiveMappings:function(){return h}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js");const h={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function parseUnionDef(u,l){if("openApi3"===l.target)return asAnyOf(u,l);const m=u.options instanceof Map?Array.from(u.options.values()):u.options;if(m.every(u=>u._def.typeName in h&&(!u._def.checks||!u._def.checks.length))){const u=m.reduce((u,l)=>{const m=h[l._def.typeName];return m&&!u.includes(m)?[...u,m]:u},[]);return{type:u.length>1?u:u[0]}}if(m.every(u=>"ZodLiteral"===u._def.typeName&&!u.description)){const u=m.reduce((u,l)=>{const m=typeof l._def.value;switch(m){case"string":case"number":case"boolean":return[...u,m];case"bigint":return[...u,"integer"];case"object":if(null===l._def.value)return[...u,"null"];default:return u}},[]);if(u.length===m.length){const l=u.filter((u,l,m)=>m.indexOf(u)===l);return{type:l.length>1?l:l[0],enum:m.reduce((u,l)=>u.includes(l._def.value)?u:[...u,l._def.value],[])}}}else if(m.every(u=>"ZodEnum"===u._def.typeName))return{type:"string",enum:m.reduce((u,l)=>[...u,...l._def.values.filter(l=>!u.includes(l))],[])};return asAnyOf(u,l)}const asAnyOf=(u,l)=>{const m=(u.options instanceof Map?Array.from(u.options.values()):u.options).map((u,m)=>(0,f.parseDef)(u._def,{...l,currentPath:[...l.currentPath,"anyOf",`${m}`]})).filter(u=>!!u&&(!l.strictUnions||"object"==typeof u&&Object.keys(u).length>0));return m.length?{anyOf:m}:void 0}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js":function(u,l,m){m.r(l),m.d(l,{parseUnknownDef:function(){return parseUnknownDef}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUnknownDef(u){return(0,f.parseAnyDef)(u)}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/selectParser.js":function(u,l,m){m.r(l),m.d(l,{selectParser:function(){return selectParser}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),v=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),w=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),b=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),S=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),j=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),$=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),x=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),E=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),R=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),Z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),C=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),z=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),A=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),O=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),D=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),N=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),M=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),U=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),L=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),F=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),V=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),K=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),H=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),B=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),J=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),W=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),G=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),Q=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");const selectParser=(u,l,m)=>{switch(l){case f.ZodFirstPartyTypeKind.ZodString:return(0,H.parseStringDef)(u,m);case f.ZodFirstPartyTypeKind.ZodNumber:return(0,N.parseNumberDef)(u,m);case f.ZodFirstPartyTypeKind.ZodObject:return(0,M.parseObjectDef)(u,m);case f.ZodFirstPartyTypeKind.ZodBigInt:return(0,v.parseBigintDef)(u,m);case f.ZodFirstPartyTypeKind.ZodBoolean:return(0,w.parseBooleanDef)();case f.ZodFirstPartyTypeKind.ZodDate:return(0,j.parseDateDef)(u,m);case f.ZodFirstPartyTypeKind.ZodUndefined:return(0,J.parseUndefinedDef)(m);case f.ZodFirstPartyTypeKind.ZodNull:return(0,O.parseNullDef)(m);case f.ZodFirstPartyTypeKind.ZodArray:return(0,y.parseArrayDef)(u,m);case f.ZodFirstPartyTypeKind.ZodUnion:case f.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,W.parseUnionDef)(u,m);case f.ZodFirstPartyTypeKind.ZodIntersection:return(0,R.parseIntersectionDef)(u,m);case f.ZodFirstPartyTypeKind.ZodTuple:return(0,B.parseTupleDef)(u,m);case f.ZodFirstPartyTypeKind.ZodRecord:return(0,V.parseRecordDef)(u,m);case f.ZodFirstPartyTypeKind.ZodLiteral:return(0,Z.parseLiteralDef)(u,m);case f.ZodFirstPartyTypeKind.ZodEnum:return(0,E.parseEnumDef)(u);case f.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,z.parseNativeEnumDef)(u);case f.ZodFirstPartyTypeKind.ZodNullable:return(0,D.parseNullableDef)(u,m);case f.ZodFirstPartyTypeKind.ZodOptional:return(0,U.parseOptionalDef)(u,m);case f.ZodFirstPartyTypeKind.ZodMap:return(0,C.parseMapDef)(u,m);case f.ZodFirstPartyTypeKind.ZodSet:return(0,K.parseSetDef)(u,m);case f.ZodFirstPartyTypeKind.ZodLazy:return()=>u.getter()._def;case f.ZodFirstPartyTypeKind.ZodPromise:return(0,F.parsePromiseDef)(u,m);case f.ZodFirstPartyTypeKind.ZodNaN:case f.ZodFirstPartyTypeKind.ZodNever:return(0,A.parseNeverDef)(m);case f.ZodFirstPartyTypeKind.ZodEffects:return(0,x.parseEffectsDef)(u,m);case f.ZodFirstPartyTypeKind.ZodAny:return(0,h.parseAnyDef)(m);case f.ZodFirstPartyTypeKind.ZodUnknown:return(0,G.parseUnknownDef)(m);case f.ZodFirstPartyTypeKind.ZodDefault:return(0,$.parseDefaultDef)(u,m);case f.ZodFirstPartyTypeKind.ZodBranded:return(0,b.parseBrandedDef)(u,m);case f.ZodFirstPartyTypeKind.ZodReadonly:return(0,Q.parseReadonlyDef)(u,m);case f.ZodFirstPartyTypeKind.ZodCatch:return(0,S.parseCatchDef)(u,m);case f.ZodFirstPartyTypeKind.ZodPipeline:return(0,L.parsePipelineDef)(u,m);case f.ZodFirstPartyTypeKind.ZodFunction:case f.ZodFirstPartyTypeKind.ZodVoid:case f.ZodFirstPartyTypeKind.ZodSymbol:default:return}}},"./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js":function(u,l,m){m.r(l),m.d(l,{zodToJsonSchema:function(){return zodToJsonSchema}});var f=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/Refs.js"),y=m("./node_modules/@modelcontextprotocol/sdk/node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const zodToJsonSchema=(u,l)=>{const m=(0,h.getRefs)(l);let v="object"==typeof l&&l.definitions?Object.entries(l.definitions).reduce((u,[l,h])=>({...u,[l]:(0,f.parseDef)(h._def,{...m,currentPath:[...m.basePath,m.definitionPath,l]},!0)??(0,y.parseAnyDef)(m)}),{}):void 0;const w="string"==typeof l?l:"title"===l?.nameStrategy?void 0:l?.name,b=(0,f.parseDef)(u._def,void 0===w?m:{...m,currentPath:[...m.basePath,m.definitionPath,w]},!1)??(0,y.parseAnyDef)(m),S="object"==typeof l&&void 0!==l.name&&"title"===l.nameStrategy?l.name:void 0;void 0!==S&&(b.title=S),m.flags.hasReferencedOpenAiAnyType&&(v||(v={}),v[m.openAiAnyTypeName]||(v[m.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===m.$refStrategy?"1":[...m.basePath,m.definitionPath,m.openAiAnyTypeName].join("/")}}));const j=void 0===w?v?{...b,[m.definitionPath]:v}:b:{$ref:[..."relative"===m.$refStrategy?[]:m.basePath,m.definitionPath,w].join("/"),[m.definitionPath]:{...v,[w]:b}};return"jsonSchema7"===m.target?j.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==m.target&&"openAi"!==m.target||(j.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===m.target&&("anyOf"in j||"oneOf"in j||"allOf"in j||"type"in j&&Array.isArray(j.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),j}},"./node_modules/fast-deep-equal/index.js":function(u){u.exports=function equal(u,l){if(u===l)return!0;if(u&&l&&"object"==typeof u&&"object"==typeof l){if(u.constructor!==l.constructor)return!1;var m,f,h;if(Array.isArray(u)){if((m=u.length)!=l.length)return!1;for(f=m;0!==f--;)if(!equal(u[f],l[f]))return!1;return!0}if(u.constructor===RegExp)return u.source===l.source&&u.flags===l.flags;if(u.valueOf!==Object.prototype.valueOf)return u.valueOf()===l.valueOf();if(u.toString!==Object.prototype.toString)return u.toString()===l.toString();if((m=(h=Object.keys(u)).length)!==Object.keys(l).length)return!1;for(f=m;0!==f--;)if(!Object.prototype.hasOwnProperty.call(l,h[f]))return!1;for(f=m;0!==f--;){var y=h[f];if(!equal(u[y],l[y]))return!1}return!0}return u!=u&&l!=l}},"./node_modules/fast-uri/index.js":function(u,l,m){const{normalizeIPv6:f,removeDotSegments:h,recomposeAuthority:y,normalizeComponentEncoding:v,isIPv4:w,nonSimpleDomain:b}=m("./node_modules/fast-uri/lib/utils.js"),{SCHEMES:S,getSchemeHandler:j}=m("./node_modules/fast-uri/lib/schemes.js");function resolveComponent(u,l,m,f){const y={};return f||(u=parse(serialize(u,m),m),l=parse(serialize(l,m),m)),!(m=m||{}).tolerant&&l.scheme?(y.scheme=l.scheme,y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=h(l.path||""),y.query=l.query):(void 0!==l.userinfo||void 0!==l.host||void 0!==l.port?(y.userinfo=l.userinfo,y.host=l.host,y.port=l.port,y.path=h(l.path||""),y.query=l.query):(l.path?("/"===l.path[0]?y.path=h(l.path):(void 0===u.userinfo&&void 0===u.host&&void 0===u.port||u.path?u.path?y.path=u.path.slice(0,u.path.lastIndexOf("/")+1)+l.path:y.path=l.path:y.path="/"+l.path,y.path=h(y.path)),y.query=l.query):(y.path=u.path,void 0!==l.query?y.query=l.query:y.query=u.query),y.userinfo=u.userinfo,y.host=u.host,y.port=u.port),y.scheme=u.scheme),y.fragment=l.fragment,y}function serialize(u,l){const m={host:u.host,scheme:u.scheme,userinfo:u.userinfo,port:u.port,path:u.path,query:u.query,nid:u.nid,nss:u.nss,uuid:u.uuid,fragment:u.fragment,reference:u.reference,resourceName:u.resourceName,secure:u.secure,error:""},f=Object.assign({},l),v=[],w=j(f.scheme||m.scheme);w&&w.serialize&&w.serialize(m,f),void 0!==m.path&&(f.skipEscape?m.path=unescape(m.path):(m.path=escape(m.path),void 0!==m.scheme&&(m.path=m.path.split("%3A").join(":")))),"suffix"!==f.reference&&m.scheme&&v.push(m.scheme,":");const b=y(m);if(void 0!==b&&("suffix"!==f.reference&&v.push("//"),v.push(b),m.path&&"/"!==m.path[0]&&v.push("/")),void 0!==m.path){let u=m.path;f.absolutePath||w&&w.absolutePath||(u=h(u)),void 0===b&&"/"===u[0]&&"/"===u[1]&&(u="/%2F"+u.slice(2)),v.push(u)}return void 0!==m.query&&v.push("?",m.query),void 0!==m.fragment&&v.push("#",m.fragment),v.join("")}const $=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function parse(u,l){const m=Object.assign({},l),h={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let y=!1;"suffix"===m.reference&&(u=m.scheme?m.scheme+":"+u:"//"+u);const v=u.match($);if(v){if(h.scheme=v[1],h.userinfo=v[3],h.host=v[4],h.port=parseInt(v[5],10),h.path=v[6]||"",h.query=v[7],h.fragment=v[8],isNaN(h.port)&&(h.port=v[5]),h.host){if(!1===w(h.host)){const u=f(h.host);h.host=u.host.toLowerCase(),y=u.isIPV6}else y=!0}void 0!==h.scheme||void 0!==h.userinfo||void 0!==h.host||void 0!==h.port||void 0!==h.query||h.path?void 0===h.scheme?h.reference="relative":void 0===h.fragment?h.reference="absolute":h.reference="uri":h.reference="same-document",m.reference&&"suffix"!==m.reference&&m.reference!==h.reference&&(h.error=h.error||"URI is not a "+m.reference+" reference.");const l=j(m.scheme||h.scheme);if(!(m.unicodeSupport||l&&l.unicodeSupport)&&h.host&&(m.domainHost||l&&l.domainHost)&&!1===y&&b(h.host))try{h.host=URL.domainToASCII(h.host.toLowerCase())}catch(u){h.error=h.error||"Host's domain name can not be converted to ASCII: "+u}(!l||l&&!l.skipNormalize)&&(-1!==u.indexOf("%")&&(void 0!==h.scheme&&(h.scheme=unescape(h.scheme)),void 0!==h.host&&(h.host=unescape(h.host))),h.path&&(h.path=escape(unescape(h.path))),h.fragment&&(h.fragment=encodeURI(decodeURIComponent(h.fragment)))),l&&l.parse&&l.parse(h,m)}else h.error=h.error||"URI can not be parsed.";return h}const x={SCHEMES:S,normalize:function normalize(u,l){return"string"==typeof u?u=serialize(parse(u,l),l):"object"==typeof u&&(u=parse(serialize(u,l),l)),u},resolve:function resolve(u,l,m){const f=m?Object.assign({scheme:"null"},m):{scheme:"null"},h=resolveComponent(parse(u,f),parse(l,f),f,!0);return f.skipEscape=!0,serialize(h,f)},resolveComponent:resolveComponent,equal:function equal(u,l,m){return"string"==typeof u?(u=unescape(u),u=serialize(v(parse(u,m),!0),{...m,skipEscape:!0})):"object"==typeof u&&(u=serialize(v(u,!0),{...m,skipEscape:!0})),"string"==typeof l?(l=unescape(l),l=serialize(v(parse(l,m),!0),{...m,skipEscape:!0})):"object"==typeof l&&(l=serialize(v(l,!0),{...m,skipEscape:!0})),u.toLowerCase()===l.toLowerCase()},serialize:serialize,parse:parse};u.exports=x,u.exports.default=x,u.exports.fastUri=x},"./node_modules/fast-uri/lib/schemes.js":function(u,l,m){const{isUUID:f}=m("./node_modules/fast-uri/lib/utils.js"),h=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,y=["http","https","ws","wss","urn","urn:uuid"];function wsIsSecure(u){return!0===u.secure||!1!==u.secure&&(!!u.scheme&&!(3!==u.scheme.length||"w"!==u.scheme[0]&&"W"!==u.scheme[0]||"s"!==u.scheme[1]&&"S"!==u.scheme[1]||"s"!==u.scheme[2]&&"S"!==u.scheme[2]))}function httpParse(u){return u.host||(u.error=u.error||"HTTP URIs must have a host."),u}function httpSerialize(u){const l="https"===String(u.scheme).toLowerCase();return u.port!==(l?443:80)&&""!==u.port||(u.port=void 0),u.path||(u.path="/"),u}const v={scheme:"http",domainHost:!0,parse:httpParse,serialize:httpSerialize},w={scheme:"ws",domainHost:!0,parse:function wsParse(u){return u.secure=wsIsSecure(u),u.resourceName=(u.path||"/")+(u.query?"?"+u.query:""),u.path=void 0,u.query=void 0,u},serialize:function wsSerialize(u){if(u.port!==(wsIsSecure(u)?443:80)&&""!==u.port||(u.port=void 0),"boolean"==typeof u.secure&&(u.scheme=u.secure?"wss":"ws",u.secure=void 0),u.resourceName){const[l,m]=u.resourceName.split("?");u.path=l&&"/"!==l?l:void 0,u.query=m,u.resourceName=void 0}return u.fragment=void 0,u}},b={http:v,https:{scheme:"https",domainHost:v.domainHost,parse:httpParse,serialize:httpSerialize},ws:w,wss:{scheme:"wss",domainHost:w.domainHost,parse:w.parse,serialize:w.serialize},urn:{scheme:"urn",parse:function urnParse(u,l){if(!u.path)return u.error="URN can not be parsed",u;const m=u.path.match(h);if(m){const f=l.scheme||u.scheme||"urn";u.nid=m[1].toLowerCase(),u.nss=m[2];const h=getSchemeHandler(`${f}:${l.nid||u.nid}`);u.path=void 0,h&&(u=h.parse(u,l))}else u.error=u.error||"URN can not be parsed.";return u},serialize:function urnSerialize(u,l){if(void 0===u.nid)throw new Error("URN without nid cannot be serialized");const m=l.scheme||u.scheme||"urn",f=u.nid.toLowerCase(),h=getSchemeHandler(`${m}:${l.nid||f}`);h&&(u=h.serialize(u,l));const y=u,v=u.nss;return y.path=`${f||l.nid}:${v}`,l.skipEscape=!0,y},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function urnuuidParse(u,l){const m=u;return m.uuid=m.nss,m.nss=void 0,l.tolerant||m.uuid&&f(m.uuid)||(m.error=m.error||"UUID is not valid."),m},serialize:function urnuuidSerialize(u){const l=u;return l.nss=(u.uuid||"").toLowerCase(),l},skipNormalize:!0}};function getSchemeHandler(u){return u&&(b[u]||b[u.toLowerCase()])||void 0}Object.setPrototypeOf(b,null),u.exports={wsIsSecure:wsIsSecure,SCHEMES:b,isValidSchemeName:function isValidSchemeName(u){return-1!==y.indexOf(u)},getSchemeHandler:getSchemeHandler}},"./node_modules/fast-uri/lib/utils.js":function(u){const l=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),m=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function stringArrayToHexStripped(u){let l="",m=0,f=0;for(f=0;f<u.length;f++)if(m=u[f].charCodeAt(0),48!==m){if(!(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102))return"";l+=u[f];break}for(f+=1;f<u.length;f++){if(m=u[f].charCodeAt(0),!(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102))return"";l+=u[f]}return l}const f=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function consumeIsZone(u){return u.length=0,!0}function consumeHextets(u,l,m){if(u.length){const f=stringArrayToHexStripped(u);if(""===f)return m.error=!0,!1;l.push(f),u.length=0}return!0}function normalizeIPv6(u){if(function findToken(u,l){let m=0;for(let f=0;f<u.length;f++)u[f]===l&&m++;return m}(u,":")<2)return{host:u,isIPV6:!1};const l=function getIPV6(u){let l=0;const m={error:!1,address:"",zone:""},f=[],h=[];let y=!1,v=!1,w=consumeHextets;for(let b=0;b<u.length;b++){const S=u[b];if("["!==S&&"]"!==S)if(":"!==S)if("%"===S){if(!w(h,f,m))break;w=consumeIsZone}else h.push(S);else{if(!0===y&&(v=!0),!w(h,f,m))break;if(++l>7){m.error=!0;break}b>0&&":"===u[b-1]&&(y=!0),f.push(":")}}return h.length&&(w===consumeIsZone?m.zone=h.join(""):v?f.push(h.join("")):f.push(stringArrayToHexStripped(h))),m.address=f.join(""),m}(u);if(l.error)return{host:u,isIPV6:!1};{let u=l.address,m=l.address;return l.zone&&(u+="%"+l.zone,m+="%25"+l.zone),{host:u,isIPV6:!0,escapedHost:m}}}u.exports={nonSimpleDomain:f,recomposeAuthority:function recomposeAuthority(u){const l=[];if(void 0!==u.userinfo&&(l.push(u.userinfo),l.push("@")),void 0!==u.host){let f=unescape(u.host);if(!m(f)){const l=normalizeIPv6(f);f=!0===l.isIPV6?`[${l.escapedHost}]`:u.host}l.push(f)}return"number"!=typeof u.port&&"string"!=typeof u.port||(l.push(":"),l.push(String(u.port))),l.length?l.join(""):void 0},normalizeComponentEncoding:function normalizeComponentEncoding(u,l){const m=!0!==l?escape:unescape;return void 0!==u.scheme&&(u.scheme=m(u.scheme)),void 0!==u.userinfo&&(u.userinfo=m(u.userinfo)),void 0!==u.host&&(u.host=m(u.host)),void 0!==u.path&&(u.path=m(u.path)),void 0!==u.query&&(u.query=m(u.query)),void 0!==u.fragment&&(u.fragment=m(u.fragment)),u},removeDotSegments:function removeDotSegments(u){let l=u;const m=[];let f=-1,h=0;for(;h=l.length;){if(1===h){if("."===l)break;if("/"===l){m.push("/");break}m.push(l);break}if(2===h){if("."===l[0]){if("."===l[1])break;if("/"===l[1]){l=l.slice(2);continue}}else if("/"===l[0]&&("."===l[1]||"/"===l[1])){m.push("/");break}}else if(3===h&&"/.."===l){0!==m.length&&m.pop(),m.push("/");break}if("."===l[0]){if("."===l[1]){if("/"===l[2]){l=l.slice(3);continue}}else if("/"===l[1]){l=l.slice(2);continue}}else if("/"===l[0]&&"."===l[1]){if("/"===l[2]){l=l.slice(2);continue}if("."===l[2]&&"/"===l[3]){l=l.slice(3),0!==m.length&&m.pop();continue}}if(-1===(f=l.indexOf("/",1))){m.push(l);break}m.push(l.slice(0,f)),l=l.slice(f)}return m.join("")},isIPv4:m,isUUID:l,normalizeIPv6:normalizeIPv6,stringArrayToHexStripped:stringArrayToHexStripped}},"./node_modules/zod-to-json-schema/dist/esm/Options.js":function(u,l,m){m.r(l),m.d(l,{defaultOptions:function(){return h},getDefaultOptions:function(){return getDefaultOptions},ignoreOverride:function(){return f},jsonDescription:function(){return jsonDescription}});const f=Symbol("Let zodToJsonSchema decide on which parser to use"),jsonDescription=(u,l)=>{if(l.description)try{return{...u,...JSON.parse(l.description)}}catch{}return u},h={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},getDefaultOptions=u=>"string"==typeof u?{...h,name:u}:{...h,...u}},"./node_modules/zod-to-json-schema/dist/esm/Refs.js":function(u,l,m){m.r(l),m.d(l,{getRefs:function(){return getRefs}});var f=m("./node_modules/zod-to-json-schema/dist/esm/Options.js");const getRefs=u=>{const l=(0,f.getDefaultOptions)(u),m=void 0!==l.name?[...l.basePath,l.definitionPath,l.name]:l.basePath;return{...l,flags:{hasReferencedOpenAiAnyType:!1},currentPath:m,propertyPath:void 0,seen:new Map(Object.entries(l.definitions).map(([u,m])=>[m._def,{def:m._def,path:[...l.basePath,l.definitionPath,u],jsonSchema:void 0}]))}}},"./node_modules/zod-to-json-schema/dist/esm/errorMessages.js":function(u,l,m){function addErrorMessage(u,l,m,f){f?.errorMessages&&m&&(u.errorMessage={...u.errorMessage,[l]:m})}function setResponseValueAndErrors(u,l,m,f,h){u[l]=m,addErrorMessage(u,l,f,h)}m.r(l),m.d(l,{addErrorMessage:function(){return addErrorMessage},setResponseValueAndErrors:function(){return setResponseValueAndErrors}})},"./node_modules/zod-to-json-schema/dist/esm/getRelativePath.js":function(u,l,m){m.r(l),m.d(l,{getRelativePath:function(){return getRelativePath}});const getRelativePath=(u,l)=>{let m=0;for(;m<u.length&&m<l.length&&u[m]===l[m];m++);return[(u.length-m).toString(),...l.slice(m)].join("/")}},"./node_modules/zod-to-json-schema/dist/esm/index.js":function(u,l,m){m.r(l),m.d(l,{addErrorMessage:function(){return y.addErrorMessage},defaultOptions:function(){return f.defaultOptions},getDefaultOptions:function(){return f.getDefaultOptions},getRefs:function(){return h.getRefs},getRelativePath:function(){return v.getRelativePath},ignoreOverride:function(){return f.ignoreOverride},jsonDescription:function(){return f.jsonDescription},parseAnyDef:function(){return b.parseAnyDef},parseArrayDef:function(){return S.parseArrayDef},parseBigintDef:function(){return j.parseBigintDef},parseBooleanDef:function(){return $.parseBooleanDef},parseBrandedDef:function(){return x.parseBrandedDef},parseCatchDef:function(){return E.parseCatchDef},parseDateDef:function(){return R.parseDateDef},parseDef:function(){return w.parseDef},parseDefaultDef:function(){return Z.parseDefaultDef},parseEffectsDef:function(){return C.parseEffectsDef},parseEnumDef:function(){return z.parseEnumDef},parseIntersectionDef:function(){return A.parseIntersectionDef},parseLiteralDef:function(){return O.parseLiteralDef},parseMapDef:function(){return D.parseMapDef},parseNativeEnumDef:function(){return N.parseNativeEnumDef},parseNeverDef:function(){return M.parseNeverDef},parseNullDef:function(){return U.parseNullDef},parseNullableDef:function(){return L.parseNullableDef},parseNumberDef:function(){return F.parseNumberDef},parseObjectDef:function(){return V.parseObjectDef},parseOptionalDef:function(){return K.parseOptionalDef},parsePipelineDef:function(){return H.parsePipelineDef},parsePromiseDef:function(){return B.parsePromiseDef},parseReadonlyDef:function(){return J.parseReadonlyDef},parseRecordDef:function(){return W.parseRecordDef},parseSetDef:function(){return G.parseSetDef},parseStringDef:function(){return Q.parseStringDef},parseTupleDef:function(){return Y.parseTupleDef},parseUndefinedDef:function(){return X.parseUndefinedDef},parseUnionDef:function(){return ee.parseUnionDef},parseUnknownDef:function(){return te.parseUnknownDef},primitiveMappings:function(){return ee.primitiveMappings},selectParser:function(){return ne.selectParser},setResponseValueAndErrors:function(){return y.setResponseValueAndErrors},zodPatterns:function(){return Q.zodPatterns},zodToJsonSchema:function(){return re.zodToJsonSchema}});var f=m("./node_modules/zod-to-json-schema/dist/esm/Options.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/Refs.js"),y=m("./node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),v=m("./node_modules/zod-to-json-schema/dist/esm/getRelativePath.js"),w=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js"),b=(m("./node_modules/zod-to-json-schema/dist/esm/parseTypes.js"),m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js")),S=m("./node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),j=m("./node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),$=m("./node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),x=m("./node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),E=m("./node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),R=m("./node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),Z=m("./node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),C=m("./node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),z=m("./node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),A=m("./node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),O=m("./node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),D=m("./node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),N=m("./node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),M=m("./node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),U=m("./node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),L=m("./node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),F=m("./node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),V=m("./node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),K=m("./node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),H=m("./node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),B=m("./node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),J=m("./node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js"),W=m("./node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),G=m("./node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),Q=m("./node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),Y=m("./node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),X=m("./node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),ee=m("./node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),te=m("./node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),ne=m("./node_modules/zod-to-json-schema/dist/esm/selectParser.js"),re=m("./node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js");l.default=re.zodToJsonSchema},"./node_modules/zod-to-json-schema/dist/esm/parseDef.js":function(u,l,m){m.r(l),m.d(l,{parseDef:function(){return parseDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/Options.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/selectParser.js"),y=m("./node_modules/zod-to-json-schema/dist/esm/getRelativePath.js"),v=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseDef(u,l,m=!1){const y=l.seen.get(u);if(l.override){const h=l.override?.(u,l,y,m);if(h!==f.ignoreOverride)return h}if(y&&!m){const u=get$ref(y,l);if(void 0!==u)return u}const v={def:u,path:l.currentPath,jsonSchema:void 0};l.seen.set(u,v);const w=(0,h.selectParser)(u,u.typeName,l),b="function"==typeof w?parseDef(w(),l):w;if(b&&addMeta(u,l,b),l.postProcess){const m=l.postProcess(b,u,l);return v.jsonSchema=b,m}return v.jsonSchema=b,b}const get$ref=(u,l)=>{switch(l.$refStrategy){case"root":return{$ref:u.path.join("/")};case"relative":return{$ref:(0,y.getRelativePath)(l.currentPath,u.path)};case"none":case"seen":return u.path.length<l.currentPath.length&&u.path.every((u,m)=>l.currentPath[m]===u)?(console.warn(`Recursive reference detected at ${l.currentPath.join("/")}! Defaulting to any`),(0,v.parseAnyDef)(l)):"seen"===l.$refStrategy?(0,v.parseAnyDef)(l):void 0}},addMeta=(u,l,m)=>(u.description&&(m.description=u.description,l.markdownDescription&&(m.markdownDescription=u.description)),m)},"./node_modules/zod-to-json-schema/dist/esm/parseTypes.js":function(u,l,m){m.r(l)},"./node_modules/zod-to-json-schema/dist/esm/parsers/any.js":function(u,l,m){m.r(l),m.d(l,{parseAnyDef:function(){return parseAnyDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/getRelativePath.js");function parseAnyDef(u){if("openAi"!==u.target)return{};const l=[...u.basePath,u.definitionPath,u.openAiAnyTypeName];return u.flags.hasReferencedOpenAiAnyType=!0,{$ref:"relative"===u.$refStrategy?(0,f.getRelativePath)(l,u.currentPath):l.join("/")}}},"./node_modules/zod-to-json-schema/dist/esm/parsers/array.js":function(u,l,m){m.r(l),m.d(l,{parseArrayDef:function(){return parseArrayDef}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),y=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseArrayDef(u,l){const m={type:"array"};return u.type?._def&&u.type?._def?.typeName!==f.ZodFirstPartyTypeKind.ZodAny&&(m.items=(0,y.parseDef)(u.type._def,{...l,currentPath:[...l.currentPath,"items"]})),u.minLength&&(0,h.setResponseValueAndErrors)(m,"minItems",u.minLength.value,u.minLength.message,l),u.maxLength&&(0,h.setResponseValueAndErrors)(m,"maxItems",u.maxLength.value,u.maxLength.message,l),u.exactLength&&((0,h.setResponseValueAndErrors)(m,"minItems",u.exactLength.value,u.exactLength.message,l),(0,h.setResponseValueAndErrors)(m,"maxItems",u.exactLength.value,u.exactLength.message,l)),m}},"./node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js":function(u,l,m){m.r(l),m.d(l,{parseBigintDef:function(){return parseBigintDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseBigintDef(u,l){const m={type:"integer",format:"int64"};if(!u.checks)return m;for(const h of u.checks)switch(h.kind){case"min":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMinimum",h.value,h.message,l):(h.inclusive||(m.exclusiveMinimum=!0),(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l));break;case"max":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMaximum",h.value,h.message,l):(h.inclusive||(m.exclusiveMaximum=!0),(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l));break;case"multipleOf":(0,f.setResponseValueAndErrors)(m,"multipleOf",h.value,h.message,l)}return m}},"./node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js":function(u,l,m){function parseBooleanDef(){return{type:"boolean"}}m.r(l),m.d(l,{parseBooleanDef:function(){return parseBooleanDef}})},"./node_modules/zod-to-json-schema/dist/esm/parsers/branded.js":function(u,l,m){m.r(l),m.d(l,{parseBrandedDef:function(){return parseBrandedDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseBrandedDef(u,l){return(0,f.parseDef)(u.type._def,l)}},"./node_modules/zod-to-json-schema/dist/esm/parsers/catch.js":function(u,l,m){m.r(l),m.d(l,{parseCatchDef:function(){return parseCatchDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseCatchDef=(u,l)=>(0,f.parseDef)(u.innerType._def,l)},"./node_modules/zod-to-json-schema/dist/esm/parsers/date.js":function(u,l,m){m.r(l),m.d(l,{parseDateDef:function(){return parseDateDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseDateDef(u,l,m){const f=m??l.dateStrategy;if(Array.isArray(f))return{anyOf:f.map((m,f)=>parseDateDef(u,l,m))};switch(f){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return integerDateParser(u,l)}}const integerDateParser=(u,l)=>{const m={type:"integer",format:"unix-time"};if("openApi3"===l.target)return m;for(const h of u.checks)switch(h.kind){case"min":(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l);break;case"max":(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l)}return m}},"./node_modules/zod-to-json-schema/dist/esm/parsers/default.js":function(u,l,m){m.r(l),m.d(l,{parseDefaultDef:function(){return parseDefaultDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseDefaultDef(u,l){return{...(0,f.parseDef)(u.innerType._def,l),default:u.defaultValue()}}},"./node_modules/zod-to-json-schema/dist/esm/parsers/effects.js":function(u,l,m){m.r(l),m.d(l,{parseEffectsDef:function(){return parseEffectsDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseEffectsDef(u,l){return"input"===l.effectStrategy?(0,f.parseDef)(u.schema._def,l):(0,h.parseAnyDef)(l)}},"./node_modules/zod-to-json-schema/dist/esm/parsers/enum.js":function(u,l,m){function parseEnumDef(u){return{type:"string",enum:Array.from(u.values)}}m.r(l),m.d(l,{parseEnumDef:function(){return parseEnumDef}})},"./node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js":function(u,l,m){m.r(l),m.d(l,{parseIntersectionDef:function(){return parseIntersectionDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");const isJsonSchema7AllOfType=u=>(!("type"in u)||"string"!==u.type)&&"allOf"in u;function parseIntersectionDef(u,l){const m=[(0,f.parseDef)(u.left._def,{...l,currentPath:[...l.currentPath,"allOf","0"]}),(0,f.parseDef)(u.right._def,{...l,currentPath:[...l.currentPath,"allOf","1"]})].filter(u=>!!u);let h="jsonSchema2019-09"===l.target?{unevaluatedProperties:!1}:void 0;const y=[];return m.forEach(u=>{if(isJsonSchema7AllOfType(u))y.push(...u.allOf),void 0===u.unevaluatedProperties&&(h=void 0);else{let l=u;if("additionalProperties"in u&&!1===u.additionalProperties){const{additionalProperties:m,...f}=u;l=f}else h=void 0;y.push(l)}}),y.length?{allOf:y,...h}:void 0}},"./node_modules/zod-to-json-schema/dist/esm/parsers/literal.js":function(u,l,m){function parseLiteralDef(u,l){const m=typeof u.value;return"bigint"!==m&&"number"!==m&&"boolean"!==m&&"string"!==m?{type:Array.isArray(u.value)?"array":"object"}:"openApi3"===l.target?{type:"bigint"===m?"integer":m,enum:[u.value]}:{type:"bigint"===m?"integer":m,const:u.value}}m.r(l),m.d(l,{parseLiteralDef:function(){return parseLiteralDef}})},"./node_modules/zod-to-json-schema/dist/esm/parsers/map.js":function(u,l,m){m.r(l),m.d(l,{parseMapDef:function(){return parseMapDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),y=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseMapDef(u,l){if("record"===l.mapStrategy)return(0,h.parseRecordDef)(u,l);return{type:"array",maxItems:125,items:{type:"array",items:[(0,f.parseDef)(u.keyType._def,{...l,currentPath:[...l.currentPath,"items","items","0"]})||(0,y.parseAnyDef)(l),(0,f.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"items","items","1"]})||(0,y.parseAnyDef)(l)],minItems:2,maxItems:2}}}},"./node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js":function(u,l,m){function parseNativeEnumDef(u){const l=u.values,m=Object.keys(u.values).filter(u=>"number"!=typeof l[l[u]]).map(u=>l[u]),f=Array.from(new Set(m.map(u=>typeof u)));return{type:1===f.length?"string"===f[0]?"string":"number":["string","number"],enum:m}}m.r(l),m.d(l,{parseNativeEnumDef:function(){return parseNativeEnumDef}})},"./node_modules/zod-to-json-schema/dist/esm/parsers/never.js":function(u,l,m){m.r(l),m.d(l,{parseNeverDef:function(){return parseNeverDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseNeverDef(u){return"openAi"===u.target?void 0:{not:(0,f.parseAnyDef)({...u,currentPath:[...u.currentPath,"not"]})}}},"./node_modules/zod-to-json-schema/dist/esm/parsers/null.js":function(u,l,m){function parseNullDef(u){return"openApi3"===u.target?{enum:["null"],nullable:!0}:{type:"null"}}m.r(l),m.d(l,{parseNullDef:function(){return parseNullDef}})},"./node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js":function(u,l,m){m.r(l),m.d(l,{parseNullableDef:function(){return parseNullableDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/parsers/union.js");function parseNullableDef(u,l){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(u.innerType._def.typeName)&&(!u.innerType._def.checks||!u.innerType._def.checks.length))return"openApi3"===l.target?{type:h.primitiveMappings[u.innerType._def.typeName],nullable:!0}:{type:[h.primitiveMappings[u.innerType._def.typeName],"null"]};if("openApi3"===l.target){const m=(0,f.parseDef)(u.innerType._def,{...l,currentPath:[...l.currentPath]});return m&&"$ref"in m?{allOf:[m],nullable:!0}:m&&{...m,nullable:!0}}const m=(0,f.parseDef)(u.innerType._def,{...l,currentPath:[...l.currentPath,"anyOf","0"]});return m&&{anyOf:[m,{type:"null"}]}}},"./node_modules/zod-to-json-schema/dist/esm/parsers/number.js":function(u,l,m){m.r(l),m.d(l,{parseNumberDef:function(){return parseNumberDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");function parseNumberDef(u,l){const m={type:"number"};if(!u.checks)return m;for(const h of u.checks)switch(h.kind){case"int":m.type="integer",(0,f.addErrorMessage)(m,"type",h.message,l);break;case"min":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMinimum",h.value,h.message,l):(h.inclusive||(m.exclusiveMinimum=!0),(0,f.setResponseValueAndErrors)(m,"minimum",h.value,h.message,l));break;case"max":"jsonSchema7"===l.target?h.inclusive?(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l):(0,f.setResponseValueAndErrors)(m,"exclusiveMaximum",h.value,h.message,l):(h.inclusive||(m.exclusiveMaximum=!0),(0,f.setResponseValueAndErrors)(m,"maximum",h.value,h.message,l));break;case"multipleOf":(0,f.setResponseValueAndErrors)(m,"multipleOf",h.value,h.message,l)}return m}},"./node_modules/zod-to-json-schema/dist/esm/parsers/object.js":function(u,l,m){m.r(l),m.d(l,{parseObjectDef:function(){return parseObjectDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseObjectDef(u,l){const m="openAi"===l.target,h={type:"object",properties:{}},y=[],v=u.shape();for(const u in v){let w=v[u];if(void 0===w||void 0===w._def)continue;let b=safeIsOptional(w);b&&m&&("ZodOptional"===w._def.typeName&&(w=w._def.innerType),w.isNullable()||(w=w.nullable()),b=!1);const S=(0,f.parseDef)(w._def,{...l,currentPath:[...l.currentPath,"properties",u],propertyPath:[...l.currentPath,"properties",u]});void 0!==S&&(h.properties[u]=S,b||y.push(u))}y.length&&(h.required=y);const w=function decideAdditionalProperties(u,l){if("ZodNever"!==u.catchall._def.typeName)return(0,f.parseDef)(u.catchall._def,{...l,currentPath:[...l.currentPath,"additionalProperties"]});switch(u.unknownKeys){case"passthrough":return l.allowedAdditionalProperties;case"strict":return l.rejectedAdditionalProperties;case"strip":return"strict"===l.removeAdditionalStrategy?l.allowedAdditionalProperties:l.rejectedAdditionalProperties}}(u,l);return void 0!==w&&(h.additionalProperties=w),h}function safeIsOptional(u){try{return u.isOptional()}catch{return!0}}},"./node_modules/zod-to-json-schema/dist/esm/parsers/optional.js":function(u,l,m){m.r(l),m.d(l,{parseOptionalDef:function(){return parseOptionalDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const parseOptionalDef=(u,l)=>{if(l.currentPath.toString()===l.propertyPath?.toString())return(0,f.parseDef)(u.innerType._def,l);const m=(0,f.parseDef)(u.innerType._def,{...l,currentPath:[...l.currentPath,"anyOf","1"]});return m?{anyOf:[{not:(0,h.parseAnyDef)(l)},m]}:(0,h.parseAnyDef)(l)}},"./node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js":function(u,l,m){m.r(l),m.d(l,{parsePipelineDef:function(){return parsePipelineDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parsePipelineDef=(u,l)=>{if("input"===l.pipeStrategy)return(0,f.parseDef)(u.in._def,l);if("output"===l.pipeStrategy)return(0,f.parseDef)(u.out._def,l);const m=(0,f.parseDef)(u.in._def,{...l,currentPath:[...l.currentPath,"allOf","0"]});return{allOf:[m,(0,f.parseDef)(u.out._def,{...l,currentPath:[...l.currentPath,"allOf",m?"1":"0"]})].filter(u=>void 0!==u)}}},"./node_modules/zod-to-json-schema/dist/esm/parsers/promise.js":function(u,l,m){m.r(l),m.d(l,{parsePromiseDef:function(){return parsePromiseDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parsePromiseDef(u,l){return(0,f.parseDef)(u.type._def,l)}},"./node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js":function(u,l,m){m.r(l),m.d(l,{parseReadonlyDef:function(){return parseReadonlyDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");const parseReadonlyDef=(u,l)=>(0,f.parseDef)(u.innerType._def,l)},"./node_modules/zod-to-json-schema/dist/esm/parsers/record.js":function(u,l,m){m.r(l),m.d(l,{parseRecordDef:function(){return parseRecordDef}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js"),y=m("./node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),v=m("./node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),w=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseRecordDef(u,l){if("openAi"===l.target&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),"openApi3"===l.target&&u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodEnum)return{type:"object",required:u.keyType._def.values,properties:u.keyType._def.values.reduce((m,f)=>({...m,[f]:(0,h.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"properties",f]})??(0,w.parseAnyDef)(l)}),{}),additionalProperties:l.rejectedAdditionalProperties};const m={type:"object",additionalProperties:(0,h.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"additionalProperties"]})??l.allowedAdditionalProperties};if("openApi3"===l.target)return m;if(u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodString&&u.keyType._def.checks?.length){const{type:f,...h}=(0,y.parseStringDef)(u.keyType._def,l);return{...m,propertyNames:h}}if(u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodEnum)return{...m,propertyNames:{enum:u.keyType._def.values}};if(u.keyType?._def.typeName===f.ZodFirstPartyTypeKind.ZodBranded&&u.keyType._def.type._def.typeName===f.ZodFirstPartyTypeKind.ZodString&&u.keyType._def.type._def.checks?.length){const{type:f,...h}=(0,v.parseBrandedDef)(u.keyType._def,l);return{...m,propertyNames:h}}return m}},"./node_modules/zod-to-json-schema/dist/esm/parsers/set.js":function(u,l,m){m.r(l),m.d(l,{parseSetDef:function(){return parseSetDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/errorMessages.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseSetDef(u,l){const m={type:"array",uniqueItems:!0,items:(0,h.parseDef)(u.valueType._def,{...l,currentPath:[...l.currentPath,"items"]})};return u.minSize&&(0,f.setResponseValueAndErrors)(m,"minItems",u.minSize.value,u.minSize.message,l),u.maxSize&&(0,f.setResponseValueAndErrors)(m,"maxItems",u.maxSize.value,u.maxSize.message,l),m}},"./node_modules/zod-to-json-schema/dist/esm/parsers/string.js":function(u,l,m){m.r(l),m.d(l,{parseStringDef:function(){return parseStringDef},zodPatterns:function(){return y}});var f=m("./node_modules/zod-to-json-schema/dist/esm/errorMessages.js");let h;const y={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===h&&(h=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),h),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function parseStringDef(u,l){const m={type:"string"};if(u.checks)for(const h of u.checks)switch(h.kind){case"min":(0,f.setResponseValueAndErrors)(m,"minLength","number"==typeof m.minLength?Math.max(m.minLength,h.value):h.value,h.message,l);break;case"max":(0,f.setResponseValueAndErrors)(m,"maxLength","number"==typeof m.maxLength?Math.min(m.maxLength,h.value):h.value,h.message,l);break;case"email":switch(l.emailStrategy){case"format:email":addFormat(m,"email",h.message,l);break;case"format:idn-email":addFormat(m,"idn-email",h.message,l);break;case"pattern:zod":addPattern(m,y.email,h.message,l)}break;case"url":addFormat(m,"uri",h.message,l);break;case"uuid":addFormat(m,"uuid",h.message,l);break;case"regex":addPattern(m,h.regex,h.message,l);break;case"cuid":addPattern(m,y.cuid,h.message,l);break;case"cuid2":addPattern(m,y.cuid2,h.message,l);break;case"startsWith":addPattern(m,RegExp(`^${escapeLiteralCheckValue(h.value,l)}`),h.message,l);break;case"endsWith":addPattern(m,RegExp(`${escapeLiteralCheckValue(h.value,l)}$`),h.message,l);break;case"datetime":addFormat(m,"date-time",h.message,l);break;case"date":addFormat(m,"date",h.message,l);break;case"time":addFormat(m,"time",h.message,l);break;case"duration":addFormat(m,"duration",h.message,l);break;case"length":(0,f.setResponseValueAndErrors)(m,"minLength","number"==typeof m.minLength?Math.max(m.minLength,h.value):h.value,h.message,l),(0,f.setResponseValueAndErrors)(m,"maxLength","number"==typeof m.maxLength?Math.min(m.maxLength,h.value):h.value,h.message,l);break;case"includes":addPattern(m,RegExp(escapeLiteralCheckValue(h.value,l)),h.message,l);break;case"ip":"v6"!==h.version&&addFormat(m,"ipv4",h.message,l),"v4"!==h.version&&addFormat(m,"ipv6",h.message,l);break;case"base64url":addPattern(m,y.base64url,h.message,l);break;case"jwt":addPattern(m,y.jwt,h.message,l);break;case"cidr":"v6"!==h.version&&addPattern(m,y.ipv4Cidr,h.message,l),"v4"!==h.version&&addPattern(m,y.ipv6Cidr,h.message,l);break;case"emoji":addPattern(m,y.emoji(),h.message,l);break;case"ulid":addPattern(m,y.ulid,h.message,l);break;case"base64":switch(l.base64Strategy){case"format:binary":addFormat(m,"binary",h.message,l);break;case"contentEncoding:base64":(0,f.setResponseValueAndErrors)(m,"contentEncoding","base64",h.message,l);break;case"pattern:zod":addPattern(m,y.base64,h.message,l)}break;case"nanoid":addPattern(m,y.nanoid,h.message,l);case"toLowerCase":case"toUpperCase":case"trim":break;default:(()=>{})()}return m}function escapeLiteralCheckValue(u,l){return"escape"===l.patternStrategy?function escapeNonAlphaNumeric(u){let l="";for(let m=0;m<u.length;m++)v.has(u[m])||(l+="\\"),l+=u[m];return l}(u):u}const v=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function addFormat(u,l,m,h){u.format||u.anyOf?.some(u=>u.format)?(u.anyOf||(u.anyOf=[]),u.format&&(u.anyOf.push({format:u.format,...u.errorMessage&&h.errorMessages&&{errorMessage:{format:u.errorMessage.format}}}),delete u.format,u.errorMessage&&(delete u.errorMessage.format,0===Object.keys(u.errorMessage).length&&delete u.errorMessage)),u.anyOf.push({format:l,...m&&h.errorMessages&&{errorMessage:{format:m}}})):(0,f.setResponseValueAndErrors)(u,"format",l,m,h)}function addPattern(u,l,m,h){u.pattern||u.allOf?.some(u=>u.pattern)?(u.allOf||(u.allOf=[]),u.pattern&&(u.allOf.push({pattern:u.pattern,...u.errorMessage&&h.errorMessages&&{errorMessage:{pattern:u.errorMessage.pattern}}}),delete u.pattern,u.errorMessage&&(delete u.errorMessage.pattern,0===Object.keys(u.errorMessage).length&&delete u.errorMessage)),u.allOf.push({pattern:stringifyRegExpWithFlags(l,h),...m&&h.errorMessages&&{errorMessage:{pattern:m}}})):(0,f.setResponseValueAndErrors)(u,"pattern",stringifyRegExpWithFlags(l,h),m,h)}function stringifyRegExpWithFlags(u,l){if(!l.applyRegexFlags||!u.flags)return u.source;const m=u.flags.includes("i"),f=u.flags.includes("m"),h=u.flags.includes("s"),y=m?u.source.toLowerCase():u.source;let v="",w=!1,b=!1,S=!1;for(let u=0;u<y.length;u++)if(w)v+=y[u],w=!1;else{if(m)if(b){if(y[u].match(/[a-z]/)){S?(v+=y[u],v+=`${y[u-2]}-${y[u]}`.toUpperCase(),S=!1):"-"===y[u+1]&&y[u+2]?.match(/[a-z]/)?(v+=y[u],S=!0):v+=`${y[u]}${y[u].toUpperCase()}`;continue}}else if(y[u].match(/[a-z]/)){v+=`[${y[u]}${y[u].toUpperCase()}]`;continue}if(f){if("^"===y[u]){v+="(^|(?<=[\r\n]))";continue}if("$"===y[u]){v+="($|(?=[\r\n]))";continue}}h&&"."===y[u]?v+=b?`${y[u]}\r\n`:`[${y[u]}\r\n]`:(v+=y[u],"\\"===y[u]?w=!0:b&&"]"===y[u]?b=!1:b||"["!==y[u]||(b=!0))}try{new RegExp(v)}catch{return console.warn(`Could not convert regex pattern at ${l.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),u.source}return v}},"./node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js":function(u,l,m){m.r(l),m.d(l,{parseTupleDef:function(){return parseTupleDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");function parseTupleDef(u,l){return u.rest?{type:"array",minItems:u.items.length,items:u.items.map((u,m)=>(0,f.parseDef)(u._def,{...l,currentPath:[...l.currentPath,"items",`${m}`]})).reduce((u,l)=>void 0===l?u:[...u,l],[]),additionalItems:(0,f.parseDef)(u.rest._def,{...l,currentPath:[...l.currentPath,"additionalItems"]})}:{type:"array",minItems:u.items.length,maxItems:u.items.length,items:u.items.map((u,m)=>(0,f.parseDef)(u._def,{...l,currentPath:[...l.currentPath,"items",`${m}`]})).reduce((u,l)=>void 0===l?u:[...u,l],[])}}},"./node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js":function(u,l,m){m.r(l),m.d(l,{parseUndefinedDef:function(){return parseUndefinedDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUndefinedDef(u){return{not:(0,f.parseAnyDef)(u)}}},"./node_modules/zod-to-json-schema/dist/esm/parsers/union.js":function(u,l,m){m.r(l),m.d(l,{parseUnionDef:function(){return parseUnionDef},primitiveMappings:function(){return h}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js");const h={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function parseUnionDef(u,l){if("openApi3"===l.target)return asAnyOf(u,l);const m=u.options instanceof Map?Array.from(u.options.values()):u.options;if(m.every(u=>u._def.typeName in h&&(!u._def.checks||!u._def.checks.length))){const u=m.reduce((u,l)=>{const m=h[l._def.typeName];return m&&!u.includes(m)?[...u,m]:u},[]);return{type:u.length>1?u:u[0]}}if(m.every(u=>"ZodLiteral"===u._def.typeName&&!u.description)){const u=m.reduce((u,l)=>{const m=typeof l._def.value;switch(m){case"string":case"number":case"boolean":return[...u,m];case"bigint":return[...u,"integer"];case"object":if(null===l._def.value)return[...u,"null"];default:return u}},[]);if(u.length===m.length){const l=u.filter((u,l,m)=>m.indexOf(u)===l);return{type:l.length>1?l:l[0],enum:m.reduce((u,l)=>u.includes(l._def.value)?u:[...u,l._def.value],[])}}}else if(m.every(u=>"ZodEnum"===u._def.typeName))return{type:"string",enum:m.reduce((u,l)=>[...u,...l._def.values.filter(l=>!u.includes(l))],[])};return asAnyOf(u,l)}const asAnyOf=(u,l)=>{const m=(u.options instanceof Map?Array.from(u.options.values()):u.options).map((u,m)=>(0,f.parseDef)(u._def,{...l,currentPath:[...l.currentPath,"anyOf",`${m}`]})).filter(u=>!!u&&(!l.strictUnions||"object"==typeof u&&Object.keys(u).length>0));return m.length?{anyOf:m}:void 0}},"./node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js":function(u,l,m){m.r(l),m.d(l,{parseUnknownDef:function(){return parseUnknownDef}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");function parseUnknownDef(u){return(0,f.parseAnyDef)(u)}},"./node_modules/zod-to-json-schema/dist/esm/selectParser.js":function(u,l,m){m.r(l),m.d(l,{selectParser:function(){return selectParser}});var f=m("./node_modules/zod/v3/types.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js"),y=m("./node_modules/zod-to-json-schema/dist/esm/parsers/array.js"),v=m("./node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js"),w=m("./node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js"),b=m("./node_modules/zod-to-json-schema/dist/esm/parsers/branded.js"),S=m("./node_modules/zod-to-json-schema/dist/esm/parsers/catch.js"),j=m("./node_modules/zod-to-json-schema/dist/esm/parsers/date.js"),$=m("./node_modules/zod-to-json-schema/dist/esm/parsers/default.js"),x=m("./node_modules/zod-to-json-schema/dist/esm/parsers/effects.js"),E=m("./node_modules/zod-to-json-schema/dist/esm/parsers/enum.js"),R=m("./node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js"),Z=m("./node_modules/zod-to-json-schema/dist/esm/parsers/literal.js"),C=m("./node_modules/zod-to-json-schema/dist/esm/parsers/map.js"),z=m("./node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js"),A=m("./node_modules/zod-to-json-schema/dist/esm/parsers/never.js"),O=m("./node_modules/zod-to-json-schema/dist/esm/parsers/null.js"),D=m("./node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js"),N=m("./node_modules/zod-to-json-schema/dist/esm/parsers/number.js"),M=m("./node_modules/zod-to-json-schema/dist/esm/parsers/object.js"),U=m("./node_modules/zod-to-json-schema/dist/esm/parsers/optional.js"),L=m("./node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js"),F=m("./node_modules/zod-to-json-schema/dist/esm/parsers/promise.js"),V=m("./node_modules/zod-to-json-schema/dist/esm/parsers/record.js"),K=m("./node_modules/zod-to-json-schema/dist/esm/parsers/set.js"),H=m("./node_modules/zod-to-json-schema/dist/esm/parsers/string.js"),B=m("./node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js"),J=m("./node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js"),W=m("./node_modules/zod-to-json-schema/dist/esm/parsers/union.js"),G=m("./node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js"),Q=m("./node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js");const selectParser=(u,l,m)=>{switch(l){case f.ZodFirstPartyTypeKind.ZodString:return(0,H.parseStringDef)(u,m);case f.ZodFirstPartyTypeKind.ZodNumber:return(0,N.parseNumberDef)(u,m);case f.ZodFirstPartyTypeKind.ZodObject:return(0,M.parseObjectDef)(u,m);case f.ZodFirstPartyTypeKind.ZodBigInt:return(0,v.parseBigintDef)(u,m);case f.ZodFirstPartyTypeKind.ZodBoolean:return(0,w.parseBooleanDef)();case f.ZodFirstPartyTypeKind.ZodDate:return(0,j.parseDateDef)(u,m);case f.ZodFirstPartyTypeKind.ZodUndefined:return(0,J.parseUndefinedDef)(m);case f.ZodFirstPartyTypeKind.ZodNull:return(0,O.parseNullDef)(m);case f.ZodFirstPartyTypeKind.ZodArray:return(0,y.parseArrayDef)(u,m);case f.ZodFirstPartyTypeKind.ZodUnion:case f.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:return(0,W.parseUnionDef)(u,m);case f.ZodFirstPartyTypeKind.ZodIntersection:return(0,R.parseIntersectionDef)(u,m);case f.ZodFirstPartyTypeKind.ZodTuple:return(0,B.parseTupleDef)(u,m);case f.ZodFirstPartyTypeKind.ZodRecord:return(0,V.parseRecordDef)(u,m);case f.ZodFirstPartyTypeKind.ZodLiteral:return(0,Z.parseLiteralDef)(u,m);case f.ZodFirstPartyTypeKind.ZodEnum:return(0,E.parseEnumDef)(u);case f.ZodFirstPartyTypeKind.ZodNativeEnum:return(0,z.parseNativeEnumDef)(u);case f.ZodFirstPartyTypeKind.ZodNullable:return(0,D.parseNullableDef)(u,m);case f.ZodFirstPartyTypeKind.ZodOptional:return(0,U.parseOptionalDef)(u,m);case f.ZodFirstPartyTypeKind.ZodMap:return(0,C.parseMapDef)(u,m);case f.ZodFirstPartyTypeKind.ZodSet:return(0,K.parseSetDef)(u,m);case f.ZodFirstPartyTypeKind.ZodLazy:return()=>u.getter()._def;case f.ZodFirstPartyTypeKind.ZodPromise:return(0,F.parsePromiseDef)(u,m);case f.ZodFirstPartyTypeKind.ZodNaN:case f.ZodFirstPartyTypeKind.ZodNever:return(0,A.parseNeverDef)(m);case f.ZodFirstPartyTypeKind.ZodEffects:return(0,x.parseEffectsDef)(u,m);case f.ZodFirstPartyTypeKind.ZodAny:return(0,h.parseAnyDef)(m);case f.ZodFirstPartyTypeKind.ZodUnknown:return(0,G.parseUnknownDef)(m);case f.ZodFirstPartyTypeKind.ZodDefault:return(0,$.parseDefaultDef)(u,m);case f.ZodFirstPartyTypeKind.ZodBranded:return(0,b.parseBrandedDef)(u,m);case f.ZodFirstPartyTypeKind.ZodReadonly:return(0,Q.parseReadonlyDef)(u,m);case f.ZodFirstPartyTypeKind.ZodCatch:return(0,S.parseCatchDef)(u,m);case f.ZodFirstPartyTypeKind.ZodPipeline:return(0,L.parsePipelineDef)(u,m);case f.ZodFirstPartyTypeKind.ZodFunction:case f.ZodFirstPartyTypeKind.ZodVoid:case f.ZodFirstPartyTypeKind.ZodSymbol:default:return}}},"./node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js":function(u,l,m){m.r(l),m.d(l,{zodToJsonSchema:function(){return zodToJsonSchema}});var f=m("./node_modules/zod-to-json-schema/dist/esm/parseDef.js"),h=m("./node_modules/zod-to-json-schema/dist/esm/Refs.js"),y=m("./node_modules/zod-to-json-schema/dist/esm/parsers/any.js");const zodToJsonSchema=(u,l)=>{const m=(0,h.getRefs)(l);let v="object"==typeof l&&l.definitions?Object.entries(l.definitions).reduce((u,[l,h])=>({...u,[l]:(0,f.parseDef)(h._def,{...m,currentPath:[...m.basePath,m.definitionPath,l]},!0)??(0,y.parseAnyDef)(m)}),{}):void 0;const w="string"==typeof l?l:"title"===l?.nameStrategy?void 0:l?.name,b=(0,f.parseDef)(u._def,void 0===w?m:{...m,currentPath:[...m.basePath,m.definitionPath,w]},!1)??(0,y.parseAnyDef)(m),S="object"==typeof l&&void 0!==l.name&&"title"===l.nameStrategy?l.name:void 0;void 0!==S&&(b.title=S),m.flags.hasReferencedOpenAiAnyType&&(v||(v={}),v[m.openAiAnyTypeName]||(v[m.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:"relative"===m.$refStrategy?"1":[...m.basePath,m.definitionPath,m.openAiAnyTypeName].join("/")}}));const j=void 0===w?v?{...b,[m.definitionPath]:v}:b:{$ref:[..."relative"===m.$refStrategy?[]:m.basePath,m.definitionPath,w].join("/"),[m.definitionPath]:{...v,[w]:b}};return"jsonSchema7"===m.target?j.$schema="http://json-schema.org/draft-07/schema#":"jsonSchema2019-09"!==m.target&&"openAi"!==m.target||(j.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===m.target&&("anyOf"in j||"oneOf"in j||"allOf"in j||"type"in j&&Array.isArray(j.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),j}},"./node_modules/zod/v3/ZodError.js":function(u,l,m){m.r(l),m.d(l,{ZodError:function(){return ZodError},ZodIssueCode:function(){return h},quotelessJson:function(){return quotelessJson}});var f=m("./node_modules/zod/v3/helpers/util.js");const h=f.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),quotelessJson=u=>JSON.stringify(u,null,2).replace(/"([^"]+)":/g,"$1:");class ZodError extends Error{get errors(){return this.issues}constructor(u){super(),this.issues=[],this.addIssue=u=>{this.issues=[...this.issues,u]},this.addIssues=(u=[])=>{this.issues=[...this.issues,...u]};const l=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,l):this.__proto__=l,this.name="ZodError",this.issues=u}format(u){const l=u||function(u){return u.message},m={_errors:[]},processError=u=>{for(const f of u.issues)if("invalid_union"===f.code)f.unionErrors.map(processError);else if("invalid_return_type"===f.code)processError(f.returnTypeError);else if("invalid_arguments"===f.code)processError(f.argumentsError);else if(0===f.path.length)m._errors.push(l(f));else{let u=m,h=0;for(;h<f.path.length;){const m=f.path[h];h===f.path.length-1?(u[m]=u[m]||{_errors:[]},u[m]._errors.push(l(f))):u[m]=u[m]||{_errors:[]},u=u[m],h++}}};return processError(this),m}static assert(u){if(!(u instanceof ZodError))throw new Error(`Not a ZodError: ${u}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,f.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(u=u=>u.message){const l={},m=[];for(const f of this.issues)if(f.path.length>0){const m=f.path[0];l[m]=l[m]||[],l[m].push(u(f))}else m.push(u(f));return{formErrors:m,fieldErrors:l}}get formErrors(){return this.flatten()}}ZodError.create=u=>new ZodError(u)},"./node_modules/zod/v3/errors.js":function(u,l,m){m.r(l),m.d(l,{defaultErrorMap:function(){return f.default},getErrorMap:function(){return getErrorMap},setErrorMap:function(){return setErrorMap}});var f=m("./node_modules/zod/v3/locales/en.js");let h=f.default;function setErrorMap(u){h=u}function getErrorMap(){return h}},"./node_modules/zod/v3/helpers/errorUtil.js":function(u,l,m){var f;m.r(l),m.d(l,{errorUtil:function(){return f}}),function(u){u.errToObj=u=>"string"==typeof u?{message:u}:u||{},u.toString=u=>"string"==typeof u?u:u?.message}(f||(f={}))},"./node_modules/zod/v3/helpers/parseUtil.js":function(u,l,m){m.r(l),m.d(l,{DIRTY:function(){return DIRTY},EMPTY_PATH:function(){return y},INVALID:function(){return v},OK:function(){return OK},ParseStatus:function(){return ParseStatus},addIssueToContext:function(){return addIssueToContext},isAborted:function(){return isAborted},isAsync:function(){return isAsync},isDirty:function(){return isDirty},isValid:function(){return isValid},makeIssue:function(){return makeIssue}});var f=m("./node_modules/zod/v3/errors.js"),h=m("./node_modules/zod/v3/locales/en.js");const makeIssue=u=>{const{data:l,path:m,errorMaps:f,issueData:h}=u,y=[...m,...h.path||[]],v={...h,path:y};if(void 0!==h.message)return{...h,path:y,message:h.message};let w="";const b=f.filter(u=>!!u).slice().reverse();for(const u of b)w=u(v,{data:l,defaultError:w}).message;return{...h,path:y,message:w}},y=[];function addIssueToContext(u,l){const m=(0,f.getErrorMap)(),y=makeIssue({issueData:l,data:u.data,path:u.path,errorMaps:[u.common.contextualErrorMap,u.schemaErrorMap,m,m===h.default?void 0:h.default].filter(u=>!!u)});u.common.issues.push(y)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(u,l){const m=[];for(const f of l){if("aborted"===f.status)return v;"dirty"===f.status&&u.dirty(),m.push(f.value)}return{status:u.value,value:m}}static async mergeObjectAsync(u,l){const m=[];for(const u of l){const l=await u.key,f=await u.value;m.push({key:l,value:f})}return ParseStatus.mergeObjectSync(u,m)}static mergeObjectSync(u,l){const m={};for(const f of l){const{key:l,value:h}=f;if("aborted"===l.status)return v;if("aborted"===h.status)return v;"dirty"===l.status&&u.dirty(),"dirty"===h.status&&u.dirty(),"__proto__"===l.value||void 0===h.value&&!f.alwaysSet||(m[l.value]=h.value)}return{status:u.value,value:m}}}const v=Object.freeze({status:"aborted"}),DIRTY=u=>({status:"dirty",value:u}),OK=u=>({status:"valid",value:u}),isAborted=u=>"aborted"===u.status,isDirty=u=>"dirty"===u.status,isValid=u=>"valid"===u.status,isAsync=u=>"undefined"!=typeof Promise&&u instanceof Promise},"./node_modules/zod/v3/helpers/util.js":function(u,l,m){var f,h;m.r(l),m.d(l,{ZodParsedType:function(){return y},getParsedType:function(){return getParsedType},objectUtil:function(){return h},util:function(){return f}}),function(u){u.assertEqual=u=>{},u.assertIs=function assertIs(u){},u.assertNever=function assertNever(u){throw new Error},u.arrayToEnum=u=>{const l={};for(const m of u)l[m]=m;return l},u.getValidEnumValues=l=>{const m=u.objectKeys(l).filter(u=>"number"!=typeof l[l[u]]),f={};for(const u of m)f[u]=l[u];return u.objectValues(f)},u.objectValues=l=>u.objectKeys(l).map(function(u){return l[u]}),u.objectKeys="function"==typeof Object.keys?u=>Object.keys(u):u=>{const l=[];for(const m in u)Object.prototype.hasOwnProperty.call(u,m)&&l.push(m);return l},u.find=(u,l)=>{for(const m of u)if(l(m))return m},u.isInteger="function"==typeof Number.isInteger?u=>Number.isInteger(u):u=>"number"==typeof u&&Number.isFinite(u)&&Math.floor(u)===u,u.joinValues=function joinValues(u,l=" | "){return u.map(u=>"string"==typeof u?`'${u}'`:u).join(l)},u.jsonStringifyReplacer=(u,l)=>"bigint"==typeof l?l.toString():l}(f||(f={})),function(u){u.mergeShapes=(u,l)=>({...u,...l})}(h||(h={}));const y=f.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=u=>{switch(typeof u){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(u)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(u)?y.array:null===u?y.null:u.then&&"function"==typeof u.then&&u.catch&&"function"==typeof u.catch?y.promise:"undefined"!=typeof Map&&u instanceof Map?y.map:"undefined"!=typeof Set&&u instanceof Set?y.set:"undefined"!=typeof Date&&u instanceof Date?y.date:y.object;default:return y.unknown}}},"./node_modules/zod/v3/locales/en.js":function(u,l,m){m.r(l);var f=m("./node_modules/zod/v3/ZodError.js"),h=m("./node_modules/zod/v3/helpers/util.js");l.default=(u,l)=>{let m;switch(u.code){case f.ZodIssueCode.invalid_type:m=u.received===h.ZodParsedType.undefined?"Required":`Expected ${u.expected}, received ${u.received}`;break;case f.ZodIssueCode.invalid_literal:m=`Invalid literal value, expected ${JSON.stringify(u.expected,h.util.jsonStringifyReplacer)}`;break;case f.ZodIssueCode.unrecognized_keys:m=`Unrecognized key(s) in object: ${h.util.joinValues(u.keys,", ")}`;break;case f.ZodIssueCode.invalid_union:m="Invalid input";break;case f.ZodIssueCode.invalid_union_discriminator:m=`Invalid discriminator value. Expected ${h.util.joinValues(u.options)}`;break;case f.ZodIssueCode.invalid_enum_value:m=`Invalid enum value. Expected ${h.util.joinValues(u.options)}, received '${u.received}'`;break;case f.ZodIssueCode.invalid_arguments:m="Invalid function arguments";break;case f.ZodIssueCode.invalid_return_type:m="Invalid function return type";break;case f.ZodIssueCode.invalid_date:m="Invalid date";break;case f.ZodIssueCode.invalid_string:"object"==typeof u.validation?"includes"in u.validation?(m=`Invalid input: must include "${u.validation.includes}"`,"number"==typeof u.validation.position&&(m=`${m} at one or more positions greater than or equal to ${u.validation.position}`)):"startsWith"in u.validation?m=`Invalid input: must start with "${u.validation.startsWith}"`:"endsWith"in u.validation?m=`Invalid input: must end with "${u.validation.endsWith}"`:h.util.assertNever(u.validation):m="regex"!==u.validation?`Invalid ${u.validation}`:"Invalid";break;case f.ZodIssueCode.too_small:m="array"===u.type?`Array must contain ${u.exact?"exactly":u.inclusive?"at least":"more than"} ${u.minimum} element(s)`:"string"===u.type?`String must contain ${u.exact?"exactly":u.inclusive?"at least":"over"} ${u.minimum} character(s)`:"number"===u.type||"bigint"===u.type?`Number must be ${u.exact?"exactly equal to ":u.inclusive?"greater than or equal to ":"greater than "}${u.minimum}`:"date"===u.type?`Date must be ${u.exact?"exactly equal to ":u.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(u.minimum))}`:"Invalid input";break;case f.ZodIssueCode.too_big:m="array"===u.type?`Array must contain ${u.exact?"exactly":u.inclusive?"at most":"less than"} ${u.maximum} element(s)`:"string"===u.type?`String must contain ${u.exact?"exactly":u.inclusive?"at most":"under"} ${u.maximum} character(s)`:"number"===u.type?`Number must be ${u.exact?"exactly":u.inclusive?"less than or equal to":"less than"} ${u.maximum}`:"bigint"===u.type?`BigInt must be ${u.exact?"exactly":u.inclusive?"less than or equal to":"less than"} ${u.maximum}`:"date"===u.type?`Date must be ${u.exact?"exactly":u.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(u.maximum))}`:"Invalid input";break;case f.ZodIssueCode.custom:m="Invalid input";break;case f.ZodIssueCode.invalid_intersection_types:m="Intersection results could not be merged";break;case f.ZodIssueCode.not_multiple_of:m=`Number must be a multiple of ${u.multipleOf}`;break;case f.ZodIssueCode.not_finite:m="Number must be finite";break;default:m=l.defaultError,h.util.assertNever(u)}return{message:m}}},"./node_modules/zod/v3/types.js":function(u,l,m){m.r(l),m.d(l,{BRAND:function(){return V},NEVER:function(){return xe},Schema:function(){return ZodType},ZodAny:function(){return ZodAny},ZodArray:function(){return ZodArray},ZodBigInt:function(){return ZodBigInt},ZodBoolean:function(){return ZodBoolean},ZodBranded:function(){return ZodBranded},ZodCatch:function(){return ZodCatch},ZodDate:function(){return ZodDate},ZodDefault:function(){return ZodDefault},ZodDiscriminatedUnion:function(){return ZodDiscriminatedUnion},ZodEffects:function(){return ZodEffects},ZodEnum:function(){return ZodEnum},ZodFirstPartyTypeKind:function(){return H},ZodFunction:function(){return ZodFunction},ZodIntersection:function(){return ZodIntersection},ZodLazy:function(){return ZodLazy},ZodLiteral:function(){return ZodLiteral},ZodMap:function(){return ZodMap},ZodNaN:function(){return ZodNaN},ZodNativeEnum:function(){return ZodNativeEnum},ZodNever:function(){return ZodNever},ZodNull:function(){return ZodNull},ZodNullable:function(){return ZodNullable},ZodNumber:function(){return ZodNumber},ZodObject:function(){return ZodObject},ZodOptional:function(){return ZodOptional},ZodPipeline:function(){return ZodPipeline},ZodPromise:function(){return ZodPromise},ZodReadonly:function(){return ZodReadonly},ZodRecord:function(){return ZodRecord},ZodSchema:function(){return ZodType},ZodSet:function(){return ZodSet},ZodString:function(){return ZodString},ZodSymbol:function(){return ZodSymbol},ZodTransformer:function(){return ZodEffects},ZodTuple:function(){return ZodTuple},ZodType:function(){return ZodType},ZodUndefined:function(){return ZodUndefined},ZodUnion:function(){return ZodUnion},ZodUnknown:function(){return ZodUnknown},ZodVoid:function(){return ZodVoid},any:function(){return ne},array:function(){return ie},bigint:function(){return G},boolean:function(){return Q},coerce:function(){return Te},custom:function(){return custom},date:function(){return Y},datetimeRegex:function(){return datetimeRegex},discriminatedUnion:function(){return ue},effect:function(){return ke},enum:function(){return ve},function:function(){return ge},instanceof:function(){return instanceOfType},intersection:function(){return le},late:function(){return K},lazy:function(){return _e},literal:function(){return ye},map:function(){return fe},nan:function(){return W},nativeEnum:function(){return we},never:function(){return oe},null:function(){return te},nullable:function(){return je},number:function(){return J},object:function(){return ae},oboolean:function(){return oboolean},onumber:function(){return onumber},optional:function(){return Se},ostring:function(){return ostring},pipeline:function(){return $e},preprocess:function(){return Pe},promise:function(){return be},record:function(){return me},set:function(){return he},strictObject:function(){return de},string:function(){return B},symbol:function(){return X},transformer:function(){return ke},tuple:function(){return pe},undefined:function(){return ee},union:function(){return ce},unknown:function(){return re},void:function(){return se}});var f=m("./node_modules/zod/v3/ZodError.js"),h=m("./node_modules/zod/v3/errors.js"),y=m("./node_modules/zod/v3/locales/en.js"),v=m("./node_modules/zod/v3/helpers/errorUtil.js"),w=m("./node_modules/zod/v3/helpers/parseUtil.js"),b=m("./node_modules/zod/v3/helpers/util.js");class ParseInputLazyPath{constructor(u,l,m,f){this._cachedPath=[],this.parent=u,this.data=l,this._path=m,this._key=f}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(u,l)=>{if((0,w.isValid)(l))return{success:!0,data:l.value};if(!u.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const l=new f.ZodError(u.common.issues);return this._error=l,this._error}}};function processCreateParams(u){if(!u)return{};const{errorMap:l,invalid_type_error:m,required_error:f,description:h}=u;if(l&&(m||f))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(l)return{errorMap:l,description:h};return{errorMap:(l,h)=>{const{message:y}=u;return"invalid_enum_value"===l.code?{message:y??h.defaultError}:void 0===h.data?{message:y??f??h.defaultError}:"invalid_type"!==l.code?{message:h.defaultError}:{message:y??m??h.defaultError}},description:h}}class ZodType{get description(){return this._def.description}_getType(u){return(0,b.getParsedType)(u.data)}_getOrReturnCtx(u,l){return l||{common:u.parent.common,data:u.data,parsedType:(0,b.getParsedType)(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}_processInputParams(u){return{status:new w.ParseStatus,ctx:{common:u.parent.common,data:u.data,parsedType:(0,b.getParsedType)(u.data),schemaErrorMap:this._def.errorMap,path:u.path,parent:u.parent}}}_parseSync(u){const l=this._parse(u);if((0,w.isAsync)(l))throw new Error("Synchronous parse encountered promise.");return l}_parseAsync(u){const l=this._parse(u);return Promise.resolve(l)}parse(u,l){const m=this.safeParse(u,l);if(m.success)return m.data;throw m.error}safeParse(u,l){const m={common:{issues:[],async:l?.async??!1,contextualErrorMap:l?.errorMap},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:(0,b.getParsedType)(u)},f=this._parseSync({data:u,path:m.path,parent:m});return handleResult(m,f)}"~validate"(u){const l={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:(0,b.getParsedType)(u)};if(!this["~standard"].async)try{const m=this._parseSync({data:u,path:[],parent:l});return(0,w.isValid)(m)?{value:m.value}:{issues:l.common.issues}}catch(u){u?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),l.common={issues:[],async:!0}}return this._parseAsync({data:u,path:[],parent:l}).then(u=>(0,w.isValid)(u)?{value:u.value}:{issues:l.common.issues})}async parseAsync(u,l){const m=await this.safeParseAsync(u,l);if(m.success)return m.data;throw m.error}async safeParseAsync(u,l){const m={common:{issues:[],contextualErrorMap:l?.errorMap,async:!0},path:l?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:u,parsedType:(0,b.getParsedType)(u)},f=this._parse({data:u,path:m.path,parent:m}),h=await((0,w.isAsync)(f)?f:Promise.resolve(f));return handleResult(m,h)}refine(u,l){const getIssueProperties=u=>"string"==typeof l||void 0===l?{message:l}:"function"==typeof l?l(u):l;return this._refinement((l,m)=>{const h=u(l),setError=()=>m.addIssue({code:f.ZodIssueCode.custom,...getIssueProperties(l)});return"undefined"!=typeof Promise&&h instanceof Promise?h.then(u=>!!u||(setError(),!1)):!!h||(setError(),!1)})}refinement(u,l){return this._refinement((m,f)=>!!u(m)||(f.addIssue("function"==typeof l?l(m,f):l),!1))}_refinement(u){return new ZodEffects({schema:this,typeName:H.ZodEffects,effect:{type:"refinement",refinement:u}})}superRefine(u){return this._refinement(u)}constructor(u){this.spa=this.safeParseAsync,this._def=u,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:u=>this["~validate"](u)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(u){return ZodUnion.create([this,u],this._def)}and(u){return ZodIntersection.create(this,u,this._def)}transform(u){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:H.ZodEffects,effect:{type:"transform",transform:u}})}default(u){const l="function"==typeof u?u:()=>u;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:l,typeName:H.ZodDefault})}brand(){return new ZodBranded({typeName:H.ZodBranded,type:this,...processCreateParams(this._def)})}catch(u){const l="function"==typeof u?u:()=>u;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:l,typeName:H.ZodCatch})}describe(u){return new(0,this.constructor)({...this._def,description:u})}pipe(u){return ZodPipeline.create(this,u)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const S=/^c[^\s-]{8,}$/i,j=/^[0-9a-z]+$/,$=/^[0-9A-HJKMNP-TV-Z]{26}$/i,x=/^[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,E=/^[a-z0-9_-]{21}$/i,R=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Z=/^[-+]?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)?)??$/,C=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let z;const A=/^(?:(?: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])$/,O=/^(?:(?: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])$/,D=/^(([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]))$/,N=/^(([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])$/,M=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,U=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,L="((\\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])))",F=new RegExp(`^${L}$`);function timeRegexSource(u){let l="[0-5]\\d";u.precision?l=`${l}\\.\\d{${u.precision}}`:null==u.precision&&(l=`${l}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${l})${u.precision?"+":"?"}`}function timeRegex(u){return new RegExp(`^${timeRegexSource(u)}$`)}function datetimeRegex(u){let l=`${L}T${timeRegexSource(u)}`;const m=[];return m.push(u.local?"Z?":"Z"),u.offset&&m.push("([+-]\\d{2}:?\\d{2})"),l=`${l}(${m.join("|")})`,new RegExp(`^${l}$`)}function isValidIP(u,l){return!("v4"!==l&&l||!A.test(u))||!("v6"!==l&&l||!D.test(u))}function isValidJWT(u,l){if(!R.test(u))return!1;try{const[m]=u.split(".");if(!m)return!1;const f=m.replace(/-/g,"+").replace(/_/g,"/").padEnd(m.length+(4-m.length%4)%4,"="),h=JSON.parse(atob(f));return"object"==typeof h&&null!==h&&((!("typ"in h)||"JWT"===h?.typ)&&(!!h.alg&&(!l||h.alg===l)))}catch{return!1}}function isValidCidr(u,l){return!("v4"!==l&&l||!O.test(u))||!("v6"!==l&&l||!N.test(u))}class ZodString extends ZodType{_parse(u){this._def.coerce&&(u.data=String(u.data));if(this._getType(u)!==b.ZodParsedType.string){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.string,received:l.parsedType}),w.INVALID}const l=new w.ParseStatus;let m;for(const h of this._def.checks)if("min"===h.kind)u.data.length<h.value&&(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),l.dirty());else if("max"===h.kind)u.data.length>h.value&&(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),l.dirty());else if("length"===h.kind){const y=u.data.length>h.value,v=u.data.length<h.value;(y||v)&&(m=this._getOrReturnCtx(u,m),y?(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):v&&(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),l.dirty())}else if("email"===h.kind)C.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"email",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("emoji"===h.kind)z||(z=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),z.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"emoji",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("uuid"===h.kind)x.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"uuid",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("nanoid"===h.kind)E.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"nanoid",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("cuid"===h.kind)S.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"cuid",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("cuid2"===h.kind)j.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"cuid2",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("ulid"===h.kind)$.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"ulid",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty());else if("url"===h.kind)try{new URL(u.data)}catch{m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"url",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()}else if("regex"===h.kind){h.regex.lastIndex=0;h.regex.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"regex",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty())}else if("trim"===h.kind)u.data=u.data.trim();else if("includes"===h.kind)u.data.includes(h.value,h.position)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),l.dirty());else if("toLowerCase"===h.kind)u.data=u.data.toLowerCase();else if("toUpperCase"===h.kind)u.data=u.data.toUpperCase();else if("startsWith"===h.kind)u.data.startsWith(h.value)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:{startsWith:h.value},message:h.message}),l.dirty());else if("endsWith"===h.kind)u.data.endsWith(h.value)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:{endsWith:h.value},message:h.message}),l.dirty());else if("datetime"===h.kind){datetimeRegex(h).test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:"datetime",message:h.message}),l.dirty())}else if("date"===h.kind){F.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:"date",message:h.message}),l.dirty())}else if("time"===h.kind){timeRegex(h).test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_string,validation:"time",message:h.message}),l.dirty())}else"duration"===h.kind?Z.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"duration",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"ip"===h.kind?isValidIP(u.data,h.version)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"ip",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"jwt"===h.kind?isValidJWT(u.data,h.alg)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"jwt",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"cidr"===h.kind?isValidCidr(u.data,h.version)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"cidr",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"base64"===h.kind?M.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"base64",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):"base64url"===h.kind?U.test(u.data)||(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{validation:"base64url",code:f.ZodIssueCode.invalid_string,message:h.message}),l.dirty()):b.util.assertNever(h);return{status:l.value,value:u.data}}_regex(u,l,m){return this.refinement(l=>u.test(l),{validation:l,code:f.ZodIssueCode.invalid_string,...v.errorUtil.errToObj(m)})}_addCheck(u){return new ZodString({...this._def,checks:[...this._def.checks,u]})}email(u){return this._addCheck({kind:"email",...v.errorUtil.errToObj(u)})}url(u){return this._addCheck({kind:"url",...v.errorUtil.errToObj(u)})}emoji(u){return this._addCheck({kind:"emoji",...v.errorUtil.errToObj(u)})}uuid(u){return this._addCheck({kind:"uuid",...v.errorUtil.errToObj(u)})}nanoid(u){return this._addCheck({kind:"nanoid",...v.errorUtil.errToObj(u)})}cuid(u){return this._addCheck({kind:"cuid",...v.errorUtil.errToObj(u)})}cuid2(u){return this._addCheck({kind:"cuid2",...v.errorUtil.errToObj(u)})}ulid(u){return this._addCheck({kind:"ulid",...v.errorUtil.errToObj(u)})}base64(u){return this._addCheck({kind:"base64",...v.errorUtil.errToObj(u)})}base64url(u){return this._addCheck({kind:"base64url",...v.errorUtil.errToObj(u)})}jwt(u){return this._addCheck({kind:"jwt",...v.errorUtil.errToObj(u)})}ip(u){return this._addCheck({kind:"ip",...v.errorUtil.errToObj(u)})}cidr(u){return this._addCheck({kind:"cidr",...v.errorUtil.errToObj(u)})}datetime(u){return"string"==typeof u?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:u}):this._addCheck({kind:"datetime",precision:void 0===u?.precision?null:u?.precision,offset:u?.offset??!1,local:u?.local??!1,...v.errorUtil.errToObj(u?.message)})}date(u){return this._addCheck({kind:"date",message:u})}time(u){return"string"==typeof u?this._addCheck({kind:"time",precision:null,message:u}):this._addCheck({kind:"time",precision:void 0===u?.precision?null:u?.precision,...v.errorUtil.errToObj(u?.message)})}duration(u){return this._addCheck({kind:"duration",...v.errorUtil.errToObj(u)})}regex(u,l){return this._addCheck({kind:"regex",regex:u,...v.errorUtil.errToObj(l)})}includes(u,l){return this._addCheck({kind:"includes",value:u,position:l?.position,...v.errorUtil.errToObj(l?.message)})}startsWith(u,l){return this._addCheck({kind:"startsWith",value:u,...v.errorUtil.errToObj(l)})}endsWith(u,l){return this._addCheck({kind:"endsWith",value:u,...v.errorUtil.errToObj(l)})}min(u,l){return this._addCheck({kind:"min",value:u,...v.errorUtil.errToObj(l)})}max(u,l){return this._addCheck({kind:"max",value:u,...v.errorUtil.errToObj(l)})}length(u,l){return this._addCheck({kind:"length",value:u,...v.errorUtil.errToObj(l)})}nonempty(u){return this.min(1,v.errorUtil.errToObj(u))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(u=>"datetime"===u.kind)}get isDate(){return!!this._def.checks.find(u=>"date"===u.kind)}get isTime(){return!!this._def.checks.find(u=>"time"===u.kind)}get isDuration(){return!!this._def.checks.find(u=>"duration"===u.kind)}get isEmail(){return!!this._def.checks.find(u=>"email"===u.kind)}get isURL(){return!!this._def.checks.find(u=>"url"===u.kind)}get isEmoji(){return!!this._def.checks.find(u=>"emoji"===u.kind)}get isUUID(){return!!this._def.checks.find(u=>"uuid"===u.kind)}get isNANOID(){return!!this._def.checks.find(u=>"nanoid"===u.kind)}get isCUID(){return!!this._def.checks.find(u=>"cuid"===u.kind)}get isCUID2(){return!!this._def.checks.find(u=>"cuid2"===u.kind)}get isULID(){return!!this._def.checks.find(u=>"ulid"===u.kind)}get isIP(){return!!this._def.checks.find(u=>"ip"===u.kind)}get isCIDR(){return!!this._def.checks.find(u=>"cidr"===u.kind)}get isBase64(){return!!this._def.checks.find(u=>"base64"===u.kind)}get isBase64url(){return!!this._def.checks.find(u=>"base64url"===u.kind)}get minLength(){let u=null;for(const l of this._def.checks)"min"===l.kind&&(null===u||l.value>u)&&(u=l.value);return u}get maxLength(){let u=null;for(const l of this._def.checks)"max"===l.kind&&(null===u||l.value<u)&&(u=l.value);return u}}function floatSafeRemainder(u,l){const m=(u.toString().split(".")[1]||"").length,f=(l.toString().split(".")[1]||"").length,h=m>f?m:f;return Number.parseInt(u.toFixed(h).replace(".",""))%Number.parseInt(l.toFixed(h).replace(".",""))/10**h}ZodString.create=u=>new ZodString({checks:[],typeName:H.ZodString,coerce:u?.coerce??!1,...processCreateParams(u)});class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(u){this._def.coerce&&(u.data=Number(u.data));if(this._getType(u)!==b.ZodParsedType.number){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.number,received:l.parsedType}),w.INVALID}let l;const m=new w.ParseStatus;for(const h of this._def.checks)if("int"===h.kind)b.util.isInteger(u.data)||(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:h.message}),m.dirty());else if("min"===h.kind){(h.inclusive?u.data<h.value:u.data<=h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),m.dirty())}else if("max"===h.kind){(h.inclusive?u.data>h.value:u.data>=h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),m.dirty())}else"multipleOf"===h.kind?0!==floatSafeRemainder(u.data,h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.not_multiple_of,multipleOf:h.value,message:h.message}),m.dirty()):"finite"===h.kind?Number.isFinite(u.data)||(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.not_finite,message:h.message}),m.dirty()):b.util.assertNever(h);return{status:m.value,value:u.data}}gte(u,l){return this.setLimit("min",u,!0,v.errorUtil.toString(l))}gt(u,l){return this.setLimit("min",u,!1,v.errorUtil.toString(l))}lte(u,l){return this.setLimit("max",u,!0,v.errorUtil.toString(l))}lt(u,l){return this.setLimit("max",u,!1,v.errorUtil.toString(l))}setLimit(u,l,m,f){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:u,value:l,inclusive:m,message:v.errorUtil.toString(f)}]})}_addCheck(u){return new ZodNumber({...this._def,checks:[...this._def.checks,u]})}int(u){return this._addCheck({kind:"int",message:v.errorUtil.toString(u)})}positive(u){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.errorUtil.toString(u)})}negative(u){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.errorUtil.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.errorUtil.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.errorUtil.toString(u)})}multipleOf(u,l){return this._addCheck({kind:"multipleOf",value:u,message:v.errorUtil.toString(l)})}finite(u){return this._addCheck({kind:"finite",message:v.errorUtil.toString(u)})}safe(u){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.errorUtil.toString(u)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.errorUtil.toString(u)})}get minValue(){let u=null;for(const l of this._def.checks)"min"===l.kind&&(null===u||l.value>u)&&(u=l.value);return u}get maxValue(){let u=null;for(const l of this._def.checks)"max"===l.kind&&(null===u||l.value<u)&&(u=l.value);return u}get isInt(){return!!this._def.checks.find(u=>"int"===u.kind||"multipleOf"===u.kind&&b.util.isInteger(u.value))}get isFinite(){let u=null,l=null;for(const m of this._def.checks){if("finite"===m.kind||"int"===m.kind||"multipleOf"===m.kind)return!0;"min"===m.kind?(null===l||m.value>l)&&(l=m.value):"max"===m.kind&&(null===u||m.value<u)&&(u=m.value)}return Number.isFinite(l)&&Number.isFinite(u)}}ZodNumber.create=u=>new ZodNumber({checks:[],typeName:H.ZodNumber,coerce:u?.coerce||!1,...processCreateParams(u)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(u){if(this._def.coerce)try{u.data=BigInt(u.data)}catch{return this._getInvalidInput(u)}if(this._getType(u)!==b.ZodParsedType.bigint)return this._getInvalidInput(u);let l;const m=new w.ParseStatus;for(const h of this._def.checks)if("min"===h.kind){(h.inclusive?u.data<h.value:u.data<=h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),m.dirty())}else if("max"===h.kind){(h.inclusive?u.data>h.value:u.data>=h.value)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),m.dirty())}else"multipleOf"===h.kind?u.data%h.value!==BigInt(0)&&(l=this._getOrReturnCtx(u,l),(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.not_multiple_of,multipleOf:h.value,message:h.message}),m.dirty()):b.util.assertNever(h);return{status:m.value,value:u.data}}_getInvalidInput(u){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.bigint,received:l.parsedType}),w.INVALID}gte(u,l){return this.setLimit("min",u,!0,v.errorUtil.toString(l))}gt(u,l){return this.setLimit("min",u,!1,v.errorUtil.toString(l))}lte(u,l){return this.setLimit("max",u,!0,v.errorUtil.toString(l))}lt(u,l){return this.setLimit("max",u,!1,v.errorUtil.toString(l))}setLimit(u,l,m,f){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:u,value:l,inclusive:m,message:v.errorUtil.toString(f)}]})}_addCheck(u){return new ZodBigInt({...this._def,checks:[...this._def.checks,u]})}positive(u){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(u)})}negative(u){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.errorUtil.toString(u)})}nonpositive(u){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(u)})}nonnegative(u){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.errorUtil.toString(u)})}multipleOf(u,l){return this._addCheck({kind:"multipleOf",value:u,message:v.errorUtil.toString(l)})}get minValue(){let u=null;for(const l of this._def.checks)"min"===l.kind&&(null===u||l.value>u)&&(u=l.value);return u}get maxValue(){let u=null;for(const l of this._def.checks)"max"===l.kind&&(null===u||l.value<u)&&(u=l.value);return u}}ZodBigInt.create=u=>new ZodBigInt({checks:[],typeName:H.ZodBigInt,coerce:u?.coerce??!1,...processCreateParams(u)});class ZodBoolean extends ZodType{_parse(u){this._def.coerce&&(u.data=Boolean(u.data));if(this._getType(u)!==b.ZodParsedType.boolean){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.boolean,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodBoolean.create=u=>new ZodBoolean({typeName:H.ZodBoolean,coerce:u?.coerce||!1,...processCreateParams(u)});class ZodDate extends ZodType{_parse(u){this._def.coerce&&(u.data=new Date(u.data));if(this._getType(u)!==b.ZodParsedType.date){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.date,received:l.parsedType}),w.INVALID}if(Number.isNaN(u.data.getTime())){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_date}),w.INVALID}const l=new w.ParseStatus;let m;for(const h of this._def.checks)"min"===h.kind?u.data.getTime()<h.value&&(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),l.dirty()):"max"===h.kind?u.data.getTime()>h.value&&(m=this._getOrReturnCtx(u,m),(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),l.dirty()):b.util.assertNever(h);return{status:l.value,value:new Date(u.data.getTime())}}_addCheck(u){return new ZodDate({...this._def,checks:[...this._def.checks,u]})}min(u,l){return this._addCheck({kind:"min",value:u.getTime(),message:v.errorUtil.toString(l)})}max(u,l){return this._addCheck({kind:"max",value:u.getTime(),message:v.errorUtil.toString(l)})}get minDate(){let u=null;for(const l of this._def.checks)"min"===l.kind&&(null===u||l.value>u)&&(u=l.value);return null!=u?new Date(u):null}get maxDate(){let u=null;for(const l of this._def.checks)"max"===l.kind&&(null===u||l.value<u)&&(u=l.value);return null!=u?new Date(u):null}}ZodDate.create=u=>new ZodDate({checks:[],coerce:u?.coerce||!1,typeName:H.ZodDate,...processCreateParams(u)});class ZodSymbol extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.symbol){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.symbol,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodSymbol.create=u=>new ZodSymbol({typeName:H.ZodSymbol,...processCreateParams(u)});class ZodUndefined extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.undefined){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.undefined,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodUndefined.create=u=>new ZodUndefined({typeName:H.ZodUndefined,...processCreateParams(u)});class ZodNull extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.null){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.null,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodNull.create=u=>new ZodNull({typeName:H.ZodNull,...processCreateParams(u)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(u){return(0,w.OK)(u.data)}}ZodAny.create=u=>new ZodAny({typeName:H.ZodAny,...processCreateParams(u)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(u){return(0,w.OK)(u.data)}}ZodUnknown.create=u=>new ZodUnknown({typeName:H.ZodUnknown,...processCreateParams(u)});class ZodNever extends ZodType{_parse(u){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.never,received:l.parsedType}),w.INVALID}}ZodNever.create=u=>new ZodNever({typeName:H.ZodNever,...processCreateParams(u)});class ZodVoid extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.undefined){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.void,received:l.parsedType}),w.INVALID}return(0,w.OK)(u.data)}}ZodVoid.create=u=>new ZodVoid({typeName:H.ZodVoid,...processCreateParams(u)});class ZodArray extends ZodType{_parse(u){const{ctx:l,status:m}=this._processInputParams(u),h=this._def;if(l.parsedType!==b.ZodParsedType.array)return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.array,received:l.parsedType}),w.INVALID;if(null!==h.exactLength){const u=l.data.length>h.exactLength.value,y=l.data.length<h.exactLength.value;(u||y)&&((0,w.addIssueToContext)(l,{code:u?f.ZodIssueCode.too_big:f.ZodIssueCode.too_small,minimum:y?h.exactLength.value:void 0,maximum:u?h.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:h.exactLength.message}),m.dirty())}if(null!==h.minLength&&l.data.length<h.minLength.value&&((0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_small,minimum:h.minLength.value,type:"array",inclusive:!0,exact:!1,message:h.minLength.message}),m.dirty()),null!==h.maxLength&&l.data.length>h.maxLength.value&&((0,w.addIssueToContext)(l,{code:f.ZodIssueCode.too_big,maximum:h.maxLength.value,type:"array",inclusive:!0,exact:!1,message:h.maxLength.message}),m.dirty()),l.common.async)return Promise.all([...l.data].map((u,m)=>h.type._parseAsync(new ParseInputLazyPath(l,u,l.path,m)))).then(u=>w.ParseStatus.mergeArray(m,u));const y=[...l.data].map((u,m)=>h.type._parseSync(new ParseInputLazyPath(l,u,l.path,m)));return w.ParseStatus.mergeArray(m,y)}get element(){return this._def.type}min(u,l){return new ZodArray({...this._def,minLength:{value:u,message:v.errorUtil.toString(l)}})}max(u,l){return new ZodArray({...this._def,maxLength:{value:u,message:v.errorUtil.toString(l)}})}length(u,l){return new ZodArray({...this._def,exactLength:{value:u,message:v.errorUtil.toString(l)}})}nonempty(u){return this.min(1,u)}}function deepPartialify(u){if(u instanceof ZodObject){const l={};for(const m in u.shape){const f=u.shape[m];l[m]=ZodOptional.create(deepPartialify(f))}return new ZodObject({...u._def,shape:()=>l})}return u instanceof ZodArray?new ZodArray({...u._def,type:deepPartialify(u.element)}):u instanceof ZodOptional?ZodOptional.create(deepPartialify(u.unwrap())):u instanceof ZodNullable?ZodNullable.create(deepPartialify(u.unwrap())):u instanceof ZodTuple?ZodTuple.create(u.items.map(u=>deepPartialify(u))):u}ZodArray.create=(u,l)=>new ZodArray({type:u,minLength:null,maxLength:null,exactLength:null,typeName:H.ZodArray,...processCreateParams(l)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const u=this._def.shape(),l=b.util.objectKeys(u);return this._cached={shape:u,keys:l},this._cached}_parse(u){if(this._getType(u)!==b.ZodParsedType.object){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.object,received:l.parsedType}),w.INVALID}const{status:l,ctx:m}=this._processInputParams(u),{shape:h,keys:y}=this._getCached(),v=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const u in m.data)y.includes(u)||v.push(u);const S=[];for(const u of y){const l=h[u],f=m.data[u];S.push({key:{status:"valid",value:u},value:l._parse(new ParseInputLazyPath(m,f,m.path,u)),alwaysSet:u in m.data})}if(this._def.catchall instanceof ZodNever){const u=this._def.unknownKeys;if("passthrough"===u)for(const u of v)S.push({key:{status:"valid",value:u},value:{status:"valid",value:m.data[u]}});else if("strict"===u)v.length>0&&((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.unrecognized_keys,keys:v}),l.dirty());else if("strip"!==u)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const l of v){const f=m.data[l];S.push({key:{status:"valid",value:l},value:u._parse(new ParseInputLazyPath(m,f,m.path,l)),alwaysSet:l in m.data})}}return m.common.async?Promise.resolve().then(async()=>{const u=[];for(const l of S){const m=await l.key,f=await l.value;u.push({key:m,value:f,alwaysSet:l.alwaysSet})}return u}).then(u=>w.ParseStatus.mergeObjectSync(l,u)):w.ParseStatus.mergeObjectSync(l,S)}get shape(){return this._def.shape()}strict(u){return v.errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==u?{errorMap:(l,m)=>{const f=this._def.errorMap?.(l,m).message??m.defaultError;return"unrecognized_keys"===l.code?{message:v.errorUtil.errToObj(u).message??f}:{message:f}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(u){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...u})})}merge(u){return new ZodObject({unknownKeys:u._def.unknownKeys,catchall:u._def.catchall,shape:()=>({...this._def.shape(),...u._def.shape()}),typeName:H.ZodObject})}setKey(u,l){return this.augment({[u]:l})}catchall(u){return new ZodObject({...this._def,catchall:u})}pick(u){const l={};for(const m of b.util.objectKeys(u))u[m]&&this.shape[m]&&(l[m]=this.shape[m]);return new ZodObject({...this._def,shape:()=>l})}omit(u){const l={};for(const m of b.util.objectKeys(this.shape))u[m]||(l[m]=this.shape[m]);return new ZodObject({...this._def,shape:()=>l})}deepPartial(){return deepPartialify(this)}partial(u){const l={};for(const m of b.util.objectKeys(this.shape)){const f=this.shape[m];u&&!u[m]?l[m]=f:l[m]=f.optional()}return new ZodObject({...this._def,shape:()=>l})}required(u){const l={};for(const m of b.util.objectKeys(this.shape))if(u&&!u[m])l[m]=this.shape[m];else{let u=this.shape[m];for(;u instanceof ZodOptional;)u=u._def.innerType;l[m]=u}return new ZodObject({...this._def,shape:()=>l})}keyof(){return createZodEnum(b.util.objectKeys(this.shape))}}ZodObject.create=(u,l)=>new ZodObject({shape:()=>u,unknownKeys:"strip",catchall:ZodNever.create(),typeName:H.ZodObject,...processCreateParams(l)}),ZodObject.strictCreate=(u,l)=>new ZodObject({shape:()=>u,unknownKeys:"strict",catchall:ZodNever.create(),typeName:H.ZodObject,...processCreateParams(l)}),ZodObject.lazycreate=(u,l)=>new ZodObject({shape:u,unknownKeys:"strip",catchall:ZodNever.create(),typeName:H.ZodObject,...processCreateParams(l)});class ZodUnion extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u),m=this._def.options;if(l.common.async)return Promise.all(m.map(async u=>{const m={...l,common:{...l.common,issues:[]},parent:null};return{result:await u._parseAsync({data:l.data,path:l.path,parent:m}),ctx:m}})).then(function handleResults(u){for(const l of u)if("valid"===l.result.status)return l.result;for(const m of u)if("dirty"===m.result.status)return l.common.issues.push(...m.ctx.common.issues),m.result;const m=u.map(u=>new f.ZodError(u.ctx.common.issues));return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_union,unionErrors:m}),w.INVALID});{let u;const h=[];for(const f of m){const m={...l,common:{...l.common,issues:[]},parent:null},y=f._parseSync({data:l.data,path:l.path,parent:m});if("valid"===y.status)return y;"dirty"!==y.status||u||(u={result:y,ctx:m}),m.common.issues.length&&h.push(m.common.issues)}if(u)return l.common.issues.push(...u.ctx.common.issues),u.result;const y=h.map(u=>new f.ZodError(u));return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_union,unionErrors:y}),w.INVALID}}get options(){return this._def.options}}ZodUnion.create=(u,l)=>new ZodUnion({options:u,typeName:H.ZodUnion,...processCreateParams(l)});const getDiscriminator=u=>u instanceof ZodLazy?getDiscriminator(u.schema):u instanceof ZodEffects?getDiscriminator(u.innerType()):u instanceof ZodLiteral?[u.value]:u instanceof ZodEnum?u.options:u instanceof ZodNativeEnum?b.util.objectValues(u.enum):u instanceof ZodDefault?getDiscriminator(u._def.innerType):u instanceof ZodUndefined?[void 0]:u instanceof ZodNull?[null]:u instanceof ZodOptional?[void 0,...getDiscriminator(u.unwrap())]:u instanceof ZodNullable?[null,...getDiscriminator(u.unwrap())]:u instanceof ZodBranded||u instanceof ZodReadonly?getDiscriminator(u.unwrap()):u instanceof ZodCatch?getDiscriminator(u._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u);if(l.parsedType!==b.ZodParsedType.object)return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.object,received:l.parsedType}),w.INVALID;const m=this.discriminator,h=l.data[m],y=this.optionsMap.get(h);return y?l.common.async?y._parseAsync({data:l.data,path:l.path,parent:l}):y._parseSync({data:l.data,path:l.path,parent:l}):((0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[m]}),w.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(u,l,m){const f=new Map;for(const m of l){const l=getDiscriminator(m.shape[u]);if(!l.length)throw new Error(`A discriminator value for key \`${u}\` could not be extracted from all schema options`);for(const h of l){if(f.has(h))throw new Error(`Discriminator property ${String(u)} has duplicate value ${String(h)}`);f.set(h,m)}}return new ZodDiscriminatedUnion({typeName:H.ZodDiscriminatedUnion,discriminator:u,options:l,optionsMap:f,...processCreateParams(m)})}}function mergeValues(u,l){const m=(0,b.getParsedType)(u),f=(0,b.getParsedType)(l);if(u===l)return{valid:!0,data:u};if(m===b.ZodParsedType.object&&f===b.ZodParsedType.object){const m=b.util.objectKeys(l),f=b.util.objectKeys(u).filter(u=>-1!==m.indexOf(u)),h={...u,...l};for(const m of f){const f=mergeValues(u[m],l[m]);if(!f.valid)return{valid:!1};h[m]=f.data}return{valid:!0,data:h}}if(m===b.ZodParsedType.array&&f===b.ZodParsedType.array){if(u.length!==l.length)return{valid:!1};const m=[];for(let f=0;f<u.length;f++){const h=mergeValues(u[f],l[f]);if(!h.valid)return{valid:!1};m.push(h.data)}return{valid:!0,data:m}}return m===b.ZodParsedType.date&&f===b.ZodParsedType.date&&+u===+l?{valid:!0,data:u}:{valid:!1}}class ZodIntersection extends ZodType{_parse(u){const{status:l,ctx:m}=this._processInputParams(u),handleParsed=(u,h)=>{if((0,w.isAborted)(u)||(0,w.isAborted)(h))return w.INVALID;const y=mergeValues(u.value,h.value);return y.valid?(((0,w.isDirty)(u)||(0,w.isDirty)(h))&&l.dirty(),{status:l.value,value:y.data}):((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_intersection_types}),w.INVALID)};return m.common.async?Promise.all([this._def.left._parseAsync({data:m.data,path:m.path,parent:m}),this._def.right._parseAsync({data:m.data,path:m.path,parent:m})]).then(([u,l])=>handleParsed(u,l)):handleParsed(this._def.left._parseSync({data:m.data,path:m.path,parent:m}),this._def.right._parseSync({data:m.data,path:m.path,parent:m}))}}ZodIntersection.create=(u,l,m)=>new ZodIntersection({left:u,right:l,typeName:H.ZodIntersection,...processCreateParams(m)});class ZodTuple extends ZodType{_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.parsedType!==b.ZodParsedType.array)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.array,received:m.parsedType}),w.INVALID;if(m.data.length<this._def.items.length)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w.INVALID;!this._def.rest&&m.data.length>this._def.items.length&&((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),l.dirty());const h=[...m.data].map((u,l)=>{const f=this._def.items[l]||this._def.rest;return f?f._parse(new ParseInputLazyPath(m,u,m.path,l)):null}).filter(u=>!!u);return m.common.async?Promise.all(h).then(u=>w.ParseStatus.mergeArray(l,u)):w.ParseStatus.mergeArray(l,h)}get items(){return this._def.items}rest(u){return new ZodTuple({...this._def,rest:u})}}ZodTuple.create=(u,l)=>{if(!Array.isArray(u))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:u,typeName:H.ZodTuple,rest:null,...processCreateParams(l)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.parsedType!==b.ZodParsedType.object)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.object,received:m.parsedType}),w.INVALID;const h=[],y=this._def.keyType,v=this._def.valueType;for(const u in m.data)h.push({key:y._parse(new ParseInputLazyPath(m,u,m.path,u)),value:v._parse(new ParseInputLazyPath(m,m.data[u],m.path,u)),alwaysSet:u in m.data});return m.common.async?w.ParseStatus.mergeObjectAsync(l,h):w.ParseStatus.mergeObjectSync(l,h)}get element(){return this._def.valueType}static create(u,l,m){return new ZodRecord(l instanceof ZodType?{keyType:u,valueType:l,typeName:H.ZodRecord,...processCreateParams(m)}:{keyType:ZodString.create(),valueType:u,typeName:H.ZodRecord,...processCreateParams(l)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.parsedType!==b.ZodParsedType.map)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.map,received:m.parsedType}),w.INVALID;const h=this._def.keyType,y=this._def.valueType,v=[...m.data.entries()].map(([u,l],f)=>({key:h._parse(new ParseInputLazyPath(m,u,m.path,[f,"key"])),value:y._parse(new ParseInputLazyPath(m,l,m.path,[f,"value"]))}));if(m.common.async){const u=new Map;return Promise.resolve().then(async()=>{for(const m of v){const f=await m.key,h=await m.value;if("aborted"===f.status||"aborted"===h.status)return w.INVALID;"dirty"!==f.status&&"dirty"!==h.status||l.dirty(),u.set(f.value,h.value)}return{status:l.value,value:u}})}{const u=new Map;for(const m of v){const f=m.key,h=m.value;if("aborted"===f.status||"aborted"===h.status)return w.INVALID;"dirty"!==f.status&&"dirty"!==h.status||l.dirty(),u.set(f.value,h.value)}return{status:l.value,value:u}}}}ZodMap.create=(u,l,m)=>new ZodMap({valueType:l,keyType:u,typeName:H.ZodMap,...processCreateParams(m)});class ZodSet extends ZodType{_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.parsedType!==b.ZodParsedType.set)return(0,w.addIssueToContext)(m,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.set,received:m.parsedType}),w.INVALID;const h=this._def;null!==h.minSize&&m.data.size<h.minSize.value&&((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_small,minimum:h.minSize.value,type:"set",inclusive:!0,exact:!1,message:h.minSize.message}),l.dirty()),null!==h.maxSize&&m.data.size>h.maxSize.value&&((0,w.addIssueToContext)(m,{code:f.ZodIssueCode.too_big,maximum:h.maxSize.value,type:"set",inclusive:!0,exact:!1,message:h.maxSize.message}),l.dirty());const y=this._def.valueType;function finalizeSet(u){const m=new Set;for(const f of u){if("aborted"===f.status)return w.INVALID;"dirty"===f.status&&l.dirty(),m.add(f.value)}return{status:l.value,value:m}}const v=[...m.data.values()].map((u,l)=>y._parse(new ParseInputLazyPath(m,u,m.path,l)));return m.common.async?Promise.all(v).then(u=>finalizeSet(u)):finalizeSet(v)}min(u,l){return new ZodSet({...this._def,minSize:{value:u,message:v.errorUtil.toString(l)}})}max(u,l){return new ZodSet({...this._def,maxSize:{value:u,message:v.errorUtil.toString(l)}})}size(u,l){return this.min(u,l).max(u,l)}nonempty(u){return this.min(1,u)}}ZodSet.create=(u,l)=>new ZodSet({valueType:u,minSize:null,maxSize:null,typeName:H.ZodSet,...processCreateParams(l)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(u){const{ctx:l}=this._processInputParams(u);if(l.parsedType!==b.ZodParsedType.function)return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.function,received:l.parsedType}),w.INVALID;function makeArgsIssue(u,m){return(0,w.makeIssue)({data:u,path:l.path,errorMaps:[l.common.contextualErrorMap,l.schemaErrorMap,(0,h.getErrorMap)(),y.default].filter(u=>!!u),issueData:{code:f.ZodIssueCode.invalid_arguments,argumentsError:m}})}function makeReturnsIssue(u,m){return(0,w.makeIssue)({data:u,path:l.path,errorMaps:[l.common.contextualErrorMap,l.schemaErrorMap,(0,h.getErrorMap)(),y.default].filter(u=>!!u),issueData:{code:f.ZodIssueCode.invalid_return_type,returnTypeError:m}})}const m={errorMap:l.common.contextualErrorMap},v=l.data;if(this._def.returns instanceof ZodPromise){const u=this;return(0,w.OK)(async function(...l){const h=new f.ZodError([]),y=await u._def.args.parseAsync(l,m).catch(u=>{throw h.addIssue(makeArgsIssue(l,u)),h}),w=await Reflect.apply(v,this,y);return await u._def.returns._def.type.parseAsync(w,m).catch(u=>{throw h.addIssue(makeReturnsIssue(w,u)),h})})}{const u=this;return(0,w.OK)(function(...l){const h=u._def.args.safeParse(l,m);if(!h.success)throw new f.ZodError([makeArgsIssue(l,h.error)]);const y=Reflect.apply(v,this,h.data),w=u._def.returns.safeParse(y,m);if(!w.success)throw new f.ZodError([makeReturnsIssue(y,w.error)]);return w.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...u){return new ZodFunction({...this._def,args:ZodTuple.create(u).rest(ZodUnknown.create())})}returns(u){return new ZodFunction({...this._def,returns:u})}implement(u){return this.parse(u)}strictImplement(u){return this.parse(u)}static create(u,l,m){return new ZodFunction({args:u||ZodTuple.create([]).rest(ZodUnknown.create()),returns:l||ZodUnknown.create(),typeName:H.ZodFunction,...processCreateParams(m)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(u){const{ctx:l}=this._processInputParams(u);return this._def.getter()._parse({data:l.data,path:l.path,parent:l})}}ZodLazy.create=(u,l)=>new ZodLazy({getter:u,typeName:H.ZodLazy,...processCreateParams(l)});class ZodLiteral extends ZodType{_parse(u){if(u.data!==this._def.value){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{received:l.data,code:f.ZodIssueCode.invalid_literal,expected:this._def.value}),w.INVALID}return{status:"valid",value:u.data}}get value(){return this._def.value}}function createZodEnum(u,l){return new ZodEnum({values:u,typeName:H.ZodEnum,...processCreateParams(l)})}ZodLiteral.create=(u,l)=>new ZodLiteral({value:u,typeName:H.ZodLiteral,...processCreateParams(l)});class ZodEnum extends ZodType{_parse(u){if("string"!=typeof u.data){const l=this._getOrReturnCtx(u),m=this._def.values;return(0,w.addIssueToContext)(l,{expected:b.util.joinValues(m),received:l.parsedType,code:f.ZodIssueCode.invalid_type}),w.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(u.data)){const l=this._getOrReturnCtx(u),m=this._def.values;return(0,w.addIssueToContext)(l,{received:l.data,code:f.ZodIssueCode.invalid_enum_value,options:m}),w.INVALID}return(0,w.OK)(u.data)}get options(){return this._def.values}get enum(){const u={};for(const l of this._def.values)u[l]=l;return u}get Values(){const u={};for(const l of this._def.values)u[l]=l;return u}get Enum(){const u={};for(const l of this._def.values)u[l]=l;return u}extract(u,l=this._def){return ZodEnum.create(u,{...this._def,...l})}exclude(u,l=this._def){return ZodEnum.create(this.options.filter(l=>!u.includes(l)),{...this._def,...l})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(u){const l=b.util.getValidEnumValues(this._def.values),m=this._getOrReturnCtx(u);if(m.parsedType!==b.ZodParsedType.string&&m.parsedType!==b.ZodParsedType.number){const u=b.util.objectValues(l);return(0,w.addIssueToContext)(m,{expected:b.util.joinValues(u),received:m.parsedType,code:f.ZodIssueCode.invalid_type}),w.INVALID}if(this._cache||(this._cache=new Set(b.util.getValidEnumValues(this._def.values))),!this._cache.has(u.data)){const u=b.util.objectValues(l);return(0,w.addIssueToContext)(m,{received:m.data,code:f.ZodIssueCode.invalid_enum_value,options:u}),w.INVALID}return(0,w.OK)(u.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(u,l)=>new ZodNativeEnum({values:u,typeName:H.ZodNativeEnum,...processCreateParams(l)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(u){const{ctx:l}=this._processInputParams(u);if(l.parsedType!==b.ZodParsedType.promise&&!1===l.common.async)return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.promise,received:l.parsedType}),w.INVALID;const m=l.parsedType===b.ZodParsedType.promise?l.data:Promise.resolve(l.data);return(0,w.OK)(m.then(u=>this._def.type.parseAsync(u,{path:l.path,errorMap:l.common.contextualErrorMap})))}}ZodPromise.create=(u,l)=>new ZodPromise({type:u,typeName:H.ZodPromise,...processCreateParams(l)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===H.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(u){const{status:l,ctx:m}=this._processInputParams(u),f=this._def.effect||null,h={addIssue:u=>{(0,w.addIssueToContext)(m,u),u.fatal?l.abort():l.dirty()},get path(){return m.path}};if(h.addIssue=h.addIssue.bind(h),"preprocess"===f.type){const u=f.transform(m.data,h);if(m.common.async)return Promise.resolve(u).then(async u=>{if("aborted"===l.value)return w.INVALID;const f=await this._def.schema._parseAsync({data:u,path:m.path,parent:m});return"aborted"===f.status?w.INVALID:"dirty"===f.status||"dirty"===l.value?(0,w.DIRTY)(f.value):f});{if("aborted"===l.value)return w.INVALID;const f=this._def.schema._parseSync({data:u,path:m.path,parent:m});return"aborted"===f.status?w.INVALID:"dirty"===f.status||"dirty"===l.value?(0,w.DIRTY)(f.value):f}}if("refinement"===f.type){const executeRefinement=u=>{const l=f.refinement(u,h);if(m.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(!1===m.common.async){const u=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});return"aborted"===u.status?w.INVALID:("dirty"===u.status&&l.dirty(),executeRefinement(u.value),{status:l.value,value:u.value})}return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(u=>"aborted"===u.status?w.INVALID:("dirty"===u.status&&l.dirty(),executeRefinement(u.value).then(()=>({status:l.value,value:u.value}))))}if("transform"===f.type){if(!1===m.common.async){const u=this._def.schema._parseSync({data:m.data,path:m.path,parent:m});if(!(0,w.isValid)(u))return w.INVALID;const y=f.transform(u.value,h);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:l.value,value:y}}return this._def.schema._parseAsync({data:m.data,path:m.path,parent:m}).then(u=>(0,w.isValid)(u)?Promise.resolve(f.transform(u.value,h)).then(u=>({status:l.value,value:u})):w.INVALID)}b.util.assertNever(f)}}ZodEffects.create=(u,l,m)=>new ZodEffects({schema:u,typeName:H.ZodEffects,effect:l,...processCreateParams(m)}),ZodEffects.createWithPreprocess=(u,l,m)=>new ZodEffects({schema:l,effect:{type:"preprocess",transform:u},typeName:H.ZodEffects,...processCreateParams(m)});class ZodOptional extends ZodType{_parse(u){return this._getType(u)===b.ZodParsedType.undefined?(0,w.OK)(void 0):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}ZodOptional.create=(u,l)=>new ZodOptional({innerType:u,typeName:H.ZodOptional,...processCreateParams(l)});class ZodNullable extends ZodType{_parse(u){return this._getType(u)===b.ZodParsedType.null?(0,w.OK)(null):this._def.innerType._parse(u)}unwrap(){return this._def.innerType}}ZodNullable.create=(u,l)=>new ZodNullable({innerType:u,typeName:H.ZodNullable,...processCreateParams(l)});class ZodDefault extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u);let m=l.data;return l.parsedType===b.ZodParsedType.undefined&&(m=this._def.defaultValue()),this._def.innerType._parse({data:m,path:l.path,parent:l})}removeDefault(){return this._def.innerType}}ZodDefault.create=(u,l)=>new ZodDefault({innerType:u,typeName:H.ZodDefault,defaultValue:"function"==typeof l.default?l.default:()=>l.default,...processCreateParams(l)});class ZodCatch extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u),m={...l,common:{...l.common,issues:[]}},h=this._def.innerType._parse({data:m.data,path:m.path,parent:{...m}});return(0,w.isAsync)(h)?h.then(u=>({status:"valid",value:"valid"===u.status?u.value:this._def.catchValue({get error(){return new f.ZodError(m.common.issues)},input:m.data})})):{status:"valid",value:"valid"===h.status?h.value:this._def.catchValue({get error(){return new f.ZodError(m.common.issues)},input:m.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(u,l)=>new ZodCatch({innerType:u,typeName:H.ZodCatch,catchValue:"function"==typeof l.catch?l.catch:()=>l.catch,...processCreateParams(l)});class ZodNaN extends ZodType{_parse(u){if(this._getType(u)!==b.ZodParsedType.nan){const l=this._getOrReturnCtx(u);return(0,w.addIssueToContext)(l,{code:f.ZodIssueCode.invalid_type,expected:b.ZodParsedType.nan,received:l.parsedType}),w.INVALID}return{status:"valid",value:u.data}}}ZodNaN.create=u=>new ZodNaN({typeName:H.ZodNaN,...processCreateParams(u)});const V=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(u){const{ctx:l}=this._processInputParams(u),m=l.data;return this._def.type._parse({data:m,path:l.path,parent:l})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(u){const{status:l,ctx:m}=this._processInputParams(u);if(m.common.async){return(async()=>{const u=await this._def.in._parseAsync({data:m.data,path:m.path,parent:m});return"aborted"===u.status?w.INVALID:"dirty"===u.status?(l.dirty(),(0,w.DIRTY)(u.value)):this._def.out._parseAsync({data:u.value,path:m.path,parent:m})})()}{const u=this._def.in._parseSync({data:m.data,path:m.path,parent:m});return"aborted"===u.status?w.INVALID:"dirty"===u.status?(l.dirty(),{status:"dirty",value:u.value}):this._def.out._parseSync({data:u.value,path:m.path,parent:m})}}static create(u,l){return new ZodPipeline({in:u,out:l,typeName:H.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(u){const l=this._def.innerType._parse(u),freeze=u=>((0,w.isValid)(u)&&(u.value=Object.freeze(u.value)),u);return(0,w.isAsync)(l)?l.then(u=>freeze(u)):freeze(l)}unwrap(){return this._def.innerType}}function cleanParams(u,l){const m="function"==typeof u?u(l):"string"==typeof u?{message:u}:u;return"string"==typeof m?{message:m}:m}function custom(u,l={},m){return u?ZodAny.create().superRefine((f,h)=>{const y=u(f);if(y instanceof Promise)return y.then(u=>{if(!u){const u=cleanParams(l,f),y=u.fatal??m??!0;h.addIssue({code:"custom",...u,fatal:y})}});if(!y){const u=cleanParams(l,f),y=u.fatal??m??!0;h.addIssue({code:"custom",...u,fatal:y})}}):ZodAny.create()}ZodReadonly.create=(u,l)=>new ZodReadonly({innerType:u,typeName:H.ZodReadonly,...processCreateParams(l)});const K={object:ZodObject.lazycreate};var H;!function(u){u.ZodString="ZodString",u.ZodNumber="ZodNumber",u.ZodNaN="ZodNaN",u.ZodBigInt="ZodBigInt",u.ZodBoolean="ZodBoolean",u.ZodDate="ZodDate",u.ZodSymbol="ZodSymbol",u.ZodUndefined="ZodUndefined",u.ZodNull="ZodNull",u.ZodAny="ZodAny",u.ZodUnknown="ZodUnknown",u.ZodNever="ZodNever",u.ZodVoid="ZodVoid",u.ZodArray="ZodArray",u.ZodObject="ZodObject",u.ZodUnion="ZodUnion",u.ZodDiscriminatedUnion="ZodDiscriminatedUnion",u.ZodIntersection="ZodIntersection",u.ZodTuple="ZodTuple",u.ZodRecord="ZodRecord",u.ZodMap="ZodMap",u.ZodSet="ZodSet",u.ZodFunction="ZodFunction",u.ZodLazy="ZodLazy",u.ZodLiteral="ZodLiteral",u.ZodEnum="ZodEnum",u.ZodEffects="ZodEffects",u.ZodNativeEnum="ZodNativeEnum",u.ZodOptional="ZodOptional",u.ZodNullable="ZodNullable",u.ZodDefault="ZodDefault",u.ZodCatch="ZodCatch",u.ZodPromise="ZodPromise",u.ZodBranded="ZodBranded",u.ZodPipeline="ZodPipeline",u.ZodReadonly="ZodReadonly"}(H||(H={}));const instanceOfType=(u,l={message:`Input not instance of ${u.name}`})=>custom(l=>l instanceof u,l),B=ZodString.create,J=ZodNumber.create,W=ZodNaN.create,G=ZodBigInt.create,Q=ZodBoolean.create,Y=ZodDate.create,X=ZodSymbol.create,ee=ZodUndefined.create,te=ZodNull.create,ne=ZodAny.create,re=ZodUnknown.create,oe=ZodNever.create,se=ZodVoid.create,ie=ZodArray.create,ae=ZodObject.create,de=ZodObject.strictCreate,ce=ZodUnion.create,ue=ZodDiscriminatedUnion.create,le=ZodIntersection.create,pe=ZodTuple.create,me=ZodRecord.create,fe=ZodMap.create,he=ZodSet.create,ge=ZodFunction.create,_e=ZodLazy.create,ye=ZodLiteral.create,ve=ZodEnum.create,we=ZodNativeEnum.create,be=ZodPromise.create,ke=ZodEffects.create,Se=ZodOptional.create,je=ZodNullable.create,Pe=ZodEffects.createWithPreprocess,$e=ZodPipeline.create,ostring=()=>B().optional(),onumber=()=>J().optional(),oboolean=()=>Q().optional(),Te={string:u=>ZodString.create({...u,coerce:!0}),number:u=>ZodNumber.create({...u,coerce:!0}),boolean:u=>ZodBoolean.create({...u,coerce:!0}),bigint:u=>ZodBigInt.create({...u,coerce:!0}),date:u=>ZodDate.create({...u,coerce:!0})},xe=w.INVALID},"./node_modules/zod/v4/classic/errors.js":function(u,l,m){m.r(l),m.d(l,{ZodError:function(){return y},ZodRealError:function(){return v}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/errors.js");const initializer=(u,l)=>{h.$ZodError.init(u,l),u.name="ZodError",Object.defineProperties(u,{format:{value:l=>h.formatError(u,l)},flatten:{value:l=>h.flattenError(u,l)},addIssue:{value:l=>u.issues.push(l)},addIssues:{value:l=>u.issues.push(...l)},isEmpty:{get(){return 0===u.issues.length}}})},y=f.$constructor("ZodError",initializer),v=f.$constructor("ZodError",initializer,{Parent:Error})},"./node_modules/zod/v4/classic/iso.js":function(u,l,m){m.r(l),m.d(l,{ZodISODate:function(){return b},ZodISODateTime:function(){return w},ZodISODuration:function(){return j},ZodISOTime:function(){return S},date:function(){return date},datetime:function(){return datetime},duration:function(){return duration},time:function(){return time}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/schemas.js"),y=m("./node_modules/zod/v4/core/api.js"),v=m("./node_modules/zod/v4/classic/schemas.js");const w=f.$constructor("ZodISODateTime",(u,l)=>{h.$ZodISODateTime.init(u,l),v.ZodStringFormat.init(u,l)});function datetime(u){return y._isoDateTime(w,u)}const b=f.$constructor("ZodISODate",(u,l)=>{h.$ZodISODate.init(u,l),v.ZodStringFormat.init(u,l)});function date(u){return y._isoDate(b,u)}const S=f.$constructor("ZodISOTime",(u,l)=>{h.$ZodISOTime.init(u,l),v.ZodStringFormat.init(u,l)});function time(u){return y._isoTime(S,u)}const j=f.$constructor("ZodISODuration",(u,l)=>{h.$ZodISODuration.init(u,l),v.ZodStringFormat.init(u,l)});function duration(u){return y._isoDuration(j,u)}},"./node_modules/zod/v4/classic/parse.js":function(u,l,m){m.r(l),m.d(l,{parse:function(){return y},parseAsync:function(){return v},safeParse:function(){return w},safeParseAsync:function(){return b}});var f=m("./node_modules/zod/v4/core/parse.js"),h=m("./node_modules/zod/v4/classic/errors.js");const y=f._parse(h.ZodRealError),v=f._parseAsync(h.ZodRealError),w=f._safeParse(h.ZodRealError),b=f._safeParseAsync(h.ZodRealError)},"./node_modules/zod/v4/classic/schemas.js":function(u,l,m){m.r(l),m.d(l,{ZodAny:function(){return ae},ZodArray:function(){return pe},ZodBase64:function(){return J},ZodBase64URL:function(){return W},ZodBigInt:function(){return ne},ZodBigIntFormat:function(){return re},ZodBoolean:function(){return te},ZodCIDRv4:function(){return H},ZodCIDRv6:function(){return B},ZodCUID:function(){return N},ZodCUID2:function(){return M},ZodCatch:function(){return Re},ZodCustom:function(){return Ne},ZodCustomStringFormat:function(){return Y},ZodDate:function(){return le},ZodDefault:function(){return Te},ZodDiscriminatedUnion:function(){return he},ZodE164:function(){return G},ZodEmail:function(){return Z},ZodEmoji:function(){return O},ZodEnum:function(){return be},ZodFile:function(){return Se},ZodGUID:function(){return C},ZodIPv4:function(){return V},ZodIPv6:function(){return K},ZodIntersection:function(){return ge},ZodJWT:function(){return Q},ZodKSUID:function(){return F},ZodLazy:function(){return Oe},ZodLiteral:function(){return ke},ZodMap:function(){return ve},ZodNaN:function(){return Ze},ZodNanoID:function(){return D},ZodNever:function(){return ce},ZodNonOptional:function(){return Ee},ZodNull:function(){return ie},ZodNullable:function(){return $e},ZodNumber:function(){return X},ZodNumberFormat:function(){return ee},ZodObject:function(){return me},ZodOptional:function(){return Pe},ZodPipe:function(){return Ce},ZodPrefault:function(){return xe},ZodPromise:function(){return De},ZodReadonly:function(){return ze},ZodRecord:function(){return ye},ZodSet:function(){return we},ZodString:function(){return E},ZodStringFormat:function(){return R},ZodSuccess:function(){return Ie},ZodSymbol:function(){return oe},ZodTemplateLiteral:function(){return Ae},ZodTransform:function(){return je},ZodTuple:function(){return _e},ZodType:function(){return $},ZodULID:function(){return U},ZodURL:function(){return A},ZodUUID:function(){return z},ZodUndefined:function(){return se},ZodUnion:function(){return fe},ZodUnknown:function(){return de},ZodVoid:function(){return ue},ZodXID:function(){return L},_ZodString:function(){return x},_default:function(){return _default},any:function(){return any},array:function(){return array},base64:function(){return base64},base64url:function(){return base64url},bigint:function(){return bigint},boolean:function(){return boolean},catch:function(){return _catch},check:function(){return check},cidrv4:function(){return cidrv4},cidrv6:function(){return cidrv6},cuid:function(){return cuid},cuid2:function(){return cuid2},custom:function(){return custom},date:function(){return date},discriminatedUnion:function(){return discriminatedUnion},e164:function(){return e164},email:function(){return email},emoji:function(){return emoji},enum:function(){return _enum},file:function(){return file},float32:function(){return float32},float64:function(){return float64},guid:function(){return guid},instanceof:function(){return _instanceof},int:function(){return int},int32:function(){return int32},int64:function(){return int64},intersection:function(){return intersection},ipv4:function(){return ipv4},ipv6:function(){return ipv6},json:function(){return json},jwt:function(){return jwt},keyof:function(){return keyof},ksuid:function(){return ksuid},lazy:function(){return lazy},literal:function(){return literal},looseObject:function(){return looseObject},map:function(){return map},nan:function(){return nan},nanoid:function(){return nanoid},nativeEnum:function(){return nativeEnum},never:function(){return never},nonoptional:function(){return nonoptional},null:function(){return _null},nullable:function(){return nullable},nullish:function(){return nullish},number:function(){return number},object:function(){return object},optional:function(){return optional},partialRecord:function(){return partialRecord},pipe:function(){return pipe},prefault:function(){return prefault},preprocess:function(){return preprocess},promise:function(){return promise},readonly:function(){return readonly},record:function(){return record},refine:function(){return refine},set:function(){return set},strictObject:function(){return strictObject},string:function(){return string},stringFormat:function(){return stringFormat},stringbool:function(){return stringbool},success:function(){return success},superRefine:function(){return superRefine},symbol:function(){return symbol},templateLiteral:function(){return templateLiteral},transform:function(){return transform},tuple:function(){return tuple},uint32:function(){return uint32},uint64:function(){return uint64},ulid:function(){return ulid},undefined:function(){return _undefined},union:function(){return union},unknown:function(){return unknown},url:function(){return url},uuid:function(){return uuid},uuidv4:function(){return uuidv4},uuidv6:function(){return uuidv6},uuidv7:function(){return uuidv7},void:function(){return _void},xid:function(){return xid}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/schemas.js"),y=m("./node_modules/zod/v4/core/checks.js"),v=m("./node_modules/zod/v4/core/util.js"),w=m("./node_modules/zod/v4/core/registries.js"),b=m("./node_modules/zod/v4/core/api.js"),S=m("./node_modules/zod/v4/classic/iso.js"),j=m("./node_modules/zod/v4/classic/parse.js");const $=f.$constructor("ZodType",(u,l)=>(h.$ZodType.init(u,l),u.def=l,Object.defineProperty(u,"_def",{value:l}),u.check=(...m)=>u.clone({...l,checks:[...l.checks??[],...m.map(u=>"function"==typeof u?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),u.clone=(l,m)=>v.clone(u,l,m),u.brand=()=>u,u.register=(l,m)=>(l.add(u,m),u),u.parse=(l,m)=>j.parse(u,l,m,{callee:u.parse}),u.safeParse=(l,m)=>j.safeParse(u,l,m),u.parseAsync=async(l,m)=>j.parseAsync(u,l,m,{callee:u.parseAsync}),u.safeParseAsync=async(l,m)=>j.safeParseAsync(u,l,m),u.spa=u.safeParseAsync,u.refine=(l,m)=>u.check(refine(l,m)),u.superRefine=l=>u.check(superRefine(l)),u.overwrite=l=>u.check(b._overwrite(l)),u.optional=()=>optional(u),u.nullable=()=>nullable(u),u.nullish=()=>optional(nullable(u)),u.nonoptional=l=>nonoptional(u,l),u.array=()=>array(u),u.or=l=>union([u,l]),u.and=l=>intersection(u,l),u.transform=l=>pipe(u,transform(l)),u.default=l=>_default(u,l),u.prefault=l=>prefault(u,l),u.catch=l=>_catch(u,l),u.pipe=l=>pipe(u,l),u.readonly=()=>readonly(u),u.describe=l=>{const m=u.clone();return w.globalRegistry.add(m,{description:l}),m},Object.defineProperty(u,"description",{get(){return w.globalRegistry.get(u)?.description},configurable:!0}),u.meta=(...l)=>{if(0===l.length)return w.globalRegistry.get(u);const m=u.clone();return w.globalRegistry.add(m,l[0]),m},u.isOptional=()=>u.safeParse(void 0).success,u.isNullable=()=>u.safeParse(null).success,u)),x=f.$constructor("_ZodString",(u,l)=>{h.$ZodString.init(u,l),$.init(u,l);const m=u._zod.bag;u.format=m.format??null,u.minLength=m.minimum??null,u.maxLength=m.maximum??null,u.regex=(...l)=>u.check(b._regex(...l)),u.includes=(...l)=>u.check(b._includes(...l)),u.startsWith=(...l)=>u.check(b._startsWith(...l)),u.endsWith=(...l)=>u.check(b._endsWith(...l)),u.min=(...l)=>u.check(b._minLength(...l)),u.max=(...l)=>u.check(b._maxLength(...l)),u.length=(...l)=>u.check(b._length(...l)),u.nonempty=(...l)=>u.check(b._minLength(1,...l)),u.lowercase=l=>u.check(b._lowercase(l)),u.uppercase=l=>u.check(b._uppercase(l)),u.trim=()=>u.check(b._trim()),u.normalize=(...l)=>u.check(b._normalize(...l)),u.toLowerCase=()=>u.check(b._toLowerCase()),u.toUpperCase=()=>u.check(b._toUpperCase())}),E=f.$constructor("ZodString",(u,l)=>{h.$ZodString.init(u,l),x.init(u,l),u.email=l=>u.check(b._email(Z,l)),u.url=l=>u.check(b._url(A,l)),u.jwt=l=>u.check(b._jwt(Q,l)),u.emoji=l=>u.check(b._emoji(O,l)),u.guid=l=>u.check(b._guid(C,l)),u.uuid=l=>u.check(b._uuid(z,l)),u.uuidv4=l=>u.check(b._uuidv4(z,l)),u.uuidv6=l=>u.check(b._uuidv6(z,l)),u.uuidv7=l=>u.check(b._uuidv7(z,l)),u.nanoid=l=>u.check(b._nanoid(D,l)),u.guid=l=>u.check(b._guid(C,l)),u.cuid=l=>u.check(b._cuid(N,l)),u.cuid2=l=>u.check(b._cuid2(M,l)),u.ulid=l=>u.check(b._ulid(U,l)),u.base64=l=>u.check(b._base64(J,l)),u.base64url=l=>u.check(b._base64url(W,l)),u.xid=l=>u.check(b._xid(L,l)),u.ksuid=l=>u.check(b._ksuid(F,l)),u.ipv4=l=>u.check(b._ipv4(V,l)),u.ipv6=l=>u.check(b._ipv6(K,l)),u.cidrv4=l=>u.check(b._cidrv4(H,l)),u.cidrv6=l=>u.check(b._cidrv6(B,l)),u.e164=l=>u.check(b._e164(G,l)),u.datetime=l=>u.check(S.datetime(l)),u.date=l=>u.check(S.date(l)),u.time=l=>u.check(S.time(l)),u.duration=l=>u.check(S.duration(l))});function string(u){return b._string(E,u)}const R=f.$constructor("ZodStringFormat",(u,l)=>{h.$ZodStringFormat.init(u,l),x.init(u,l)}),Z=f.$constructor("ZodEmail",(u,l)=>{h.$ZodEmail.init(u,l),R.init(u,l)});function email(u){return b._email(Z,u)}const C=f.$constructor("ZodGUID",(u,l)=>{h.$ZodGUID.init(u,l),R.init(u,l)});function guid(u){return b._guid(C,u)}const z=f.$constructor("ZodUUID",(u,l)=>{h.$ZodUUID.init(u,l),R.init(u,l)});function uuid(u){return b._uuid(z,u)}function uuidv4(u){return b._uuidv4(z,u)}function uuidv6(u){return b._uuidv6(z,u)}function uuidv7(u){return b._uuidv7(z,u)}const A=f.$constructor("ZodURL",(u,l)=>{h.$ZodURL.init(u,l),R.init(u,l)});function url(u){return b._url(A,u)}const O=f.$constructor("ZodEmoji",(u,l)=>{h.$ZodEmoji.init(u,l),R.init(u,l)});function emoji(u){return b._emoji(O,u)}const D=f.$constructor("ZodNanoID",(u,l)=>{h.$ZodNanoID.init(u,l),R.init(u,l)});function nanoid(u){return b._nanoid(D,u)}const N=f.$constructor("ZodCUID",(u,l)=>{h.$ZodCUID.init(u,l),R.init(u,l)});function cuid(u){return b._cuid(N,u)}const M=f.$constructor("ZodCUID2",(u,l)=>{h.$ZodCUID2.init(u,l),R.init(u,l)});function cuid2(u){return b._cuid2(M,u)}const U=f.$constructor("ZodULID",(u,l)=>{h.$ZodULID.init(u,l),R.init(u,l)});function ulid(u){return b._ulid(U,u)}const L=f.$constructor("ZodXID",(u,l)=>{h.$ZodXID.init(u,l),R.init(u,l)});function xid(u){return b._xid(L,u)}const F=f.$constructor("ZodKSUID",(u,l)=>{h.$ZodKSUID.init(u,l),R.init(u,l)});function ksuid(u){return b._ksuid(F,u)}const V=f.$constructor("ZodIPv4",(u,l)=>{h.$ZodIPv4.init(u,l),R.init(u,l)});function ipv4(u){return b._ipv4(V,u)}const K=f.$constructor("ZodIPv6",(u,l)=>{h.$ZodIPv6.init(u,l),R.init(u,l)});function ipv6(u){return b._ipv6(K,u)}const H=f.$constructor("ZodCIDRv4",(u,l)=>{h.$ZodCIDRv4.init(u,l),R.init(u,l)});function cidrv4(u){return b._cidrv4(H,u)}const B=f.$constructor("ZodCIDRv6",(u,l)=>{h.$ZodCIDRv6.init(u,l),R.init(u,l)});function cidrv6(u){return b._cidrv6(B,u)}const J=f.$constructor("ZodBase64",(u,l)=>{h.$ZodBase64.init(u,l),R.init(u,l)});function base64(u){return b._base64(J,u)}const W=f.$constructor("ZodBase64URL",(u,l)=>{h.$ZodBase64URL.init(u,l),R.init(u,l)});function base64url(u){return b._base64url(W,u)}const G=f.$constructor("ZodE164",(u,l)=>{h.$ZodE164.init(u,l),R.init(u,l)});function e164(u){return b._e164(G,u)}const Q=f.$constructor("ZodJWT",(u,l)=>{h.$ZodJWT.init(u,l),R.init(u,l)});function jwt(u){return b._jwt(Q,u)}const Y=f.$constructor("ZodCustomStringFormat",(u,l)=>{h.$ZodCustomStringFormat.init(u,l),R.init(u,l)});function stringFormat(u,l,m={}){return b._stringFormat(Y,u,l,m)}const X=f.$constructor("ZodNumber",(u,l)=>{h.$ZodNumber.init(u,l),$.init(u,l),u.gt=(l,m)=>u.check(b._gt(l,m)),u.gte=(l,m)=>u.check(b._gte(l,m)),u.min=(l,m)=>u.check(b._gte(l,m)),u.lt=(l,m)=>u.check(b._lt(l,m)),u.lte=(l,m)=>u.check(b._lte(l,m)),u.max=(l,m)=>u.check(b._lte(l,m)),u.int=l=>u.check(int(l)),u.safe=l=>u.check(int(l)),u.positive=l=>u.check(b._gt(0,l)),u.nonnegative=l=>u.check(b._gte(0,l)),u.negative=l=>u.check(b._lt(0,l)),u.nonpositive=l=>u.check(b._lte(0,l)),u.multipleOf=(l,m)=>u.check(b._multipleOf(l,m)),u.step=(l,m)=>u.check(b._multipleOf(l,m)),u.finite=()=>u;const m=u._zod.bag;u.minValue=Math.max(m.minimum??Number.NEGATIVE_INFINITY,m.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,u.maxValue=Math.min(m.maximum??Number.POSITIVE_INFINITY,m.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,u.isInt=(m.format??"").includes("int")||Number.isSafeInteger(m.multipleOf??.5),u.isFinite=!0,u.format=m.format??null});function number(u){return b._number(X,u)}const ee=f.$constructor("ZodNumberFormat",(u,l)=>{h.$ZodNumberFormat.init(u,l),X.init(u,l)});function int(u){return b._int(ee,u)}function float32(u){return b._float32(ee,u)}function float64(u){return b._float64(ee,u)}function int32(u){return b._int32(ee,u)}function uint32(u){return b._uint32(ee,u)}const te=f.$constructor("ZodBoolean",(u,l)=>{h.$ZodBoolean.init(u,l),$.init(u,l)});function boolean(u){return b._boolean(te,u)}const ne=f.$constructor("ZodBigInt",(u,l)=>{h.$ZodBigInt.init(u,l),$.init(u,l),u.gte=(l,m)=>u.check(b._gte(l,m)),u.min=(l,m)=>u.check(b._gte(l,m)),u.gt=(l,m)=>u.check(b._gt(l,m)),u.gte=(l,m)=>u.check(b._gte(l,m)),u.min=(l,m)=>u.check(b._gte(l,m)),u.lt=(l,m)=>u.check(b._lt(l,m)),u.lte=(l,m)=>u.check(b._lte(l,m)),u.max=(l,m)=>u.check(b._lte(l,m)),u.positive=l=>u.check(b._gt(BigInt(0),l)),u.negative=l=>u.check(b._lt(BigInt(0),l)),u.nonpositive=l=>u.check(b._lte(BigInt(0),l)),u.nonnegative=l=>u.check(b._gte(BigInt(0),l)),u.multipleOf=(l,m)=>u.check(b._multipleOf(l,m));const m=u._zod.bag;u.minValue=m.minimum??null,u.maxValue=m.maximum??null,u.format=m.format??null});function bigint(u){return b._bigint(ne,u)}const re=f.$constructor("ZodBigIntFormat",(u,l)=>{h.$ZodBigIntFormat.init(u,l),ne.init(u,l)});function int64(u){return b._int64(re,u)}function uint64(u){return b._uint64(re,u)}const oe=f.$constructor("ZodSymbol",(u,l)=>{h.$ZodSymbol.init(u,l),$.init(u,l)});function symbol(u){return b._symbol(oe,u)}const se=f.$constructor("ZodUndefined",(u,l)=>{h.$ZodUndefined.init(u,l),$.init(u,l)});function _undefined(u){return b._undefined(se,u)}const ie=f.$constructor("ZodNull",(u,l)=>{h.$ZodNull.init(u,l),$.init(u,l)});function _null(u){return b._null(ie,u)}const ae=f.$constructor("ZodAny",(u,l)=>{h.$ZodAny.init(u,l),$.init(u,l)});function any(){return b._any(ae)}const de=f.$constructor("ZodUnknown",(u,l)=>{h.$ZodUnknown.init(u,l),$.init(u,l)});function unknown(){return b._unknown(de)}const ce=f.$constructor("ZodNever",(u,l)=>{h.$ZodNever.init(u,l),$.init(u,l)});function never(u){return b._never(ce,u)}const ue=f.$constructor("ZodVoid",(u,l)=>{h.$ZodVoid.init(u,l),$.init(u,l)});function _void(u){return b._void(ue,u)}const le=f.$constructor("ZodDate",(u,l)=>{h.$ZodDate.init(u,l),$.init(u,l),u.min=(l,m)=>u.check(b._gte(l,m)),u.max=(l,m)=>u.check(b._lte(l,m));const m=u._zod.bag;u.minDate=m.minimum?new Date(m.minimum):null,u.maxDate=m.maximum?new Date(m.maximum):null});function date(u){return b._date(le,u)}const pe=f.$constructor("ZodArray",(u,l)=>{h.$ZodArray.init(u,l),$.init(u,l),u.element=l.element,u.min=(l,m)=>u.check(b._minLength(l,m)),u.nonempty=l=>u.check(b._minLength(1,l)),u.max=(l,m)=>u.check(b._maxLength(l,m)),u.length=(l,m)=>u.check(b._length(l,m)),u.unwrap=()=>u.element});function array(u,l){return b._array(pe,u,l)}function keyof(u){const l=u._zod.def.shape;return literal(Object.keys(l))}const me=f.$constructor("ZodObject",(u,l)=>{h.$ZodObject.init(u,l),$.init(u,l),v.defineLazy(u,"shape",()=>l.shape),u.keyof=()=>_enum(Object.keys(u._zod.def.shape)),u.catchall=l=>u.clone({...u._zod.def,catchall:l}),u.passthrough=()=>u.clone({...u._zod.def,catchall:unknown()}),u.loose=()=>u.clone({...u._zod.def,catchall:unknown()}),u.strict=()=>u.clone({...u._zod.def,catchall:never()}),u.strip=()=>u.clone({...u._zod.def,catchall:void 0}),u.extend=l=>v.extend(u,l),u.merge=l=>v.merge(u,l),u.pick=l=>v.pick(u,l),u.omit=l=>v.omit(u,l),u.partial=(...l)=>v.partial(Pe,u,l[0]),u.required=(...l)=>v.required(Ee,u,l[0])});function object(u,l){const m={type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},...v.normalizeParams(l)};return new me(m)}function strictObject(u,l){return new me({type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},catchall:never(),...v.normalizeParams(l)})}function looseObject(u,l){return new me({type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},catchall:unknown(),...v.normalizeParams(l)})}const fe=f.$constructor("ZodUnion",(u,l)=>{h.$ZodUnion.init(u,l),$.init(u,l),u.options=l.options});function union(u,l){return new fe({type:"union",options:u,...v.normalizeParams(l)})}const he=f.$constructor("ZodDiscriminatedUnion",(u,l)=>{fe.init(u,l),h.$ZodDiscriminatedUnion.init(u,l)});function discriminatedUnion(u,l,m){return new he({type:"union",options:l,discriminator:u,...v.normalizeParams(m)})}const ge=f.$constructor("ZodIntersection",(u,l)=>{h.$ZodIntersection.init(u,l),$.init(u,l)});function intersection(u,l){return new ge({type:"intersection",left:u,right:l})}const _e=f.$constructor("ZodTuple",(u,l)=>{h.$ZodTuple.init(u,l),$.init(u,l),u.rest=l=>u.clone({...u._zod.def,rest:l})});function tuple(u,l,m){const f=l instanceof h.$ZodType,y=f?m:l;return new _e({type:"tuple",items:u,rest:f?l:null,...v.normalizeParams(y)})}const ye=f.$constructor("ZodRecord",(u,l)=>{h.$ZodRecord.init(u,l),$.init(u,l),u.keyType=l.keyType,u.valueType=l.valueType});function record(u,l,m){return new ye({type:"record",keyType:u,valueType:l,...v.normalizeParams(m)})}function partialRecord(u,l,m){return new ye({type:"record",keyType:union([u,never()]),valueType:l,...v.normalizeParams(m)})}const ve=f.$constructor("ZodMap",(u,l)=>{h.$ZodMap.init(u,l),$.init(u,l),u.keyType=l.keyType,u.valueType=l.valueType});function map(u,l,m){return new ve({type:"map",keyType:u,valueType:l,...v.normalizeParams(m)})}const we=f.$constructor("ZodSet",(u,l)=>{h.$ZodSet.init(u,l),$.init(u,l),u.min=(...l)=>u.check(b._minSize(...l)),u.nonempty=l=>u.check(b._minSize(1,l)),u.max=(...l)=>u.check(b._maxSize(...l)),u.size=(...l)=>u.check(b._size(...l))});function set(u,l){return new we({type:"set",valueType:u,...v.normalizeParams(l)})}const be=f.$constructor("ZodEnum",(u,l)=>{h.$ZodEnum.init(u,l),$.init(u,l),u.enum=l.entries,u.options=Object.values(l.entries);const m=new Set(Object.keys(l.entries));u.extract=(u,f)=>{const h={};for(const f of u){if(!m.has(f))throw new Error(`Key ${f} not found in enum`);h[f]=l.entries[f]}return new be({...l,checks:[],...v.normalizeParams(f),entries:h})},u.exclude=(u,f)=>{const h={...l.entries};for(const l of u){if(!m.has(l))throw new Error(`Key ${l} not found in enum`);delete h[l]}return new be({...l,checks:[],...v.normalizeParams(f),entries:h})}});function _enum(u,l){const m=Array.isArray(u)?Object.fromEntries(u.map(u=>[u,u])):u;return new be({type:"enum",entries:m,...v.normalizeParams(l)})}function nativeEnum(u,l){return new be({type:"enum",entries:u,...v.normalizeParams(l)})}const ke=f.$constructor("ZodLiteral",(u,l)=>{h.$ZodLiteral.init(u,l),$.init(u,l),u.values=new Set(l.values),Object.defineProperty(u,"value",{get(){if(l.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return l.values[0]}})});function literal(u,l){return new ke({type:"literal",values:Array.isArray(u)?u:[u],...v.normalizeParams(l)})}const Se=f.$constructor("ZodFile",(u,l)=>{h.$ZodFile.init(u,l),$.init(u,l),u.min=(l,m)=>u.check(b._minSize(l,m)),u.max=(l,m)=>u.check(b._maxSize(l,m)),u.mime=(l,m)=>u.check(b._mime(Array.isArray(l)?l:[l],m))});function file(u){return b._file(Se,u)}const je=f.$constructor("ZodTransform",(u,l)=>{h.$ZodTransform.init(u,l),$.init(u,l),u._zod.parse=(m,f)=>{m.addIssue=f=>{if("string"==typeof f)m.issues.push(v.issue(f,m.value,l));else{const l=f;l.fatal&&(l.continue=!1),l.code??(l.code="custom"),l.input??(l.input=m.value),l.inst??(l.inst=u),l.continue??(l.continue=!0),m.issues.push(v.issue(l))}};const h=l.transform(m.value,m);return h instanceof Promise?h.then(u=>(m.value=u,m)):(m.value=h,m)}});function transform(u){return new je({type:"transform",transform:u})}const Pe=f.$constructor("ZodOptional",(u,l)=>{h.$ZodOptional.init(u,l),$.init(u,l),u.unwrap=()=>u._zod.def.innerType});function optional(u){return new Pe({type:"optional",innerType:u})}const $e=f.$constructor("ZodNullable",(u,l)=>{h.$ZodNullable.init(u,l),$.init(u,l),u.unwrap=()=>u._zod.def.innerType});function nullable(u){return new $e({type:"nullable",innerType:u})}function nullish(u){return optional(nullable(u))}const Te=f.$constructor("ZodDefault",(u,l)=>{h.$ZodDefault.init(u,l),$.init(u,l),u.unwrap=()=>u._zod.def.innerType,u.removeDefault=u.unwrap});function _default(u,l){return new Te({type:"default",innerType:u,get defaultValue(){return"function"==typeof l?l():l}})}const xe=f.$constructor("ZodPrefault",(u,l)=>{h.$ZodPrefault.init(u,l),$.init(u,l),u.unwrap=()=>u._zod.def.innerType});function prefault(u,l){return new xe({type:"prefault",innerType:u,get defaultValue(){return"function"==typeof l?l():l}})}const Ee=f.$constructor("ZodNonOptional",(u,l)=>{h.$ZodNonOptional.init(u,l),$.init(u,l),u.unwrap=()=>u._zod.def.innerType});function nonoptional(u,l){return new Ee({type:"nonoptional",innerType:u,...v.normalizeParams(l)})}const Ie=f.$constructor("ZodSuccess",(u,l)=>{h.$ZodSuccess.init(u,l),$.init(u,l),u.unwrap=()=>u._zod.def.innerType});function success(u){return new Ie({type:"success",innerType:u})}const Re=f.$constructor("ZodCatch",(u,l)=>{h.$ZodCatch.init(u,l),$.init(u,l),u.unwrap=()=>u._zod.def.innerType,u.removeCatch=u.unwrap});function _catch(u,l){return new Re({type:"catch",innerType:u,catchValue:"function"==typeof l?l:()=>l})}const Ze=f.$constructor("ZodNaN",(u,l)=>{h.$ZodNaN.init(u,l),$.init(u,l)});function nan(u){return b._nan(Ze,u)}const Ce=f.$constructor("ZodPipe",(u,l)=>{h.$ZodPipe.init(u,l),$.init(u,l),u.in=l.in,u.out=l.out});function pipe(u,l){return new Ce({type:"pipe",in:u,out:l})}const ze=f.$constructor("ZodReadonly",(u,l)=>{h.$ZodReadonly.init(u,l),$.init(u,l)});function readonly(u){return new ze({type:"readonly",innerType:u})}const Ae=f.$constructor("ZodTemplateLiteral",(u,l)=>{h.$ZodTemplateLiteral.init(u,l),$.init(u,l)});function templateLiteral(u,l){return new Ae({type:"template_literal",parts:u,...v.normalizeParams(l)})}const Oe=f.$constructor("ZodLazy",(u,l)=>{h.$ZodLazy.init(u,l),$.init(u,l),u.unwrap=()=>u._zod.def.getter()});function lazy(u){return new Oe({type:"lazy",getter:u})}const De=f.$constructor("ZodPromise",(u,l)=>{h.$ZodPromise.init(u,l),$.init(u,l),u.unwrap=()=>u._zod.def.innerType});function promise(u){return new De({type:"promise",innerType:u})}const Ne=f.$constructor("ZodCustom",(u,l)=>{h.$ZodCustom.init(u,l),$.init(u,l)});function check(u){const l=new y.$ZodCheck({check:"custom"});return l._zod.check=u,l}function custom(u,l){return b._custom(Ne,u??(()=>!0),l)}function refine(u,l={}){return b._refine(Ne,u,l)}function superRefine(u){const l=check(m=>(m.addIssue=u=>{if("string"==typeof u)m.issues.push(v.issue(u,m.value,l._zod.def));else{const f=u;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=m.value),f.inst??(f.inst=l),f.continue??(f.continue=!l._zod.def.abort),m.issues.push(v.issue(f))}},u(m.value,m)));return l}function _instanceof(u,l={error:`Input not instance of ${u.name}`}){const m=new Ne({type:"custom",check:"custom",fn:l=>l instanceof u,abort:!0,...v.normalizeParams(l)});return m._zod.bag.Class=u,m}const stringbool=(...u)=>b._stringbool({Pipe:Ce,Boolean:te,String:E,Transform:je},...u);function json(u){const l=lazy(()=>union([string(u),number(),boolean(),_null(),array(l),record(string(),l)]));return l}function preprocess(u,l){return pipe(transform(u),l)}},"./node_modules/zod/v4/core/api.js":function(u,l,m){m.r(l),m.d(l,{TimePrecision:function(){return v},_any:function(){return _any},_array:function(){return _array},_base64:function(){return _base64},_base64url:function(){return _base64url},_bigint:function(){return _bigint},_boolean:function(){return _boolean},_catch:function(){return _catch},_cidrv4:function(){return _cidrv4},_cidrv6:function(){return _cidrv6},_coercedBigint:function(){return _coercedBigint},_coercedBoolean:function(){return _coercedBoolean},_coercedDate:function(){return _coercedDate},_coercedNumber:function(){return _coercedNumber},_coercedString:function(){return _coercedString},_cuid:function(){return _cuid},_cuid2:function(){return _cuid2},_custom:function(){return _custom},_date:function(){return _date},_default:function(){return _default},_discriminatedUnion:function(){return _discriminatedUnion},_e164:function(){return _e164},_email:function(){return _email},_emoji:function(){return _emoji},_endsWith:function(){return _endsWith},_enum:function(){return _enum},_file:function(){return _file},_float32:function(){return _float32},_float64:function(){return _float64},_gt:function(){return _gt},_gte:function(){return _gte},_guid:function(){return _guid},_includes:function(){return _includes},_int:function(){return _int},_int32:function(){return _int32},_int64:function(){return _int64},_intersection:function(){return _intersection},_ipv4:function(){return _ipv4},_ipv6:function(){return _ipv6},_isoDate:function(){return _isoDate},_isoDateTime:function(){return _isoDateTime},_isoDuration:function(){return _isoDuration},_isoTime:function(){return _isoTime},_jwt:function(){return _jwt},_ksuid:function(){return _ksuid},_lazy:function(){return _lazy},_length:function(){return _length},_literal:function(){return _literal},_lowercase:function(){return _lowercase},_lt:function(){return _lt},_lte:function(){return _lte},_map:function(){return _map},_max:function(){return _lte},_maxLength:function(){return _maxLength},_maxSize:function(){return _maxSize},_mime:function(){return _mime},_min:function(){return _gte},_minLength:function(){return _minLength},_minSize:function(){return _minSize},_multipleOf:function(){return _multipleOf},_nan:function(){return _nan},_nanoid:function(){return _nanoid},_nativeEnum:function(){return _nativeEnum},_negative:function(){return _negative},_never:function(){return _never},_nonnegative:function(){return _nonnegative},_nonoptional:function(){return _nonoptional},_nonpositive:function(){return _nonpositive},_normalize:function(){return _normalize},_null:function(){return _null},_nullable:function(){return _nullable},_number:function(){return _number},_optional:function(){return _optional},_overwrite:function(){return _overwrite},_pipe:function(){return _pipe},_positive:function(){return _positive},_promise:function(){return _promise},_property:function(){return _property},_readonly:function(){return _readonly},_record:function(){return _record},_refine:function(){return _refine},_regex:function(){return _regex},_set:function(){return _set},_size:function(){return _size},_startsWith:function(){return _startsWith},_string:function(){return _string},_stringFormat:function(){return _stringFormat},_stringbool:function(){return _stringbool},_success:function(){return _success},_symbol:function(){return _symbol},_templateLiteral:function(){return _templateLiteral},_toLowerCase:function(){return _toLowerCase},_toUpperCase:function(){return _toUpperCase},_transform:function(){return _transform},_trim:function(){return _trim},_tuple:function(){return _tuple},_uint32:function(){return _uint32},_uint64:function(){return _uint64},_ulid:function(){return _ulid},_undefined:function(){return _undefined},_union:function(){return _union},_unknown:function(){return _unknown},_uppercase:function(){return _uppercase},_url:function(){return _url},_uuid:function(){return _uuid},_uuidv4:function(){return _uuidv4},_uuidv6:function(){return _uuidv6},_uuidv7:function(){return _uuidv7},_void:function(){return _void},_xid:function(){return _xid}});var f=m("./node_modules/zod/v4/core/checks.js"),h=m("./node_modules/zod/v4/core/schemas.js"),y=m("./node_modules/zod/v4/core/util.js");function _string(u,l){return new u({type:"string",...y.normalizeParams(l)})}function _coercedString(u,l){return new u({type:"string",coerce:!0,...y.normalizeParams(l)})}function _email(u,l){return new u({type:"string",format:"email",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _guid(u,l){return new u({type:"string",format:"guid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _uuid(u,l){return new u({type:"string",format:"uuid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _uuidv4(u,l){return new u({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...y.normalizeParams(l)})}function _uuidv6(u,l){return new u({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...y.normalizeParams(l)})}function _uuidv7(u,l){return new u({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...y.normalizeParams(l)})}function _url(u,l){return new u({type:"string",format:"url",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _emoji(u,l){return new u({type:"string",format:"emoji",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _nanoid(u,l){return new u({type:"string",format:"nanoid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _cuid(u,l){return new u({type:"string",format:"cuid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _cuid2(u,l){return new u({type:"string",format:"cuid2",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _ulid(u,l){return new u({type:"string",format:"ulid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _xid(u,l){return new u({type:"string",format:"xid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _ksuid(u,l){return new u({type:"string",format:"ksuid",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _ipv4(u,l){return new u({type:"string",format:"ipv4",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _ipv6(u,l){return new u({type:"string",format:"ipv6",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _cidrv4(u,l){return new u({type:"string",format:"cidrv4",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _cidrv6(u,l){return new u({type:"string",format:"cidrv6",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _base64(u,l){return new u({type:"string",format:"base64",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _base64url(u,l){return new u({type:"string",format:"base64url",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _e164(u,l){return new u({type:"string",format:"e164",check:"string_format",abort:!1,...y.normalizeParams(l)})}function _jwt(u,l){return new u({type:"string",format:"jwt",check:"string_format",abort:!1,...y.normalizeParams(l)})}const v={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function _isoDateTime(u,l){return new u({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...y.normalizeParams(l)})}function _isoDate(u,l){return new u({type:"string",format:"date",check:"string_format",...y.normalizeParams(l)})}function _isoTime(u,l){return new u({type:"string",format:"time",check:"string_format",precision:null,...y.normalizeParams(l)})}function _isoDuration(u,l){return new u({type:"string",format:"duration",check:"string_format",...y.normalizeParams(l)})}function _number(u,l){return new u({type:"number",checks:[],...y.normalizeParams(l)})}function _coercedNumber(u,l){return new u({type:"number",coerce:!0,checks:[],...y.normalizeParams(l)})}function _int(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"safeint",...y.normalizeParams(l)})}function _float32(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"float32",...y.normalizeParams(l)})}function _float64(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"float64",...y.normalizeParams(l)})}function _int32(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"int32",...y.normalizeParams(l)})}function _uint32(u,l){return new u({type:"number",check:"number_format",abort:!1,format:"uint32",...y.normalizeParams(l)})}function _boolean(u,l){return new u({type:"boolean",...y.normalizeParams(l)})}function _coercedBoolean(u,l){return new u({type:"boolean",coerce:!0,...y.normalizeParams(l)})}function _bigint(u,l){return new u({type:"bigint",...y.normalizeParams(l)})}function _coercedBigint(u,l){return new u({type:"bigint",coerce:!0,...y.normalizeParams(l)})}function _int64(u,l){return new u({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...y.normalizeParams(l)})}function _uint64(u,l){return new u({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...y.normalizeParams(l)})}function _symbol(u,l){return new u({type:"symbol",...y.normalizeParams(l)})}function _undefined(u,l){return new u({type:"undefined",...y.normalizeParams(l)})}function _null(u,l){return new u({type:"null",...y.normalizeParams(l)})}function _any(u){return new u({type:"any"})}function _unknown(u){return new u({type:"unknown"})}function _never(u,l){return new u({type:"never",...y.normalizeParams(l)})}function _void(u,l){return new u({type:"void",...y.normalizeParams(l)})}function _date(u,l){return new u({type:"date",...y.normalizeParams(l)})}function _coercedDate(u,l){return new u({type:"date",coerce:!0,...y.normalizeParams(l)})}function _nan(u,l){return new u({type:"nan",...y.normalizeParams(l)})}function _lt(u,l){return new f.$ZodCheckLessThan({check:"less_than",...y.normalizeParams(l),value:u,inclusive:!1})}function _lte(u,l){return new f.$ZodCheckLessThan({check:"less_than",...y.normalizeParams(l),value:u,inclusive:!0})}function _gt(u,l){return new f.$ZodCheckGreaterThan({check:"greater_than",...y.normalizeParams(l),value:u,inclusive:!1})}function _gte(u,l){return new f.$ZodCheckGreaterThan({check:"greater_than",...y.normalizeParams(l),value:u,inclusive:!0})}function _positive(u){return _gt(0,u)}function _negative(u){return _lt(0,u)}function _nonpositive(u){return _lte(0,u)}function _nonnegative(u){return _gte(0,u)}function _multipleOf(u,l){return new f.$ZodCheckMultipleOf({check:"multiple_of",...y.normalizeParams(l),value:u})}function _maxSize(u,l){return new f.$ZodCheckMaxSize({check:"max_size",...y.normalizeParams(l),maximum:u})}function _minSize(u,l){return new f.$ZodCheckMinSize({check:"min_size",...y.normalizeParams(l),minimum:u})}function _size(u,l){return new f.$ZodCheckSizeEquals({check:"size_equals",...y.normalizeParams(l),size:u})}function _maxLength(u,l){return new f.$ZodCheckMaxLength({check:"max_length",...y.normalizeParams(l),maximum:u})}function _minLength(u,l){return new f.$ZodCheckMinLength({check:"min_length",...y.normalizeParams(l),minimum:u})}function _length(u,l){return new f.$ZodCheckLengthEquals({check:"length_equals",...y.normalizeParams(l),length:u})}function _regex(u,l){return new f.$ZodCheckRegex({check:"string_format",format:"regex",...y.normalizeParams(l),pattern:u})}function _lowercase(u){return new f.$ZodCheckLowerCase({check:"string_format",format:"lowercase",...y.normalizeParams(u)})}function _uppercase(u){return new f.$ZodCheckUpperCase({check:"string_format",format:"uppercase",...y.normalizeParams(u)})}function _includes(u,l){return new f.$ZodCheckIncludes({check:"string_format",format:"includes",...y.normalizeParams(l),includes:u})}function _startsWith(u,l){return new f.$ZodCheckStartsWith({check:"string_format",format:"starts_with",...y.normalizeParams(l),prefix:u})}function _endsWith(u,l){return new f.$ZodCheckEndsWith({check:"string_format",format:"ends_with",...y.normalizeParams(l),suffix:u})}function _property(u,l,m){return new f.$ZodCheckProperty({check:"property",property:u,schema:l,...y.normalizeParams(m)})}function _mime(u,l){return new f.$ZodCheckMimeType({check:"mime_type",mime:u,...y.normalizeParams(l)})}function _overwrite(u){return new f.$ZodCheckOverwrite({check:"overwrite",tx:u})}function _normalize(u){return _overwrite(l=>l.normalize(u))}function _trim(){return _overwrite(u=>u.trim())}function _toLowerCase(){return _overwrite(u=>u.toLowerCase())}function _toUpperCase(){return _overwrite(u=>u.toUpperCase())}function _array(u,l,m){return new u({type:"array",element:l,...y.normalizeParams(m)})}function _union(u,l,m){return new u({type:"union",options:l,...y.normalizeParams(m)})}function _discriminatedUnion(u,l,m,f){return new u({type:"union",options:m,discriminator:l,...y.normalizeParams(f)})}function _intersection(u,l,m){return new u({type:"intersection",left:l,right:m})}function _tuple(u,l,m,f){const v=m instanceof h.$ZodType,w=v?f:m;return new u({type:"tuple",items:l,rest:v?m:null,...y.normalizeParams(w)})}function _record(u,l,m,f){return new u({type:"record",keyType:l,valueType:m,...y.normalizeParams(f)})}function _map(u,l,m,f){return new u({type:"map",keyType:l,valueType:m,...y.normalizeParams(f)})}function _set(u,l,m){return new u({type:"set",valueType:l,...y.normalizeParams(m)})}function _enum(u,l,m){return new u({type:"enum",entries:Array.isArray(l)?Object.fromEntries(l.map(u=>[u,u])):l,...y.normalizeParams(m)})}function _nativeEnum(u,l,m){return new u({type:"enum",entries:l,...y.normalizeParams(m)})}function _literal(u,l,m){return new u({type:"literal",values:Array.isArray(l)?l:[l],...y.normalizeParams(m)})}function _file(u,l){return new u({type:"file",...y.normalizeParams(l)})}function _transform(u,l){return new u({type:"transform",transform:l})}function _optional(u,l){return new u({type:"optional",innerType:l})}function _nullable(u,l){return new u({type:"nullable",innerType:l})}function _default(u,l,m){return new u({type:"default",innerType:l,get defaultValue(){return"function"==typeof m?m():m}})}function _nonoptional(u,l,m){return new u({type:"nonoptional",innerType:l,...y.normalizeParams(m)})}function _success(u,l){return new u({type:"success",innerType:l})}function _catch(u,l,m){return new u({type:"catch",innerType:l,catchValue:"function"==typeof m?m:()=>m})}function _pipe(u,l,m){return new u({type:"pipe",in:l,out:m})}function _readonly(u,l){return new u({type:"readonly",innerType:l})}function _templateLiteral(u,l,m){return new u({type:"template_literal",parts:l,...y.normalizeParams(m)})}function _lazy(u,l){return new u({type:"lazy",getter:l})}function _promise(u,l){return new u({type:"promise",innerType:l})}function _custom(u,l,m){const f=y.normalizeParams(m);f.abort??(f.abort=!0);return new u({type:"custom",check:"custom",fn:l,...f})}function _refine(u,l,m){return new u({type:"custom",check:"custom",fn:l,...y.normalizeParams(m)})}function _stringbool(u,l){const m=y.normalizeParams(l);let f=m.truthy??["true","1","yes","on","y","enabled"],v=m.falsy??["false","0","no","off","n","disabled"];"sensitive"!==m.case&&(f=f.map(u=>"string"==typeof u?u.toLowerCase():u),v=v.map(u=>"string"==typeof u?u.toLowerCase():u));const w=new Set(f),b=new Set(v),S=u.Pipe??h.$ZodPipe,j=u.Boolean??h.$ZodBoolean,$=u.String??h.$ZodString,x=new(u.Transform??h.$ZodTransform)({type:"transform",transform:(u,l)=>{let f=u;return"sensitive"!==m.case&&(f=f.toLowerCase()),!!w.has(f)||!b.has(f)&&(l.issues.push({code:"invalid_value",expected:"stringbool",values:[...w,...b],input:l.value,inst:x}),{})},error:m.error}),E=new S({type:"pipe",in:new $({type:"string",error:m.error}),out:x,error:m.error});return new S({type:"pipe",in:E,out:new j({type:"boolean",error:m.error}),error:m.error})}function _stringFormat(u,l,m,f={}){const h=y.normalizeParams(f),v={...y.normalizeParams(f),check:"string_format",type:"string",format:l,fn:"function"==typeof m?m:u=>m.test(u),...h};m instanceof RegExp&&(v.pattern=m);return new u(v)}},"./node_modules/zod/v4/core/checks.js":function(u,l,m){m.r(l),m.d(l,{$ZodCheck:function(){return v},$ZodCheckBigIntFormat:function(){return x},$ZodCheckEndsWith:function(){return F},$ZodCheckGreaterThan:function(){return S},$ZodCheckIncludes:function(){return U},$ZodCheckLengthEquals:function(){return A},$ZodCheckLessThan:function(){return b},$ZodCheckLowerCase:function(){return N},$ZodCheckMaxLength:function(){return C},$ZodCheckMaxSize:function(){return E},$ZodCheckMimeType:function(){return K},$ZodCheckMinLength:function(){return z},$ZodCheckMinSize:function(){return R},$ZodCheckMultipleOf:function(){return j},$ZodCheckNumberFormat:function(){return $},$ZodCheckOverwrite:function(){return H},$ZodCheckProperty:function(){return V},$ZodCheckRegex:function(){return D},$ZodCheckSizeEquals:function(){return Z},$ZodCheckStartsWith:function(){return L},$ZodCheckStringFormat:function(){return O},$ZodCheckUpperCase:function(){return M}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/regexes.js"),y=m("./node_modules/zod/v4/core/util.js");const v=f.$constructor("$ZodCheck",(u,l)=>{var m;u._zod??(u._zod={}),u._zod.def=l,(m=u._zod).onattach??(m.onattach=[])}),w={number:"number",bigint:"bigint",object:"date"},b=f.$constructor("$ZodCheckLessThan",(u,l)=>{v.init(u,l);const m=w[typeof l.value];u._zod.onattach.push(u=>{const m=u._zod.bag,f=(l.inclusive?m.maximum:m.exclusiveMaximum)??Number.POSITIVE_INFINITY;l.value<f&&(l.inclusive?m.maximum=l.value:m.exclusiveMaximum=l.value)}),u._zod.check=f=>{(l.inclusive?f.value<=l.value:f.value<l.value)||f.issues.push({origin:m,code:"too_big",maximum:l.value,input:f.value,inclusive:l.inclusive,inst:u,continue:!l.abort})}}),S=f.$constructor("$ZodCheckGreaterThan",(u,l)=>{v.init(u,l);const m=w[typeof l.value];u._zod.onattach.push(u=>{const m=u._zod.bag,f=(l.inclusive?m.minimum:m.exclusiveMinimum)??Number.NEGATIVE_INFINITY;l.value>f&&(l.inclusive?m.minimum=l.value:m.exclusiveMinimum=l.value)}),u._zod.check=f=>{(l.inclusive?f.value>=l.value:f.value>l.value)||f.issues.push({origin:m,code:"too_small",minimum:l.value,input:f.value,inclusive:l.inclusive,inst:u,continue:!l.abort})}}),j=f.$constructor("$ZodCheckMultipleOf",(u,l)=>{v.init(u,l),u._zod.onattach.push(u=>{var m;(m=u._zod.bag).multipleOf??(m.multipleOf=l.value)}),u._zod.check=m=>{if(typeof m.value!=typeof l.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof m.value?m.value%l.value===BigInt(0):0===y.floatSafeRemainder(m.value,l.value))||m.issues.push({origin:typeof m.value,code:"not_multiple_of",divisor:l.value,input:m.value,inst:u,continue:!l.abort})}}),$=f.$constructor("$ZodCheckNumberFormat",(u,l)=>{v.init(u,l),l.format=l.format||"float64";const m=l.format?.includes("int"),f=m?"int":"number",[w,b]=y.NUMBER_FORMAT_RANGES[l.format];u._zod.onattach.push(u=>{const f=u._zod.bag;f.format=l.format,f.minimum=w,f.maximum=b,m&&(f.pattern=h.integer)}),u._zod.check=h=>{const y=h.value;if(m){if(!Number.isInteger(y))return void h.issues.push({expected:f,format:l.format,code:"invalid_type",input:y,inst:u});if(!Number.isSafeInteger(y))return void(y>0?h.issues.push({input:y,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:u,origin:f,continue:!l.abort}):h.issues.push({input:y,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:u,origin:f,continue:!l.abort}))}y<w&&h.issues.push({origin:"number",input:y,code:"too_small",minimum:w,inclusive:!0,inst:u,continue:!l.abort}),y>b&&h.issues.push({origin:"number",input:y,code:"too_big",maximum:b,inst:u})}}),x=f.$constructor("$ZodCheckBigIntFormat",(u,l)=>{v.init(u,l);const[m,f]=y.BIGINT_FORMAT_RANGES[l.format];u._zod.onattach.push(u=>{const h=u._zod.bag;h.format=l.format,h.minimum=m,h.maximum=f}),u._zod.check=h=>{const y=h.value;y<m&&h.issues.push({origin:"bigint",input:y,code:"too_small",minimum:m,inclusive:!0,inst:u,continue:!l.abort}),y>f&&h.issues.push({origin:"bigint",input:y,code:"too_big",maximum:f,inst:u})}}),E=f.$constructor("$ZodCheckMaxSize",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.size}),u._zod.onattach.push(u=>{const m=u._zod.bag.maximum??Number.POSITIVE_INFINITY;l.maximum<m&&(u._zod.bag.maximum=l.maximum)}),u._zod.check=m=>{const f=m.value;f.size<=l.maximum||m.issues.push({origin:y.getSizableOrigin(f),code:"too_big",maximum:l.maximum,input:f,inst:u,continue:!l.abort})}}),R=f.$constructor("$ZodCheckMinSize",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.size}),u._zod.onattach.push(u=>{const m=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;l.minimum>m&&(u._zod.bag.minimum=l.minimum)}),u._zod.check=m=>{const f=m.value;f.size>=l.minimum||m.issues.push({origin:y.getSizableOrigin(f),code:"too_small",minimum:l.minimum,input:f,inst:u,continue:!l.abort})}}),Z=f.$constructor("$ZodCheckSizeEquals",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.size}),u._zod.onattach.push(u=>{const m=u._zod.bag;m.minimum=l.size,m.maximum=l.size,m.size=l.size}),u._zod.check=m=>{const f=m.value,h=f.size;if(h===l.size)return;const v=h>l.size;m.issues.push({origin:y.getSizableOrigin(f),...v?{code:"too_big",maximum:l.size}:{code:"too_small",minimum:l.size},inclusive:!0,exact:!0,input:m.value,inst:u,continue:!l.abort})}}),C=f.$constructor("$ZodCheckMaxLength",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.length}),u._zod.onattach.push(u=>{const m=u._zod.bag.maximum??Number.POSITIVE_INFINITY;l.maximum<m&&(u._zod.bag.maximum=l.maximum)}),u._zod.check=m=>{const f=m.value;if(f.length<=l.maximum)return;const h=y.getLengthableOrigin(f);m.issues.push({origin:h,code:"too_big",maximum:l.maximum,inclusive:!0,input:f,inst:u,continue:!l.abort})}}),z=f.$constructor("$ZodCheckMinLength",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.length}),u._zod.onattach.push(u=>{const m=u._zod.bag.minimum??Number.NEGATIVE_INFINITY;l.minimum>m&&(u._zod.bag.minimum=l.minimum)}),u._zod.check=m=>{const f=m.value;if(f.length>=l.minimum)return;const h=y.getLengthableOrigin(f);m.issues.push({origin:h,code:"too_small",minimum:l.minimum,inclusive:!0,input:f,inst:u,continue:!l.abort})}}),A=f.$constructor("$ZodCheckLengthEquals",(u,l)=>{var m;v.init(u,l),(m=u._zod.def).when??(m.when=u=>{const l=u.value;return!y.nullish(l)&&void 0!==l.length}),u._zod.onattach.push(u=>{const m=u._zod.bag;m.minimum=l.length,m.maximum=l.length,m.length=l.length}),u._zod.check=m=>{const f=m.value,h=f.length;if(h===l.length)return;const v=y.getLengthableOrigin(f),w=h>l.length;m.issues.push({origin:v,...w?{code:"too_big",maximum:l.length}:{code:"too_small",minimum:l.length},inclusive:!0,exact:!0,input:m.value,inst:u,continue:!l.abort})}}),O=f.$constructor("$ZodCheckStringFormat",(u,l)=>{var m,f;v.init(u,l),u._zod.onattach.push(u=>{const m=u._zod.bag;m.format=l.format,l.pattern&&(m.patterns??(m.patterns=new Set),m.patterns.add(l.pattern))}),l.pattern?(m=u._zod).check??(m.check=m=>{l.pattern.lastIndex=0,l.pattern.test(m.value)||m.issues.push({origin:"string",code:"invalid_format",format:l.format,input:m.value,...l.pattern?{pattern:l.pattern.toString()}:{},inst:u,continue:!l.abort})}):(f=u._zod).check??(f.check=()=>{})}),D=f.$constructor("$ZodCheckRegex",(u,l)=>{O.init(u,l),u._zod.check=m=>{l.pattern.lastIndex=0,l.pattern.test(m.value)||m.issues.push({origin:"string",code:"invalid_format",format:"regex",input:m.value,pattern:l.pattern.toString(),inst:u,continue:!l.abort})}}),N=f.$constructor("$ZodCheckLowerCase",(u,l)=>{l.pattern??(l.pattern=h.lowercase),O.init(u,l)}),M=f.$constructor("$ZodCheckUpperCase",(u,l)=>{l.pattern??(l.pattern=h.uppercase),O.init(u,l)}),U=f.$constructor("$ZodCheckIncludes",(u,l)=>{v.init(u,l);const m=y.escapeRegex(l.includes),f=new RegExp("number"==typeof l.position?`^.{${l.position}}${m}`:m);l.pattern=f,u._zod.onattach.push(u=>{const l=u._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(f)}),u._zod.check=m=>{m.value.includes(l.includes,l.position)||m.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:l.includes,input:m.value,inst:u,continue:!l.abort})}}),L=f.$constructor("$ZodCheckStartsWith",(u,l)=>{v.init(u,l);const m=new RegExp(`^${y.escapeRegex(l.prefix)}.*`);l.pattern??(l.pattern=m),u._zod.onattach.push(u=>{const l=u._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(m)}),u._zod.check=m=>{m.value.startsWith(l.prefix)||m.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:l.prefix,input:m.value,inst:u,continue:!l.abort})}}),F=f.$constructor("$ZodCheckEndsWith",(u,l)=>{v.init(u,l);const m=new RegExp(`.*${y.escapeRegex(l.suffix)}$`);l.pattern??(l.pattern=m),u._zod.onattach.push(u=>{const l=u._zod.bag;l.patterns??(l.patterns=new Set),l.patterns.add(m)}),u._zod.check=m=>{m.value.endsWith(l.suffix)||m.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:l.suffix,input:m.value,inst:u,continue:!l.abort})}});function handleCheckPropertyResult(u,l,m){u.issues.length&&l.issues.push(...y.prefixIssues(m,u.issues))}const V=f.$constructor("$ZodCheckProperty",(u,l)=>{v.init(u,l),u._zod.check=u=>{const m=l.schema._zod.run({value:u.value[l.property],issues:[]},{});if(m instanceof Promise)return m.then(m=>handleCheckPropertyResult(m,u,l.property));handleCheckPropertyResult(m,u,l.property)}}),K=f.$constructor("$ZodCheckMimeType",(u,l)=>{v.init(u,l);const m=new Set(l.mime);u._zod.onattach.push(u=>{u._zod.bag.mime=l.mime}),u._zod.check=f=>{m.has(f.value.type)||f.issues.push({code:"invalid_value",values:l.mime,input:f.value.type,inst:u})}}),H=f.$constructor("$ZodCheckOverwrite",(u,l)=>{v.init(u,l),u._zod.check=u=>{u.value=l.tx(u.value)}})},"./node_modules/zod/v4/core/core.js":function(u,l,m){m.r(l),m.d(l,{$ZodAsyncError:function(){return $ZodAsyncError},$brand:function(){return h},$constructor:function(){return $constructor},NEVER:function(){return f},config:function(){return config},globalConfig:function(){return y}});const f=Object.freeze({status:"aborted"});function $constructor(u,l,m){function init(m,f){var h;Object.defineProperty(m,"_zod",{value:m._zod??{},enumerable:!1}),(h=m._zod).traits??(h.traits=new Set),m._zod.traits.add(u),l(m,f);for(const u in _.prototype)u in m||Object.defineProperty(m,u,{value:_.prototype[u].bind(m)});m._zod.constr=_,m._zod.def=f}const f=m?.Parent??Object;class Definition extends f{}function _(u){var l;const f=m?.Parent?new Definition:this;init(f,u),(l=f._zod).deferred??(l.deferred=[]);for(const u of f._zod.deferred)u();return f}return Object.defineProperty(Definition,"name",{value:u}),Object.defineProperty(_,"init",{value:init}),Object.defineProperty(_,Symbol.hasInstance,{value:l=>!!(m?.Parent&&l instanceof m.Parent)||l?._zod?.traits?.has(u)}),Object.defineProperty(_,"name",{value:u}),_}const h=Symbol("zod_brand");class $ZodAsyncError extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const y={};function config(u){return u&&Object.assign(y,u),y}},"./node_modules/zod/v4/core/doc.js":function(u,l,m){m.r(l),m.d(l,{Doc:function(){return Doc}});class Doc{constructor(u=[]){this.content=[],this.indent=0,this&&(this.args=u)}indented(u){this.indent+=1,u(this),this.indent-=1}write(u){if("function"==typeof u)return u(this,{execution:"sync"}),void u(this,{execution:"async"});const l=u.split("\n").filter(u=>u),m=Math.min(...l.map(u=>u.length-u.trimStart().length)),f=l.map(u=>u.slice(m)).map(u=>" ".repeat(2*this.indent)+u);for(const u of f)this.content.push(u)}compile(){const u=Function,l=this?.args;return new u(...l,[...(this?.content??[""]).map(u=>` ${u}`)].join("\n"))}}},"./node_modules/zod/v4/core/errors.js":function(u,l,m){m.r(l),m.d(l,{$ZodError:function(){return y},$ZodRealError:function(){return v},flattenError:function(){return flattenError},formatError:function(){return formatError},prettifyError:function(){return prettifyError},toDotPath:function(){return toDotPath},treeifyError:function(){return treeifyError}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/util.js");const initializer=(u,l)=>{u.name="$ZodError",Object.defineProperty(u,"_zod",{value:u._zod,enumerable:!1}),Object.defineProperty(u,"issues",{value:l,enumerable:!1}),Object.defineProperty(u,"message",{get(){return JSON.stringify(l,h.jsonStringifyReplacer,2)},enumerable:!0}),Object.defineProperty(u,"toString",{value:()=>u.message,enumerable:!1})},y=(0,f.$constructor)("$ZodError",initializer),v=(0,f.$constructor)("$ZodError",initializer,{Parent:Error});function flattenError(u,l=u=>u.message){const m={},f=[];for(const h of u.issues)h.path.length>0?(m[h.path[0]]=m[h.path[0]]||[],m[h.path[0]].push(l(h))):f.push(l(h));return{formErrors:f,fieldErrors:m}}function formatError(u,l){const m=l||function(u){return u.message},f={_errors:[]},processError=u=>{for(const l of u.issues)if("invalid_union"===l.code&&l.errors.length)l.errors.map(u=>processError({issues:u}));else if("invalid_key"===l.code)processError({issues:l.issues});else if("invalid_element"===l.code)processError({issues:l.issues});else if(0===l.path.length)f._errors.push(m(l));else{let u=f,h=0;for(;h<l.path.length;){const f=l.path[h];h===l.path.length-1?(u[f]=u[f]||{_errors:[]},u[f]._errors.push(m(l))):u[f]=u[f]||{_errors:[]},u=u[f],h++}}};return processError(u),f}function treeifyError(u,l){const m=l||function(u){return u.message},f={errors:[]},processError=(u,l=[])=>{var h,y;for(const v of u.issues)if("invalid_union"===v.code&&v.errors.length)v.errors.map(u=>processError({issues:u},v.path));else if("invalid_key"===v.code)processError({issues:v.issues},v.path);else if("invalid_element"===v.code)processError({issues:v.issues},v.path);else{const u=[...l,...v.path];if(0===u.length){f.errors.push(m(v));continue}let w=f,b=0;for(;b<u.length;){const l=u[b],f=b===u.length-1;"string"==typeof l?(w.properties??(w.properties={}),(h=w.properties)[l]??(h[l]={errors:[]}),w=w.properties[l]):(w.items??(w.items=[]),(y=w.items)[l]??(y[l]={errors:[]}),w=w.items[l]),f&&w.errors.push(m(v)),b++}}};return processError(u),f}function toDotPath(u){const l=[];for(const m of u)"number"==typeof m?l.push(`[${m}]`):"symbol"==typeof m?l.push(`[${JSON.stringify(String(m))}]`):/[^\w$]/.test(m)?l.push(`[${JSON.stringify(m)}]`):(l.length&&l.push("."),l.push(m));return l.join("")}function prettifyError(u){const l=[],m=[...u.issues].sort((u,l)=>u.path.length-l.path.length);for(const u of m)l.push(`✖ ${u.message}`),u.path?.length&&l.push(` → at ${toDotPath(u.path)}`);return l.join("\n")}},"./node_modules/zod/v4/core/parse.js":function(u,l,m){m.r(l),m.d(l,{_parse:function(){return _parse},_parseAsync:function(){return _parseAsync},_safeParse:function(){return _safeParse},_safeParseAsync:function(){return _safeParseAsync},parse:function(){return v},parseAsync:function(){return w},safeParse:function(){return b},safeParseAsync:function(){return S}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/errors.js"),y=m("./node_modules/zod/v4/core/util.js");const _parse=u=>(l,m,h,v)=>{const w=h?Object.assign(h,{async:!1}):{async:!1},b=l._zod.run({value:m,issues:[]},w);if(b instanceof Promise)throw new f.$ZodAsyncError;if(b.issues.length){const l=new(v?.Err??u)(b.issues.map(u=>y.finalizeIssue(u,w,f.config())));throw y.captureStackTrace(l,v?.callee),l}return b.value},v=_parse(h.$ZodRealError),_parseAsync=u=>async(l,m,h,v)=>{const w=h?Object.assign(h,{async:!0}):{async:!0};let b=l._zod.run({value:m,issues:[]},w);if(b instanceof Promise&&(b=await b),b.issues.length){const l=new(v?.Err??u)(b.issues.map(u=>y.finalizeIssue(u,w,f.config())));throw y.captureStackTrace(l,v?.callee),l}return b.value},w=_parseAsync(h.$ZodRealError),_safeParse=u=>(l,m,v)=>{const w=v?{...v,async:!1}:{async:!1},b=l._zod.run({value:m,issues:[]},w);if(b instanceof Promise)throw new f.$ZodAsyncError;return b.issues.length?{success:!1,error:new(u??h.$ZodError)(b.issues.map(u=>y.finalizeIssue(u,w,f.config())))}:{success:!0,data:b.value}},b=_safeParse(h.$ZodRealError),_safeParseAsync=u=>async(l,m,h)=>{const v=h?Object.assign(h,{async:!0}):{async:!0};let w=l._zod.run({value:m,issues:[]},v);return w instanceof Promise&&(w=await w),w.issues.length?{success:!1,error:new u(w.issues.map(u=>y.finalizeIssue(u,v,f.config())))}:{success:!0,data:w.value}},S=_safeParseAsync(h.$ZodRealError)},"./node_modules/zod/v4/core/regexes.js":function(u,l,m){m.r(l),m.d(l,{_emoji:function(){return D},base64:function(){return F},base64url:function(){return V},bigint:function(){return G},boolean:function(){return X},browserEmail:function(){return O},cidrv4:function(){return U},cidrv6:function(){return L},cuid:function(){return f},cuid2:function(){return h},date:function(){return W},datetime:function(){return datetime},domain:function(){return H},duration:function(){return S},e164:function(){return B},email:function(){return Z},emoji:function(){return emoji},extendedDuration:function(){return j},guid:function(){return $},hostname:function(){return K},html5Email:function(){return C},integer:function(){return Q},ipv4:function(){return N},ipv6:function(){return M},ksuid:function(){return w},lowercase:function(){return ne},nanoid:function(){return b},null:function(){return ee},number:function(){return Y},rfc5322Email:function(){return z},string:function(){return string},time:function(){return time},ulid:function(){return y},undefined:function(){return te},unicodeEmail:function(){return A},uppercase:function(){return re},uuid:function(){return uuid},uuid4:function(){return x},uuid6:function(){return E},uuid7:function(){return R},xid:function(){return v}});const f=/^[cC][^\s-]{8,}$/,h=/^[0-9a-z]+$/,y=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,v=/^[0-9a-vA-V]{20}$/,w=/^[A-Za-z0-9]{27}$/,b=/^[a-zA-Z0-9_-]{21}$/,S=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,j=/^[-+]?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)?)??$/,$=/^([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})$/,uuid=u=>u?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${u}[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)$/,x=uuid(4),E=uuid(6),R=uuid(7),Z=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,C=/^[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])?)*$/,z=/^(([^<>()\[\]\\.,;:\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,}))$/,A=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,O=/^[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])?)*$/,D="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function emoji(){return new RegExp(D,"u")}const N=/^(?:(?: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])$/,M=/^(([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})$/,U=/^((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])$/,L=/^(([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])$/,F=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,V=/^[A-Za-z0-9_-]*$/,K=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,H=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,B=/^\+(?:[0-9]){6,14}[0-9]$/,J="(?:(?:\\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])))",W=new RegExp(`^${J}$`);function timeSource(u){const l="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof u.precision?-1===u.precision?`${l}`:0===u.precision?`${l}:[0-5]\\d`:`${l}:[0-5]\\d\\.\\d{${u.precision}}`:`${l}(?::[0-5]\\d(?:\\.\\d+)?)?`}function time(u){return new RegExp(`^${timeSource(u)}$`)}function datetime(u){const l=timeSource({precision:u.precision}),m=["Z"];u.local&&m.push(""),u.offset&&m.push("([+-]\\d{2}:\\d{2})");const f=`${l}(?:${m.join("|")})`;return new RegExp(`^${J}T(?:${f})$`)}const string=u=>new RegExp(`^${u?`[\\s\\S]{${u?.minimum??0},${u?.maximum??""}}`:"[\\s\\S]*"}$`),G=/^\d+n?$/,Q=/^\d+$/,Y=/^-?\d+(?:\.\d+)?/i,X=/true|false/i,ee=/null/i,te=/undefined/i,ne=/^[^A-Z]*$/,re=/^[^a-z]*$/},"./node_modules/zod/v4/core/registries.js":function(u,l,m){m.r(l),m.d(l,{$ZodRegistry:function(){return $ZodRegistry},$input:function(){return h},$output:function(){return f},globalRegistry:function(){return y},registry:function(){return registry}});const f=Symbol("ZodOutput"),h=Symbol("ZodInput");class $ZodRegistry{constructor(){this._map=new Map,this._idmap=new Map}add(u,...l){const m=l[0];if(this._map.set(u,m),m&&"object"==typeof m&&"id"in m){if(this._idmap.has(m.id))throw new Error(`ID ${m.id} already exists in the registry`);this._idmap.set(m.id,u)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(u){const l=this._map.get(u);return l&&"object"==typeof l&&"id"in l&&this._idmap.delete(l.id),this._map.delete(u),this}get(u){const l=u._zod.parent;if(l){const m={...this.get(l)??{}};return delete m.id,{...m,...this._map.get(u)}}return this._map.get(u)}has(u){return this._map.has(u)}}function registry(){return new $ZodRegistry}const y=registry()},"./node_modules/zod/v4/core/schemas.js":function(u,l,m){m.r(l),m.d(l,{$ZodAny:function(){return ce},$ZodArray:function(){return fe},$ZodBase64:function(){return G},$ZodBase64URL:function(){return Q},$ZodBigInt:function(){return oe},$ZodBigIntFormat:function(){return se},$ZodBoolean:function(){return re},$ZodCIDRv4:function(){return J},$ZodCIDRv6:function(){return W},$ZodCUID:function(){return O},$ZodCUID2:function(){return D},$ZodCatch:function(){return Ce},$ZodCustom:function(){return Ue},$ZodCustomStringFormat:function(){return ee},$ZodDate:function(){return me},$ZodDefault:function(){return Ee},$ZodDiscriminatedUnion:function(){return _e},$ZodE164:function(){return Y},$ZodEmail:function(){return Z},$ZodEmoji:function(){return z},$ZodEnum:function(){return Se},$ZodFile:function(){return Pe},$ZodGUID:function(){return E},$ZodIPv4:function(){return H},$ZodIPv6:function(){return B},$ZodISODate:function(){return F},$ZodISODateTime:function(){return L},$ZodISODuration:function(){return K},$ZodISOTime:function(){return V},$ZodIntersection:function(){return ye},$ZodJWT:function(){return X},$ZodKSUID:function(){return U},$ZodLazy:function(){return Me},$ZodLiteral:function(){return je},$ZodMap:function(){return be},$ZodNaN:function(){return ze},$ZodNanoID:function(){return A},$ZodNever:function(){return le},$ZodNonOptional:function(){return Re},$ZodNull:function(){return de},$ZodNullable:function(){return xe},$ZodNumber:function(){return te},$ZodNumberFormat:function(){return ne},$ZodObject:function(){return he},$ZodOptional:function(){return Te},$ZodPipe:function(){return Ae},$ZodPrefault:function(){return Ie},$ZodPromise:function(){return Ne},$ZodReadonly:function(){return Oe},$ZodRecord:function(){return we},$ZodSet:function(){return ke},$ZodString:function(){return $},$ZodStringFormat:function(){return x},$ZodSuccess:function(){return Ze},$ZodSymbol:function(){return ie},$ZodTemplateLiteral:function(){return De},$ZodTransform:function(){return $e},$ZodTuple:function(){return ve},$ZodType:function(){return j},$ZodULID:function(){return N},$ZodURL:function(){return C},$ZodUUID:function(){return R},$ZodUndefined:function(){return ae},$ZodUnion:function(){return ge},$ZodUnknown:function(){return ue},$ZodVoid:function(){return pe},$ZodXID:function(){return M},clone:function(){return b.clone},isValidBase64:function(){return isValidBase64},isValidBase64URL:function(){return isValidBase64URL},isValidJWT:function(){return isValidJWT}});var f=m("./node_modules/zod/v4/core/checks.js"),h=m("./node_modules/zod/v4/core/core.js"),y=m("./node_modules/zod/v4/core/doc.js"),v=m("./node_modules/zod/v4/core/parse.js"),w=m("./node_modules/zod/v4/core/regexes.js"),b=m("./node_modules/zod/v4/core/util.js"),S=m("./node_modules/zod/v4/core/versions.js");const j=h.$constructor("$ZodType",(u,l)=>{var m;u??(u={}),u._zod.def=l,u._zod.bag=u._zod.bag||{},u._zod.version=S.version;const f=[...u._zod.def.checks??[]];u._zod.traits.has("$ZodCheck")&&f.unshift(u);for(const l of f)for(const m of l._zod.onattach)m(u);if(0===f.length)(m=u._zod).deferred??(m.deferred=[]),u._zod.deferred?.push(()=>{u._zod.run=u._zod.parse});else{const runChecks=(u,l,m)=>{let f,y=b.aborted(u);for(const v of l){if(v._zod.def.when){if(!v._zod.def.when(u))continue}else if(y)continue;const l=u.issues.length,w=v._zod.check(u);if(w instanceof Promise&&!1===m?.async)throw new h.$ZodAsyncError;if(f||w instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await w;u.issues.length!==l&&(y||(y=b.aborted(u,l)))});else{if(u.issues.length===l)continue;y||(y=b.aborted(u,l))}}return f?f.then(()=>u):u};u._zod.run=(l,m)=>{const y=u._zod.parse(l,m);if(y instanceof Promise){if(!1===m.async)throw new h.$ZodAsyncError;return y.then(u=>runChecks(u,f,m))}return runChecks(y,f,m)}}u["~standard"]={validate:l=>{try{const m=(0,v.safeParse)(u,l);return m.success?{value:m.data}:{issues:m.error?.issues}}catch(m){return(0,v.safeParseAsync)(u,l).then(u=>u.success?{value:u.data}:{issues:u.error?.issues})}},vendor:"zod",version:1}}),$=h.$constructor("$ZodString",(u,l)=>{j.init(u,l),u._zod.pattern=[...u?._zod.bag?.patterns??[]].pop()??w.string(u._zod.bag),u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=String(m.value)}catch(f){}return"string"==typeof m.value||m.issues.push({expected:"string",code:"invalid_type",input:m.value,inst:u}),m}}),x=h.$constructor("$ZodStringFormat",(u,l)=>{f.$ZodCheckStringFormat.init(u,l),$.init(u,l)}),E=h.$constructor("$ZodGUID",(u,l)=>{l.pattern??(l.pattern=w.guid),x.init(u,l)}),R=h.$constructor("$ZodUUID",(u,l)=>{if(l.version){const u={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[l.version];if(void 0===u)throw new Error(`Invalid UUID version: "${l.version}"`);l.pattern??(l.pattern=w.uuid(u))}else l.pattern??(l.pattern=w.uuid());x.init(u,l)}),Z=h.$constructor("$ZodEmail",(u,l)=>{l.pattern??(l.pattern=w.email),x.init(u,l)}),C=h.$constructor("$ZodURL",(u,l)=>{x.init(u,l),u._zod.check=m=>{try{const f=m.value,h=new URL(f),y=h.href;return l.hostname&&(l.hostname.lastIndex=0,l.hostname.test(h.hostname)||m.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:w.hostname.source,input:m.value,inst:u,continue:!l.abort})),l.protocol&&(l.protocol.lastIndex=0,l.protocol.test(h.protocol.endsWith(":")?h.protocol.slice(0,-1):h.protocol)||m.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:l.protocol.source,input:m.value,inst:u,continue:!l.abort})),void(!f.endsWith("/")&&y.endsWith("/")?m.value=y.slice(0,-1):m.value=y)}catch(f){m.issues.push({code:"invalid_format",format:"url",input:m.value,inst:u,continue:!l.abort})}}}),z=h.$constructor("$ZodEmoji",(u,l)=>{l.pattern??(l.pattern=w.emoji()),x.init(u,l)}),A=h.$constructor("$ZodNanoID",(u,l)=>{l.pattern??(l.pattern=w.nanoid),x.init(u,l)}),O=h.$constructor("$ZodCUID",(u,l)=>{l.pattern??(l.pattern=w.cuid),x.init(u,l)}),D=h.$constructor("$ZodCUID2",(u,l)=>{l.pattern??(l.pattern=w.cuid2),x.init(u,l)}),N=h.$constructor("$ZodULID",(u,l)=>{l.pattern??(l.pattern=w.ulid),x.init(u,l)}),M=h.$constructor("$ZodXID",(u,l)=>{l.pattern??(l.pattern=w.xid),x.init(u,l)}),U=h.$constructor("$ZodKSUID",(u,l)=>{l.pattern??(l.pattern=w.ksuid),x.init(u,l)}),L=h.$constructor("$ZodISODateTime",(u,l)=>{l.pattern??(l.pattern=w.datetime(l)),x.init(u,l)}),F=h.$constructor("$ZodISODate",(u,l)=>{l.pattern??(l.pattern=w.date),x.init(u,l)}),V=h.$constructor("$ZodISOTime",(u,l)=>{l.pattern??(l.pattern=w.time(l)),x.init(u,l)}),K=h.$constructor("$ZodISODuration",(u,l)=>{l.pattern??(l.pattern=w.duration),x.init(u,l)}),H=h.$constructor("$ZodIPv4",(u,l)=>{l.pattern??(l.pattern=w.ipv4),x.init(u,l),u._zod.onattach.push(u=>{u._zod.bag.format="ipv4"})}),B=h.$constructor("$ZodIPv6",(u,l)=>{l.pattern??(l.pattern=w.ipv6),x.init(u,l),u._zod.onattach.push(u=>{u._zod.bag.format="ipv6"}),u._zod.check=m=>{try{new URL(`http://[${m.value}]`)}catch{m.issues.push({code:"invalid_format",format:"ipv6",input:m.value,inst:u,continue:!l.abort})}}}),J=h.$constructor("$ZodCIDRv4",(u,l)=>{l.pattern??(l.pattern=w.cidrv4),x.init(u,l)}),W=h.$constructor("$ZodCIDRv6",(u,l)=>{l.pattern??(l.pattern=w.cidrv6),x.init(u,l),u._zod.check=m=>{const[f,h]=m.value.split("/");try{if(!h)throw new Error;const u=Number(h);if(`${u}`!==h)throw new Error;if(u<0||u>128)throw new Error;new URL(`http://[${f}]`)}catch{m.issues.push({code:"invalid_format",format:"cidrv6",input:m.value,inst:u,continue:!l.abort})}}});function isValidBase64(u){if(""===u)return!0;if(u.length%4!=0)return!1;try{return atob(u),!0}catch{return!1}}const G=h.$constructor("$ZodBase64",(u,l)=>{l.pattern??(l.pattern=w.base64),x.init(u,l),u._zod.onattach.push(u=>{u._zod.bag.contentEncoding="base64"}),u._zod.check=m=>{isValidBase64(m.value)||m.issues.push({code:"invalid_format",format:"base64",input:m.value,inst:u,continue:!l.abort})}});function isValidBase64URL(u){if(!w.base64url.test(u))return!1;const l=u.replace(/[-_]/g,u=>"-"===u?"+":"/");return isValidBase64(l.padEnd(4*Math.ceil(l.length/4),"="))}const Q=h.$constructor("$ZodBase64URL",(u,l)=>{l.pattern??(l.pattern=w.base64url),x.init(u,l),u._zod.onattach.push(u=>{u._zod.bag.contentEncoding="base64url"}),u._zod.check=m=>{isValidBase64URL(m.value)||m.issues.push({code:"invalid_format",format:"base64url",input:m.value,inst:u,continue:!l.abort})}}),Y=h.$constructor("$ZodE164",(u,l)=>{l.pattern??(l.pattern=w.e164),x.init(u,l)});function isValidJWT(u,l=null){try{const m=u.split(".");if(3!==m.length)return!1;const[f]=m;if(!f)return!1;const h=JSON.parse(atob(f));return(!("typ"in h)||"JWT"===h?.typ)&&(!!h.alg&&(!l||"alg"in h&&h.alg===l))}catch{return!1}}const X=h.$constructor("$ZodJWT",(u,l)=>{x.init(u,l),u._zod.check=m=>{isValidJWT(m.value,l.alg)||m.issues.push({code:"invalid_format",format:"jwt",input:m.value,inst:u,continue:!l.abort})}}),ee=h.$constructor("$ZodCustomStringFormat",(u,l)=>{x.init(u,l),u._zod.check=m=>{l.fn(m.value)||m.issues.push({code:"invalid_format",format:l.format,input:m.value,inst:u,continue:!l.abort})}}),te=h.$constructor("$ZodNumber",(u,l)=>{j.init(u,l),u._zod.pattern=u._zod.bag.pattern??w.number,u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=Number(m.value)}catch(u){}const h=m.value;if("number"==typeof h&&!Number.isNaN(h)&&Number.isFinite(h))return m;const y="number"==typeof h?Number.isNaN(h)?"NaN":Number.isFinite(h)?void 0:"Infinity":void 0;return m.issues.push({expected:"number",code:"invalid_type",input:h,inst:u,...y?{received:y}:{}}),m}}),ne=h.$constructor("$ZodNumber",(u,l)=>{f.$ZodCheckNumberFormat.init(u,l),te.init(u,l)}),re=h.$constructor("$ZodBoolean",(u,l)=>{j.init(u,l),u._zod.pattern=w.boolean,u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=Boolean(m.value)}catch(u){}const h=m.value;return"boolean"==typeof h||m.issues.push({expected:"boolean",code:"invalid_type",input:h,inst:u}),m}}),oe=h.$constructor("$ZodBigInt",(u,l)=>{j.init(u,l),u._zod.pattern=w.bigint,u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=BigInt(m.value)}catch(u){}return"bigint"==typeof m.value||m.issues.push({expected:"bigint",code:"invalid_type",input:m.value,inst:u}),m}}),se=h.$constructor("$ZodBigInt",(u,l)=>{f.$ZodCheckBigIntFormat.init(u,l),oe.init(u,l)}),ie=h.$constructor("$ZodSymbol",(u,l)=>{j.init(u,l),u._zod.parse=(l,m)=>{const f=l.value;return"symbol"==typeof f||l.issues.push({expected:"symbol",code:"invalid_type",input:f,inst:u}),l}}),ae=h.$constructor("$ZodUndefined",(u,l)=>{j.init(u,l),u._zod.pattern=w.undefined,u._zod.values=new Set([void 0]),u._zod.optin="optional",u._zod.optout="optional",u._zod.parse=(l,m)=>{const f=l.value;return void 0===f||l.issues.push({expected:"undefined",code:"invalid_type",input:f,inst:u}),l}}),de=h.$constructor("$ZodNull",(u,l)=>{j.init(u,l),u._zod.pattern=w.null,u._zod.values=new Set([null]),u._zod.parse=(l,m)=>{const f=l.value;return null===f||l.issues.push({expected:"null",code:"invalid_type",input:f,inst:u}),l}}),ce=h.$constructor("$ZodAny",(u,l)=>{j.init(u,l),u._zod.parse=u=>u}),ue=h.$constructor("$ZodUnknown",(u,l)=>{j.init(u,l),u._zod.parse=u=>u}),le=h.$constructor("$ZodNever",(u,l)=>{j.init(u,l),u._zod.parse=(l,m)=>(l.issues.push({expected:"never",code:"invalid_type",input:l.value,inst:u}),l)}),pe=h.$constructor("$ZodVoid",(u,l)=>{j.init(u,l),u._zod.parse=(l,m)=>{const f=l.value;return void 0===f||l.issues.push({expected:"void",code:"invalid_type",input:f,inst:u}),l}}),me=h.$constructor("$ZodDate",(u,l)=>{j.init(u,l),u._zod.parse=(m,f)=>{if(l.coerce)try{m.value=new Date(m.value)}catch(u){}const h=m.value,y=h instanceof Date;return y&&!Number.isNaN(h.getTime())||m.issues.push({expected:"date",code:"invalid_type",input:h,...y?{received:"Invalid Date"}:{},inst:u}),m}});function handleArrayResult(u,l,m){u.issues.length&&l.issues.push(...b.prefixIssues(m,u.issues)),l.value[m]=u.value}const fe=h.$constructor("$ZodArray",(u,l)=>{j.init(u,l),u._zod.parse=(m,f)=>{const h=m.value;if(!Array.isArray(h))return m.issues.push({expected:"array",code:"invalid_type",input:h,inst:u}),m;m.value=Array(h.length);const y=[];for(let u=0;u<h.length;u++){const v=h[u],w=l.element._zod.run({value:v,issues:[]},f);w instanceof Promise?y.push(w.then(l=>handleArrayResult(l,m,u))):handleArrayResult(w,m,u)}return y.length?Promise.all(y).then(()=>m):m}});function handleObjectResult(u,l,m){u.issues.length&&l.issues.push(...b.prefixIssues(m,u.issues)),l.value[m]=u.value}function handleOptionalObjectResult(u,l,m,f){u.issues.length?void 0===f[m]?l.value[m]=m in f?void 0:u.value:l.issues.push(...b.prefixIssues(m,u.issues)):void 0===u.value?m in f&&(l.value[m]=void 0):l.value[m]=u.value}const he=h.$constructor("$ZodObject",(u,l)=>{j.init(u,l);const m=b.cached(()=>{const u=Object.keys(l.shape);for(const m of u)if(!(l.shape[m]instanceof j))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const m=b.optionalKeys(l.shape);return{shape:l.shape,keys:u,keySet:new Set(u),numKeys:u.length,optionalKeys:new Set(m)}});b.defineLazy(u._zod,"propValues",()=>{const u=l.shape,m={};for(const l in u){const f=u[l]._zod;if(f.values){m[l]??(m[l]=new Set);for(const u of f.values)m[l].add(u)}}return m});let f;const v=b.isObject,w=!h.globalConfig.jitless,S=b.allowsEval,$=w&&S.value,x=l.catchall;let E;u._zod.parse=(h,S)=>{E??(E=m.value);const j=h.value;if(!v(j))return h.issues.push({expected:"object",code:"invalid_type",input:j,inst:u}),h;const R=[];if(w&&$&&!1===S?.async&&!0!==S.jitless)f||(f=(u=>{const l=new y.Doc(["shape","payload","ctx"]),f=m.value,parseStr=u=>{const l=b.esc(u);return`shape[${l}]._zod.run({ value: input[${l}], issues: [] }, ctx)`};l.write("const input = payload.value;");const h=Object.create(null);let v=0;for(const u of f.keys)h[u]="key_"+v++;l.write("const newResult = {}");for(const u of f.keys)if(f.optionalKeys.has(u)){const m=h[u];l.write(`const ${m} = ${parseStr(u)};`);const f=b.esc(u);l.write(`\n if (${m}.issues.length) {\n if (input[${f}] === undefined) {\n if (${f} in input) {\n newResult[${f}] = undefined;\n }\n } else {\n payload.issues = payload.issues.concat(\n ${m}.issues.map((iss) => ({\n ...iss,\n path: iss.path ? [${f}, ...iss.path] : [${f}],\n }))\n );\n }\n } else if (${m}.value === undefined) {\n if (${f} in input) newResult[${f}] = undefined;\n } else {\n newResult[${f}] = ${m}.value;\n }\n `)}else{const m=h[u];l.write(`const ${m} = ${parseStr(u)};`),l.write(`\n if (${m}.issues.length) payload.issues = payload.issues.concat(${m}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${b.esc(u)}, ...iss.path] : [${b.esc(u)}]\n })));`),l.write(`newResult[${b.esc(u)}] = ${m}.value`)}l.write("payload.value = newResult;"),l.write("return payload;");const w=l.compile();return(l,m)=>w(u,l,m)})(l.shape)),h=f(h,S);else{h.value={};const u=E.shape;for(const l of E.keys){const m=u[l],f=m._zod.run({value:j[l],issues:[]},S),y="optional"===m._zod.optin&&"optional"===m._zod.optout;f instanceof Promise?R.push(f.then(u=>y?handleOptionalObjectResult(u,h,l,j):handleObjectResult(u,h,l))):y?handleOptionalObjectResult(f,h,l,j):handleObjectResult(f,h,l)}}if(!x)return R.length?Promise.all(R).then(()=>h):h;const Z=[],C=E.keySet,z=x._zod,A=z.def.type;for(const u of Object.keys(j)){if(C.has(u))continue;if("never"===A){Z.push(u);continue}const l=z.run({value:j[u],issues:[]},S);l instanceof Promise?R.push(l.then(l=>handleObjectResult(l,h,u))):handleObjectResult(l,h,u)}return Z.length&&h.issues.push({code:"unrecognized_keys",keys:Z,input:j,inst:u}),R.length?Promise.all(R).then(()=>h):h}});function handleUnionResults(u,l,m,f){for(const m of u)if(0===m.issues.length)return l.value=m.value,l;return l.issues.push({code:"invalid_union",input:l.value,inst:m,errors:u.map(u=>u.issues.map(u=>b.finalizeIssue(u,f,h.config())))}),l}const ge=h.$constructor("$ZodUnion",(u,l)=>{j.init(u,l),b.defineLazy(u._zod,"optin",()=>l.options.some(u=>"optional"===u._zod.optin)?"optional":void 0),b.defineLazy(u._zod,"optout",()=>l.options.some(u=>"optional"===u._zod.optout)?"optional":void 0),b.defineLazy(u._zod,"values",()=>{if(l.options.every(u=>u._zod.values))return new Set(l.options.flatMap(u=>Array.from(u._zod.values)))}),b.defineLazy(u._zod,"pattern",()=>{if(l.options.every(u=>u._zod.pattern)){const u=l.options.map(u=>u._zod.pattern);return new RegExp(`^(${u.map(u=>b.cleanRegex(u.source)).join("|")})$`)}}),u._zod.parse=(m,f)=>{let h=!1;const y=[];for(const u of l.options){const l=u._zod.run({value:m.value,issues:[]},f);if(l instanceof Promise)y.push(l),h=!0;else{if(0===l.issues.length)return l;y.push(l)}}return h?Promise.all(y).then(l=>handleUnionResults(l,m,u,f)):handleUnionResults(y,m,u,f)}}),_e=h.$constructor("$ZodDiscriminatedUnion",(u,l)=>{ge.init(u,l);const m=u._zod.parse;b.defineLazy(u._zod,"propValues",()=>{const u={};for(const m of l.options){const f=m._zod.propValues;if(!f||0===Object.keys(f).length)throw new Error(`Invalid discriminated union option at index "${l.options.indexOf(m)}"`);for(const[l,m]of Object.entries(f)){u[l]||(u[l]=new Set);for(const f of m)u[l].add(f)}}return u});const f=b.cached(()=>{const u=l.options,m=new Map;for(const f of u){const u=f._zod.propValues[l.discriminator];if(!u||0===u.size)throw new Error(`Invalid discriminated union option at index "${l.options.indexOf(f)}"`);for(const l of u){if(m.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);m.set(l,f)}}return m});u._zod.parse=(h,y)=>{const v=h.value;if(!b.isObject(v))return h.issues.push({code:"invalid_type",expected:"object",input:v,inst:u}),h;const w=f.value.get(v?.[l.discriminator]);return w?w._zod.run(h,y):l.unionFallback?m(h,y):(h.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:v,path:[l.discriminator],inst:u}),h)}}),ye=h.$constructor("$ZodIntersection",(u,l)=>{j.init(u,l),u._zod.parse=(u,m)=>{const f=u.value,h=l.left._zod.run({value:f,issues:[]},m),y=l.right._zod.run({value:f,issues:[]},m);return h instanceof Promise||y instanceof Promise?Promise.all([h,y]).then(([l,m])=>handleIntersectionResults(u,l,m)):handleIntersectionResults(u,h,y)}});function mergeValues(u,l){if(u===l)return{valid:!0,data:u};if(u instanceof Date&&l instanceof Date&&+u===+l)return{valid:!0,data:u};if(b.isPlainObject(u)&&b.isPlainObject(l)){const m=Object.keys(l),f=Object.keys(u).filter(u=>-1!==m.indexOf(u)),h={...u,...l};for(const m of f){const f=mergeValues(u[m],l[m]);if(!f.valid)return{valid:!1,mergeErrorPath:[m,...f.mergeErrorPath]};h[m]=f.data}return{valid:!0,data:h}}if(Array.isArray(u)&&Array.isArray(l)){if(u.length!==l.length)return{valid:!1,mergeErrorPath:[]};const m=[];for(let f=0;f<u.length;f++){const h=mergeValues(u[f],l[f]);if(!h.valid)return{valid:!1,mergeErrorPath:[f,...h.mergeErrorPath]};m.push(h.data)}return{valid:!0,data:m}}return{valid:!1,mergeErrorPath:[]}}function handleIntersectionResults(u,l,m){if(l.issues.length&&u.issues.push(...l.issues),m.issues.length&&u.issues.push(...m.issues),b.aborted(u))return u;const f=mergeValues(l.value,m.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return u.value=f.data,u}const ve=h.$constructor("$ZodTuple",(u,l)=>{j.init(u,l);const m=l.items,f=m.length-[...m].reverse().findIndex(u=>"optional"!==u._zod.optin);u._zod.parse=(h,y)=>{const v=h.value;if(!Array.isArray(v))return h.issues.push({input:v,inst:u,expected:"tuple",code:"invalid_type"}),h;h.value=[];const w=[];if(!l.rest){const l=v.length>m.length,y=v.length<f-1;if(l||y)return h.issues.push({input:v,inst:u,origin:"array",...l?{code:"too_big",maximum:m.length}:{code:"too_small",minimum:m.length}}),h}let b=-1;for(const u of m){if(b++,b>=v.length&&b>=f)continue;const l=u._zod.run({value:v[b],issues:[]},y);l instanceof Promise?w.push(l.then(u=>handleTupleResult(u,h,b))):handleTupleResult(l,h,b)}if(l.rest){const u=v.slice(m.length);for(const m of u){b++;const u=l.rest._zod.run({value:m,issues:[]},y);u instanceof Promise?w.push(u.then(u=>handleTupleResult(u,h,b))):handleTupleResult(u,h,b)}}return w.length?Promise.all(w).then(()=>h):h}});function handleTupleResult(u,l,m){u.issues.length&&l.issues.push(...b.prefixIssues(m,u.issues)),l.value[m]=u.value}const we=h.$constructor("$ZodRecord",(u,l)=>{j.init(u,l),u._zod.parse=(m,f)=>{const y=m.value;if(!b.isPlainObject(y))return m.issues.push({expected:"record",code:"invalid_type",input:y,inst:u}),m;const v=[];if(l.keyType._zod.values){const h=l.keyType._zod.values;m.value={};for(const u of h)if("string"==typeof u||"number"==typeof u||"symbol"==typeof u){const h=l.valueType._zod.run({value:y[u],issues:[]},f);h instanceof Promise?v.push(h.then(l=>{l.issues.length&&m.issues.push(...b.prefixIssues(u,l.issues)),m.value[u]=l.value})):(h.issues.length&&m.issues.push(...b.prefixIssues(u,h.issues)),m.value[u]=h.value)}let w;for(const u in y)h.has(u)||(w=w??[],w.push(u));w&&w.length>0&&m.issues.push({code:"unrecognized_keys",input:y,inst:u,keys:w})}else{m.value={};for(const w of Reflect.ownKeys(y)){if("__proto__"===w)continue;const S=l.keyType._zod.run({value:w,issues:[]},f);if(S instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(S.issues.length){m.issues.push({origin:"record",code:"invalid_key",issues:S.issues.map(u=>b.finalizeIssue(u,f,h.config())),input:w,path:[w],inst:u}),m.value[S.value]=S.value;continue}const j=l.valueType._zod.run({value:y[w],issues:[]},f);j instanceof Promise?v.push(j.then(u=>{u.issues.length&&m.issues.push(...b.prefixIssues(w,u.issues)),m.value[S.value]=u.value})):(j.issues.length&&m.issues.push(...b.prefixIssues(w,j.issues)),m.value[S.value]=j.value)}}return v.length?Promise.all(v).then(()=>m):m}}),be=h.$constructor("$ZodMap",(u,l)=>{j.init(u,l),u._zod.parse=(m,f)=>{const h=m.value;if(!(h instanceof Map))return m.issues.push({expected:"map",code:"invalid_type",input:h,inst:u}),m;const y=[];m.value=new Map;for(const[v,w]of h){const b=l.keyType._zod.run({value:v,issues:[]},f),S=l.valueType._zod.run({value:w,issues:[]},f);b instanceof Promise||S instanceof Promise?y.push(Promise.all([b,S]).then(([l,y])=>{handleMapResult(l,y,m,v,h,u,f)})):handleMapResult(b,S,m,v,h,u,f)}return y.length?Promise.all(y).then(()=>m):m}});function handleMapResult(u,l,m,f,y,v,w){u.issues.length&&(b.propertyKeyTypes.has(typeof f)?m.issues.push(...b.prefixIssues(f,u.issues)):m.issues.push({origin:"map",code:"invalid_key",input:y,inst:v,issues:u.issues.map(u=>b.finalizeIssue(u,w,h.config()))})),l.issues.length&&(b.propertyKeyTypes.has(typeof f)?m.issues.push(...b.prefixIssues(f,l.issues)):m.issues.push({origin:"map",code:"invalid_element",input:y,inst:v,key:f,issues:l.issues.map(u=>b.finalizeIssue(u,w,h.config()))})),m.value.set(u.value,l.value)}const ke=h.$constructor("$ZodSet",(u,l)=>{j.init(u,l),u._zod.parse=(m,f)=>{const h=m.value;if(!(h instanceof Set))return m.issues.push({input:h,inst:u,expected:"set",code:"invalid_type"}),m;const y=[];m.value=new Set;for(const u of h){const h=l.valueType._zod.run({value:u,issues:[]},f);h instanceof Promise?y.push(h.then(u=>handleSetResult(u,m))):handleSetResult(h,m)}return y.length?Promise.all(y).then(()=>m):m}});function handleSetResult(u,l){u.issues.length&&l.issues.push(...u.issues),l.value.add(u.value)}const Se=h.$constructor("$ZodEnum",(u,l)=>{j.init(u,l);const m=b.getEnumValues(l.entries);u._zod.values=new Set(m),u._zod.pattern=new RegExp(`^(${m.filter(u=>b.propertyKeyTypes.has(typeof u)).map(u=>"string"==typeof u?b.escapeRegex(u):u.toString()).join("|")})$`),u._zod.parse=(l,f)=>{const h=l.value;return u._zod.values.has(h)||l.issues.push({code:"invalid_value",values:m,input:h,inst:u}),l}}),je=h.$constructor("$ZodLiteral",(u,l)=>{j.init(u,l),u._zod.values=new Set(l.values),u._zod.pattern=new RegExp(`^(${l.values.map(u=>"string"==typeof u?b.escapeRegex(u):u?u.toString():String(u)).join("|")})$`),u._zod.parse=(m,f)=>{const h=m.value;return u._zod.values.has(h)||m.issues.push({code:"invalid_value",values:l.values,input:h,inst:u}),m}}),Pe=h.$constructor("$ZodFile",(u,l)=>{j.init(u,l),u._zod.parse=(l,m)=>{const f=l.value;return f instanceof File||l.issues.push({expected:"file",code:"invalid_type",input:f,inst:u}),l}}),$e=h.$constructor("$ZodTransform",(u,l)=>{j.init(u,l),u._zod.parse=(u,m)=>{const f=l.transform(u.value,u);if(m.async){return(f instanceof Promise?f:Promise.resolve(f)).then(l=>(u.value=l,u))}if(f instanceof Promise)throw new h.$ZodAsyncError;return u.value=f,u}}),Te=h.$constructor("$ZodOptional",(u,l)=>{j.init(u,l),u._zod.optin="optional",u._zod.optout="optional",b.defineLazy(u._zod,"values",()=>l.innerType._zod.values?new Set([...l.innerType._zod.values,void 0]):void 0),b.defineLazy(u._zod,"pattern",()=>{const u=l.innerType._zod.pattern;return u?new RegExp(`^(${b.cleanRegex(u.source)})?$`):void 0}),u._zod.parse=(u,m)=>"optional"===l.innerType._zod.optin?l.innerType._zod.run(u,m):void 0===u.value?u:l.innerType._zod.run(u,m)}),xe=h.$constructor("$ZodNullable",(u,l)=>{j.init(u,l),b.defineLazy(u._zod,"optin",()=>l.innerType._zod.optin),b.defineLazy(u._zod,"optout",()=>l.innerType._zod.optout),b.defineLazy(u._zod,"pattern",()=>{const u=l.innerType._zod.pattern;return u?new RegExp(`^(${b.cleanRegex(u.source)}|null)$`):void 0}),b.defineLazy(u._zod,"values",()=>l.innerType._zod.values?new Set([...l.innerType._zod.values,null]):void 0),u._zod.parse=(u,m)=>null===u.value?u:l.innerType._zod.run(u,m)}),Ee=h.$constructor("$ZodDefault",(u,l)=>{j.init(u,l),u._zod.optin="optional",b.defineLazy(u._zod,"values",()=>l.innerType._zod.values),u._zod.parse=(u,m)=>{if(void 0===u.value)return u.value=l.defaultValue,u;const f=l.innerType._zod.run(u,m);return f instanceof Promise?f.then(u=>handleDefaultResult(u,l)):handleDefaultResult(f,l)}});function handleDefaultResult(u,l){return void 0===u.value&&(u.value=l.defaultValue),u}const Ie=h.$constructor("$ZodPrefault",(u,l)=>{j.init(u,l),u._zod.optin="optional",b.defineLazy(u._zod,"values",()=>l.innerType._zod.values),u._zod.parse=(u,m)=>(void 0===u.value&&(u.value=l.defaultValue),l.innerType._zod.run(u,m))}),Re=h.$constructor("$ZodNonOptional",(u,l)=>{j.init(u,l),b.defineLazy(u._zod,"values",()=>{const u=l.innerType._zod.values;return u?new Set([...u].filter(u=>void 0!==u)):void 0}),u._zod.parse=(m,f)=>{const h=l.innerType._zod.run(m,f);return h instanceof Promise?h.then(l=>handleNonOptionalResult(l,u)):handleNonOptionalResult(h,u)}});function handleNonOptionalResult(u,l){return u.issues.length||void 0!==u.value||u.issues.push({code:"invalid_type",expected:"nonoptional",input:u.value,inst:l}),u}const Ze=h.$constructor("$ZodSuccess",(u,l)=>{j.init(u,l),u._zod.parse=(u,m)=>{const f=l.innerType._zod.run(u,m);return f instanceof Promise?f.then(l=>(u.value=0===l.issues.length,u)):(u.value=0===f.issues.length,u)}}),Ce=h.$constructor("$ZodCatch",(u,l)=>{j.init(u,l),u._zod.optin="optional",b.defineLazy(u._zod,"optout",()=>l.innerType._zod.optout),b.defineLazy(u._zod,"values",()=>l.innerType._zod.values),u._zod.parse=(u,m)=>{const f=l.innerType._zod.run(u,m);return f instanceof Promise?f.then(f=>(u.value=f.value,f.issues.length&&(u.value=l.catchValue({...u,error:{issues:f.issues.map(u=>b.finalizeIssue(u,m,h.config()))},input:u.value}),u.issues=[]),u)):(u.value=f.value,f.issues.length&&(u.value=l.catchValue({...u,error:{issues:f.issues.map(u=>b.finalizeIssue(u,m,h.config()))},input:u.value}),u.issues=[]),u)}}),ze=h.$constructor("$ZodNaN",(u,l)=>{j.init(u,l),u._zod.parse=(l,m)=>("number"==typeof l.value&&Number.isNaN(l.value)||l.issues.push({input:l.value,inst:u,expected:"nan",code:"invalid_type"}),l)}),Ae=h.$constructor("$ZodPipe",(u,l)=>{j.init(u,l),b.defineLazy(u._zod,"values",()=>l.in._zod.values),b.defineLazy(u._zod,"optin",()=>l.in._zod.optin),b.defineLazy(u._zod,"optout",()=>l.out._zod.optout),u._zod.parse=(u,m)=>{const f=l.in._zod.run(u,m);return f instanceof Promise?f.then(u=>handlePipeResult(u,l,m)):handlePipeResult(f,l,m)}});function handlePipeResult(u,l,m){return b.aborted(u)?u:l.out._zod.run({value:u.value,issues:u.issues},m)}const Oe=h.$constructor("$ZodReadonly",(u,l)=>{j.init(u,l),b.defineLazy(u._zod,"propValues",()=>l.innerType._zod.propValues),b.defineLazy(u._zod,"values",()=>l.innerType._zod.values),b.defineLazy(u._zod,"optin",()=>l.innerType._zod.optin),b.defineLazy(u._zod,"optout",()=>l.innerType._zod.optout),u._zod.parse=(u,m)=>{const f=l.innerType._zod.run(u,m);return f instanceof Promise?f.then(handleReadonlyResult):handleReadonlyResult(f)}});function handleReadonlyResult(u){return u.value=Object.freeze(u.value),u}const De=h.$constructor("$ZodTemplateLiteral",(u,l)=>{j.init(u,l);const m=[];for(const u of l.parts)if(u instanceof j){if(!u._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...u._zod.traits].shift()}`);const l=u._zod.pattern instanceof RegExp?u._zod.pattern.source:u._zod.pattern;if(!l)throw new Error(`Invalid template literal part: ${u._zod.traits}`);const f=l.startsWith("^")?1:0,h=l.endsWith("$")?l.length-1:l.length;m.push(l.slice(f,h))}else{if(null!==u&&!b.primitiveTypes.has(typeof u))throw new Error(`Invalid template literal part: ${u}`);m.push(b.escapeRegex(`${u}`))}u._zod.pattern=new RegExp(`^${m.join("")}$`),u._zod.parse=(l,m)=>"string"!=typeof l.value?(l.issues.push({input:l.value,inst:u,expected:"template_literal",code:"invalid_type"}),l):(u._zod.pattern.lastIndex=0,u._zod.pattern.test(l.value)||l.issues.push({input:l.value,inst:u,code:"invalid_format",format:"template_literal",pattern:u._zod.pattern.source}),l)}),Ne=h.$constructor("$ZodPromise",(u,l)=>{j.init(u,l),u._zod.parse=(u,m)=>Promise.resolve(u.value).then(u=>l.innerType._zod.run({value:u,issues:[]},m))}),Me=h.$constructor("$ZodLazy",(u,l)=>{j.init(u,l),b.defineLazy(u._zod,"innerType",()=>l.getter()),b.defineLazy(u._zod,"pattern",()=>u._zod.innerType._zod.pattern),b.defineLazy(u._zod,"propValues",()=>u._zod.innerType._zod.propValues),b.defineLazy(u._zod,"optin",()=>u._zod.innerType._zod.optin),b.defineLazy(u._zod,"optout",()=>u._zod.innerType._zod.optout),u._zod.parse=(l,m)=>u._zod.innerType._zod.run(l,m)}),Ue=h.$constructor("$ZodCustom",(u,l)=>{f.$ZodCheck.init(u,l),j.init(u,l),u._zod.parse=(u,l)=>u,u._zod.check=m=>{const f=m.value,h=l.fn(f);if(h instanceof Promise)return h.then(l=>handleRefineResult(l,m,f,u));handleRefineResult(h,m,f,u)}});function handleRefineResult(u,l,m,f){if(!u){const u={code:"custom",input:m,inst:f,path:[...f._zod.def.path??[]],continue:!f._zod.def.abort};f._zod.def.params&&(u.params=f._zod.def.params),l.issues.push(b.issue(u))}}},"./node_modules/zod/v4/core/to-json-schema.js":function(u,l,m){m.r(l),m.d(l,{JSONSchemaGenerator:function(){return JSONSchemaGenerator},toJSONSchema:function(){return toJSONSchema}});var f=m("./node_modules/zod/v4/core/registries.js"),h=m("./node_modules/zod/v4/core/util.js");class JSONSchemaGenerator{constructor(u){this.counter=0,this.metadataRegistry=u?.metadata??f.globalRegistry,this.target=u?.target??"draft-2020-12",this.unrepresentable=u?.unrepresentable??"throw",this.override=u?.override??(()=>{}),this.io=u?.io??"output",this.seen=new Map}process(u,l={path:[],schemaPath:[]}){var m;const f=u._zod.def,y={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},v=this.seen.get(u);if(v){v.count++;return l.schemaPath.includes(u)&&(v.cycle=l.path),v.schema}const w={schema:{},count:1,cycle:void 0,path:l.path};this.seen.set(u,w);const b=u._zod.toJSONSchema?.();if(b)w.schema=b;else{const m={...l,schemaPath:[...l.schemaPath,u],path:l.path},v=u._zod.parent;if(v)w.ref=v,this.process(v,m),this.seen.get(v).isParent=!0;else{const l=w.schema;switch(f.type){case"string":{const m=l;m.type="string";const{minimum:f,maximum:h,format:v,patterns:b,contentEncoding:S}=u._zod.bag;if("number"==typeof f&&(m.minLength=f),"number"==typeof h&&(m.maxLength=h),v&&(m.format=y[v]??v,""===m.format&&delete m.format),S&&(m.contentEncoding=S),b&&b.size>0){const u=[...b];1===u.length?m.pattern=u[0].source:u.length>1&&(w.schema.allOf=[...u.map(u=>({..."draft-7"===this.target?{type:"string"}:{},pattern:u.source}))])}break}case"number":{const m=l,{minimum:f,maximum:h,format:y,multipleOf:v,exclusiveMaximum:w,exclusiveMinimum:b}=u._zod.bag;"string"==typeof y&&y.includes("int")?m.type="integer":m.type="number","number"==typeof b&&(m.exclusiveMinimum=b),"number"==typeof f&&(m.minimum=f,"number"==typeof b&&(b>=f?delete m.minimum:delete m.exclusiveMinimum)),"number"==typeof w&&(m.exclusiveMaximum=w),"number"==typeof h&&(m.maximum=h,"number"==typeof w&&(w<=h?delete m.maximum:delete m.exclusiveMaximum)),"number"==typeof v&&(m.multipleOf=v);break}case"boolean":l.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":l.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":l.not={};break;case"date":if("throw"===this.unrepresentable)throw new Error("Date cannot be represented in JSON Schema");break;case"array":{const h=l,{minimum:y,maximum:v}=u._zod.bag;"number"==typeof y&&(h.minItems=y),"number"==typeof v&&(h.maxItems=v),h.type="array",h.items=this.process(f.element,{...m,path:[...m.path,"items"]});break}case"object":{const u=l;u.type="object",u.properties={};const h=f.shape;for(const l in h)u.properties[l]=this.process(h[l],{...m,path:[...m.path,"properties",l]});const y=new Set(Object.keys(h)),v=new Set([...y].filter(u=>{const l=f.shape[u]._zod;return"input"===this.io?void 0===l.optin:void 0===l.optout}));v.size>0&&(u.required=Array.from(v)),"never"===f.catchall?._zod.def.type?u.additionalProperties=!1:f.catchall?f.catchall&&(u.additionalProperties=this.process(f.catchall,{...m,path:[...m.path,"additionalProperties"]})):"output"===this.io&&(u.additionalProperties=!1);break}case"union":l.anyOf=f.options.map((u,l)=>this.process(u,{...m,path:[...m.path,"anyOf",l]}));break;case"intersection":{const u=l,h=this.process(f.left,{...m,path:[...m.path,"allOf",0]}),y=this.process(f.right,{...m,path:[...m.path,"allOf",1]}),isSimpleIntersection=u=>"allOf"in u&&1===Object.keys(u).length,v=[...isSimpleIntersection(h)?h.allOf:[h],...isSimpleIntersection(y)?y.allOf:[y]];u.allOf=v;break}case"tuple":{const h=l;h.type="array";const y=f.items.map((u,l)=>this.process(u,{...m,path:[...m.path,"prefixItems",l]}));if("draft-2020-12"===this.target?h.prefixItems=y:h.items=y,f.rest){const u=this.process(f.rest,{...m,path:[...m.path,"items"]});"draft-2020-12"===this.target?h.items=u:h.additionalItems=u}f.rest&&(h.items=this.process(f.rest,{...m,path:[...m.path,"items"]}));const{minimum:v,maximum:w}=u._zod.bag;"number"==typeof v&&(h.minItems=v),"number"==typeof w&&(h.maxItems=w);break}case"record":{const u=l;u.type="object",u.propertyNames=this.process(f.keyType,{...m,path:[...m.path,"propertyNames"]}),u.additionalProperties=this.process(f.valueType,{...m,path:[...m.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 u=l,m=(0,h.getEnumValues)(f.entries);m.every(u=>"number"==typeof u)&&(u.type="number"),m.every(u=>"string"==typeof u)&&(u.type="string"),u.enum=m;break}case"literal":{const u=l,m=[];for(const u of f.values)if(void 0===u){if("throw"===this.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof u){if("throw"===this.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");m.push(Number(u))}else m.push(u);if(0===m.length);else if(1===m.length){const l=m[0];u.type=null===l?"null":typeof l,u.const=l}else m.every(u=>"number"==typeof u)&&(u.type="number"),m.every(u=>"string"==typeof u)&&(u.type="string"),m.every(u=>"boolean"==typeof u)&&(u.type="string"),m.every(u=>null===u)&&(u.type="null"),u.enum=m;break}case"file":{const m=l,f={type:"string",format:"binary",contentEncoding:"binary"},{minimum:h,maximum:y,mime:v}=u._zod.bag;void 0!==h&&(f.minLength=h),void 0!==y&&(f.maxLength=y),v?1===v.length?(f.contentMediaType=v[0],Object.assign(m,f)):m.anyOf=v.map(u=>({...f,contentMediaType:u})):Object.assign(m,f);break}case"transform":if("throw"===this.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema");break;case"nullable":{const u=this.process(f.innerType,m);l.anyOf=[u,{type:"null"}];break}case"nonoptional":case"promise":case"optional":this.process(f.innerType,m),w.ref=f.innerType;break;case"success":l.type="boolean";break;case"default":this.process(f.innerType,m),w.ref=f.innerType,l.default=JSON.parse(JSON.stringify(f.defaultValue));break;case"prefault":this.process(f.innerType,m),w.ref=f.innerType,"input"===this.io&&(l._prefault=JSON.parse(JSON.stringify(f.defaultValue)));break;case"catch":{let u;this.process(f.innerType,m),w.ref=f.innerType;try{u=f.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}l.default=u;break}case"nan":if("throw"===this.unrepresentable)throw new Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{const m=l,f=u._zod.pattern;if(!f)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=f.source;break}case"pipe":{const u="input"===this.io?"transform"===f.in._zod.def.type?f.out:f.in:f.out;this.process(u,m),w.ref=u;break}case"readonly":this.process(f.innerType,m),w.ref=f.innerType,l.readOnly=!0;break;case"lazy":{const l=u._zod.innerType;this.process(l,m),w.ref=l;break}case"custom":if("throw"===this.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")}}}const S=this.metadataRegistry.get(u);S&&Object.assign(w.schema,S),"input"===this.io&&isTransforming(u)&&(delete w.schema.examples,delete w.schema.default),"input"===this.io&&w.schema._prefault&&((m=w.schema).default??(m.default=w.schema._prefault)),delete w.schema._prefault;return this.seen.get(u).schema}emit(u,l){const m={cycles:l?.cycles??"ref",reused:l?.reused??"inline",external:l?.external??void 0},f=this.seen.get(u);if(!f)throw new Error("Unprocessed schema. This is a bug in Zod.");const makeURI=u=>{const l="draft-2020-12"===this.target?"$defs":"definitions";if(m.external){const f=m.external.registry.get(u[0])?.id,h=m.external.uri??(u=>u);if(f)return{ref:h(f)};const y=u[1].defId??u[1].schema.id??"schema"+this.counter++;return u[1].defId=y,{defId:y,ref:`${h("__shared")}#/${l}/${y}`}}if(u[1]===f)return{ref:"#"};const h=`#/${l}/`,y=u[1].schema.id??"__schema"+this.counter++;return{defId:y,ref:h+y}},extractToDef=u=>{if(u[1].schema.$ref)return;const l=u[1],{ref:m,defId:f}=makeURI(u);l.def={...l.schema},f&&(l.defId=f);const h=l.schema;for(const u in h)delete h[u];h.$ref=m};if("throw"===m.cycles)for(const u of this.seen.entries()){const l=u[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of this.seen.entries()){const f=l[1];if(u===l[0]){extractToDef(l);continue}if(m.external){const f=m.external.registry.get(l[0])?.id;if(u!==l[0]&&f){extractToDef(l);continue}}const h=this.metadataRegistry.get(l[0])?.id;h?extractToDef(l):(f.cycle||f.count>1&&"ref"===m.reused)&&extractToDef(l)}const flattenRef=(u,l)=>{const m=this.seen.get(u),f=m.def??m.schema,h={...f};if(null===m.ref)return;const y=m.ref;if(m.ref=null,y){flattenRef(y,l);const u=this.seen.get(y).schema;u.$ref&&"draft-7"===l.target?(f.allOf=f.allOf??[],f.allOf.push(u)):(Object.assign(f,u),Object.assign(f,h))}m.isParent||this.override({zodSchema:u,jsonSchema:f,path:m.path??[]})};for(const u of[...this.seen.entries()].reverse())flattenRef(u[0],{target:this.target});const h={};if("draft-2020-12"===this.target?h.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?h.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),m.external?.uri){const l=m.external.registry.get(u)?.id;if(!l)throw new Error("Schema is missing an `id` property");h.$id=m.external.uri(l)}Object.assign(h,f.def);const y=m.external?.defs??{};for(const u of this.seen.entries()){const l=u[1];l.def&&l.defId&&(y[l.defId]=l.def)}m.external||Object.keys(y).length>0&&("draft-2020-12"===this.target?h.$defs=y:h.definitions=y);try{return JSON.parse(JSON.stringify(h))}catch(u){throw new Error("Error converting schema to JSON.")}}}function toJSONSchema(u,l){if(u instanceof f.$ZodRegistry){const m=new JSONSchemaGenerator(l),f={};for(const l of u._idmap.entries()){const[u,f]=l;m.process(f)}const h={},y={registry:u,uri:l?.uri,defs:f};for(const f of u._idmap.entries()){const[u,v]=f;h[u]=m.emit(v,{...l,external:y})}if(Object.keys(f).length>0){const u="draft-2020-12"===m.target?"$defs":"definitions";h.__shared={[u]:f}}return{schemas:h}}const m=new JSONSchemaGenerator(l);return m.process(u),m.emit(u,l)}function isTransforming(u,l){const m=l??{seen:new Set};if(m.seen.has(u))return!1;m.seen.add(u);const f=u._zod.def;switch(f.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 isTransforming(f.element,m);case"object":for(const u in f.shape)if(isTransforming(f.shape[u],m))return!0;return!1;case"union":for(const u of f.options)if(isTransforming(u,m))return!0;return!1;case"intersection":return isTransforming(f.left,m)||isTransforming(f.right,m);case"tuple":for(const u of f.items)if(isTransforming(u,m))return!0;return!(!f.rest||!isTransforming(f.rest,m));case"record":case"map":return isTransforming(f.keyType,m)||isTransforming(f.valueType,m);case"set":return isTransforming(f.valueType,m);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return isTransforming(f.innerType,m);case"lazy":return isTransforming(f.getter(),m);case"transform":return!0;case"pipe":return isTransforming(f.in,m)||isTransforming(f.out,m)}throw new Error(`Unknown schema type: ${f.type}`)}},"./node_modules/zod/v4/core/util.js":function(u,l,m){function assertEqual(u){return u}function assertNotEqual(u){return u}function assertIs(u){}function assertNever(u){throw new Error}function assert(u){}function getEnumValues(u){const l=Object.values(u).filter(u=>"number"==typeof u);return Object.entries(u).filter(([u,m])=>-1===l.indexOf(+u)).map(([u,l])=>l)}function joinValues(u,l="|"){return u.map(u=>stringifyPrimitive(u)).join(l)}function jsonStringifyReplacer(u,l){return"bigint"==typeof l?l.toString():l}function cached(u){return{get value(){{const l=u();return Object.defineProperty(this,"value",{value:l}),l}}}}function nullish(u){return null==u}function cleanRegex(u){const l=u.startsWith("^")?1:0,m=u.endsWith("$")?u.length-1:u.length;return u.slice(l,m)}function floatSafeRemainder(u,l){const m=(u.toString().split(".")[1]||"").length,f=(l.toString().split(".")[1]||"").length,h=m>f?m:f;return Number.parseInt(u.toFixed(h).replace(".",""))%Number.parseInt(l.toFixed(h).replace(".",""))/10**h}function defineLazy(u,l,m){Object.defineProperty(u,l,{get(){{const f=m();return u[l]=f,f}},set(m){Object.defineProperty(u,l,{value:m})},configurable:!0})}function assignProp(u,l,m){Object.defineProperty(u,l,{value:m,writable:!0,enumerable:!0,configurable:!0})}function getElementAtPath(u,l){return l?l.reduce((u,l)=>u?.[l],u):u}function promiseAllObject(u){const l=Object.keys(u),m=l.map(l=>u[l]);return Promise.all(m).then(u=>{const m={};for(let f=0;f<l.length;f++)m[l[f]]=u[f];return m})}function randomString(u=10){const l="abcdefghijklmnopqrstuvwxyz";let m="";for(let f=0;f<u;f++)m+=l[Math.floor(26*Math.random())];return m}function esc(u){return JSON.stringify(u)}m.r(l),m.d(l,{BIGINT_FORMAT_RANGES:function(){return b},Class:function(){return Class},NUMBER_FORMAT_RANGES:function(){return w},aborted:function(){return aborted},allowsEval:function(){return h},assert:function(){return assert},assertEqual:function(){return assertEqual},assertIs:function(){return assertIs},assertNever:function(){return assertNever},assertNotEqual:function(){return assertNotEqual},assignProp:function(){return assignProp},cached:function(){return cached},captureStackTrace:function(){return f},cleanEnum:function(){return cleanEnum},cleanRegex:function(){return cleanRegex},clone:function(){return clone},createTransparentProxy:function(){return createTransparentProxy},defineLazy:function(){return defineLazy},esc:function(){return esc},escapeRegex:function(){return escapeRegex},extend:function(){return extend},finalizeIssue:function(){return finalizeIssue},floatSafeRemainder:function(){return floatSafeRemainder},getElementAtPath:function(){return getElementAtPath},getEnumValues:function(){return getEnumValues},getLengthableOrigin:function(){return getLengthableOrigin},getParsedType:function(){return getParsedType},getSizableOrigin:function(){return getSizableOrigin},isObject:function(){return isObject},isPlainObject:function(){return isPlainObject},issue:function(){return issue},joinValues:function(){return joinValues},jsonStringifyReplacer:function(){return jsonStringifyReplacer},merge:function(){return merge},normalizeParams:function(){return normalizeParams},nullish:function(){return nullish},numKeys:function(){return numKeys},omit:function(){return omit},optionalKeys:function(){return optionalKeys},partial:function(){return partial},pick:function(){return pick},prefixIssues:function(){return prefixIssues},primitiveTypes:function(){return v},promiseAllObject:function(){return promiseAllObject},propertyKeyTypes:function(){return y},randomString:function(){return randomString},required:function(){return required},stringifyPrimitive:function(){return stringifyPrimitive},unwrapMessage:function(){return unwrapMessage}});const f=Error.captureStackTrace?Error.captureStackTrace:(...u)=>{};function isObject(u){return"object"==typeof u&&null!==u&&!Array.isArray(u)}const h=cached(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(u){return!1}});function isPlainObject(u){if(!1===isObject(u))return!1;const l=u.constructor;if(void 0===l)return!0;const m=l.prototype;return!1!==isObject(m)&&!1!==Object.prototype.hasOwnProperty.call(m,"isPrototypeOf")}function numKeys(u){let l=0;for(const m in u)Object.prototype.hasOwnProperty.call(u,m)&&l++;return l}const getParsedType=u=>{const l=typeof u;switch(l){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(u)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(u)?"array":null===u?"null":u.then&&"function"==typeof u.then&&u.catch&&"function"==typeof u.catch?"promise":"undefined"!=typeof Map&&u instanceof Map?"map":"undefined"!=typeof Set&&u instanceof Set?"set":"undefined"!=typeof Date&&u instanceof Date?"date":"undefined"!=typeof File&&u instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${l}`)}},y=new Set(["string","number","symbol"]),v=new Set(["string","number","bigint","boolean","symbol","undefined"]);function escapeRegex(u){return u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function clone(u,l,m){const f=new u._zod.constr(l??u._zod.def);return l&&!m?.parent||(f._zod.parent=u),f}function normalizeParams(u){const l=u;if(!l)return{};if("string"==typeof l)return{error:()=>l};if(void 0!==l?.message){if(void 0!==l?.error)throw new Error("Cannot specify both `message` and `error` params");l.error=l.message}return delete l.message,"string"==typeof l.error?{...l,error:()=>l.error}:l}function createTransparentProxy(u){let l;return new Proxy({},{get(m,f,h){return l??(l=u()),Reflect.get(l,f,h)},set(m,f,h,y){return l??(l=u()),Reflect.set(l,f,h,y)},has(m,f){return l??(l=u()),Reflect.has(l,f)},deleteProperty(m,f){return l??(l=u()),Reflect.deleteProperty(l,f)},ownKeys(m){return l??(l=u()),Reflect.ownKeys(l)},getOwnPropertyDescriptor(m,f){return l??(l=u()),Reflect.getOwnPropertyDescriptor(l,f)},defineProperty(m,f,h){return l??(l=u()),Reflect.defineProperty(l,f,h)}})}function stringifyPrimitive(u){return"bigint"==typeof u?u.toString()+"n":"string"==typeof u?`"${u}"`:`${u}`}function optionalKeys(u){return Object.keys(u).filter(l=>"optional"===u[l]._zod.optin&&"optional"===u[l]._zod.optout)}const w={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]},b={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function pick(u,l){const m={},f=u._zod.def;for(const u in l){if(!(u in f.shape))throw new Error(`Unrecognized key: "${u}"`);l[u]&&(m[u]=f.shape[u])}return clone(u,{...u._zod.def,shape:m,checks:[]})}function omit(u,l){const m={...u._zod.def.shape},f=u._zod.def;for(const u in l){if(!(u in f.shape))throw new Error(`Unrecognized key: "${u}"`);l[u]&&delete m[u]}return clone(u,{...u._zod.def,shape:m,checks:[]})}function extend(u,l){if(!isPlainObject(l))throw new Error("Invalid input to extend: expected a plain object");const m={...u._zod.def,get shape(){const m={...u._zod.def.shape,...l};return assignProp(this,"shape",m),m},checks:[]};return clone(u,m)}function merge(u,l){return clone(u,{...u._zod.def,get shape(){const m={...u._zod.def.shape,...l._zod.def.shape};return assignProp(this,"shape",m),m},catchall:l._zod.def.catchall,checks:[]})}function partial(u,l,m){const f=l._zod.def.shape,h={...f};if(m)for(const l in m){if(!(l in f))throw new Error(`Unrecognized key: "${l}"`);m[l]&&(h[l]=u?new u({type:"optional",innerType:f[l]}):f[l])}else for(const l in f)h[l]=u?new u({type:"optional",innerType:f[l]}):f[l];return clone(l,{...l._zod.def,shape:h,checks:[]})}function required(u,l,m){const f=l._zod.def.shape,h={...f};if(m)for(const l in m){if(!(l in h))throw new Error(`Unrecognized key: "${l}"`);m[l]&&(h[l]=new u({type:"nonoptional",innerType:f[l]}))}else for(const l in f)h[l]=new u({type:"nonoptional",innerType:f[l]});return clone(l,{...l._zod.def,shape:h,checks:[]})}function aborted(u,l=0){for(let m=l;m<u.issues.length;m++)if(!0!==u.issues[m]?.continue)return!0;return!1}function prefixIssues(u,l){return l.map(l=>{var m;return(m=l).path??(m.path=[]),l.path.unshift(u),l})}function unwrapMessage(u){return"string"==typeof u?u:u?.message}function finalizeIssue(u,l,m){const f={...u,path:u.path??[]};if(!u.message){const h=unwrapMessage(u.inst?._zod.def?.error?.(u))??unwrapMessage(l?.error?.(u))??unwrapMessage(m.customError?.(u))??unwrapMessage(m.localeError?.(u))??"Invalid input";f.message=h}return delete f.inst,delete f.continue,l?.reportInput||delete f.input,f}function getSizableOrigin(u){return u instanceof Set?"set":u instanceof Map?"map":u instanceof File?"file":"unknown"}function getLengthableOrigin(u){return Array.isArray(u)?"array":"string"==typeof u?"string":"unknown"}function issue(...u){const[l,m,f]=u;return"string"==typeof l?{message:l,code:"custom",input:m,inst:f}:{...l}}function cleanEnum(u){return Object.entries(u).filter(([u,l])=>Number.isNaN(Number.parseInt(u,10))).map(u=>u[1])}class Class{constructor(...u){}}},"./node_modules/zod/v4/core/versions.js":function(u,l,m){m.r(l),m.d(l,{version:function(){return f}});const f={major:4,minor:0,patch:0}},"./node_modules/zod/v4/mini/schemas.js":function(u,l,m){m.r(l),m.d(l,{ZodMiniAny:function(){return oe},ZodMiniArray:function(){return ce},ZodMiniBase64:function(){return K},ZodMiniBase64URL:function(){return H},ZodMiniBigInt:function(){return X},ZodMiniBigIntFormat:function(){return ee},ZodMiniBoolean:function(){return Y},ZodMiniCIDRv4:function(){return F},ZodMiniCIDRv6:function(){return V},ZodMiniCUID:function(){return A},ZodMiniCUID2:function(){return O},ZodMiniCatch:function(){return xe},ZodMiniCustom:function(){return Ae},ZodMiniCustomStringFormat:function(){return W},ZodMiniDate:function(){return de},ZodMiniDefault:function(){return je},ZodMiniDiscriminatedUnion:function(){return pe},ZodMiniE164:function(){return B},ZodMiniEmail:function(){return x},ZodMiniEmoji:function(){return C},ZodMiniEnum:function(){return ye},ZodMiniFile:function(){return we},ZodMiniGUID:function(){return E},ZodMiniIPv4:function(){return U},ZodMiniIPv6:function(){return L},ZodMiniIntersection:function(){return me},ZodMiniJWT:function(){return J},ZodMiniKSUID:function(){return M},ZodMiniLazy:function(){return Ce},ZodMiniLiteral:function(){return ve},ZodMiniMap:function(){return ge},ZodMiniNaN:function(){return Ee},ZodMiniNanoID:function(){return z},ZodMiniNever:function(){return ie},ZodMiniNonOptional:function(){return $e},ZodMiniNull:function(){return re},ZodMiniNullable:function(){return Se},ZodMiniNumber:function(){return G},ZodMiniNumberFormat:function(){return Q},ZodMiniObject:function(){return ue},ZodMiniOptional:function(){return ke},ZodMiniPipe:function(){return Ie},ZodMiniPrefault:function(){return Pe},ZodMiniPromise:function(){return ze},ZodMiniReadonly:function(){return Re},ZodMiniRecord:function(){return he},ZodMiniSet:function(){return _e},ZodMiniString:function(){return j},ZodMiniStringFormat:function(){return $},ZodMiniSuccess:function(){return Te},ZodMiniSymbol:function(){return te},ZodMiniTemplateLiteral:function(){return Ze},ZodMiniTransform:function(){return be},ZodMiniTuple:function(){return fe},ZodMiniType:function(){return S},ZodMiniULID:function(){return D},ZodMiniURL:function(){return Z},ZodMiniUUID:function(){return R},ZodMiniUndefined:function(){return ne},ZodMiniUnion:function(){return le},ZodMiniUnknown:function(){return se},ZodMiniVoid:function(){return ae},ZodMiniXID:function(){return N},_default:function(){return _default},any:function(){return any},array:function(){return array},base64:function(){return base64},base64url:function(){return base64url},bigint:function(){return bigint},boolean:function(){return boolean},catch:function(){return _catch},catchall:function(){return catchall},check:function(){return check},cidrv4:function(){return cidrv4},cidrv6:function(){return cidrv6},cuid:function(){return cuid},cuid2:function(){return cuid2},custom:function(){return custom},date:function(){return date},discriminatedUnion:function(){return discriminatedUnion},e164:function(){return e164},email:function(){return email},emoji:function(){return emoji},enum:function(){return _enum},extend:function(){return extend},file:function(){return file},float32:function(){return float32},float64:function(){return float64},guid:function(){return guid},instanceof:function(){return _instanceof},int:function(){return int},int32:function(){return int32},int64:function(){return int64},intersection:function(){return intersection},ipv4:function(){return ipv4},ipv6:function(){return ipv6},json:function(){return json},jwt:function(){return jwt},keyof:function(){return keyof},ksuid:function(){return ksuid},lazy:function(){return _lazy},literal:function(){return literal},looseObject:function(){return looseObject},map:function(){return map},merge:function(){return merge},nan:function(){return nan},nanoid:function(){return nanoid},nativeEnum:function(){return nativeEnum},never:function(){return never},nonoptional:function(){return nonoptional},null:function(){return _null},nullable:function(){return nullable},nullish:function(){return nullish},number:function(){return number},object:function(){return object},omit:function(){return omit},optional:function(){return optional},partial:function(){return partial},partialRecord:function(){return partialRecord},pick:function(){return pick},pipe:function(){return pipe},prefault:function(){return prefault},promise:function(){return promise},readonly:function(){return readonly},record:function(){return record},refine:function(){return refine},required:function(){return required},set:function(){return set},strictObject:function(){return strictObject},string:function(){return string},stringFormat:function(){return stringFormat},stringbool:function(){return stringbool},success:function(){return success},symbol:function(){return symbol},templateLiteral:function(){return templateLiteral},transform:function(){return transform},tuple:function(){return tuple},uint32:function(){return uint32},uint64:function(){return uint64},ulid:function(){return ulid},undefined:function(){return _undefined},union:function(){return union},unknown:function(){return unknown},url:function(){return url},uuid:function(){return uuid},uuidv4:function(){return uuidv4},uuidv6:function(){return uuidv6},uuidv7:function(){return uuidv7},void:function(){return _void},xid:function(){return xid}});var f=m("./node_modules/zod/v4/core/core.js"),h=m("./node_modules/zod/v4/core/schemas.js"),y=m("./node_modules/zod/v4/core/checks.js"),v=m("./node_modules/zod/v4/core/util.js"),w=m("./node_modules/zod/v4/core/api.js"),b=m("./node_modules/zod/v4/core/parse.js");const S=f.$constructor("ZodMiniType",(u,l)=>{if(!u._zod)throw new Error("Uninitialized schema in ZodMiniType.");h.$ZodType.init(u,l),u.def=l,u.parse=(l,m)=>b.parse(u,l,m,{callee:u.parse}),u.safeParse=(l,m)=>b.safeParse(u,l,m),u.parseAsync=async(l,m)=>b.parseAsync(u,l,m,{callee:u.parseAsync}),u.safeParseAsync=async(l,m)=>b.safeParseAsync(u,l,m),u.check=(...m)=>u.clone({...l,checks:[...l.checks??[],...m.map(u=>"function"==typeof u?{_zod:{check:u,def:{check:"custom"},onattach:[]}}:u)]}),u.clone=(l,m)=>v.clone(u,l,m),u.brand=()=>u,u.register=(l,m)=>(l.add(u,m),u)}),j=f.$constructor("ZodMiniString",(u,l)=>{h.$ZodString.init(u,l),S.init(u,l)});function string(u){return w._string(j,u)}const $=f.$constructor("ZodMiniStringFormat",(u,l)=>{h.$ZodStringFormat.init(u,l),j.init(u,l)}),x=f.$constructor("ZodMiniEmail",(u,l)=>{h.$ZodEmail.init(u,l),$.init(u,l)});function email(u){return w._email(x,u)}const E=f.$constructor("ZodMiniGUID",(u,l)=>{h.$ZodGUID.init(u,l),$.init(u,l)});function guid(u){return w._guid(E,u)}const R=f.$constructor("ZodMiniUUID",(u,l)=>{h.$ZodUUID.init(u,l),$.init(u,l)});function uuid(u){return w._uuid(R,u)}function uuidv4(u){return w._uuidv4(R,u)}function uuidv6(u){return w._uuidv6(R,u)}function uuidv7(u){return w._uuidv7(R,u)}const Z=f.$constructor("ZodMiniURL",(u,l)=>{h.$ZodURL.init(u,l),$.init(u,l)});function url(u){return w._url(Z,u)}const C=f.$constructor("ZodMiniEmoji",(u,l)=>{h.$ZodEmoji.init(u,l),$.init(u,l)});function emoji(u){return w._emoji(C,u)}const z=f.$constructor("ZodMiniNanoID",(u,l)=>{h.$ZodNanoID.init(u,l),$.init(u,l)});function nanoid(u){return w._nanoid(z,u)}const A=f.$constructor("ZodMiniCUID",(u,l)=>{h.$ZodCUID.init(u,l),$.init(u,l)});function cuid(u){return w._cuid(A,u)}const O=f.$constructor("ZodMiniCUID2",(u,l)=>{h.$ZodCUID2.init(u,l),$.init(u,l)});function cuid2(u){return w._cuid2(O,u)}const D=f.$constructor("ZodMiniULID",(u,l)=>{h.$ZodULID.init(u,l),$.init(u,l)});function ulid(u){return w._ulid(D,u)}const N=f.$constructor("ZodMiniXID",(u,l)=>{h.$ZodXID.init(u,l),$.init(u,l)});function xid(u){return w._xid(N,u)}const M=f.$constructor("ZodMiniKSUID",(u,l)=>{h.$ZodKSUID.init(u,l),$.init(u,l)});function ksuid(u){return w._ksuid(M,u)}const U=f.$constructor("ZodMiniIPv4",(u,l)=>{h.$ZodIPv4.init(u,l),$.init(u,l)});function ipv4(u){return w._ipv4(U,u)}const L=f.$constructor("ZodMiniIPv6",(u,l)=>{h.$ZodIPv6.init(u,l),$.init(u,l)});function ipv6(u){return w._ipv6(L,u)}const F=f.$constructor("ZodMiniCIDRv4",(u,l)=>{h.$ZodCIDRv4.init(u,l),$.init(u,l)});function cidrv4(u){return w._cidrv4(F,u)}const V=f.$constructor("ZodMiniCIDRv6",(u,l)=>{h.$ZodCIDRv6.init(u,l),$.init(u,l)});function cidrv6(u){return w._cidrv6(V,u)}const K=f.$constructor("ZodMiniBase64",(u,l)=>{h.$ZodBase64.init(u,l),$.init(u,l)});function base64(u){return w._base64(K,u)}const H=f.$constructor("ZodMiniBase64URL",(u,l)=>{h.$ZodBase64URL.init(u,l),$.init(u,l)});function base64url(u){return w._base64url(H,u)}const B=f.$constructor("ZodMiniE164",(u,l)=>{h.$ZodE164.init(u,l),$.init(u,l)});function e164(u){return w._e164(B,u)}const J=f.$constructor("ZodMiniJWT",(u,l)=>{h.$ZodJWT.init(u,l),$.init(u,l)});function jwt(u){return w._jwt(J,u)}const W=f.$constructor("ZodMiniCustomStringFormat",(u,l)=>{h.$ZodCustomStringFormat.init(u,l),$.init(u,l)});function stringFormat(u,l,m={}){return w._stringFormat(W,u,l,m)}const G=f.$constructor("ZodMiniNumber",(u,l)=>{h.$ZodNumber.init(u,l),S.init(u,l)});function number(u){return w._number(G,u)}const Q=f.$constructor("ZodMiniNumberFormat",(u,l)=>{h.$ZodNumberFormat.init(u,l),G.init(u,l)});function int(u){return w._int(Q,u)}function float32(u){return w._float32(Q,u)}function float64(u){return w._float64(Q,u)}function int32(u){return w._int32(Q,u)}function uint32(u){return w._uint32(Q,u)}const Y=f.$constructor("ZodMiniBoolean",(u,l)=>{h.$ZodBoolean.init(u,l),S.init(u,l)});function boolean(u){return w._boolean(Y,u)}const X=f.$constructor("ZodMiniBigInt",(u,l)=>{h.$ZodBigInt.init(u,l),S.init(u,l)});function bigint(u){return w._bigint(X,u)}const ee=f.$constructor("ZodMiniBigIntFormat",(u,l)=>{h.$ZodBigIntFormat.init(u,l),X.init(u,l)});function int64(u){return w._int64(ee,u)}function uint64(u){return w._uint64(ee,u)}const te=f.$constructor("ZodMiniSymbol",(u,l)=>{h.$ZodSymbol.init(u,l),S.init(u,l)});function symbol(u){return w._symbol(te,u)}const ne=f.$constructor("ZodMiniUndefined",(u,l)=>{h.$ZodUndefined.init(u,l),S.init(u,l)});function _undefined(u){return w._undefined(ne,u)}const re=f.$constructor("ZodMiniNull",(u,l)=>{h.$ZodNull.init(u,l),S.init(u,l)});function _null(u){return w._null(re,u)}const oe=f.$constructor("ZodMiniAny",(u,l)=>{h.$ZodAny.init(u,l),S.init(u,l)});function any(){return w._any(oe)}const se=f.$constructor("ZodMiniUnknown",(u,l)=>{h.$ZodUnknown.init(u,l),S.init(u,l)});function unknown(){return w._unknown(se)}const ie=f.$constructor("ZodMiniNever",(u,l)=>{h.$ZodNever.init(u,l),S.init(u,l)});function never(u){return w._never(ie,u)}const ae=f.$constructor("ZodMiniVoid",(u,l)=>{h.$ZodVoid.init(u,l),S.init(u,l)});function _void(u){return w._void(ae,u)}const de=f.$constructor("ZodMiniDate",(u,l)=>{h.$ZodDate.init(u,l),S.init(u,l)});function date(u){return w._date(de,u)}const ce=f.$constructor("ZodMiniArray",(u,l)=>{h.$ZodArray.init(u,l),S.init(u,l)});function array(u,l){return new ce({type:"array",element:u,...v.normalizeParams(l)})}function keyof(u){const l=u._zod.def.shape;return literal(Object.keys(l))}const ue=f.$constructor("ZodMiniObject",(u,l)=>{h.$ZodObject.init(u,l),S.init(u,l),v.defineLazy(u,"shape",()=>l.shape)});function object(u,l){const m={type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},...v.normalizeParams(l)};return new ue(m)}function strictObject(u,l){return new ue({type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},catchall:never(),...v.normalizeParams(l)})}function looseObject(u,l){return new ue({type:"object",get shape(){return v.assignProp(this,"shape",{...u}),this.shape},catchall:unknown(),...v.normalizeParams(l)})}function extend(u,l){return v.extend(u,l)}function merge(u,l){return v.extend(u,l)}function pick(u,l){return v.pick(u,l)}function omit(u,l){return v.omit(u,l)}function partial(u,l){return v.partial(ke,u,l)}function required(u,l){return v.required($e,u,l)}function catchall(u,l){return u.clone({...u._zod.def,catchall:l})}const le=f.$constructor("ZodMiniUnion",(u,l)=>{h.$ZodUnion.init(u,l),S.init(u,l)});function union(u,l){return new le({type:"union",options:u,...v.normalizeParams(l)})}const pe=f.$constructor("ZodMiniDiscriminatedUnion",(u,l)=>{h.$ZodDiscriminatedUnion.init(u,l),S.init(u,l)});function discriminatedUnion(u,l,m){return new pe({type:"union",options:l,discriminator:u,...v.normalizeParams(m)})}const me=f.$constructor("ZodMiniIntersection",(u,l)=>{h.$ZodIntersection.init(u,l),S.init(u,l)});function intersection(u,l){return new me({type:"intersection",left:u,right:l})}const fe=f.$constructor("ZodMiniTuple",(u,l)=>{h.$ZodTuple.init(u,l),S.init(u,l)});function tuple(u,l,m){const f=l instanceof h.$ZodType,y=f?m:l;return new fe({type:"tuple",items:u,rest:f?l:null,...v.normalizeParams(y)})}const he=f.$constructor("ZodMiniRecord",(u,l)=>{h.$ZodRecord.init(u,l),S.init(u,l)});function record(u,l,m){return new he({type:"record",keyType:u,valueType:l,...v.normalizeParams(m)})}function partialRecord(u,l,m){return new he({type:"record",keyType:union([u,never()]),valueType:l,...v.normalizeParams(m)})}const ge=f.$constructor("ZodMiniMap",(u,l)=>{h.$ZodMap.init(u,l),S.init(u,l)});function map(u,l,m){return new ge({type:"map",keyType:u,valueType:l,...v.normalizeParams(m)})}const _e=f.$constructor("ZodMiniSet",(u,l)=>{h.$ZodSet.init(u,l),S.init(u,l)});function set(u,l){return new _e({type:"set",valueType:u,...v.normalizeParams(l)})}const ye=f.$constructor("ZodMiniEnum",(u,l)=>{h.$ZodEnum.init(u,l),S.init(u,l)});function _enum(u,l){const m=Array.isArray(u)?Object.fromEntries(u.map(u=>[u,u])):u;return new ye({type:"enum",entries:m,...v.normalizeParams(l)})}function nativeEnum(u,l){return new ye({type:"enum",entries:u,...v.normalizeParams(l)})}const ve=f.$constructor("ZodMiniLiteral",(u,l)=>{h.$ZodLiteral.init(u,l),S.init(u,l)});function literal(u,l){return new ve({type:"literal",values:Array.isArray(u)?u:[u],...v.normalizeParams(l)})}const we=f.$constructor("ZodMiniFile",(u,l)=>{h.$ZodFile.init(u,l),S.init(u,l)});function file(u){return w._file(we,u)}const be=f.$constructor("ZodMiniTransform",(u,l)=>{h.$ZodTransform.init(u,l),S.init(u,l)});function transform(u){return new be({type:"transform",transform:u})}const ke=f.$constructor("ZodMiniOptional",(u,l)=>{h.$ZodOptional.init(u,l),S.init(u,l)});function optional(u){return new ke({type:"optional",innerType:u})}const Se=f.$constructor("ZodMiniNullable",(u,l)=>{h.$ZodNullable.init(u,l),S.init(u,l)});function nullable(u){return new Se({type:"nullable",innerType:u})}function nullish(u){return optional(nullable(u))}const je=f.$constructor("ZodMiniDefault",(u,l)=>{h.$ZodDefault.init(u,l),S.init(u,l)});function _default(u,l){return new je({type:"default",innerType:u,get defaultValue(){return"function"==typeof l?l():l}})}const Pe=f.$constructor("ZodMiniPrefault",(u,l)=>{h.$ZodPrefault.init(u,l),S.init(u,l)});function prefault(u,l){return new Pe({type:"prefault",innerType:u,get defaultValue(){return"function"==typeof l?l():l}})}const $e=f.$constructor("ZodMiniNonOptional",(u,l)=>{h.$ZodNonOptional.init(u,l),S.init(u,l)});function nonoptional(u,l){return new $e({type:"nonoptional",innerType:u,...v.normalizeParams(l)})}const Te=f.$constructor("ZodMiniSuccess",(u,l)=>{h.$ZodSuccess.init(u,l),S.init(u,l)});function success(u){return new Te({type:"success",innerType:u})}const xe=f.$constructor("ZodMiniCatch",(u,l)=>{h.$ZodCatch.init(u,l),S.init(u,l)});function _catch(u,l){return new xe({type:"catch",innerType:u,catchValue:"function"==typeof l?l:()=>l})}const Ee=f.$constructor("ZodMiniNaN",(u,l)=>{h.$ZodNaN.init(u,l),S.init(u,l)});function nan(u){return w._nan(Ee,u)}const Ie=f.$constructor("ZodMiniPipe",(u,l)=>{h.$ZodPipe.init(u,l),S.init(u,l)});function pipe(u,l){return new Ie({type:"pipe",in:u,out:l})}const Re=f.$constructor("ZodMiniReadonly",(u,l)=>{h.$ZodReadonly.init(u,l),S.init(u,l)});function readonly(u){return new Re({type:"readonly",innerType:u})}const Ze=f.$constructor("ZodMiniTemplateLiteral",(u,l)=>{h.$ZodTemplateLiteral.init(u,l),S.init(u,l)});function templateLiteral(u,l){return new Ze({type:"template_literal",parts:u,...v.normalizeParams(l)})}const Ce=f.$constructor("ZodMiniLazy",(u,l)=>{h.$ZodLazy.init(u,l),S.init(u,l)});function _lazy(u){return new Ce({type:"lazy",getter:u})}const ze=f.$constructor("ZodMiniPromise",(u,l)=>{h.$ZodPromise.init(u,l),S.init(u,l)});function promise(u){return new ze({type:"promise",innerType:u})}const Ae=f.$constructor("ZodMiniCustom",(u,l)=>{h.$ZodCustom.init(u,l),S.init(u,l)});function check(u,l){const m=new y.$ZodCheck({check:"custom",...v.normalizeParams(l)});return m._zod.check=u,m}function custom(u,l){return w._custom(Ae,u??(()=>!0),l)}function refine(u,l={}){return w._refine(Ae,u,l)}function _instanceof(u,l={error:`Input not instance of ${u.name}`}){const m=custom(l=>l instanceof u,l);return m._zod.bag.Class=u,m}const stringbool=(...u)=>w._stringbool({Pipe:Ie,Boolean:Y,String:j,Transform:be},...u);function json(){const u=_lazy(()=>union([string(),number(),boolean(),_null(),array(u),record(string(),u)]));return u}},"./packages/node_modules/@elementor-external/angie-sdk/dist/index.js":function(u,l,m){m.r(l),m.d(l,{ANGIE_EXTENDED_TIMEOUT:function(){return Qt},ANGIE_MODEL_PREFERENCES:function(){return Gt},ANGIE_REQUIRED_RESOURCES:function(){return Wt},ANGIE_SIDEBAR_STATE_OPEN:function(){return qt},AngieDetector:function(){return k},AngieLocalServerTransport:function(){return j},AngieMCPTransport:function(){return S},AngieMcpSdk:function(){return jt},AngieRemoteServerTransport:function(){return $},AngieServerType:function(){return x},BrowserContextTransport:function(){return I},ClientManager:function(){return T},DEFAULT_CONTAINER_ID:function(){return z},HostEventType:function(){return Z},HostLocalStorageEventType:function(){return R},MCP_READONLY:function(){return Yt},McpAppDisplayMode:function(){return Xt},MessageEventType:function(){return E},RegistrationQueue:function(){return Ht},applyWidth:function(){return Pt},clearReferrerRedirect:function(){return gt},disableNavigationPrevention:function(){return Nt},executeReferrerRedirect:function(){return ut},getAngieIframe:function(){return p},getAngieSidebarSavedState:function(){return Tt},getReferrerRedirect:function(){return lt},initAngieSidebar:function(){return Ut},initializeResize:function(){return Ot},loadState:function(){return Ct},loadWidth:function(){return It},navigateAngieIframe:function(){return zt},saveState:function(){return Rt},saveWidth:function(){return At},setReferrerRedirect:function(){return dt},toggleAngieSidebar:function(){return wt},waitForDocumentReady:function(){return ft}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");const h={none:0,error:1,warn:2,info:3,debug:4},y={error:"error",warn:"warn",info:"info",log:"info",debug:"debug"},s=(u,l)=>h[u]<=h[l],r=u=>"string"==typeof u?u:JSON.stringify(u),o=(u,l)=>{let m=`[${r(u)}]`;return typeof window<"u"?{text:`%c${m}`,style:`color: ${l.color||"#00bcd4"}; font-weight: bold;`}:{text:m}},a=(u,l,m,f)=>(...h)=>{if(!s(y[u],f()))return;if(!l)return void console[u](...h);let{text:v,style:w}=o(l,m);w?console[u](v,w,...h):console[u](v,...h)},c=(u,l)=>{let m=l.logLevel??"debug",s=()=>m;return{log:a("log",u,l,s),info:a("info",u,l,s),warn:a("warn",u,l,s),error:a("error",u,l,s),debug:a("debug",u,l,s),setLogLevel:u=>{m=u},extend:f=>c(u?((u,l)=>`${r(u)} > ${r(l)}`)(u,f):f,{...l,logLevel:m})}},d=(u,l)=>c(u,{color:"#00bcd4",logLevel:"debug",...l}),v=d("angie-sdk",{color:"#00BCD4",logLevel:"error"}),g=u=>v.extend(u),w=g("iframe-utils");let b=null;const p=()=>(b&&document.contains(b)||(b=document.querySelector('iframe[src*="angie/"]')),b),_=(u,l)=>{w.log("postMessageToAngieIframe",u,l);const m=p();if(!m?.contentWindow)return!1;const f=l||(()=>{const u=p();if(!u)return null;try{return new URL(u.src).origin}catch(u){return w.error("Error parsing iframe URL:",u),null}})();return f?(m.contentWindow.postMessage(u,f),!0):(w.error("Could not determine target origin for Angie iframe"),!1)};var S,j,$,x,E,R,Z;(S||(S={})).POST_MESSAGE="postMessage",function(u){u.POST_MESSAGE="postMessage"}(j||(j={})),function(u){u.STREAMABLE_HTTP="streamableHttp",u.SSE="sse"}($||($={})),function(u){u.LOCAL="local",u.REMOTE="remote"}(x||(x={})),function(u){u.SDK_ANGIE_READY_PING="sdk-angie-ready-ping",u.SDK_ANGIE_REFRESH_PING="sdk-angie-refresh-ping",u.SDK_ANGIE_ALL_SERVERS_REGISTERED="sdk-angie-all-servers-registered",u.SDK_REQUEST_CLIENT_CREATION="sdk-request-client-creation",u.SDK_REQUEST_INIT_SERVER="sdk-request-init-server",u.SDK_TRIGGER_ANGIE="sdk-trigger-angie",u.SDK_TRIGGER_ANGIE_RESPONSE="sdk-trigger-angie-response",u.ANGIE_SIDEBAR_RESIZED="angie-sidebar-resized",u.ANGIE_SIDEBAR_TOGGLED="angie-sidebar-toggled",u.ANGIE_CHAT_TOGGLE="angie-chat-toggle",u.ANGIE_STUDIO_TOGGLE="angie-studio-toggle",u.ANGIE_NAVIGATE_TO_URL="angie/navigate-to-url",u.ANGIE_PAGE_RELOAD="angie/page-reload",u.ANGIE_DISABLE_NAVIGATION_PREVENTION="angie/disable-navigation-prevention",u.ANGIE_NAVIGATE_AFTER_RESPONSE="angie/navigate-after-response"}(E||(E={})),function(u){u.SET="ANGIE_SET_LOCALSTORAGE",u.GET="ANGIE_GET_LOCALSTORAGE"}(R||(R={})),function(u){u.RESET_HASH="reset-hash",u.HOST_READY="host/ready",u.ANGIE_LOADED="angie/loaded",u.ANGIE_READY="angie/ready"}(Z||(Z={}));const C=g("angie-detector");class k{isAngieReady=!1;readyPromise;readyResolve;constructor(){if(this.readyPromise=new Promise(u=>{this.readyResolve=u}),"undefined"==typeof window)return;let u=0;const t=()=>{if(this.isAngieReady||u>=500)return void(!this.isAngieReady&&u>=500&&this.handleDetectionTimeout());const l=new MessageChannel;l.port1.onmessage=u=>{this.handleAngieReady(u.data),l.port1.close(),l.port2.close()};const m={type:E.SDK_ANGIE_READY_PING,timestamp:Date.now()};window.postMessage(m,window.location.origin,[l.port2]),u++,setTimeout(t,500)};t()}handleAngieReady(u){this.isAngieReady=!0;const l={isReady:!0,version:u.version,capabilities:u.capabilities};this.readyResolve&&this.readyResolve(l)}handleDetectionTimeout(){this.readyResolve&&this.readyResolve({isReady:!1}),C.warn("Detection timeout - Angie may not be available")}isReady(){return this.isAngieReady}async waitForReady(){return this.readyPromise}}class I{sessionId;onmessage;onerror;onclose;_port;_started=!1;_closed=!1;constructor(u){if(!u)throw new Error("MessagePort is required");this._port=u,this._port.onmessage=u=>{try{const l=f.JSONRPCMessageSchema.parse(u.data);this.onmessage?.(l)}catch(u){const l=new Error(`Failed to parse message: ${u}`);this.onerror?.(l)}},this._port.onmessageerror=u=>{const l=new Error(`MessagePort error: ${JSON.stringify(u)}`);this.onerror?.(l)}}async start(){if(this._started)throw new Error("BrowserContextTransport already started! If using Client or Server class, note that connect() calls start() automatically.");if(this._closed)throw new Error("Cannot start a closed BrowserContextTransport");this._started=!0,this._port.start()}async send(u){if(this._closed)throw new Error("Cannot send on a closed BrowserContextTransport");return new Promise((l,m)=>{try{this._port.postMessage(u),l()}catch(u){const l=u instanceof Error?u:new Error(String(u));this.onerror?.(l),m(l)}})}async close(){this._closed||(this._closed=!0,this._port.close(),this.onclose?.())}}class T{async requestClientCreation(u){const{config:l}=u,m={serverId:u.id,serverName:l.name,serverTitle:l.title,serverVersion:l.version,description:l.description,transport:l.transport||j.POST_MESSAGE,capabilities:l.capabilities,instanceId:u.instanceId};return"type"in l&&"remote"===l.type&&(m.remote={url:l.url}),new Promise((u,l)=>{const f=new MessageChannel,h=setTimeout(()=>{l(new Error("Client creation request timed out after 15000ms"))},15e3);f.port1.onmessage=l=>{clearTimeout(h),u(l.data)};const y={type:E.SDK_REQUEST_CLIENT_CREATION,payload:m,timestamp:Date.now()};window.postMessage(y,window.location.origin,[f.port2])})}}const z="angie-sidebar-container",A={open:!1,iframe:null,iframeUrlObject:null,containerId:z};class P extends Error{}P.prototype.name="InvalidTokenError";var O,D,N,M={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},U=(u=>(u[u.NONE=0]="NONE",u[u.ERROR=1]="ERROR",u[u.WARN=2]="WARN",u[u.INFO=3]="INFO",u[u.DEBUG=4]="DEBUG",u))(U||{});(N=U||(U={})).reset=function(){O=3,D=M},N.setLevel=function(u){if(!(0<=u&&u<=4))throw new Error("Invalid log level");O=u},N.setLogger=function(u){D=u};var L=class e{constructor(u){this._name=u}debug(...u){O>=4&&D.debug(e._format(this._name,this._method),...u)}info(...u){O>=3&&D.info(e._format(this._name,this._method),...u)}warn(...u){O>=2&&D.warn(e._format(this._name,this._method),...u)}error(...u){O>=1&&D.error(e._format(this._name,this._method),...u)}throw(u){throw this.error(u),u}create(u){const l=Object.create(this);return l._method=u,l.debug("begin"),l}static createStatic(u,l){const m=new e(`${u}.${l}`);return m.debug("begin"),m}static _format(u,l){const m=`[${u}]`;return l?`${m} ${l}:`:m}static debug(u,...l){O>=4&&D.debug(e._format(u),...l)}static info(u,...l){O>=3&&D.info(e._format(u),...l)}static warn(u,...l){O>=2&&D.warn(e._format(u),...l)}static error(u,...l){O>=1&&D.error(e._format(u),...l)}};U.reset();var F=class{static decode(u){try{return function(u,l){if("string"!=typeof u)throw new P("Invalid token specified: must be a string");l||(l={});const m=!0===l.header?0:1,f=u.split(".")[m];if("string"!=typeof f)throw new P(`Invalid token specified: missing part #${m+1}`);let h;try{h=function(u){let l=u.replace(/-/g,"+").replace(/_/g,"/");switch(l.length%4){case 0:break;case 2:l+="==";break;case 3:l+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(u){return decodeURIComponent(atob(u).replace(/(.)/g,(u,l)=>{let m=l.charCodeAt(0).toString(16).toUpperCase();return m.length<2&&(m="0"+m),"%"+m}))}(l)}catch(u){return atob(l)}}(f)}catch(u){throw new P(`Invalid token specified: invalid base64 for part #${m+1} (${u.message})`)}try{return JSON.parse(h)}catch(u){throw new P(`Invalid token specified: invalid json for part #${m+1} (${u.message})`)}}(u)}catch(u){throw L.error("JwtUtils.decode",u),u}}static async generateSignedJwt(u,l,m){const f=`${K.encodeBase64Url((new TextEncoder).encode(JSON.stringify(u)))}.${K.encodeBase64Url((new TextEncoder).encode(JSON.stringify(l)))}`,h=await window.crypto.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},m,(new TextEncoder).encode(f));return`${f}.${K.encodeBase64Url(new Uint8Array(h))}`}static async generateSignedJwtWithHmac(u,l,m){const f=`${K.encodeBase64Url((new TextEncoder).encode(JSON.stringify(u)))}.${K.encodeBase64Url((new TextEncoder).encode(JSON.stringify(l)))}`,h=await window.crypto.subtle.sign("HMAC",m,(new TextEncoder).encode(f));return`${f}.${K.encodeBase64Url(new Uint8Array(h))}`}},q=u=>btoa([...new Uint8Array(u)].map(u=>String.fromCharCode(u)).join("")),V=class e{static _randomWord(){const u=new Uint32Array(1);return crypto.getRandomValues(u),u[0]}static generateUUIDv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,u=>(+u^e._randomWord()&15>>+u/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return e.generateUUIDv4()+e.generateUUIDv4()+e.generateUUIDv4()}static async generateCodeChallenge(u){if(!crypto.subtle)throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");try{const l=(new TextEncoder).encode(u),m=await crypto.subtle.digest("SHA-256",l);return q(m).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(u){throw L.error("CryptoUtils.generateCodeChallenge",u),u}}static generateBasicAuth(u,l){const m=(new TextEncoder).encode([u,l].join(":"));return q(m)}static async hash(u,l){const m=(new TextEncoder).encode(l),f=await crypto.subtle.digest(u,m);return new Uint8Array(f)}static async customCalculateJwkThumbprint(u){let l;switch(u.kty){case"RSA":l={e:u.e,kty:u.kty,n:u.n};break;case"EC":l={crv:u.crv,kty:u.kty,x:u.x,y:u.y};break;case"OKP":l={crv:u.crv,kty:u.kty,x:u.x};break;case"oct":l={crv:u.k,kty:u.kty};break;default:throw new Error("Unknown jwk type")}const m=await e.hash("SHA-256",JSON.stringify(l));return e.encodeBase64Url(m)}static async generateDPoPProof({url:u,accessToken:l,httpMethod:m,keyPair:f,nonce:h}){let y,v;const w={jti:window.crypto.randomUUID(),htm:null!=m?m:"GET",htu:u,iat:Math.floor(Date.now()/1e3)};l&&(y=await e.hash("SHA-256",l),v=e.encodeBase64Url(y),w.ath=v),h&&(w.nonce=h);try{const u=await crypto.subtle.exportKey("jwk",f.publicKey),l={alg:"ES256",typ:"dpop+jwt",jwk:{crv:u.crv,kty:u.kty,x:u.x,y:u.y}};return await F.generateSignedJwt(l,w,f.privateKey)}catch(u){throw u instanceof TypeError?new Error(`Error exporting dpop public key: ${u.message}`):u}}static async generateDPoPJkt(u){try{const l=await crypto.subtle.exportKey("jwk",u.publicKey);return await e.customCalculateJwkThumbprint(l)}catch(u){throw u instanceof TypeError?new Error(`Could not retrieve dpop keys from storage: ${u.message}`):u}}static async generateDPoPKeys(){return await window.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"])}static async generateClientAssertionJwt(u,l,m,f="HS256"){const h=Math.floor(Date.now()/1e3),y={alg:f,typ:"JWT"},v={iss:u,sub:u,aud:m,jti:e.generateUUIDv4(),exp:h+300,iat:h},w={HS256:"SHA-256",HS384:"SHA-384",HS512:"SHA-512"}[f];if(!w)throw new Error(`Unsupported algorithm: ${f}. Supported algorithms are: HS256, HS384, HS512`);const b=new TextEncoder,S=await crypto.subtle.importKey("raw",b.encode(l),{name:"HMAC",hash:w},!1,["sign"]);return await F.generateSignedJwtWithHmac(y,v,S)}};V.encodeBase64Url=u=>q(u).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");var K=V,H=class{constructor(u){this._name=u,this._callbacks=[],this._logger=new L(`Event('${this._name}')`)}addHandler(u){return this._callbacks.push(u),()=>this.removeHandler(u)}removeHandler(u){const l=this._callbacks.lastIndexOf(u);l>=0&&this._callbacks.splice(l,1)}async raise(...u){this._logger.debug("raise:",...u);for(const l of this._callbacks)await l(...u)}},B=class{static center({...u}){var l;return null==u.width&&(u.width=null!=(l=[800,720,600,480].find(u=>u<=window.outerWidth/1.618))?l:360),null!=u.left||(u.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-u.width)/2))),null!=u.height&&(null!=u.top||(u.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-u.height)/2)))),u}static serialize(u){return Object.entries(u).filter(([,u])=>null!=u).map(([u,l])=>`${u}=${"boolean"!=typeof l?l:l?"yes":"no"}`).join(",")}},J=class e extends H{constructor(){super(...arguments),this._logger=new L(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const u=this._expiration-e.getEpochTime();this._logger.debug("timer completes in",u),this._expiration<=e.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(u){const l=this._logger.create("init");u=Math.max(Math.floor(u),1);const m=e.getEpochTime()+u;if(this.expiration===m&&this._timerHandle)return void l.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),l.debug("using duration",u),this._expiration=m;const f=Math.min(u,5);this._timerHandle=setInterval(this._callback,1e3*f)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},W=class{static readParams(u,l="query"){if(!u)throw new TypeError("Invalid URL");const m=new URL(u,"http://127.0.0.1")["fragment"===l?"hash":"search"];return new URLSearchParams(m.slice(1))}},G=";",Q=class extends Error{constructor(u,l){var m,f,h;if(super(u.error_description||u.error||""),this.form=l,this.name="ErrorResponse",!u.error)throw L.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=u.error,this.error_description=null!=(m=u.error_description)?m:null,this.error_uri=null!=(f=u.error_uri)?f:null,this.state=u.userState,this.session_state=null!=(h=u.session_state)?h:null,this.url_state=u.url_state}},Y=class extends Error{constructor(u){super(u),this.name="ErrorTimeout"}},X=class{constructor(u){this._logger=new L("AccessTokenEvents"),this._expiringTimer=new J("Access token expiring"),this._expiredTimer=new J("Access token expired"),this._expiringNotificationTimeInSeconds=u.expiringNotificationTimeInSeconds}async load(u){const l=this._logger.create("load");if(u.access_token&&void 0!==u.expires_in){const m=u.expires_in;if(l.debug("access token present, remaining duration:",m),m>0){let u=m-this._expiringNotificationTimeInSeconds;u<=0&&(u=1),l.debug("registering expiring timer, raising in",u,"seconds"),this._expiringTimer.init(u)}else l.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const f=m+1;l.debug("registering expired timer, raising in",f,"seconds"),this._expiredTimer.init(f)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}async unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(u){return this._expiringTimer.addHandler(u)}removeAccessTokenExpiring(u){this._expiringTimer.removeHandler(u)}addAccessTokenExpired(u){return this._expiredTimer.addHandler(u)}removeAccessTokenExpired(u){this._expiredTimer.removeHandler(u)}},ee=class{constructor(u,l,m,f,h){this._callback=u,this._client_id=l,this._intervalInSeconds=f,this._stopOnError=h,this._logger=new L("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=u=>{u.origin===this._frame_origin&&u.source===this._frame.contentWindow&&("error"===u.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===u.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(u.data+" message from check session op iframe"))};const y=new URL(m);this._frame_origin=y.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=y.href}load(){return new Promise(u=>{this._frame.onload=()=>{u()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(u){if(this._session_state===u)return;this._logger.create("start"),this.stop(),this._session_state=u;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},te=class{constructor(){this._logger=new L("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(u){return this._logger.create(`getItem('${u}')`),this._data[u]}setItem(u,l){this._logger.create(`setItem('${u}')`),this._data[u]=l}removeItem(u){this._logger.create(`removeItem('${u}')`),delete this._data[u]}get length(){return Object.getOwnPropertyNames(this._data).length}key(u){return Object.getOwnPropertyNames(this._data)[u]}},ne=class extends Error{constructor(u,l){super(l),this.name="ErrorDPoPNonce",this.nonce=u}},re=class{constructor(u=[],l=null,m={}){this._jwtHandler=l,this._extraHeaders=m,this._logger=new L("JsonService"),this._contentTypes=[],this._contentTypes.push(...u,"application/json"),l&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(u,l={}){const{timeoutInSeconds:m,...f}=l;if(!m)return await fetch(u,f);const h=new AbortController,y=setTimeout(()=>h.abort(),1e3*m);try{return await fetch(u,{...l,signal:h.signal})}catch(u){if(u instanceof DOMException&&"AbortError"===u.name)throw new Y("Network timed out");throw u}finally{clearTimeout(y)}}async getJson(u,{token:l,credentials:m,timeoutInSeconds:f}={}){const h=this._logger.create("getJson"),y={Accept:this._contentTypes.join(", ")};let v;l&&(h.debug("token passed, setting Authorization header"),y.Authorization="Bearer "+l),this._appendExtraHeaders(y);try{h.debug("url:",u),v=await this.fetchWithTimeout(u,{method:"GET",headers:y,timeoutInSeconds:f,credentials:m})}catch(u){throw h.error("Network Error"),u}h.debug("HTTP response received, status",v.status);const w=v.headers.get("Content-Type");if(w&&!this._contentTypes.find(u=>w.startsWith(u))&&h.throw(new Error(`Invalid response Content-Type: ${null!=w?w:"undefined"}, from URL: ${u}`)),v.ok&&this._jwtHandler&&(null==w?void 0:w.startsWith("application/jwt")))return await this._jwtHandler(await v.text());let b;try{b=await v.json()}catch(u){if(h.error("Error parsing JSON response",u),v.ok)throw u;throw new Error(`${v.statusText} (${v.status})`)}if(!v.ok){if(h.error("Error from server:",b),b.error)throw new Q(b);throw new Error(`${v.statusText} (${v.status}): ${JSON.stringify(b)}`)}return b}async postForm(u,{body:l,basicAuth:m,timeoutInSeconds:f,initCredentials:h,extraHeaders:y}){const v=this._logger.create("postForm"),w={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded",...y};let b;void 0!==m&&(w.Authorization="Basic "+m),this._appendExtraHeaders(w);try{v.debug("url:",u),b=await this.fetchWithTimeout(u,{method:"POST",headers:w,body:l,timeoutInSeconds:f,credentials:h})}catch(u){throw v.error("Network error"),u}v.debug("HTTP response received, status",b.status);const S=b.headers.get("Content-Type");if(S&&!this._contentTypes.find(u=>S.startsWith(u)))throw new Error(`Invalid response Content-Type: ${null!=S?S:"undefined"}, from URL: ${u}`);const j=await b.text();let $={};if(j)try{$=JSON.parse(j)}catch(u){if(v.error("Error parsing JSON response",u),b.ok)throw u;throw new Error(`${b.statusText} (${b.status})`)}if(!b.ok){if(v.error("Error from server:",$),b.headers.has("dpop-nonce")){const u=b.headers.get("dpop-nonce");throw new ne(u,`${JSON.stringify($)}`)}if($.error)throw new Q($,l);throw new Error(`${b.statusText} (${b.status}): ${JSON.stringify($)}`)}return $}_appendExtraHeaders(u){const l=this._logger.create("appendExtraHeaders"),m=Object.keys(this._extraHeaders),f=["accept","content-type"],h=["authorization"];0!==m.length&&m.forEach(m=>{if(f.includes(m.toLocaleLowerCase()))return void l.warn("Protected header could not be set",m,f);if(h.includes(m.toLocaleLowerCase())&&Object.keys(u).includes(m))return void l.warn("Header could not be overridden",m,h);const y="function"==typeof this._extraHeaders[m]?this._extraHeaders[m]():this._extraHeaders[m];y&&""!==y&&(u[m]=y)})}},oe=class{constructor(u){this._settings=u,this._logger=new L("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new re(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const u=this._logger.create("getMetadata");if(this._metadata)return u.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw u.throw(new Error("No authority or metadataUrl configured on settings")),null;u.debug("getting metadata from",this._metadataUrl);const l=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return u.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},l,this._settings.metadataSeed),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(u=!0){return this._getMetadataProperty("token_endpoint",u)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(u=!0){return this._getMetadataProperty("revocation_endpoint",u)}getKeysEndpoint(u=!0){return this._getMetadataProperty("jwks_uri",u)}async _getMetadataProperty(u,l=!1){const m=this._logger.create(`_getMetadataProperty('${u}')`),f=await this.getMetadata();if(m.debug("resolved"),void 0===f[u]){if(!0===l)return void m.warn("Metadata does not contain optional property");m.throw(new Error("Metadata does not contain property "+u))}return f[u]}async getSigningKeys(){const u=this._logger.create("getSigningKeys");if(this._signingKeys)return u.debug("returning signingKeys from cache"),this._signingKeys;const l=await this.getKeysEndpoint(!1);u.debug("got jwks_uri",l);const m=await this._jsonService.getJson(l,{timeoutInSeconds:this._settings.requestTimeoutInSeconds});if(u.debug("got key set",m),!Array.isArray(m.keys))throw u.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=m.keys,this._signingKeys}},se=class{constructor({prefix:u="oidc.",store:l=localStorage}={}){this._logger=new L("WebStorageStateStore"),this._store=l,this._prefix=u}async set(u,l){this._logger.create(`set('${u}')`),u=this._prefix+u,await this._store.setItem(u,l)}async get(u){return this._logger.create(`get('${u}')`),u=this._prefix+u,await this._store.getItem(u)}async remove(u){this._logger.create(`remove('${u}')`),u=this._prefix+u;const l=await this._store.getItem(u);return await this._store.removeItem(u),l}async getAllKeys(){this._logger.create("getAllKeys");const u=await this._store.length,l=[];for(let m=0;m<u;m++){const u=await this._store.key(m);u&&0===u.indexOf(this._prefix)&&l.push(u.substr(this._prefix.length))}return l}},ie=class{constructor({authority:u,metadataUrl:l,metadata:m,signingKeys:f,metadataSeed:h,client_id:y,client_secret:v,response_type:w="code",scope:b="openid",redirect_uri:S,post_logout_redirect_uri:j,client_authentication:$="client_secret_post",token_endpoint_auth_signing_alg:x="HS256",prompt:E,display:R,max_age:Z,ui_locales:C,acr_values:z,resource:A,response_mode:O,filterProtocolClaims:D=!0,loadUserInfo:N=!1,requestTimeoutInSeconds:M,staleStateAgeInSeconds:U=900,mergeClaimsStrategy:L={array:"replace"},disablePKCE:F=!1,stateStore:V,revokeTokenAdditionalContentTypes:K,fetchRequestCredentials:H,refreshTokenAllowedScope:B,extraQueryParams:J={},extraTokenParams:W={},extraHeaders:G={},dpop:Q,omitScopeWhenRequesting:Y=!1}){var X;if(this.authority=u,l?this.metadataUrl=l:(this.metadataUrl=u,u&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=m,this.metadataSeed=h,this.signingKeys=f,this.client_id=y,this.client_secret=v,this.response_type=w,this.scope=b,this.redirect_uri=S,this.post_logout_redirect_uri=j,this.client_authentication=$,this.token_endpoint_auth_signing_alg=x,this.prompt=E,this.display=R,this.max_age=Z,this.ui_locales=C,this.acr_values=z,this.resource=A,this.response_mode=O,this.filterProtocolClaims=null==D||D,this.loadUserInfo=!!N,this.staleStateAgeInSeconds=U,this.mergeClaimsStrategy=L,this.omitScopeWhenRequesting=Y,this.disablePKCE=!!F,this.revokeTokenAdditionalContentTypes=K,this.fetchRequestCredentials=H||"same-origin",this.requestTimeoutInSeconds=M,V)this.stateStore=V;else{const u="undefined"!=typeof window?window.localStorage:new te;this.stateStore=new se({store:u})}if(this.refreshTokenAllowedScope=B,this.extraQueryParams=J,this.extraTokenParams=W,this.extraHeaders=G,this.dpop=Q,this.dpop&&!(null==(X=this.dpop)?void 0:X.store))throw new Error("A DPoPStore is required when dpop is enabled")}},ae=class{constructor(u,l){this._settings=u,this._metadataService=l,this._logger=new L("UserInfoService"),this._getClaimsFromJwt=async u=>{const l=this._logger.create("_getClaimsFromJwt");try{const m=F.decode(u);return l.debug("JWT decoding successful"),m}catch(u){throw l.error("Error parsing JWT response"),u}},this._jsonService=new re(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(u){const l=this._logger.create("getClaims");u||this._logger.throw(new Error("No token passed"));const m=await this._metadataService.getUserInfoEndpoint();l.debug("got userinfo url",m);const f=await this._jsonService.getJson(m,{token:u,credentials:this._settings.fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return l.debug("got claims",f),f}},de=class{constructor(u,l){this._settings=u,this._metadataService=l,this._logger=new L("TokenClient"),this._jsonService=new re(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:u="authorization_code",redirect_uri:l=this._settings.redirect_uri,client_id:m=this._settings.client_id,client_secret:f=this._settings.client_secret,extraHeaders:h,...y}){const v=this._logger.create("exchangeCode");m||v.throw(new Error("A client_id is required")),l||v.throw(new Error("A redirect_uri is required")),y.code||v.throw(new Error("A code is required"));const w=new URLSearchParams({grant_type:u,redirect_uri:l});for(const[u,l]of Object.entries(y))null!=l&&w.set(u,l);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==f)throw v.throw(new Error("A client_secret is required")),null;let b;const S=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":b=K.generateBasicAuth(m,f);break;case"client_secret_post":w.append("client_id",m),f&&w.append("client_secret",f);break;case"client_secret_jwt":{const u=await K.generateClientAssertionJwt(m,f,S,this._settings.token_endpoint_auth_signing_alg);w.append("client_id",m),w.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),w.append("client_assertion",u);break}}v.debug("got token endpoint");const j=await this._jsonService.postForm(S,{body:w,basicAuth:b,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:h});return v.debug("got response"),j}async exchangeCredentials({grant_type:u="password",client_id:l=this._settings.client_id,client_secret:m=this._settings.client_secret,scope:f=this._settings.scope,...h}){const y=this._logger.create("exchangeCredentials");l||y.throw(new Error("A client_id is required"));const v=new URLSearchParams({grant_type:u});this._settings.omitScopeWhenRequesting||v.set("scope",f);for(const[u,l]of Object.entries(h))null!=l&&v.set(u,l);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==m)throw y.throw(new Error("A client_secret is required")),null;let w;const b=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":w=K.generateBasicAuth(l,m);break;case"client_secret_post":v.append("client_id",l),m&&v.append("client_secret",m);break;case"client_secret_jwt":{const u=await K.generateClientAssertionJwt(l,m,b,this._settings.token_endpoint_auth_signing_alg);v.append("client_id",l),v.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),v.append("client_assertion",u);break}}y.debug("got token endpoint");const S=await this._jsonService.postForm(b,{body:v,basicAuth:w,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials});return y.debug("got response"),S}async exchangeRefreshToken({grant_type:u="refresh_token",client_id:l=this._settings.client_id,client_secret:m=this._settings.client_secret,timeoutInSeconds:f,extraHeaders:h,...y}){const v=this._logger.create("exchangeRefreshToken");l||v.throw(new Error("A client_id is required")),y.refresh_token||v.throw(new Error("A refresh_token is required"));const w=new URLSearchParams({grant_type:u});for(const[u,l]of Object.entries(y))Array.isArray(l)?l.forEach(l=>w.append(u,l)):null!=l&&w.set(u,l);if(("client_secret_basic"===this._settings.client_authentication||"client_secret_jwt"===this._settings.client_authentication)&&null==m)throw v.throw(new Error("A client_secret is required")),null;let b;const S=await this._metadataService.getTokenEndpoint(!1);switch(this._settings.client_authentication){case"client_secret_basic":b=K.generateBasicAuth(l,m);break;case"client_secret_post":w.append("client_id",l),m&&w.append("client_secret",m);break;case"client_secret_jwt":{const u=await K.generateClientAssertionJwt(l,m,S,this._settings.token_endpoint_auth_signing_alg);w.append("client_id",l),w.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),w.append("client_assertion",u);break}}v.debug("got token endpoint");const j=await this._jsonService.postForm(S,{body:w,basicAuth:b,timeoutInSeconds:f,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:h});return v.debug("got response"),j}async revoke(u){var l;const m=this._logger.create("revoke");u.token||m.throw(new Error("A token is required"));const f=await this._metadataService.getRevocationEndpoint(!1);m.debug(`got revocation endpoint, revoking ${null!=(l=u.token_type_hint)?l:"default token type"}`);const h=new URLSearchParams;for(const[l,m]of Object.entries(u))null!=m&&h.set(l,m);h.set("client_id",this._settings.client_id),this._settings.client_secret&&h.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(f,{body:h,timeoutInSeconds:this._settings.requestTimeoutInSeconds}),m.debug("got response")}},ce=class{constructor(u,l,m){this._settings=u,this._metadataService=l,this._claimsService=m,this._logger=new L("ResponseValidator"),this._userInfoService=new ae(this._settings,this._metadataService),this._tokenClient=new de(this._settings,this._metadataService)}async validateSigninResponse(u,l,m){const f=this._logger.create("validateSigninResponse");this._processSigninState(u,l),f.debug("state processed"),await this._processCode(u,l,m),f.debug("code processed"),u.isOpenId&&this._validateIdTokenAttributes(u),f.debug("tokens validated"),await this._processClaims(u,null==l?void 0:l.skipUserInfo,u.isOpenId),f.debug("claims processed")}async validateCredentialsResponse(u,l){const m=this._logger.create("validateCredentialsResponse"),f=u.isOpenId&&!!u.id_token;f&&this._validateIdTokenAttributes(u),m.debug("tokens validated"),await this._processClaims(u,l,f),m.debug("claims processed")}async validateRefreshResponse(u,l){const m=this._logger.create("validateRefreshResponse");u.userState=l.data,null!=u.session_state||(u.session_state=l.session_state),null!=u.scope||(u.scope=l.scope),u.isOpenId&&u.id_token&&(this._validateIdTokenAttributes(u,l.id_token),m.debug("ID Token validated")),u.id_token||(u.id_token=l.id_token,u.profile=l.profile);const f=u.isOpenId&&!!u.id_token;await this._processClaims(u,!1,f),m.debug("claims processed")}validateSignoutResponse(u,l){const m=this._logger.create("validateSignoutResponse");if(l.id!==u.state&&m.throw(new Error("State does not match")),m.debug("state validated"),u.userState=l.data,u.error)throw m.warn("Response was error",u.error),new Q(u)}_processSigninState(u,l){const m=this._logger.create("_processSigninState");if(l.id!==u.state&&m.throw(new Error("State does not match")),l.client_id||m.throw(new Error("No client_id on state")),l.authority||m.throw(new Error("No authority on state")),this._settings.authority!==l.authority&&m.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==l.client_id&&m.throw(new Error("client_id mismatch on settings vs. signin state")),m.debug("state validated"),u.userState=l.data,u.url_state=l.url_state,null!=u.scope||(u.scope=l.scope),u.error)throw m.warn("Response was error",u.error),new Q(u);l.code_verifier&&!u.code&&m.throw(new Error("Expected code in response"))}async _processClaims(u,l=!1,m=!0){const f=this._logger.create("_processClaims");if(u.profile=this._claimsService.filterProtocolClaims(u.profile),l||!this._settings.loadUserInfo||!u.access_token)return void f.debug("not loading user info");f.debug("loading user info");const h=await this._userInfoService.getClaims(u.access_token);f.debug("user info claims received from user info endpoint"),m&&h.sub!==u.profile.sub&&f.throw(new Error("subject from UserInfo response does not match subject in ID Token")),u.profile=this._claimsService.mergeClaims(u.profile,this._claimsService.filterProtocolClaims(h)),f.debug("user info claims received, updated profile:",u.profile)}async _processCode(u,l,m){const f=this._logger.create("_processCode");if(u.code){f.debug("Validating code");const h=await this._tokenClient.exchangeCode({client_id:l.client_id,client_secret:l.client_secret,code:u.code,redirect_uri:l.redirect_uri,code_verifier:l.code_verifier,extraHeaders:m,...l.extraTokenParams});Object.assign(u,h)}else f.debug("No code to process")}_validateIdTokenAttributes(u,l){var m;const f=this._logger.create("_validateIdTokenAttributes");f.debug("decoding ID Token JWT");const h=F.decode(null!=(m=u.id_token)?m:"");if(h.sub||f.throw(new Error("ID Token is missing a subject claim")),l){const u=F.decode(l);h.sub!==u.sub&&f.throw(new Error("sub in id_token does not match current sub")),h.auth_time&&h.auth_time!==u.auth_time&&f.throw(new Error("auth_time in id_token does not match original auth_time")),h.azp&&h.azp!==u.azp&&f.throw(new Error("azp in id_token does not match original azp")),!h.azp&&u.azp&&f.throw(new Error("azp not in id_token, but present in original id_token"))}u.profile=h}},ue=class e{constructor(u){this.id=u.id||K.generateUUIDv4(),this.data=u.data,u.created&&u.created>0?this.created=u.created:this.created=J.getEpochTime(),this.request_type=u.request_type,this.url_state=u.url_state}toStorageString(){return new L("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(u){return L.createStatic("State","fromStorageString"),Promise.resolve(new e(JSON.parse(u)))}static async clearStaleState(u,l){const m=L.createStatic("State","clearStaleState"),f=J.getEpochTime()-l,h=await u.getAllKeys();m.debug("got keys",h);for(let l=0;l<h.length;l++){const y=h[l],v=await u.get(y);let w=!1;if(v)try{const u=await e.fromStorageString(v);m.debug("got item from key:",y,u.created),u.created<=f&&(w=!0)}catch(u){m.error("Error parsing state for key:",y,u),w=!0}else m.debug("no item in storage for key:",y),w=!0;w&&(m.debug("removed item for key:",y),u.remove(y))}}},le=class e extends ue{constructor(u){super(u),this.code_verifier=u.code_verifier,this.code_challenge=u.code_challenge,this.authority=u.authority,this.client_id=u.client_id,this.redirect_uri=u.redirect_uri,this.scope=u.scope,this.client_secret=u.client_secret,this.extraTokenParams=u.extraTokenParams,this.response_mode=u.response_mode,this.skipUserInfo=u.skipUserInfo}static async create(u){const l=!0===u.code_verifier?K.generateCodeVerifier():u.code_verifier||void 0,m=l?await K.generateCodeChallenge(l):void 0;return new e({...u,code_verifier:l,code_challenge:m})}toStorageString(){return new L("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(u){L.createStatic("SigninState","fromStorageString");const l=JSON.parse(u);return e.create(l)}},pe=class e{constructor(u){this.url=u.url,this.state=u.state}static async create({url:u,authority:l,client_id:m,redirect_uri:f,response_type:h,scope:y,state_data:v,response_mode:w,request_type:b,client_secret:S,nonce:j,url_state:$,resource:x,skipUserInfo:E,extraQueryParams:R,extraTokenParams:Z,disablePKCE:C,dpopJkt:z,omitScopeWhenRequesting:A,...O}){if(!u)throw this._logger.error("create: No url passed"),new Error("url");if(!m)throw this._logger.error("create: No client_id passed"),new Error("client_id");if(!f)throw this._logger.error("create: No redirect_uri passed"),new Error("redirect_uri");if(!h)throw this._logger.error("create: No response_type passed"),new Error("response_type");if(!y)throw this._logger.error("create: No scope passed"),new Error("scope");if(!l)throw this._logger.error("create: No authority passed"),new Error("authority");const D=await le.create({data:v,request_type:b,url_state:$,code_verifier:!C,client_id:m,authority:l,redirect_uri:f,response_mode:w,client_secret:S,scope:y,extraTokenParams:Z,skipUserInfo:E}),N=new URL(u);N.searchParams.append("client_id",m),N.searchParams.append("redirect_uri",f),N.searchParams.append("response_type",h),A||N.searchParams.append("scope",y),j&&N.searchParams.append("nonce",j),z&&N.searchParams.append("dpop_jkt",z);let M=D.id;$&&(M=`${M}${G}${$}`),N.searchParams.append("state",M),D.code_challenge&&(N.searchParams.append("code_challenge",D.code_challenge),N.searchParams.append("code_challenge_method","S256")),x&&(Array.isArray(x)?x:[x]).forEach(u=>N.searchParams.append("resource",u));for(const[u,l]of Object.entries({response_mode:w,...O,...R}))null!=l&&N.searchParams.append(u,l.toString());return new e({url:N.href,state:D})}};pe._logger=new L("SigninRequest");var me=pe,fe=class{constructor(u){if(this.access_token="",this.token_type="",this.profile={},this.state=u.get("state"),this.session_state=u.get("session_state"),this.state){const u=decodeURIComponent(this.state).split(G);this.state=u[0],u.length>1&&(this.url_state=u.slice(1).join(G))}this.error=u.get("error"),this.error_description=u.get("error_description"),this.error_uri=u.get("error_uri"),this.code=u.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-J.getEpochTime()}set expires_in(u){"string"==typeof u&&(u=Number(u)),void 0!==u&&u>=0&&(this.expires_at=Math.floor(u)+J.getEpochTime())}get isOpenId(){var u;return(null==(u=this.scope)?void 0:u.split(" ").includes("openid"))||!!this.id_token}},he=class{constructor({url:u,state_data:l,id_token_hint:m,post_logout_redirect_uri:f,extraQueryParams:h,request_type:y,client_id:v,url_state:w}){if(this._logger=new L("SignoutRequest"),!u)throw this._logger.error("ctor: No url passed"),new Error("url");const b=new URL(u);if(m&&b.searchParams.append("id_token_hint",m),v&&b.searchParams.append("client_id",v),f&&(b.searchParams.append("post_logout_redirect_uri",f),l||w)){this.state=new ue({data:l,request_type:y,url_state:w});let u=this.state.id;w&&(u=`${u}${G}${w}`),b.searchParams.append("state",u)}for(const[u,l]of Object.entries({...h}))null!=l&&b.searchParams.append(u,l.toString());this.url=b.href}},ge=class{constructor(u){if(this.state=u.get("state"),this.state){const u=decodeURIComponent(this.state).split(G);this.state=u[0],u.length>1&&(this.url_state=u.slice(1).join(G))}this.error=u.get("error"),this.error_description=u.get("error_description"),this.error_uri=u.get("error_uri")}},_e=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],ye=["sub","iss","aud","exp","iat"],ve=class{constructor(u){this._settings=u,this._logger=new L("ClaimsService")}filterProtocolClaims(u){const l={...u};if(this._settings.filterProtocolClaims){let u;u=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:_e;for(const m of u)ye.includes(m)||delete l[m]}return l}mergeClaims(u,l){const m={...u};for(const[u,f]of Object.entries(l))if(m[u]!==f)if(Array.isArray(m[u])||Array.isArray(f))if("replace"==this._settings.mergeClaimsStrategy.array)m[u]=f;else{const l=Array.isArray(m[u])?m[u]:[m[u]];for(const u of Array.isArray(f)?f:[f])l.includes(u)||l.push(u);m[u]=l}else"object"==typeof m[u]&&"object"==typeof f?m[u]=this.mergeClaims(m[u],f):m[u]=f;return m}},we=class{constructor(u,l){this.keys=u,this.nonce=l}},be=class{constructor(u,l){this._logger=new L("OidcClient"),this.settings=u instanceof ie?u:new ie(u),this.metadataService=null!=l?l:new oe(this.settings),this._claimsService=new ve(this.settings),this._validator=new ce(this.settings,this.metadataService,this._claimsService),this._tokenClient=new de(this.settings,this.metadataService)}async createSigninRequest({state:u,request:l,request_uri:m,request_type:f,id_token_hint:h,login_hint:y,skipUserInfo:v,nonce:w,url_state:b,response_type:S=this.settings.response_type,scope:j=this.settings.scope,redirect_uri:$=this.settings.redirect_uri,prompt:x=this.settings.prompt,display:E=this.settings.display,max_age:R=this.settings.max_age,ui_locales:Z=this.settings.ui_locales,acr_values:C=this.settings.acr_values,resource:z=this.settings.resource,response_mode:A=this.settings.response_mode,extraQueryParams:O=this.settings.extraQueryParams,extraTokenParams:D=this.settings.extraTokenParams,dpopJkt:N,omitScopeWhenRequesting:M=this.settings.omitScopeWhenRequesting}){const U=this._logger.create("createSigninRequest");if("code"!==S)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const L=await this.metadataService.getAuthorizationEndpoint();U.debug("Received authorization endpoint",L);const F=await me.create({url:L,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:$,response_type:S,scope:j,state_data:u,url_state:b,prompt:x,display:E,max_age:R,ui_locales:Z,id_token_hint:h,login_hint:y,acr_values:C,dpopJkt:N,resource:z,request:l,request_uri:m,extraQueryParams:O,extraTokenParams:D,request_type:f,response_mode:A,client_secret:this.settings.client_secret,skipUserInfo:v,nonce:w,disablePKCE:this.settings.disablePKCE,omitScopeWhenRequesting:M});await this.clearStaleState();const V=F.state;return await this.settings.stateStore.set(V.id,V.toStorageString()),F}async readSigninResponseState(u,l=!1){const m=this._logger.create("readSigninResponseState"),f=new fe(W.readParams(u,this.settings.response_mode));if(!f.state)throw m.throw(new Error("No state in response")),null;const h=await this.settings.stateStore[l?"remove":"get"](f.state);if(!h)throw m.throw(new Error("No matching state found in storage")),null;return{state:await le.fromStorageString(h),response:f}}async processSigninResponse(u,l,m=!0){const f=this._logger.create("processSigninResponse"),{state:h,response:y}=await this.readSigninResponseState(u,m);if(f.debug("received state from storage; validating response"),this.settings.dpop&&this.settings.dpop.store){const u=await this.getDpopProof(this.settings.dpop.store);l={...l,DPoP:u}}try{await this._validator.validateSigninResponse(y,h,l)}catch(u){if(!(u instanceof ne&&this.settings.dpop))throw u;{const m=await this.getDpopProof(this.settings.dpop.store,u.nonce);l.DPoP=m,await this._validator.validateSigninResponse(y,h,l)}}return y}async getDpopProof(u,l){let m,f;return(await u.getAllKeys()).includes(this.settings.client_id)?(f=await u.get(this.settings.client_id),f.nonce!==l&&l&&(f.nonce=l,await u.set(this.settings.client_id,f))):(m=await K.generateDPoPKeys(),f=new we(m,l),await u.set(this.settings.client_id,f)),await K.generateDPoPProof({url:await this.metadataService.getTokenEndpoint(!1),httpMethod:"POST",keyPair:f.keys,nonce:f.nonce})}async processResourceOwnerPasswordCredentials({username:u,password:l,skipUserInfo:m=!1,extraTokenParams:f={}}){const h=await this._tokenClient.exchangeCredentials({username:u,password:l,...f}),y=new fe(new URLSearchParams);return Object.assign(y,h),await this._validator.validateCredentialsResponse(y,m),y}async useRefreshToken({state:u,redirect_uri:l,resource:m,timeoutInSeconds:f,extraHeaders:h,extraTokenParams:y}){var v;const w=this._logger.create("useRefreshToken");let b,S;if(void 0===this.settings.refreshTokenAllowedScope)b=u.scope;else{const l=this.settings.refreshTokenAllowedScope.split(" ");b=((null==(v=u.scope)?void 0:v.split(" "))||[]).filter(u=>l.includes(u)).join(" ")}if(this.settings.dpop&&this.settings.dpop.store){const u=await this.getDpopProof(this.settings.dpop.store);h={...h,DPoP:u}}try{S=await this._tokenClient.exchangeRefreshToken({refresh_token:u.refresh_token,scope:b,redirect_uri:l,resource:m,timeoutInSeconds:f,extraHeaders:h,...y})}catch(v){if(!(v instanceof ne&&this.settings.dpop))throw v;h.DPoP=await this.getDpopProof(this.settings.dpop.store,v.nonce),S=await this._tokenClient.exchangeRefreshToken({refresh_token:u.refresh_token,scope:b,redirect_uri:l,resource:m,timeoutInSeconds:f,extraHeaders:h,...y})}const j=new fe(new URLSearchParams);return Object.assign(j,S),w.debug("validating response",j),await this._validator.validateRefreshResponse(j,{...u,scope:b}),j}async createSignoutRequest({state:u,id_token_hint:l,client_id:m,request_type:f,url_state:h,post_logout_redirect_uri:y=this.settings.post_logout_redirect_uri,extraQueryParams:v=this.settings.extraQueryParams}={}){const w=this._logger.create("createSignoutRequest"),b=await this.metadataService.getEndSessionEndpoint();if(!b)throw w.throw(new Error("No end session endpoint")),null;w.debug("Received end session endpoint",b),m||!y||l||(m=this.settings.client_id);const S=new he({url:b,id_token_hint:l,client_id:m,post_logout_redirect_uri:y,state_data:u,extraQueryParams:v,request_type:f,url_state:h});await this.clearStaleState();const j=S.state;return j&&(w.debug("Signout request has state to persist"),await this.settings.stateStore.set(j.id,j.toStorageString())),S}async readSignoutResponseState(u,l=!1){const m=this._logger.create("readSignoutResponseState"),f=new ge(W.readParams(u,this.settings.response_mode));if(!f.state){if(m.debug("No state in response"),f.error)throw m.warn("Response was error:",f.error),new Q(f);return{state:void 0,response:f}}const h=await this.settings.stateStore[l?"remove":"get"](f.state);if(!h)throw m.throw(new Error("No matching state found in storage")),null;return{state:await ue.fromStorageString(h),response:f}}async processSignoutResponse(u){const l=this._logger.create("processSignoutResponse"),{state:m,response:f}=await this.readSignoutResponseState(u,!0);return m?(l.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(f,m)):l.debug("No state from storage; skipping response validation"),f}clearStaleState(){return this._logger.create("clearStaleState"),ue.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(u,l){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:u,token_type_hint:l})}},ke=class{constructor(u){this._userManager=u,this._logger=new L("SessionMonitor"),this._start=async u=>{const l=u.session_state;if(!l)return;const m=this._logger.create("_start");if(u.profile?(this._sub=u.profile.sub,m.debug("session_state",l,", sub",this._sub)):(this._sub=void 0,m.debug("session_state",l,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(l);else try{const u=await this._userManager.metadataService.getCheckSessionIframe();if(u){m.debug("initializing check session iframe");const f=this._userManager.settings.client_id,h=this._userManager.settings.checkSessionIntervalInSeconds,y=this._userManager.settings.stopCheckSessionOnError,v=new ee(this._callback,f,u,h,y);await v.load(),this._checkSessionIFrame=v,v.start(l)}else m.warn("no check session iframe found in the metadata")}catch(u){m.error("Error from getCheckSessionIframe:",u instanceof Error?u.message:u)}},this._stop=()=>{const u=this._logger.create("_stop");if(this._sub=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const l=setInterval(async()=>{clearInterval(l);try{const u=await this._userManager.querySessionStatus();if(u){const l={session_state:u.session_state,profile:u.sub?{sub:u.sub}:null};this._start(l)}}catch(l){u.error("error from querySessionStatus",l instanceof Error?l.message:l)}},1e3)}},this._callback=async()=>{const u=this._logger.create("_callback");try{const l=await this._userManager.querySessionStatus();let m=!0;l&&this._checkSessionIFrame?l.sub===this._sub?(m=!1,this._checkSessionIFrame.start(l.session_state),u.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",l.session_state),await this._userManager.events._raiseUserSessionChanged()):u.debug("different subject signed into OP",l.sub):u.debug("subject no longer signed into OP"),m?this._sub?await this._userManager.events._raiseUserSignedOut():await this._userManager.events._raiseUserSignedIn():u.debug("no change in session detected, no event to raise")}catch(l){this._sub&&(u.debug("Error calling queryCurrentSigninSession; raising signed out event",l),await this._userManager.events._raiseUserSignedOut())}},u||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(u=>{this._logger.error(u)})}async _init(){this._logger.create("_init");const u=await this._userManager.getUser();if(u)this._start(u);else if(this._userManager.settings.monitorAnonymousSession){const u=await this._userManager.querySessionStatus();if(u){const l={session_state:u.session_state,profile:u.sub?{sub:u.sub}:null};this._start(l)}}}},Se=class e{constructor(u){var l;this.id_token=u.id_token,this.session_state=null!=(l=u.session_state)?l:null,this.access_token=u.access_token,this.refresh_token=u.refresh_token,this.token_type=u.token_type,this.scope=u.scope,this.profile=u.profile,this.expires_at=u.expires_at,this.state=u.userState,this.url_state=u.url_state}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-J.getEpochTime()}set expires_in(u){void 0!==u&&(this.expires_at=Math.floor(u)+J.getEpochTime())}get expired(){const u=this.expires_in;if(void 0!==u)return u<=0}get scopes(){var u,l;return null!=(l=null==(u=this.scope)?void 0:u.split(" "))?l:[]}toStorageString(){return new L("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(u){return L.createStatic("User","fromStorageString"),new e(JSON.parse(u))}},je="oidc-client",Pe=class{constructor(){this._abort=new H("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(u){const l=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");l.debug("setting URL in window"),this._window.location.replace(u.url);const{url:m,keepOpen:f}=await new Promise((m,f)=>{const r=h=>{var y;const v=h.data,w=null!=(y=u.scriptOrigin)?y:window.location.origin;if(h.origin===w&&(null==v?void 0:v.source)===je){try{const m=W.readParams(v.url,u.response_mode).get("state");if(m||l.warn("no state found in response url"),h.source!==this._window&&m!==u.state)return}catch{this._dispose(),f(new Error("Invalid response from window"))}m(v)}};window.addEventListener("message",r,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",r,!1));const h=new BroadcastChannel(`oidc-client-popup-${u.state}`);h.addEventListener("message",r,!1),this._disposeHandlers.add(()=>h.close()),this._disposeHandlers.add(this._abort.addHandler(u=>{this._dispose(),f(u)}))});return l.debug("got response from window"),this._dispose(),f||this.close(),{url:m}}_dispose(){this._logger.create("_dispose");for(const u of this._disposeHandlers)u();this._disposeHandlers.clear()}static _notifyParent(u,l,m=!1,f=window.location.origin){const h={source:je,url:l,keepOpen:m},y=new L("_notifyParent");if(u)y.debug("With parent. Using parent.postMessage."),u.postMessage(h,f);else{y.debug("No parent. Using BroadcastChannel.");const u=new URL(l).searchParams.get("state");if(!u)throw new Error("No parent and no state in URL. Can't complete notification.");const m=new BroadcastChannel(`oidc-client-popup-${u}`);m.postMessage(h),m.close()}}},$e={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},Te="_blank",xe=60,Ee=2,Ie=class extends ie{constructor(u){const{popup_redirect_uri:l=u.redirect_uri,popup_post_logout_redirect_uri:m=u.post_logout_redirect_uri,popupWindowFeatures:f=$e,popupWindowTarget:h=Te,redirectMethod:y="assign",redirectTarget:v="self",iframeNotifyParentOrigin:w=u.iframeNotifyParentOrigin,iframeScriptOrigin:b=u.iframeScriptOrigin,requestTimeoutInSeconds:S,silent_redirect_uri:j=u.redirect_uri,silentRequestTimeoutInSeconds:$,automaticSilentRenew:x=!0,validateSubOnSilentRenew:E=!0,includeIdTokenInSilentRenew:R=!1,monitorSession:Z=!1,monitorAnonymousSession:C=!1,checkSessionIntervalInSeconds:z=Ee,query_status_response_type:A="code",stopCheckSessionOnError:O=!0,revokeTokenTypes:D=["access_token","refresh_token"],revokeTokensOnSignout:N=!1,includeIdTokenInSilentSignout:M=!1,accessTokenExpiringNotificationTimeInSeconds:U=xe,userStore:L}=u;if(super(u),this.popup_redirect_uri=l,this.popup_post_logout_redirect_uri=m,this.popupWindowFeatures=f,this.popupWindowTarget=h,this.redirectMethod=y,this.redirectTarget=v,this.iframeNotifyParentOrigin=w,this.iframeScriptOrigin=b,this.silent_redirect_uri=j,this.silentRequestTimeoutInSeconds=$||S||10,this.automaticSilentRenew=x,this.validateSubOnSilentRenew=E,this.includeIdTokenInSilentRenew=R,this.monitorSession=Z,this.monitorAnonymousSession=C,this.checkSessionIntervalInSeconds=z,this.stopCheckSessionOnError=O,this.query_status_response_type=A,this.revokeTokenTypes=D,this.revokeTokensOnSignout=N,this.includeIdTokenInSilentSignout=M,this.accessTokenExpiringNotificationTimeInSeconds=U,L)this.userStore=L;else{const u="undefined"!=typeof window?window.sessionStorage:new te;this.userStore=new se({store:u})}}},Re=class e extends Pe{constructor({silentRequestTimeoutInSeconds:u=10}){super(),this._logger=new L("IFrameWindow"),this._timeoutInSeconds=u,this._frame=e.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const u=window.document.createElement("iframe");return u.style.visibility="hidden",u.style.position="fixed",u.style.left="-1000px",u.style.top="0",u.width="0",u.height="0",window.document.body.appendChild(u),u}async navigate(u){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const l=setTimeout(()=>{this._abort.raise(new Y("IFrame timed out without a response"))},1e3*this._timeoutInSeconds);return this._disposeHandlers.add(()=>clearTimeout(l)),await super.navigate(u)}close(){var u;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",u=>{var l;const m=u.target;null==(l=m.parentNode)||l.removeChild(m),this._abort.raise(new Error("IFrame removed from DOM"))},!0),null==(u=this._frame.contentWindow)||u.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(u,l){return super._notifyParent(window.parent,u,!1,l)}},Ze=class{constructor(u){this._settings=u,this._logger=new L("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:u=this._settings.silentRequestTimeoutInSeconds}){return new Re({silentRequestTimeoutInSeconds:u})}async callback(u){this._logger.create("callback"),Re.notifyParent(u,this._settings.iframeNotifyParentOrigin)}},Ce=class extends Pe{constructor({popupWindowTarget:u=Te,popupWindowFeatures:l={},popupSignal:m,popupAbortOnClose:f}){super(),this._logger=new L("PopupWindow");const h=B.center({...$e,...l});this._window=window.open(void 0,u,B.serialize(h)),this.abortOnClose=Boolean(f),m&&m.addEventListener("abort",()=>{var u;this._abort.raise(new Error(null!=(u=m.reason)?u:"Popup aborted"))}),l.closePopupWindowAfterInSeconds&&l.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{this._window&&"boolean"==typeof this._window.closed&&!this._window.closed?this.close():this._abort.raise(new Error("Popup blocked by user"))},1e3*l.closePopupWindowAfterInSeconds)}async navigate(u){var l;null==(l=this._window)||l.focus();const m=setInterval(()=>{this._window&&!this._window.closed||(this._logger.debug("Popup closed by user or isolated by redirect"),s(),this._disposeHandlers.delete(s),this.abortOnClose&&this._abort.raise(new Error("Popup closed by user")))},500),s=()=>clearInterval(m);return this._disposeHandlers.add(s),await super.navigate(u)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(u,l){super._notifyParent(window.opener,u,l),l||window.opener||window.close()}},ze=class{constructor(u){this._settings=u,this._logger=new L("PopupNavigator")}async prepare({popupWindowFeatures:u=this._settings.popupWindowFeatures,popupWindowTarget:l=this._settings.popupWindowTarget,popupSignal:m,popupAbortOnClose:f}){return new Ce({popupWindowFeatures:u,popupWindowTarget:l,popupSignal:m,popupAbortOnClose:f})}async callback(u,{keepOpen:l=!1}){this._logger.create("callback"),Ce.notifyOpener(u,l)}},Ae=class{constructor(u){this._settings=u,this._logger=new L("RedirectNavigator")}async prepare({redirectMethod:u=this._settings.redirectMethod,redirectTarget:l=this._settings.redirectTarget}){var m;this._logger.create("prepare");let f=window.self;"top"===l&&(f=null!=(m=window.top)?m:window.self);const h=f.location[u].bind(f.location);let y;return{navigate:async u=>{this._logger.create("navigate");const l=new Promise((l,m)=>{y=m,window.addEventListener("pageshow",()=>l(window.location.href)),h(u.url)});return await l},close:()=>{this._logger.create("close"),null==y||y(new Error("Redirect aborted")),f.stop()}}}async callback(){}},Oe=class extends X{constructor(u){super({expiringNotificationTimeInSeconds:u.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new L("UserManagerEvents"),this._userLoaded=new H("User loaded"),this._userUnloaded=new H("User unloaded"),this._silentRenewError=new H("Silent renew error"),this._userSignedIn=new H("User signed in"),this._userSignedOut=new H("User signed out"),this._userSessionChanged=new H("User session changed")}async load(u,l=!0){await super.load(u),l&&await this._userLoaded.raise(u)}async unload(){await super.unload(),await this._userUnloaded.raise()}addUserLoaded(u){return this._userLoaded.addHandler(u)}removeUserLoaded(u){return this._userLoaded.removeHandler(u)}addUserUnloaded(u){return this._userUnloaded.addHandler(u)}removeUserUnloaded(u){return this._userUnloaded.removeHandler(u)}addSilentRenewError(u){return this._silentRenewError.addHandler(u)}removeSilentRenewError(u){return this._silentRenewError.removeHandler(u)}async _raiseSilentRenewError(u){await this._silentRenewError.raise(u)}addUserSignedIn(u){return this._userSignedIn.addHandler(u)}removeUserSignedIn(u){this._userSignedIn.removeHandler(u)}async _raiseUserSignedIn(){await this._userSignedIn.raise()}addUserSignedOut(u){return this._userSignedOut.addHandler(u)}removeUserSignedOut(u){this._userSignedOut.removeHandler(u)}async _raiseUserSignedOut(){await this._userSignedOut.raise()}addUserSessionChanged(u){return this._userSessionChanged.addHandler(u)}removeUserSessionChanged(u){this._userSessionChanged.removeHandler(u)}async _raiseUserSessionChanged(){await this._userSessionChanged.raise()}},De=class{constructor(u){this._userManager=u,this._logger=new L("SilentRenewService"),this._isStarted=!1,this._retryTimer=new J("Retry Silent Renew"),this._tokenExpiring=async()=>{const u=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),u.debug("silent token renewal successful")}catch(l){if(l instanceof Y)return u.warn("ErrorTimeout from signinSilent:",l,"retry in 5s"),void this._retryTimer.init(5);u.error("Error from signinSilent:",l),await this._userManager.events._raiseSilentRenewError(l)}}}async start(){const u=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(l){u.error("getUser error",l)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},Ne=class{constructor(u){this.refresh_token=u.refresh_token,this.id_token=u.id_token,this.session_state=u.session_state,this.scope=u.scope,this.profile=u.profile,this.data=u.state}},Me=class{constructor(u,l,m,f){this._logger=new L("UserManager"),this.settings=new Ie(u),this._client=new be(u),this._redirectNavigator=null!=l?l:new Ae(this.settings),this._popupNavigator=null!=m?m:new ze(this.settings),this._iframeNavigator=null!=f?f:new Ze(this.settings),this._events=new Oe(this.settings),this._silentRenewService=new De(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new ke(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(u=!1){const l=this._logger.create("getUser"),m=await this._loadUser();return m?(l.info("user loaded"),await this._events.load(m,u),m):(l.info("user not found in storage"),null)}async removeUser(){const u=this._logger.create("removeUser");await this.storeUser(null),u.info("user removed from storage"),await this._events.unload()}async signinRedirect(u={}){var l;this._logger.create("signinRedirect");const{redirectMethod:m,...f}=u;let h;(null==(l=this.settings.dpop)?void 0:l.bind_authorization_code)&&(h=await this.generateDPoPJkt(this.settings.dpop));const y=await this._redirectNavigator.prepare({redirectMethod:m});await this._signinStart({request_type:"si:r",dpopJkt:h,...f},y)}async signinRedirectCallback(u=window.location.href){const l=this._logger.create("signinRedirectCallback"),m=await this._signinEnd(u);return m.profile&&m.profile.sub?l.info("success, signed in subject",m.profile.sub):l.info("no subject"),m}async signinResourceOwnerCredentials({username:u,password:l,skipUserInfo:m=!1}){const f=this._logger.create("signinResourceOwnerCredential"),h=await this._client.processResourceOwnerPasswordCredentials({username:u,password:l,skipUserInfo:m,extraTokenParams:this.settings.extraTokenParams});f.debug("got signin response");const y=await this._buildUser(h);return y.profile&&y.profile.sub?f.info("success, signed in subject",y.profile.sub):f.info("no subject"),y}async signinPopup(u={}){var l;const m=this._logger.create("signinPopup");let f;(null==(l=this.settings.dpop)?void 0:l.bind_authorization_code)&&(f=await this.generateDPoPJkt(this.settings.dpop));const{popupWindowFeatures:h,popupWindowTarget:y,popupSignal:v,popupAbortOnClose:w,...b}=u,S=this.settings.popup_redirect_uri;S||m.throw(new Error("No popup_redirect_uri configured"));const j=await this._popupNavigator.prepare({popupWindowFeatures:h,popupWindowTarget:y,popupSignal:v,popupAbortOnClose:w}),$=await this._signin({request_type:"si:p",redirect_uri:S,display:"popup",dpopJkt:f,...b},j);return $&&($.profile&&$.profile.sub?m.info("success, signed in subject",$.profile.sub):m.info("no subject")),$}async signinPopupCallback(u=window.location.href,l=!1){const m=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(u,{keepOpen:l}),m.info("success")}async signinSilent(u={}){var l,m;const f=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:h,...y}=u;let v,w=await this._loadUser();if(!u.forceIframeAuth&&(null==w?void 0:w.refresh_token)){f.debug("using refresh token");const u=new Ne(w);return await this._useRefreshToken({state:u,redirect_uri:y.redirect_uri,resource:y.resource,extraTokenParams:y.extraTokenParams,timeoutInSeconds:h})}(null==(l=this.settings.dpop)?void 0:l.bind_authorization_code)&&(v=await this.generateDPoPJkt(this.settings.dpop));const b=this.settings.silent_redirect_uri;let S;b||f.throw(new Error("No silent_redirect_uri configured")),w&&this.settings.validateSubOnSilentRenew&&(f.debug("subject prior to silent renew:",w.profile.sub),S=w.profile.sub);const j=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:h});return w=await this._signin({request_type:"si:s",redirect_uri:b,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==w?void 0:w.id_token:void 0,dpopJkt:v,...y},j,S),w&&((null==(m=w.profile)?void 0:m.sub)?f.info("success, signed in subject",w.profile.sub):f.info("no subject")),w}async _useRefreshToken(u){const l=await this._client.useRefreshToken({timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds,...u}),m=new Se({...u.state,...l});return await this.storeUser(m),await this._events.load(m),m}async signinSilentCallback(u=window.location.href){const l=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(u),l.info("success")}async signinCallback(u=window.location.href){const{state:l}=await this._client.readSigninResponseState(u);switch(l.request_type){case"si:r":return await this.signinRedirectCallback(u);case"si:p":await this.signinPopupCallback(u);break;case"si:s":await this.signinSilentCallback(u);break;default:throw new Error("invalid response_type in state")}}async signoutCallback(u=window.location.href,l=!1){const{state:m}=await this._client.readSignoutResponseState(u);if(m)switch(m.request_type){case"so:r":return await this.signoutRedirectCallback(u);case"so:p":await this.signoutPopupCallback(u,l);break;case"so:s":await this.signoutSilentCallback(u);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(u={}){const l=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:m,...f}=u,h=this.settings.silent_redirect_uri;h||l.throw(new Error("No silent_redirect_uri configured"));const y=await this._loadUser(),v=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:m}),w=await this._signinStart({request_type:"si:s",redirect_uri:h,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==y?void 0:y.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...f},v);try{const u={},m=await this._client.processSigninResponse(w.url,u);return l.debug("got signin response"),m.session_state&&m.profile.sub?(l.info("success for subject",m.profile.sub),{session_state:m.session_state,sub:m.profile.sub}):(l.info("success, user not authenticated"),null)}catch(u){if(this.settings.monitorAnonymousSession&&u instanceof Q)switch(u.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return l.info("success for anonymous user"),{session_state:u.session_state}}throw u}}async _signin(u,l,m){const f=await this._signinStart(u,l);return await this._signinEnd(f.url,m)}async _signinStart(u,l){const m=this._logger.create("_signinStart");try{const f=await this._client.createSigninRequest(u);return m.debug("got signin request"),await l.navigate({url:f.url,state:f.state.id,response_mode:f.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(u){throw m.debug("error after preparing navigator, closing navigator window"),l.close(),u}}async _signinEnd(u,l){const m=this._logger.create("_signinEnd"),f=await this._client.processSigninResponse(u,{});return m.debug("got signin response"),await this._buildUser(f,l)}async _buildUser(u,l){const m=this._logger.create("_buildUser"),f=new Se(u);if(l){if(l!==f.profile.sub)throw m.debug("current user does not match user returned from signin. sub from signin:",f.profile.sub),new Q({...u,error:"login_required"});m.debug("current user matches user returned from signin")}return await this.storeUser(f),m.debug("user stored"),await this._events.load(f),f}async signoutRedirect(u={}){const l=this._logger.create("signoutRedirect"),{redirectMethod:m,...f}=u,h=await this._redirectNavigator.prepare({redirectMethod:m});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...f},h),l.info("success")}async signoutRedirectCallback(u=window.location.href){const l=this._logger.create("signoutRedirectCallback"),m=await this._signoutEnd(u);return l.info("success"),m}async signoutPopup(u={}){const l=this._logger.create("signoutPopup"),{popupWindowFeatures:m,popupWindowTarget:f,popupSignal:h,...y}=u,v=this.settings.popup_post_logout_redirect_uri,w=await this._popupNavigator.prepare({popupWindowFeatures:m,popupWindowTarget:f,popupSignal:h});await this._signout({request_type:"so:p",post_logout_redirect_uri:v,state:null==v?void 0:{},...y},w),l.info("success")}async signoutPopupCallback(u=window.location.href,l=!1){const m=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(u,{keepOpen:l}),m.info("success")}async _signout(u,l){const m=await this._signoutStart(u,l);return await this._signoutEnd(m.url)}async _signoutStart(u={},l){var m;const f=this._logger.create("_signoutStart");try{const h=await this._loadUser();f.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(h);const y=u.id_token_hint||h&&h.id_token;y&&(f.debug("setting id_token_hint in signout request"),u.id_token_hint=y),await this.removeUser(),f.debug("user removed, creating signout request");const v=await this._client.createSignoutRequest(u);return f.debug("got signout request"),await l.navigate({url:v.url,state:null==(m=v.state)?void 0:m.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(u){throw f.debug("error after preparing navigator, closing navigator window"),l.close(),u}}async _signoutEnd(u){const l=this._logger.create("_signoutEnd"),m=await this._client.processSignoutResponse(u);return l.debug("got signout response"),m}async signoutSilent(u={}){var l;const m=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:f,...h}=u,y=this.settings.includeIdTokenInSilentSignout?null==(l=await this._loadUser())?void 0:l.id_token:void 0,v=this.settings.popup_post_logout_redirect_uri,w=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:f});await this._signout({request_type:"so:s",post_logout_redirect_uri:v,id_token_hint:y,...h},w),m.info("success")}async signoutSilentCallback(u=window.location.href){const l=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(u),l.info("success")}async revokeTokens(u){const l=await this._loadUser();await this._revokeInternal(l,u)}async _revokeInternal(u,l=this.settings.revokeTokenTypes){const m=this._logger.create("_revokeInternal");if(!u)return;const f=l.filter(l=>"string"==typeof u[l]);if(f.length){for(const l of f)await this._client.revokeToken(u[l],l),m.info(`${l} revoked successfully`),"access_token"!==l&&(u[l]=null);await this.storeUser(u),m.debug("user stored"),await this._events.load(u)}else m.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const u=this._logger.create("_loadUser"),l=await this.settings.userStore.get(this._userStoreKey);return l?(u.debug("user storageString loaded"),Se.fromStorageString(l)):(u.debug("no user storageString"),null)}async storeUser(u){const l=this._logger.create("storeUser");if(u){l.debug("storing user");const m=u.toStorageString();await this.settings.userStore.set(this._userStoreKey,m)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey),this.settings.dpop&&await this.settings.dpop.store.remove(this.settings.client_id)}async clearStaleState(){await this._client.clearStaleState()}async dpopProof(u,l,m,f){var h,y;const v=await(null==(y=null==(h=this.settings.dpop)?void 0:h.store)?void 0:y.get(this.settings.client_id));if(v)return await K.generateDPoPProof({url:u,accessToken:null==l?void 0:l.access_token,httpMethod:m,keyPair:v.keys,nonce:f})}async generateDPoPJkt(u){let l=await u.store.get(this.settings.client_id);if(!l){const m=await K.generateDPoPKeys();l=new we(m),await u.store.set(this.settings.client_id,l)}return await K.generateDPoPJkt(l.keys)}};const Ue="OAUTH2_LOGIN_FLOW_COMPLETE_EVENT",Le="OAUTH_GET_TOP_URL",qe="OAUTH_REDIRECT_TOP_WINDOW",He="OAUTH_UPDATE_URL",Be="OAUTH2_CHECK_PENDING",We="oauth2_top_origin",Ge="oauth2_login_success",Qe="oauth2_state",Xe=60,tt=Math.max(Xe-15,20),ot=d("oidc-auth",{color:"green"}),Fe=u=>ot.extend(u);d("oidc-auth-utils");const Ke=()=>"undefined"==typeof window?"":new URLSearchParams(window.location.search).get("origin")||"";class Je{static instance=null;settings=null;constructor(){}static getInstance(){return Je.instance||(Je.instance=new Je),Je.instance}configure(u){this.settings=u}isConfigured(){return null!==this.settings}getSettings(){if(!this.settings)throw new Error("OidcAuthConfig not configured. Call configure() or pass settings to OidcAuthClient.initialize().");return this.settings}getAuthOrigin(){const{authOrigin:u,authEndpoint:l}=this.getSettings();return u||new URL(l).origin}isAccessTokenProactiveRefreshEnabled(){return this.settings?.accessTokenProactiveRefreshEnabled??!0}getOidcSettings(){const u="undefined"==typeof window?"":window.location.origin,{clientId:l,authEndpoint:m}=this.getSettings(),f=this.getAuthOrigin(),h="undefined"!=typeof window?new se({store:window.localStorage}):void 0,{accessTokenExpiringNotificationTimeInSeconds:y=Xe}=this.getSettings();return{client_id:l,authority:f,redirect_uri:`${u}/login/oauth-callback`,post_logout_redirect_uri:u,response_type:"code",scope:"openid offline_access",automaticSilentRenew:!1,accessTokenExpiringNotificationTimeInSeconds:y,stateStore:h,userStore:h,metadata:{issuer:f,authorization_endpoint:m,token_endpoint:`${f}/connect/api/v1/oauth2/token`,end_session_endpoint:`${f}/logout/`}}}getAccessTokenExpiringNotificationTimeInSeconds(){return this.getSettings().accessTokenExpiringNotificationTimeInSeconds??Xe}getAccessTokenFreshnessThresholdInSeconds(){return this.getSettings().accessTokenFreshnessThresholdInSeconds??tt}getAllowedParentOrigins(){return this.settings?.allowedParentOrigins}}const it=Je.getInstance(),at=Fe("oidc-auth:host-api"),Ve=async u=>new Promise((l,m)=>{const f=new MessageChannel;let h=!1;const n=()=>{h=!0,f.port1.close()},y=setTimeout(()=>{h||(n(),m(new Error(`Host message timeout: ${u.type}`)))},1e4);f.port1.onmessage=u=>{clearTimeout(y),n(),"success"!==u.data.status?m(u.data.payload):l(u.data.payload)};const v=new URLSearchParams(window.location.search).get("origin")||"";if(!function(u){if(!u.startsWith("http://")&&!u.startsWith("https://"))return!1;const l=it.getAllowedParentOrigins();return!l||0===l.length||l.includes(u)}(v))return clearTimeout(y),n(),void m(new Error("Origin not allowed"));at.log("posting message to host",u),window.top.postMessage({type:u.type,payload:u.payload,...u.data||{}},v,[f.port2])}),pt=Fe("oidc-auth:OidcAuthTimer");class Ye{timerHandle=null;expiration=null;initialized=!1;callback=()=>{};constructor(){this.timerHandle=null}init(u,l,m){const f=u-this.getEpochTime(),h=Math.max(f-l,10);this.cancel(),this.expiration=h,this.callback=m,pt.debug("OIDC: timer - using expiration",h,f,l,u,f-l),this.timerHandle=setTimeout(this.callback,1e3*h),this.initialized=!0}cancel(){this.timerHandle&&(clearTimeout(this.timerHandle),this.timerHandle=null),this.expiration=null}getEpochTime(){return Math.floor(Date.now()/1e3)}isInitialized(){return this.initialized}}const yt=Fe("oidc-auth:OidcAuthClient");class et{static instance=null;userManager=null;initialized=!1;accessTokenExpiringTimer=null;retryTimers=new Set;constructor(){}static getInstance(){return et.instance||(et.instance=new et),et.instance}isInitialized(){return this.initialized}ensureInitialized(){if(!this.userManager)throw new Error("OidcAuthClient not initialized. Call initialize() first.");return this.userManager}initialize(u){if(u&&(this.initialized=!1,it.configure(u)),this.initialized)yt.info("OIDC: initialize() - already initialized, skipping");else if("undefined"!=typeof window)if(it.isConfigured())try{yt.info("OIDC: initialize() - starting initialization");const u=it.getOidcSettings();this.userManager=new Me(u),U.setLogger(yt),U.setLevel(U.ERROR),this.initAccessTokenExpiringTimer(),this.initialized=!0}catch(u){throw yt.error("OIDC: initialize() - FAILED:",u),u}else yt.warn("OIDC: initialize() - skipped, config not set");else yt.warn("OidcAuthClient cannot initialize on server side")}async initAccessTokenExpiringTimer(){it.isAccessTokenProactiveRefreshEnabled()?this.getUser().then(u=>{const l=u?.expires_at;l&&(this.accessTokenExpiringTimer||(this.accessTokenExpiringTimer=new Ye),this.accessTokenExpiringTimer.init(l,it.getAccessTokenExpiringNotificationTimeInSeconds(),async()=>{yt.info("OIDC: timer proactive refresh access token expiring timer fired",l),this.proactiveRefreshWithRetry()}))}).catch(u=>{yt.error("OIDC: initAccessTokenExpiringTimer - FAILED:",u)}):yt.warn("OIDC: timer - not starting, access token proactive refresh is disabled")}async getUser(){if(!this.userManager)return null;try{return await this.userManager.getUser()}catch(u){return yt.error("OIDC: getUser - FAILED:",u),null}}async storeUser(u){const l=this.ensureInitialized();await l.storeUser(u)}async getAccessToken(){const u=await this.getUser();if(!u)return yt.info("OIDC: getAccessToken - no user found"),null;if(u.expired)try{const u=await this.signinSilent();return u?.access_token||null}catch(u){return yt.error("OIDC: getAccessToken - silent renew failed:",u),null}return this.isTokenFresh(u)||this.signinSilent().catch(u=>{yt.error("OIDC: getAccessToken - background refresh failed:",u)}),u.access_token}getUserData(){if("undefined"==typeof window)return null;try{const u=it.getOidcSettings(),l=`oidc.user:${u.authority}:${u.client_id}`,m=localStorage.getItem(l);if(!m)return null;const f=JSON.parse(m),h=f?.profile;return h?.sub?(yt.info("OIDC: USER:",{profile:h}),{id:h.sub,email:h.email||"",first_name:h.given_name,last_name:h.family_name}):null}catch(u){return yt.error("OIDC: getUserData - FAILED:",u),null}}async isAuthenticated(){const u=await this.getUser();return null!==u&&!u.expired}async signinRedirect(u){const l=this.ensureInitialized();await l.signinRedirect({state:u?{data:u}:void 0,prompt:"login"})}async signinCallback(){const u=this.ensureInitialized(),l=await u.signinCallback();if(!l)throw yt.error("OIDC: signinCallback - FAILED: no user returned"),new Error("Signin callback failed: no user returned");return l}async signinSilent(u){return this.ensureInitialized(),"undefined"!=typeof navigator&&navigator.locks?navigator.locks.request("oidc-token-refresh",async()=>{const l=await this.getUser();return l&&this.isTokenFresh(l,u)?l:this.doSigninSilent()}):(yt.warn("OIDC: signinSilent - navigator.locks not available, proceeding without lock"),this.doSigninSilent())}isTokenFresh(u,l){if(!u.expires_at)return!1;const m=l??it.getAccessTokenFreshnessThresholdInSeconds(),f=Math.floor(Date.now()/1e3);return u.expires_at-f>m}async doSigninSilent(){const u=this.ensureInitialized();try{return await u.signinSilent()}catch(u){throw yt.error("OIDC: doSigninSilent - FAILED:",u),u}}proactiveRefreshWithRetry(u=1){if("undefined"!=typeof document&&"hidden"===document.visibilityState){yt.info("OIDC: tab is hidden, deferring proactive refresh until visible");const t=()=>{"visible"===document.visibilityState&&(document.removeEventListener("visibilitychange",t),this.proactiveRefreshWithRetry(u))};return void document.addEventListener("visibilitychange",t)}this.signinSilent(it.getAccessTokenExpiringNotificationTimeInSeconds()).then(()=>{this.initAccessTokenExpiringTimer()}).catch(l=>{if(yt.error(`OIDC: proactive refresh failed (attempt ${u}/2):`,l),u<2){const l=setTimeout(()=>{this.retryTimers.delete(l),this.proactiveRefreshWithRetry(u+1)},3e3);this.retryTimers.add(l)}else yt.error("OIDC: proactive refresh exhausted all retries")})}async removeUser(){const u=this.ensureInitialized();this.accessTokenExpiringTimer?.cancel(),this.retryTimers.forEach(clearTimeout),this.retryTimers.clear(),await u.removeUser()}onUserLoaded(u){this.ensureInitialized().events.addUserLoaded(u)}offUserLoaded(u){this.ensureInitialized().events.removeUserLoaded(u)}onUserUnloaded(u){this.ensureInitialized().events.addUserUnloaded(u)}offUserUnloaded(u){this.ensureInitialized().events.removeUserUnloaded(u)}onSilentRenewError(u){this.ensureInitialized().events.addSilentRenewError(u)}offSilentRenewError(u){this.ensureInitialized().events.removeSilentRenewError(u)}onAccessTokenExpiring(u){this.ensureInitialized().events.addAccessTokenExpiring(u)}offAccessTokenExpiring(u){this.ensureInitialized().events.removeAccessTokenExpiring(u)}onAccessTokenExpired(u){this.ensureInitialized().events.addAccessTokenExpired(u)}offAccessTokenExpired(u){this.ensureInitialized().events.removeAccessTokenExpired(u)}getLogoutUrl(u,l){const m=new URL(function(u){return`${it.getAuthOrigin()}${u.logoutPath}`}(u));return l&&m.searchParams.set("redirect_to",l),m.toString()}getWindowOriginParam(){const u=new URL(window.location.href).searchParams.get("origin");if(!u)throw new Error("iframe origin param is required");return u}async getTopUrl(){return(await Ve({type:Le})).topUrl}async isOAuthFlowPending(){try{return(await Ve({type:Be})).isPending}catch(u){return yt.warn("OIDC: isOAuthFlowPending() - failed to check, assuming not pending:",u),!1}}async triggerLoginFlowViaParent({loginPath:u,windowPath:l}){yt.info("OIDC: triggerLoginFlowViaParent() - starting");const m=await this.getTopUrl(),f=new URL(m).origin,h=`${f}${l}`,y=new URL(`${window.location.origin}${u}`);y.searchParams.set(We,f),y.searchParams.set("oauth2_top_wp_url",h),yt.info("OIDC: triggerLoginFlowViaParent() - redirecting parent to:",y.toString()),await Ve({type:qe,payload:{url:y.toString()}})}async handleLoginFlowComplete(u,l){if(!l)throw new Error("oauthUserState is required");const m=this.getWindowOriginParam(),f=l.state,h=f?.data?.[We];if(m!==h)throw yt.error("OIDC: handleLoginFlowComplete - origin mismatch:",m,"!==",h),new Error("Invalid origin in OAuth state");try{const u=new Se(l);await this.storeUser(u),this.initAccessTokenExpiringTimer(),window.dispatchEvent(new CustomEvent("oidc-auth-completed"))}catch(l){yt.error("OIDC: handleLoginFlowComplete - FAILED to store user:",l),await this.triggerLoginFlowViaParent(u)}}async triggerLogoutViaParent(u,l=!0){const m=await this.getTopUrl(),f=new URL(m).origin,h=l?`${f}${u.windowPath}`:f;await this.removeUser();const y=this.getLogoutUrl(u,h);await Ve({type:qe,payload:{url:y}})}async cleanOAuthParamsFromUrl(){try{const u=await this.getTopUrl(),l=new URL(u);l.searchParams.delete("oauth_code"),l.searchParams.delete("oauth_state"),l.searchParams.delete("start-oauth"),l.searchParams.delete(Ge),l.searchParams.delete(Qe),await Ve({type:He,payload:{url:l.toString()}})}catch(u){yt.warn("Failed to clean OAuth params from URL:",u)}}setupLoginFlowMessageListener(u){let l=!1;const i=m=>{if(m.data?.type!==Ue)return;if(m.origin!==Ke())return void yt.error("OIDC: origin mismatch - expected:",Ke(),"received:",m.origin);if(l)return void yt.debug("OIDC: LOGIN_FLOW_COMPLETE already processed, ignoring duplicate");const f=m.data.payload;f?.oauthState?(l=!0,this.handleLoginFlowComplete(u,f.oauthState).catch(u=>{yt.error("OIDC: Failed to handle login flow complete:",u),l=!1})):yt.warn("OIDC: LOGIN_FLOW_COMPLETE but no oauthState in payload")};return window.addEventListener("message",i),()=>{window.removeEventListener("message",i)}}async getTokenExpirationInfo(){const u=await this.getUser();if(!u||!u.expires_at)return{expiresAt:null,expiresInSeconds:null,isExpired:!0};const l=new Date(1e3*u.expires_at),m=Date.now(),f=Math.floor((1e3*u.expires_at-m)/1e3);return{expiresAt:l,expiresInSeconds:f,isExpired:f<=0}}async forceTokenRefresh(){return yt.info("OIDC: forceTokenRefresh() - manually triggering token refresh"),this.signinSilent()}}const vt=et.getInstance();"undefined"!=typeof window&&(window.oidcAuthClient=vt);const bt=Fe("oidc-auth:oidc-auth-redirect");function st(u,l){u.postMessage({status:"success",payload:l})}function rt(u,l){u.postMessage({status:"error",payload:l})}function nt({targets:u,onSuccess:l,attempt:m=1}){const f=new URLSearchParams(window.location.search);if(!f.get(Ge))return void bt.warn("OIDC: No login_success param found, skipping");const h=f.get(Qe);if(h){if(!u.window?.contentWindow||!u.windowURL)return bt.warn("Cannot forward OIDC state: iframe not available"),void(m<5?setTimeout(()=>{nt({targets:u,onSuccess:l,attempt:m+1})},500):bt.error("OIDC: Failed to forward login flow after",5,"attempts - iframe never became available"));try{const m=JSON.parse(h),f=m.state?.data?.[We];if(f&&f!==window.location.origin)return void bt.error("Origin mismatch in OIDC state:",f,"vs",window.location.origin);!function(u,l){const m=l.window?.contentWindow,f=l.windowURL?.origin;m&&f?m.postMessage({type:Ue,payload:u},f):bt.warn("Cannot send OIDC state: window or origin not available")}({oauthState:m},u);const y=new URL(window.location.href);y.searchParams.delete(Ge),y.searchParams.delete(Qe),history.replaceState({},"",y.toString()),l?.()}catch(u){bt.error("Failed to parse or forward OIDC state:",u)}}else bt.warn("OIDC login complete but no state found in URL")}const kt="angie_return_url",St=g("referrer-redirect");function ct(u){try{return new URL(u,window.location.origin).origin===window.location.origin}catch{return!1}}function dt(u,l){if(!ct(u))return St.warn("Invalid redirect URL rejected:",u),!1;try{const m={url:u};return l&&(m.prompt=l),localStorage.setItem(kt,JSON.stringify(m)),!0}catch(u){return St.warn("localStorage not available"),!1}}function lt(){try{const u=localStorage.getItem(kt);if(!u)return null;let l;try{l=JSON.parse(u)}catch{return St.warn("Stored redirect data is not valid JSON, returning null"),null}return l.url&&"string"==typeof l.url?ct(l.url)?l:(St.warn("Stored redirect URL is invalid, returning null:",l.url),null):(St.warn("Stored redirect data missing url field, returning null"),null)}catch(u){return St.warn("localStorage not available"),null}}function gt(){try{localStorage.removeItem(kt)}catch(u){St.warn("localStorage not available")}}function ht(u,l){return l?`${u}#angie-prompt=${encodeURIComponent(l)}`:u}function ut(){const u=lt();return!!u&&(gt(),window.location.href=ht(u.url,u.prompt),!0)}const $t=g("oauth");function _t(){const u=lt();if(u)return gt(),void(window.location.href=ht(u.url,u.prompt));try{localStorage.setItem("angie_sidebar_state","open")}catch(u){$t.warn("localStorage not available")}setTimeout(()=>{window.toggleAngieSidebar(!0)},500)}const wt=(u,l)=>{const m=document.getElementById(A.containerId);m&&m.setAttribute("aria-hidden",l?"false":"true"),l?u.removeAttribute("tabindex"):u.setAttribute("tabindex","-1")},mt=(u,l)=>{u.postMessage({status:"success",payload:l})},ft=()=>new Promise(u=>{"loading"===document.readyState?document.addEventListener("DOMContentLoaded",u):u(null)}),Et=g("sdk");var Zt;(Zt||(Zt={})).POST_MESSAGE="postMessage";const Mt=g("sidebar");let Lt=!1;const qt="open",Ft="closed";function It(){if("undefined"==typeof window)return 370;try{const u=window.localStorage.getItem("angie_sidebar_width");if(u){const l=parseInt(u,10);if(l>=350&&l<=590)return l}}catch(u){Mt.warn("localStorage not available")}return 370}function Tt(){return"undefined"==typeof window?null:localStorage.getItem("angie_sidebar_state")}function Rt(u){try{localStorage.setItem("angie_sidebar_state",u)}catch(u){Mt.warn("localStorage not available")}}function At(u){try{localStorage.setItem("angie_sidebar_width",u.toString())}catch(u){Mt.warn("localStorage not available")}}function Pt(u){document.documentElement.style.setProperty("--angie-sidebar-width",`${u}px`)}function Ct(){!function(){if("undefined"==typeof window)return!1;const u=new URLSearchParams(window.location.search);return u.has(Ge)||u.has(Qe)||u.has(We)}()?xt(Tt()||qt):function(){xt(Ft);try{localStorage.setItem("angie_sidebar_state",Ft)}catch(u){Mt.warn("localStorage not available")}}()}function xt(u){"undefined"!=typeof window&&window.toggleAngieSidebar&&window.toggleAngieSidebar(u===qt,!0)}function Ot(){const u=document.getElementById(A.containerId);if(!u)return;let l=!1,m=0,f=0;u.addEventListener("mousedown",h=>{const y=u.getBoundingClientRect();("rtl"===document.documentElement.dir?h.clientX<=y.left+4:h.clientX>=y.right-4)&&(l=!0,m=h.clientX,f=y.width,u.classList.add("angie-resizing"),document.body.style.cursor="ew-resize",document.body.style.userSelect="none",h.preventDefault(),h.stopPropagation())}),document.addEventListener("mousemove",u=>{if(!l)return;let h;h="rtl"===document.documentElement.dir?m-u.clientX:u.clientX-m,Pt(Math.max(350,Math.min(590,f+h))),u.preventDefault(),u.stopPropagation()}),document.addEventListener("mouseup",m=>{if(l){l=!1,u.classList.remove("angie-resizing"),document.body.style.cursor="",document.body.style.userSelect="";const h=parseInt(getComputedStyle(document.documentElement).getPropertyValue("--angie-sidebar-width"),10);At(h),_({type:E.ANGIE_SIDEBAR_RESIZED,payload:{initialWidth:f,width:h}}),m.preventDefault(),m.stopPropagation()}}),Pt(It())}function Ut(u){var l;u?.skipDefaultCss||function(){if("undefined"==typeof document||Lt)return;const u="angie-sidebar-styles";if(document.getElementById(u))return void(Lt=!0);const l=document.createElement("style");l.id=u,l.textContent="/* Angie Sidebar - CSS Variables */\n:root {\n --angie-sidebar-z-index: 1200; /* below MUI popups, elementor popups and media library modal */\n --angie-sidebar-width: 330px;\n --angie-sidebar-transition: margin 0.3s ease-in-out, transform 0.3s ease-in-out;\n /* Direction-aware transform values for sidebar positioning */\n --angie-sidebar-hide-transform: translateX(-100%); /* LTR: hide to the left */\n --angie-sidebar-show-transform: translateX(0);\n}\n\n/* RTL-specific transform values */\n[dir=\"rtl\"] {\n --angie-sidebar-hide-transform: translateX(100%); /* RTL: hide to the right */\n}\n\n/* Respect user's motion preferences */\n@media (prefers-reduced-motion: reduce) {\n :root {\n --angie-sidebar-transition: none;\n }\n}\n\n/* Apply transitions only when user is actively toggling */\nbody.angie-sidebar-transitioning {\n transition: var(--angie-sidebar-transition) !important;\n}\n\nbody.angie-sidebar-transitioning #angie-sidebar-container {\n transition: var(--angie-sidebar-transition) !important;\n}\n\n/* Layout (default) - Push content */\n@media (min-width: 768px) {\n body.angie-sidebar-active {\n padding-inline-start: var(--angie-sidebar-width) !important;\n }\n\n #angie-sidebar-container {\n position: fixed;\n top: 0;\n inset-inline-start: 0;\n width: var(--angie-sidebar-width);\n height: 100vh;\n z-index: var(--angie-sidebar-z-index) !important; /* below elementor popups and media library modal */\n background: #FCFCFC;\n transform: var(--angie-sidebar-hide-transform);\n outline: none;\n overflow: hidden;\n /* No default transition - only when transitioning */\n }\n\n /* Resize handle */\n #angie-sidebar-container::after {\n content: '';\n position: absolute;\n top: 0;\n inset-inline-end: 0;\n width: 4px;\n height: 100%;\n cursor: ew-resize;\n background: transparent;\n z-index: 1000001;\n }\n\n /* Pink border during resize */\n #angie-sidebar-container.angie-resizing {\n border-inline-end-color: #ff69b4 !important;\n border-inline-end-width: 2px !important;\n }\n\n /* Disable iframe pointer events during resize */\n #angie-sidebar-container.angie-resizing iframe#angie-iframe {\n pointer-events: none !important;\n }\n}\n\n/* Active states */\nbody.angie-sidebar-active #angie-sidebar-container {\n transform: var(--angie-sidebar-show-transform);\n}\n\n/* Studio mode - sidebar takes full width */\n@media (min-width: 768px) {\n html.angie-studio-active body.angie-sidebar-active #angie-sidebar-container {\n width: 100%;\n }\n}\n\n/* High contrast mode support */\n@media (prefers-contrast: high) {\n #angie-sidebar-container {\n border-color: #000;\n box-shadow: none;\n }\n}\n\n/* Screen reader only class */\n.angie-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n/* Plugin conflict resolution */\nbody.angie-sidebar-active {\n /* Reset common conflicting styles */\n box-sizing: border-box !important;\n position: relative !important;\n}\n\n#angie-sidebar-toggle {\n z-index: 99999 !important;\n}\n";const m=document.head||document.getElementsByTagName("head")[0];m.insertBefore(l,m.firstChild),Lt=!0}(),"undefined"!=typeof window&&(window.toggleAngieSidebar=(l=u?.onToggle,function(u,m){const f=document.body,h=document.getElementById(A.containerId);if(!h)return void Mt.warn("Required elements not found!");const y=f.classList.contains("angie-sidebar-active"),v=void 0!==u?u:!y;m||(f.classList.add("angie-sidebar-transitioning"),setTimeout(function(){f.classList.remove("angie-sidebar-transitioning")},300)),v?f.classList.add("angie-sidebar-active"):f.classList.remove("angie-sidebar-active"),v&&setTimeout(function(){_({type:"focusInput"})},m?0:300),l&&l(v,h,m),Rt(v?qt:Ft);const w=new CustomEvent("angieSidebarToggle",{detail:{isOpen:v,sidebar:h,skipTransition:m}});document.dispatchEvent(w),_({type:E.ANGIE_SIDEBAR_TOGGLED,payload:{state:v?"opened":"closed"}})}),window.addEventListener("message",function(u){if(u.data&&"toggleAngieSidebar"===u.data.type){const{force:l,skipTransition:m}=u.data.payload||{};window.toggleAngieSidebar&&window.toggleAngieSidebar(l,m)}}))}const Vt=g("iframe"),Dt=u=>{if(u.includes("://")||u.startsWith("//"))return!1;try{const l="https://test.com";return new URL(u,l).origin===l}catch{return!1}},Nt=async()=>{if(A.iframe?.contentWindow&&A.iframeUrlObject)try{Vt.log("Disabling navigation prevention in Angie iframe"),A.iframe.contentWindow.postMessage({type:E.ANGIE_DISABLE_NAVIGATION_PREVENTION},A.iframeUrlObject.origin),await new Promise(u=>setTimeout(u,100))}catch(u){throw Vt.error("Failed to disable navigation prevention:",u),u}else Vt.warn("Cannot disable navigation prevention: iframe or origin not available")},Kt=g("registration-queue");class Ht{queue=[];isProcessing=!1;add(u){const l={id:this.generateId(u),config:u,timestamp:Date.now(),status:"pending"};return this.queue.push(l),Kt.log(`Added server "${u.name}" to queue`),l}getAll(){return[...this.queue]}getPending(){return this.queue.filter(u=>"pending"===u.status)}updateStatus(u,l,m){const f=this.queue.find(l=>l.id===u);f&&(f.status=l,m?f.error=m:"pending"!==l&&"registered"!==l||delete f.error,Kt.log(`Updated server ${u} status to ${l}`))}async processQueue(u){if(this.isProcessing)return void Kt.log("Already processing queue");this.isProcessing=!0;const l=this.getPending();Kt.log(`Processing ${l.length} pending registrations`);try{for(const m of l)try{await u(m),this.updateStatus(m.id,"registered")}catch(u){const l=u instanceof Error?u.message:String(u);this.updateStatus(m.id,"failed",l),Kt.error(`Failed to process registration ${m.id}:`,l)}}finally{this.isProcessing=!1}}clear(){this.queue=[],Kt.log("Cleared all registrations")}resetAllToPending(){if(this.isProcessing)return Kt.log("Cannot reset to pending - processing in progress"),!1;const u=this.queue.filter(u=>"registered"===u.status).length,l=this.queue.filter(u=>"failed"===u.status).length;return this.queue.forEach(u=>{"pending"!==u.status&&(u.status="pending",delete u.error)}),Kt.log(`Reset ${u+l} registrations to pending`),!0}remove(u){const l=this.queue.findIndex(l=>l.id===u);return-1!==l&&(this.queue.splice(l,1),Kt.log(`Removed registration ${u}`),!0)}generateId(u){return`reg_${u.name}_${u.version}_${Date.now()}`}}const Bt={origin:"https://angie.elementor.com",uiTheme:"light",isRTL:!1,containerId:z,skipDefaultCss:!1,path:"angie/wp-admin"};class jt{angieDetector;clientManager;logger;registrationQueue;isInitialized=!1;instanceId;constructor(){this.instanceId=Math.random().toString(36).substring(2,8),this.logger=g({instanceId:this.instanceId}),this.logger.log("Constructor called - initializing SDK"),this.angieDetector=new k,this.registrationQueue=new Ht,this.clientManager=new T,this.logger.log("Setting up event handlers"),this.setupAngieReadyHandler(),this.setupServerInitHandler(),this.setupReRegistrationHandler(),this.logger.log("SDK initialization complete")}async loadSidebar(u){const{widgetConfig:l,...m}=u||{},f={...Bt,...m};A.containerId=f.containerId,Ut({skipDefaultCss:f.skipDefaultCss}),await(async u=>{if(window.screen.availWidth<=768)return void Vt.log("Mobile detected, skipping iframe injection");let l=document.getElementById(A.containerId);if(!l){const u=performance.now();if(Vt.log("⏱️ Waiting for sidebar container..."),await new Promise(u=>{let m=0;const f=setInterval(()=>{l=document.getElementById(A.containerId),m++,(l||m>20)&&(clearInterval(f),l&&u())},100);setTimeout(()=>{if(clearInterval(f),l)return void u();const m=new MutationObserver(()=>{l=document.getElementById(A.containerId),l&&(m.disconnect(),u())});m.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{m.disconnect(),u()},8e3)},2e3)}),Vt.log(`⏱️ Sidebar container detection took: ${(performance.now()-u).toFixed(2)}ms`),!l)return void Vt.error("Sidebar container not found")}const{iframe:m,iframeUrlObject:f}=await(async u=>{const l=u.origin,m=new URL(u.path,l),f=m.pathname.slice(1).replace(/\//,"--")+"-"+Math.random().toString(36).substring(7);return new Promise(h=>{const y=new URL(l);y.pathname=m.pathname;const v=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(y.searchParams.append("colorScheme",u.uiTheme||v||"light"),y.searchParams.append("sdkVersion",u.sdkVersion),y.searchParams.append("instanceId",f),y.searchParams.append("origin",window.location.origin),u.isRTL&&y.searchParams.append("isRTL",u.isRTL?"true":"false"),"localhost"===window.location.hostname&&window.location.search.includes("debug_error")){const u=new URLSearchParams(window.location.search).get("debug_error");u&&y.searchParams.append("debug_error",u)}m.searchParams.forEach((u,l)=>{y.searchParams.set(l,u)}),y.searchParams.set("ver",(new Date).getTime().toString());const w=u.parent||document,b=w.createElement("iframe"),S={"background-color":"transparent","color-scheme":"normal",...u.css};window.addEventListener("message",async u=>{if(u.origin===y.origin)switch(u.data.type){case Z.ANGIE_READY:h({iframe:b,iframeUrlObject:y});break;case Z.ANGIE_LOADED:b.contentWindow?.postMessage({type:Z.HOST_READY,instanceId:f},y.origin)}}),b.setAttribute("src",y.href),b.id="angie-iframe",b.setAttribute("frameborder","0"),b.setAttribute("scrolling","no"),b.setAttribute("style",Object.entries(S).map(([u,l])=>`${u}: ${l}`).join("; ")),b.setAttribute("allow","clipboard-write; clipboard-read"),u.insertCallback?u.insertCallback(b):w.body.appendChild(b)})})({origin:u.origin||"https://angie.elementor.com",path:u.path&&Dt(u.path)?u.path:"angie/wp-admin",insertCallback:u=>{Vt.log("Injecting Angie iframe into sidebar container"),u.setAttribute("title","Angie AI Assistant"),u.setAttribute("role","application"),u.setAttribute("aria-label","Angie AI Assistant Interface");const m=document.getElementById("angie-sidebar-loading");m&&(m.textContent=""),l?.appendChild(u),wt(u,!0),u.addEventListener("load",()=>{u.focus()})},css:{width:"100%",height:"100%",border:"none",outline:"none"},uiTheme:u.uiTheme,isRTL:u.isRTL,sdkVersion:"1.4.5"});A.iframe=m,A.iframeUrlObject=f,window.addEventListener("message",u=>{if(u.origin===A.iframeUrlObject?.origin)switch(u.data.type){case R.SET:window.localStorage.setItem(u.data.key,u.data.value);break;case R.GET:{const l=u.ports[0],m=window.localStorage.getItem(u.data.key);l.postMessage({value:m});break}}}),(u=>{window.addEventListener("message",async l=>{const m=l.origin===window.location.origin,f=l.origin===u.iframeUrlObject?.origin;if(m||f)switch(l?.data?.type){case E.SDK_ANGIE_ALL_SERVERS_REGISTERED:break;case E.SDK_ANGIE_READY_PING:{const u=l.ports[0];Et.log("Angie is ready",l),mt(u,{message:"Angie is ready"});break}case E.SDK_REQUEST_CLIENT_CREATION:{const m=l.data.payload;try{const f=l.ports[0],h=new MessageChannel;h.port1.onmessage=u=>{f.postMessage({success:!0,data:u.data})};const y={type:E.SDK_REQUEST_CLIENT_CREATION,payload:{success:!0,...m,clientId:`dynamic-client-${m.serverName}-${m.serverVersion}-${Date.now()}`,requestId:l.data.payload.requestId},timestamp:Date.now()};if(!u.iframe)throw new Error("Iframe not found");u.iframe.contentWindow?.postMessage(y,u.iframeUrlObject?.origin||"",[h.port2])}catch(u){Et.error(`Failed to create client for SDK server "${m.serverName}":`,u)}break}case E.SDK_TRIGGER_ANGIE:Et.log("SDK Trigger Angie received",l.data);try{const{requestId:m,prompt:f,context:h}=l.data.payload;if(!u.iframe)throw new Error("Iframe not found");u.iframe.contentWindow?.postMessage({type:E.SDK_TRIGGER_ANGIE,payload:{requestId:m,prompt:f,context:h}},u.iframeUrlObject?.origin||""),window.postMessage({type:E.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!0,requestId:m,response:"Angie triggered successfully"}},window.location.origin)}catch(u){Et.error("Failed to trigger Angie:",u),window.postMessage({type:E.SDK_TRIGGER_ANGIE_RESPONSE,payload:{success:!1,requestId:l.data.payload?.requestId,error:u instanceof Error?u.message:"Unknown error"}},window.location.origin)}}})})(A),function({trustedOrigin:u,onOAuthParamsCleared:l}){window.addEventListener("message",m=>{if(m.origin!==u)return;const f=m.ports?.[0];switch(m.data.type){case Le:if(!f)return;st(f,{topUrl:window.location.href});break;case qe:window.location.href=m.data.payload.url;break;case He:{if(!f)return;const u=m.data.payload.url;if(!history?.replaceState)return void rt(f,{message:"URL update not supported in this browser"});try{const m=window.location.href;history.replaceState({},"",u),function(u,l){const m=new URL(u).searchParams,f=new URL(l).searchParams,h=[Ge,Qe,We];return h.some(u=>m.has(u))&&!h.some(u=>f.has(u))}(m,u)&&l?.(),st(f,{message:"URL updated successfully"})}catch(u){rt(f,{message:"URL update failed: "+(u instanceof Error?u.message:"Unknown error")})}break}case Be:if(!f)return;st(f,{isPending:"true"===new URLSearchParams(window.location.search).get(Ge)})}})}({trustedOrigin:A.iframeUrlObject?.origin??"",onOAuthParamsCleared:_t}),(()=>{const u={window:A.iframe,windowURL:A.iframeUrlObject};window.addEventListener("load",()=>{$t.log("OIDC: Window load event fired, forwarding OIDC state if present"),nt({targets:u,onSuccess:_t})}),nt({targets:u,onSuccess:_t})})(),new URLSearchParams(window.location.search).has("start-oauth")&&($t.log("Post-consent flow detected, checking for referrer redirect"),ut()),window.addEventListener("message",async l=>{if([window.location.origin,u.origin||"https://angie.elementor.com"].includes(l.origin))if(l?.data?.type===E.ANGIE_CHAT_TOGGLE)A.open=l.data.open,A.iframe&&wt(A.iframe,A.open);else if(l?.data?.type===E.ANGIE_STUDIO_TOGGLE){const u=l.data.isStudioOpen;if(!A.iframe)return;if(u)document.documentElement.classList.add("angie-studio-active");else{const u=It();document.documentElement.style.setProperty("--angie-sidebar-width",`${u}px`),document.documentElement.classList.remove("angie-studio-active")}}else if(l?.data?.type===E.ANGIE_NAVIGATE_TO_URL){const{url:u="",confirmed:m=!1}=l.data.payload||{};if(!m)return void Vt.log("Navigation requires user confirmation");if(!((u,l=[])=>{const m=0===l.length&&"undefined"!=typeof window?[window.location.origin]:l;if(!u.startsWith("http"))return!1;try{const l=new URL(u);return m.includes(l.origin)}catch{return!1}})(u))return void Vt.error("Navigation blocked: Invalid or unsafe URL",{url:u});await Nt(),window.location.assign(u)}else if(l?.data?.type===E.ANGIE_PAGE_RELOAD){const{confirmed:u=!1}=l.data.payload||{};if(!u)return void Vt.log("Page reload requires user confirmation");Vt.log("Page reload confirmed - disabling navigation prevention and reloading"),await Nt(),setTimeout(()=>{window.location.reload()},50)}else l?.data?.type===Z.RESET_HASH&&(window.location.hash="",mt(l.ports[0],{message:"Hash reset successfully"}))})})(f),l&&_({type:"sdk-widget-config",payload:l}),this.setupPromptHashDetection()}setupReRegistrationHandler(){window.addEventListener("message",u=>{if(u.data?.type===E.SDK_ANGIE_REFRESH_PING)if(this.logger.log("Angie refresh ping received"),this.registrationQueue.resetAllToPending()){const u=this.registrationQueue.getPending().length;this.logger.log(`Successfully reset ${u} registrations, processing queue`),this.handleAngieReady()}else this.logger.log("Skipping queue reset - processing already in progress")})}setupAngieReadyHandler(){this.angieDetector.waitForReady().then(u=>{u.isReady?this.handleAngieReady():this.logger.warn("Angie not detected - servers will remain queued")}).catch(u=>{this.logger.error("Error waiting for Angie:",u)})}async handleAngieReady(){this.logger.log("Angie is ready, processing queued registrations");try{await this.registrationQueue.processQueue(async u=>{this.logger.log(`processQueue callback called for "${u.config.name}"`),await this.processRegistration(u)}),this.isInitialized=!0,this.logger.log("Initialization complete")}catch(u){this.logger.error("Error processing registration queue:",u)}}async processRegistration(u){this.logger.log(`Processing registration for server "${u.config.name}" (ID: ${u.id})`);try{this.logger.log(`Calling clientManager.requestClientCreation for "${u.config.name}"`);const l={...u,instanceId:this.instanceId};await this.clientManager.requestClientCreation(l),this.logger.log(`Successfully registered server "${u.config.name}"`)}catch(l){throw this.logger.error(`Failed to register server "${u.config.name}":`,l),l}}registerLocalServer(u){return u.type=x.LOCAL,u.transport=j.POST_MESSAGE,this.registerServer(u)}registerRemoteServer(u){return u.type=x.REMOTE,this.registerServer(u)}isLocalServerConfig(u){return u.type===x.LOCAL||!u.type&&"server"in u}isRemoteServerConfig(u){return u.type===x.REMOTE&&"url"in u}async registerServer(u){if(!u.type)return this.logger.warn("For a local server, please use registerLocalServer instead of registerServer"),void this.registerLocalServer(u);if(this.logger.log(`registerServer called for "${u.name}"`),!u.name)throw new Error("Server name is required");if(!u.description)throw new Error("Server description is required");if(this.isLocalServerConfig(u)&&!u.server)throw new Error("Server instance is required for local servers");this.logger.log(`Registering server "${u.name}"`);const l=this.registrationQueue.add(u);if(this.logger.log(`Added registration to queue: ${l.id}`),this.angieDetector.isReady())try{await this.processRegistration(l),this.registrationQueue.updateStatus(l.id,"registered"),this.logger.log(`Server "${u.name}" registered successfully`)}catch(u){const m=u instanceof Error?u.message:String(u);throw this.registrationQueue.updateStatus(l.id,"failed",m),u}else this.logger.log(`Server "${u.name}" queued until Angie is ready`)}getRegistrations(){return this.registrationQueue.getAll()}getPendingRegistrations(){return this.registrationQueue.getPending()}isAngieReady(){return this.angieDetector.isReady()}isReady(){return this.isInitialized}async waitForReady(){if(!(await this.angieDetector.waitForReady()).isReady)throw new Error("Angie is not available");for(;!this.isInitialized;)await new Promise(u=>setTimeout(u,100))}async triggerAngie(u){if(!this.isAngieReady())throw new Error("Angie is not ready. Please wait for Angie to be available before triggering.");const l=this.generateRequestId(),m=u.options?.timeout||3e4;return new Promise((f,h)=>{const y=setTimeout(()=>{h(new Error("Angie trigger request timed out"))},m),o=u=>{u.data?.type===E.SDK_TRIGGER_ANGIE_RESPONSE&&u.data?.payload?.requestId===l&&(clearTimeout(y),window.removeEventListener("message",o),f(u.data.payload))};window.addEventListener("message",o);const v={type:E.SDK_TRIGGER_ANGIE,payload:{requestId:l,prompt:u.prompt,options:u.options,context:{pageUrl:window.location.href,pageTitle:document.title,...u.context}},timestamp:Date.now()};this.logger.log(`Triggering Angie with prompt (Request ID: ${l})`),window.postMessage(v,window.location.origin)})}destroy(){this.registrationQueue.clear(),this.logger.log("SDK destroyed")}setupServerInitHandler(){window.addEventListener("message",u=>{u.data?.type===E.SDK_REQUEST_INIT_SERVER&&(this.logger.log("Server init request received"),this.handleServerInitRequest(u))})}handleServerInitRequest(u){const{clientId:l,serverId:m,instanceId:f}=u.data.payload||{};if(l&&m)if(this.logger.log(`Server init request received - Request instanceId: ${f}, This instanceId: ${this.instanceId}`),f&&f!==this.instanceId)this.logger.log(`Ignoring server init request for different instance. Request instanceId: ${f}, this instanceId: ${this.instanceId}`);else{this.logger.log(`Handling server init request for clientId: ${l}, serverId: ${m}`);try{const l=this.registrationQueue.getAll().find(u=>u.id===m);if(!l)return void this.logger.error(`No registration found for serverId: ${m}`);if("type"in l.config&&"remote"===l.config.type)return void this.logger.log("Remote server registration detected; skipping local connect");const f=u.ports[0];if(!f)return void this.logger.error("No port provided in server init request");const h=l.config.server;this.migrateInstructionsCompat(h);const y=new I(f);h.connect(y),this.logger.log(`Server "${l.config.name}" initialized successfully`)}catch(u){this.logger.error(`Error initializing server for clientId ${l}:`,u)}}else this.logger.error("Invalid server init request - missing clientId or serverId")}migrateInstructionsCompat(u){try{const l="server"in u&&u.server?u.server:u,m=l._serverInfo,f=l._instructions;m?.instructions&&!f&&(l._instructions=m.instructions,this.logger.log("Migrated instructions from serverInfo to serverOptions (backward compat)"))}catch{}}generateRequestId(){return`${this.instanceId}-${Date.now()}-${Math.random().toString(36).substring(2,8)}`}async handlePromptHash(){const u=window.location.hash;if(u.startsWith("#angie-prompt="))try{const l=u.replace("#angie-prompt=",""),m=decodeURIComponent(l);if(!m)return void this.logger.warn("Empty prompt detected in hash");this.logger.log("Detected prompt in hash:",m),await this.waitForReady();const f=await this.triggerAngie({prompt:m,context:{source:"hash-parameter",pageUrl:window.location.href,timestamp:(new Date).toISOString()}});this.logger.log("Triggered successfully from hash:",f),window.location.hash=""}catch(u){this.logger.error("Failed to trigger from hash:",u)}}setupPromptHashDetection(){this.handlePromptHash(),window.addEventListener("hashchange",()=>this.handlePromptHash())}}const Jt=g("navigation"),zt=(u,l)=>{if(p()){l.isOpen&&window.toggleAngieSidebar&&window.toggleAngieSidebar(!0);const m=_({type:"angie-route-navigation",path:u,payload:l});return m||Jt.error("Failed to post navigation message to Angie iframe"),m}return Jt.error("Angie iframe not found"),!1},Wt="angie/requiredResources",Gt="angie/modelPreferences",Qt="angie/extendedTimeout",Yt="readOnlyHint";var Xt;!function(u){u.Inline="inline",u.EndOfTurn="end-of-turn"}(Xt||(Xt={}))},"./packages/packages/libs/editor-mcp/src/adapters/angie-adapter.ts":function(u,l,m){m.r(l),m.d(l,{AngieMcpAdapter:function(){return AngieMcpAdapter}});var f=m("./packages/packages/libs/editor-mcp/src/mcp-registry.ts");class AngieMcpAdapter{constructor(u){this.sdk=u}async activate(){await this.sdk.waitForReady(),await this.registerEntries((0,f.getRegisteredMcpServers)(),3)}async registerEntries(u,l){if(0===l)return void console.error("Failed to register MCP after 3 retries. failed entries: ",u.map(([u])=>u));const m=[];for(const[l,h,y]of u)try{await this.sdk.registerLocalServer({title:(0,f.toMCPTitle)(l),name:`editor-${l}`,server:h,version:"1.0.0",description:y})}catch{m.push([l,h,y])}return m.length>0?this.registerEntries(m,l-1):void 0}onToolRegistered(){}onResourceRegistered(){}sendResourceUpdated(){}}},"./packages/packages/libs/editor-mcp/src/adapters/web-mcp-adapter.ts":function(u,l,m){m.r(l),m.d(l,{WebMCPAdapter:function(){return WebMCPAdapter}});var f=m("./node_modules/zod-to-json-schema/dist/esm/index.js"),h=m("@elementor/schema");class WebMCPAdapter{registeredToolNames=new Set;resourceEntries=[];activated=!1;constructor(u){this.ctx=u}activate(){this.activated||(this.activated=!0,this.ctx.registerTool({name:"editor-resource-getter",description:"Get an editor resource by URI, or search for available resources by partial URI. Pass a full URI to retrieve content, or a partial string to discover matching patterns.",inputSchema:{type:"object",properties:{uri:{type:"string",description:"A full resource URI (e.g. elementor://styles/best-practices) or a partial string to search across available resource patterns."}},required:["uri"]},execute:async u=>{const l=u.uri,m=this.resourceEntries;if(0===m.length)return"No resources are registered yet.";for(const u of m){const m=u.match(l);if(null!==m){let f;try{f=new URL(l)}catch{return`Invalid URI '${l}'. Provide a valid resource URI or a partial string to search patterns.`}const h=await u.handler(f,m);return h.contents?.[0]?.text??JSON.stringify(h)}}const f=m.map(u=>u.pattern).filter(u=>u.includes(l));if(f.length>0)return`Found ${f.length} matching resource pattern(s):\n${f.join("\n")}\n\nProvide a full URI to retrieve the resource content.`;const h=m.map(u=>u.pattern).join("\n");throw new Error(`No resource matched '${l}'.\n\nAvailable patterns:\n${h}`)}}))}onToolRegistered(u,l){let m;try{m=(0,f.zodToJsonSchema)(h.z.object(u.inputSchema))}catch{m=u.inputSchema}this.registeredToolNames.has(u.name)&&this.ctx.unregisterTool(u.name);let y="";l&&(l.resources?.length>0&&(y+=`#Resources:\n${l.resources?.join("\n")}\n\n`),l.requiredResources?.length>0&&(y+=`#Required Resources:\n${l.requiredResources?.join("\n")}\n\n`),y+="To read resources, use editor-resource-getter tool.\n\n"),this.ctx.registerTool({name:u.name,description:`${y}${u.description}`,inputSchema:m,execute:u.execute}),this.registeredToolNames.add(u.name)}onResourceRegistered(u,l,m){if("string"==typeof l)this.resourceEntries.push({pattern:l,match:u=>u===l?{}:null,handler:m});else{const u=l.uriTemplate;this.resourceEntries.push({pattern:u.toString(),match:l=>u.match(l),handler:m})}}sendResourceUpdated(){}}},"./packages/packages/libs/editor-mcp/src/angie-annotations.ts":function(u,l,m){m.r(l),m.d(l,{ANGIE_MODEL_PREFERENCES:function(){return f},ANGIE_REQUIRED_RESOURCES:function(){return h},createDefaultModelPreferences:function(){return createDefaultModelPreferences}});const f="angie/modelPreferences",h="angie/requiredResources";function createDefaultModelPreferences(){return{hints:[{name:"claude-sonnet-4-5"}],intelligencePriority:.8,speedPriority:.7}}},"./packages/packages/libs/editor-mcp/src/init.ts":function(u,l,m){m.r(l),m.d(l,{startMCPServer:function(){return startMCPServer}});var f=m("./packages/packages/libs/editor-mcp/src/adapters/angie-adapter.ts"),h=m("./packages/packages/libs/editor-mcp/src/adapters/web-mcp-adapter.ts"),y=m("./packages/packages/libs/editor-mcp/src/mcp-registry.ts"),v=m("./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts"),w=m("./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts");function startMCPServer(){"undefined"!=typeof navigator&&"modelContext"in navigator&&(0,y.registerMcpAdapter)(new h.WebMCPAdapter(navigator.modelContext)),(0,w.isAngieAvailable)()&&(0,y.registerMcpAdapter)(new f.AngieMcpAdapter((0,v.getSDK)())),(0,y.activateAdapters)(),(0,y.signalMcpReady)()}"undefined"!=typeof document?document.addEventListener("DOMContentLoaded",()=>startMCPServer(),{once:!0}):startMCPServer()},"./packages/packages/libs/editor-mcp/src/mcp-registry.ts":function(u,l,m){m.r(l),m.d(l,{activateAdapters:function(){return activateAdapters},getMCPByDomain:function(){return getMCPByDomain},getRegisteredMcpServers:function(){return getRegisteredMcpServers},registerMcp:function(){return registerMcp},registerMcpAdapter:function(){return registerMcpAdapter},signalMcpReady:function(){return signalMcpReady},toMCPTitle:function(){return toMCPTitle}});var f=m("@elementor/schema"),h=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),y=m("./packages/packages/libs/editor-mcp/src/angie-annotations.ts"),v=m("./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts"),w=m("./packages/packages/libs/editor-mcp/src/utils/merge-required-resources.ts"),b=m("./packages/packages/libs/editor-mcp/src/utils/register-server-docs-resource.ts");const S={},j={},$=void 0!==globalThis.jest,x=[],E=[],R=[];let Z;const C=new Promise(u=>{Z=u}),registerMcpAdapter=u=>{x.push(u);for(const l of E)try{u.onToolRegistered(l[0],l[1])}catch{}for(const l of R)try{u.onResourceRegistered(...l)}catch{}},signalMcpReady=()=>Z(),activateAdapters=()=>callAdapters(u=>u.activate());function callAdapters(u){for(const l of x)try{u(l)}catch{}}const registerMcp=(u,l)=>{const m=isAlphabet(l);S[m]=u},getRegisteredMcpServers=()=>Object.entries(S).map(([u,l])=>[u,l,j[u]||u]),isAlphabet=u=>{if(!(!!u&&/^[a-z_]+$/.test(u)))throw new Error("Not alphabet");return u},toMCPTitle=u=>`Editor ${u.charAt(0).toUpperCase()+u.slice(1)}`,getMCPByDomain=(u,l)=>{const m=`editor-${isAlphabet(u)}`,x=toMCPTitle(u);if(void 0!==globalThis.jest)return(0,v.mockMcpRegistry)();S[u]||(S[u]=new h.McpServer({name:m,title:x,version:"1.0.0"},{instructions:l?.instructions,capabilities:{resources:{subscribe:!0}}}),l?.docs&&(0,b.registerServerDocsResource)(S[u],u,x,l.docs,(...u)=>{R.push(u),callAdapters(l=>l.onResourceRegistered(...u))}));const Z=S[u],z=l?.docs?`elementor://${u}/server-docs`:void 0,{addTool:A}=function createToolRegistry(u,l,m){function addTool(h){const v=h.outputSchema;v&&Object.assign(v,v.errors??{errors:f.z.string().optional().describe("Error message if the tool failed")});const b=h.schema?h.schema:{},toolCallback=async function(u,l){try{const m=await h.handler(h.schema?u:{},l);return{content:[{type:"text",text:"string"==typeof m?m:JSON.stringify(m)}]}}catch(u){return{isError:!0,structuredContent:{errors:u.message||"Unknown error"},content:[{type:"text",text:u.message||"Unknown error"}]}}},S={destructiveHint:h.isDestructive,readOnlyHint:!h.isDestructive&&void 0,title:h.name},j=(0,w.mergeRequiredResources)(h.requiredResources,m),x={[y.ANGIE_MODEL_PREFERENCES]:h.modelPreferences??(0,y.createDefaultModelPreferences)(),[y.ANGIE_REQUIRED_RESOURCES]:j};u.registerTool(h.name,{description:h.description,inputSchema:b,title:h.name,annotations:S,_meta:x},toolCallback);const R={name:h.name,description:h.description,inputSchema:b,execute:u=>Promise.resolve(toolCallback(u,{}))},Z={resources:[`Server resource name: ${l}, Required to fetch!`],requiredResources:j?.map(u=>u.uri)??[]};E.push([R,Z]),callAdapters(u=>u.onToolRegistered(R,Z)),$&&u.sendToolListChanged()}return{addTool:addTool}}(Z,m,z);return{waitForReady:()=>C,resource:async(...u)=>{const[l,m,...f]=u,h=[l,m,f[f.length-1]];return R.push(h),callAdapters(u=>u.onResourceRegistered(...h)),Z.registerResource(...u)},sendResourceUpdated:(...u)=>(callAdapters(l=>l.sendResourceUpdated({uri:u[0].uri})),Promise.resolve(Z.server.sendResourceUpdated(...u)).catch(u=>{if(!u?.message?.includes("Not connected")&&!u?.message?.includes("does not support notifying about resources"))throw u})),addTool:A,setMCPDescription:l=>{j[u]=l}}}},"./packages/packages/libs/editor-mcp/src/sampler.ts":function(u,l,m){m.r(l),m.d(l,{createSampler:function(){return createSampler}});var f=m("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js");const h={maxTokens:1e4,modelPreferences:"openai",model:"gpt-4o"},y={type:"object",properties:{content:{type:"string",description:"Result"}},required:["content"],additionalProperties:!1},createSampler=(u,l=h)=>{const{maxTokens:m=1e3,modelPreferences:v="openai",model:w="gpt-4o"}=l;return async l=>{const h={...l.systemPrompt?{systemPrompt:l.systemPrompt}:{}},b=l.requestParams||{};return(await u.sendRequest({method:"sampling/createMessage",params:{...b,maxTokens:m,modelPreferences:{hints:[{name:v}]},metadata:{model:w,...h,structured_output:l.structuredOutput||y},messages:l.messages}},f.SamplingMessageSchema)).content}}},"./packages/packages/libs/editor-mcp/src/test-utils/mock-mcp-registry.ts":function(u,l,m){m.r(l),m.d(l,{mockMcpRegistry:function(){return mockMcpRegistry}});const f=new Proxy({},{get:()=>function mockedFn(...u){}}),mockMcpRegistry=()=>({resource:async()=>{},sendResourceUpdated:()=>{},addTool:()=>{},setMCPDescription:()=>{},mcpServer:f})},"./packages/packages/libs/editor-mcp/src/utils/create-simple-resource-handler.ts":function(u,l,m){m.r(l),m.d(l,{createSimpleResourceHandler:function(){return createSimpleResourceHandler}});const createSimpleResourceHandler=u=>async l=>({contents:[{uri:l.href,mimeType:"text/plain",text:u}]})},"./packages/packages/libs/editor-mcp/src/utils/get-active-chat-info.ts":function(u,l,m){m.r(l),m.d(l,{getActiveChatInfo:function(){return getActiveChatInfo}});const getActiveChatInfo=()=>{const u=localStorage.getItem("angie_active_chat_id");if(!u)return{expiresAt:0,sessionId:""};const l=JSON.parse(u);return{expiresAt:l.expiresAt,sessionId:l.sessionId}}},"./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts":function(u,l,m){m.r(l),m.d(l,{MessageEventType:function(){return f.MessageEventType},getAngieIframe:function(){return f.getAngieIframe},getSDK:function(){return getSDK}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");let h;const getSDK=()=>globalThis.__ELEMENTOR_MCP_DISABLED__?{}:(h||(h=new f.AngieMcpSdk),h)},"./packages/packages/libs/editor-mcp/src/utils/install-angie-plugin.ts":function(u,l,m){m.r(l),m.d(l,{installAngiePlugin:function(){return installAngiePlugin}});var f=m("@wordpress/api-fetch"),h=m.n(f);const y="angie",isPluginErrorResponse=u=>"object"==typeof u&&null!==u&&"code"in u&&"message"in u,installPlugin=async()=>{try{return await h()({path:"/wp/v2/plugins",method:"POST",data:{slug:y,status:"active"}})}catch(u){if(isPluginErrorResponse(u)&&"folder_exists"===u.code)return(async u=>h()({path:`/wp/v2/plugins/${u}`,method:"POST",data:{status:"active"}}))(`${y}/${y}`);throw u}},installAngiePlugin=async()=>{try{return await installPlugin(),{success:!0}}catch(u){return isPluginErrorResponse(u)?{success:!1,error:u.message,code:u.code}:{success:!1,error:"Unknown error occurred"}}}},"./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts":function(u,l,m){m.r(l),m.d(l,{isAngieAvailable:function(){return isAngieAvailable}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const isAngieAvailable=()=>!!(0,f.getAngieIframe)()},"./packages/packages/libs/editor-mcp/src/utils/is-angie-sidebar-open.ts":function(u,l,m){m.r(l),m.d(l,{isAngieSidebarOpen:function(){return isAngieSidebarOpen}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const isAngieSidebarOpen=()=>(0,f.getAngieSidebarSavedState)()===f.ANGIE_SIDEBAR_STATE_OPEN},"./packages/packages/libs/editor-mcp/src/utils/merge-required-resources.ts":function(u,l,m){m.r(l),m.d(l,{mergeRequiredResources:function(){return mergeRequiredResources}});const mergeRequiredResources=(u,l)=>l?u?.some(u=>u.uri===l)?u:[...u??[],{uri:l,description:"Server docs"}]:u},"./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts":function(u,l,m){m.r(l),m.d(l,{toolPrompts:function(){return toolPrompts}});class ToolPrompts{_description="";_parameters={};_examples=[];_furtherInstructions=[];constructor(u){this.name=u}description(u){return void 0===u?this._description:(this._description=u,this)}parameter(u,l){return void 0===l?this._parameters[u]:(this._parameters[u]=`**${u}**:\n${l}`,this)}instruction(u){return this._furtherInstructions.push(u),this}example(u){return this._examples.push(u),this}get examples(){return this._examples.join("\n\n")}prompt(){return`# ${this.name}\n# Description\n${this._description}\n${this._parameters.length?"# Parameters\n"+Object.values(this._parameters).join("\n\n"):""}\n${this._examples.length?"# Examples\n"+this.examples:""}\n${this._furtherInstructions.length?"# Further Instructions\n"+this._furtherInstructions.join("\n\n"):""}\n`.trim()}}const toolPrompts=u=>new ToolPrompts(u)},"./packages/packages/libs/editor-mcp/src/utils/redirect-to-app-admin.ts":function(u,l,m){m.r(l),m.d(l,{redirectToAppAdmin:function(){return redirectToAppAdmin}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const redirectToAppAdmin=u=>{(0,f.setReferrerRedirect)(window.location.href,u),(0,f.saveState)(f.ANGIE_SIDEBAR_STATE_OPEN),window.location.href="/wp-admin/admin.php?page=angie-app"}},"./packages/packages/libs/editor-mcp/src/utils/redirect-to-installation.ts":function(u,l,m){m.r(l),m.d(l,{redirectToInstallation:function(){return redirectToInstallation}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const redirectToInstallation=u=>{(0,f.setReferrerRedirect)(window.location.href,u),window.location.href="/wp-admin/plugin-install.php?s=angie&tab=search&type=term"}},"./packages/packages/libs/editor-mcp/src/utils/register-server-docs-resource.ts":function(u,l,m){m.r(l),m.d(l,{registerServerDocsResource:function(){return registerServerDocsResource}});var f=m("./packages/packages/libs/editor-mcp/src/utils/create-simple-resource-handler.ts");const registerServerDocsResource=(u,l,m,h,y)=>{const v=`elementor://${l}/server-docs`,w=`${l}-server-docs`,b=(0,f.createSimpleResourceHandler)(h);u.registerResource(w,v,{title:`${m} server docs`,description:"Full MCP documentation (lazy-loaded)",mimeType:"text/plain"},b),y(w,v,b)}},"./packages/packages/libs/editor-mcp/src/utils/save-angie-consent.ts":function(u,l,m){m.r(l),m.d(l,{saveAngieConsent:function(){return saveAngieConsent}});var f=m("@wordpress/api-fetch"),h=m.n(f);const saveAngieConsent=async()=>{await h()({path:"/elementor/v1/angie/consent",method:"POST"})}},"./packages/packages/libs/editor-mcp/src/utils/send-prompt-to-angie.ts":function(u,l,m){m.r(l),m.d(l,{sendPromptToAngie:function(){return sendPromptToAngie}});var f=m("./packages/node_modules/@elementor-external/angie-sdk/dist/index.js");const sendPromptToAngie=u=>{const l=(0,f.getAngieIframe)();l&&((0,f.toggleAngieSidebar)(l,!0),u&&(window.location.hash=`angie-prompt=${encodeURIComponent(u)}`))}},"@elementor/schema":function(u){u.exports=window.elementorV2.schema},"@wordpress/api-fetch":function(u){u.exports=window.wp.apiFetch}},l={};function __webpack_require__(m){var f=l[m];if(void 0!==f)return f.exports;var h=l[m]={exports:{}};return u[m](h,h.exports,__webpack_require__),h.exports}__webpack_require__.n=function(u){var l=u&&u.__esModule?function(){return u.default}:function(){return u};return __webpack_require__.d(l,{a:l}),l},__webpack_require__.d=function(u,l){for(var m in l)__webpack_require__.o(l,m)&&!__webpack_require__.o(u,m)&&Object.defineProperty(u,m,{enumerable:!0,get:l[m]})},__webpack_require__.o=function(u,l){return Object.prototype.hasOwnProperty.call(u,l)},__webpack_require__.r=function(u){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(u,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(u,"__esModule",{value:!0})};var m={};!function(){__webpack_require__.r(m),__webpack_require__.d(m,{ANGIE_MODEL_PREFERENCES:function(){return S.ANGIE_MODEL_PREFERENCES},ANGIE_REQUIRED_RESOURCES:function(){return S.ANGIE_REQUIRED_RESOURCES},AngieMessageEvenetType:function(){return u.MessageEventType},McpServer:function(){return l.McpServer},ResourceTemplate:function(){return l.ResourceTemplate},SamplingMessageSchema:function(){return f.SamplingMessageSchema},activateAdapters:function(){return v.activateAdapters},createSampler:function(){return w.createSampler},getActiveChatInfo:function(){return j.getActiveChatInfo},getAngieIframe:function(){return u.getAngieIframe},getAngieSdk:function(){return getAngieSdk},getMCPByDomain:function(){return v.getMCPByDomain},getRegisteredMcpServers:function(){return v.getRegisteredMcpServers},installAngiePlugin:function(){return R.installAngiePlugin},isAngieAvailable:function(){return h.isAngieAvailable},isAngieSidebarOpen:function(){return y.isAngieSidebarOpen},redirectToAppAdmin:function(){return E.redirectToAppAdmin},redirectToInstallation:function(){return x.redirectToInstallation},registerMcp:function(){return v.registerMcp},registerMcpAdapter:function(){return v.registerMcpAdapter},saveAngieConsent:function(){return Z.saveAngieConsent},sendPromptToAngie:function(){return $.sendPromptToAngie},signalMcpReady:function(){return v.signalMcpReady},startMCPServer:function(){return C.startMCPServer},toMCPTitle:function(){return v.toMCPTitle},toolPrompts:function(){return b.toolPrompts}});var u=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/get-sdk.ts"),l=__webpack_require__("./node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js"),f=__webpack_require__("./node_modules/@modelcontextprotocol/sdk/dist/esm/types.js"),h=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/is-angie-available.ts"),y=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/is-angie-sidebar-open.ts"),v=__webpack_require__("./packages/packages/libs/editor-mcp/src/mcp-registry.ts"),w=__webpack_require__("./packages/packages/libs/editor-mcp/src/sampler.ts"),b=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/prompt-builder.ts"),S=__webpack_require__("./packages/packages/libs/editor-mcp/src/angie-annotations.ts"),j=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/get-active-chat-info.ts"),$=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/send-prompt-to-angie.ts"),x=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/redirect-to-installation.ts"),E=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/redirect-to-app-admin.ts"),R=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/install-angie-plugin.ts"),Z=__webpack_require__("./packages/packages/libs/editor-mcp/src/utils/save-angie-consent.ts"),C=__webpack_require__("./packages/packages/libs/editor-mcp/src/init.ts");const getAngieSdk=()=>(0,u.getSDK)()}(),(window.elementorV2=window.elementorV2||{}).editorMcp=m}(),window.elementorV2.editorMcp?.init?.();
31055 9 //# sourceMappingURL=editor-mcp.js.map