diff --git a/dist/index.js b/dist/index.js index 68e210c..8871f14 100644 --- a/dist/index.js +++ b/dist/index.js @@ -115,10 +115,10 @@ var require_command = __commonJS({ process.stdout.write(cmd.toString() + os7.EOL); } exports2.issueCommand = issueCommand; - function issue(name, message = "") { + function issue2(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; + exports2.issue = issue2; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -317,8 +317,8 @@ var require_tunnel = __commonJS({ var http2 = require("http"); var https2 = require("https"); var events = require("events"); - var assert2 = require("assert"); - var util4 = require("util"); + var assert3 = require("assert"); + var util3 = require("util"); exports2.httpOverHttp = httpOverHttp; exports2.httpsOverHttp = httpsOverHttp; exports2.httpOverHttps = httpOverHttps; @@ -368,7 +368,7 @@ var require_tunnel = __commonJS({ self2.removeSocket(socket); }); } - util4.inherits(TunnelingAgent, events.EventEmitter); + util3.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self2 = this; var options2 = mergeOptions({ request: req }, self2.options, toOptions(host, port, localAddress)); @@ -950,7 +950,7 @@ var require_constants = __commonJS({ var require_util = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/util.js"(exports2, module2) { "use strict"; - var assert2 = require("assert"); + var assert3 = require("assert"); var { kDestroyed, kBodyUsed } = require_symbols(); var { IncomingMessage } = require("http"); var stream = require("stream"); @@ -1032,7 +1032,7 @@ var require_util = __commonJS({ function getHostname(host) { if (host[0] === "[") { const idx2 = host.indexOf("]"); - assert2(idx2 !== -1); + assert3(idx2 !== -1); return host.substring(1, idx2); } const idx = host.indexOf(":"); @@ -1043,7 +1043,7 @@ var require_util = __commonJS({ if (!host) { return null; } - assert2.strictEqual(typeof host, "string"); + assert3.strictEqual(typeof host, "string"); const servername = getHostname(host); if (net.isIP(servername)) { return ""; @@ -3646,7 +3646,7 @@ var require_util2 = __commonJS({ var { getGlobalOrigin } = require_global(); var { performance: performance2 } = require("perf_hooks"); var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util(); - var assert2 = require("assert"); + var assert3 = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; var crypto; @@ -3836,7 +3836,7 @@ var require_util2 = __commonJS({ } function determineRequestsReferrer(request3) { const policy = request3.referrerPolicy; - assert2(policy); + assert3(policy); let referrerSource = null; if (request3.referrer === "client") { const globalOrigin = getGlobalOrigin(); @@ -3894,7 +3894,7 @@ var require_util2 = __commonJS({ } } function stripURLForReferrer(url2, originOnly) { - assert2(url2 instanceof URL); + assert3(url2 instanceof URL); if (url2.protocol === "file:" || url2.protocol === "about:" || url2.protocol === "blank:") { return "no-referrer"; } @@ -4044,7 +4044,7 @@ var require_util2 = __commonJS({ }); return { promise, resolve: res, reject: rej }; } - function isAborted2(fetchParams) { + function isAborted(fetchParams) { return fetchParams.controller.state === "aborted"; } function isCancelled(fetchParams) { @@ -4073,7 +4073,7 @@ var require_util2 = __commonJS({ if (result === void 0) { throw new TypeError("Value is not JSON serializable"); } - assert2(typeof result === "string"); + assert3(typeof result === "string"); return result; } var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); @@ -4167,7 +4167,7 @@ var require_util2 = __commonJS({ } function isomorphicEncode(input) { for (let i = 0; i < input.length; i++) { - assert2(input.charCodeAt(i) <= 255); + assert3(input.charCodeAt(i) <= 255); } return input; } @@ -4187,7 +4187,7 @@ var require_util2 = __commonJS({ } } function urlIsLocal(url2) { - assert2("protocol" in url2); + assert3("protocol" in url2); const protocol = url2.protocol; return protocol === "about:" || protocol === "blob:" || protocol === "data:"; } @@ -4198,13 +4198,13 @@ var require_util2 = __commonJS({ return url2.protocol === "https:"; } function urlIsHttpHttpsScheme(url2) { - assert2("protocol" in url2); + assert3("protocol" in url2); const protocol = url2.protocol; return protocol === "http:" || protocol === "https:"; } var hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)); module2.exports = { - isAborted: isAborted2, + isAborted, isCancelled, createDeferredPromise, ReadableStreamFrom, @@ -4482,8 +4482,8 @@ var require_webidl = __commonJS({ }); } for (const options2 of converters) { - const { key, defaultValue, required, converter } = options2; - if (required === true) { + const { key, defaultValue, required: required2, converter } = options2; + if (required2 === true) { if (!hasOwn(dictionary, key)) { throw webidl.errors.exception({ header: "Dictionary", @@ -4496,7 +4496,7 @@ var require_webidl = __commonJS({ if (hasDefault && value !== null) { value = value ?? defaultValue; } - if (required || hasDefault || value !== void 0) { + if (required2 || hasDefault || value !== void 0) { value = converter(value); if (options2.allowedValues && !options2.allowedValues.includes(value)) { throw webidl.errors.exception({ @@ -4641,7 +4641,7 @@ var require_webidl = __commonJS({ var require_dataURL = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/dataURL.js"(exports2, module2) { "use strict"; - var assert2 = require("assert"); + var assert3 = require("assert"); var { atob: atob2 } = require("buffer"); var { isomorphicDecode } = require_util2(); var encoder = new TextEncoder(); @@ -4649,7 +4649,7 @@ var require_dataURL = __commonJS({ var HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/; var HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/; function dataURLProcessor(dataURL) { - assert2(dataURL.protocol === "data:"); + assert3(dataURL.protocol === "data:"); let input = URLSerializer(dataURL, true); input = input.slice(5); const position = { position: 0 }; @@ -4835,7 +4835,7 @@ var require_dataURL = __commonJS({ function collectAnHTTPQuotedString(input, position, extractValue2) { const positionStart = position.position; let value = ""; - assert2(input[position.position] === '"'); + assert3(input[position.position] === '"'); position.position++; while (true) { value += collectASequenceOfCodePoints( @@ -4856,7 +4856,7 @@ var require_dataURL = __commonJS({ value += input[position.position]; position.position++; } else { - assert2(quoteOrBackslash === '"'); + assert3(quoteOrBackslash === '"'); break; } } @@ -4866,7 +4866,7 @@ var require_dataURL = __commonJS({ return input.slice(positionStart, position.position); } function serializeAMimeType(mimeType) { - assert2(mimeType !== "failure"); + assert3(mimeType !== "failure"); const { parameters, essence } = mimeType; let serialization = essence; for (let [name, value] of parameters.entries()) { @@ -5270,7 +5270,7 @@ var require_body = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/body.js"(exports2, module2) { "use strict"; var Busboy = require_main(); - var util4 = require_util(); + var util3 = require_util(); var { ReadableStreamFrom, isBlobLike, @@ -5285,7 +5285,7 @@ var require_body = __commonJS({ var { DOMException: DOMException2, structuredClone } = require_constants2(); var { Blob: Blob2, File: NativeFile } = require("buffer"); var { kBodyUsed } = require_symbols(); - var assert2 = require("assert"); + var assert3 = require("assert"); var { isErrored } = require_util(); var { isUint8Array, isArrayBuffer: isArrayBuffer2 } = require("util/types"); var { File: UndiciFile } = require_file(); @@ -5323,7 +5323,7 @@ var require_body = __commonJS({ type: void 0 }); } - assert2(isReadableStreamLike(stream)); + assert3(isReadableStreamLike(stream)); let action5 = null; let source = null; let length = null; @@ -5338,7 +5338,7 @@ var require_body = __commonJS({ source = new Uint8Array(object.slice()); } else if (ArrayBuffer.isView(object)) { source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); - } else if (util4.isFormDataLike(object)) { + } else if (util3.isFormDataLike(object)) { const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; const prefix2 = `--${boundary}\r Content-Disposition: form-data`; @@ -5396,14 +5396,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r if (keepalive) { throw new TypeError("keepalive"); } - if (util4.isDisturbed(object) || object.locked) { + if (util3.isDisturbed(object) || object.locked) { throw new TypeError( "Response body object should not be disturbed or locked" ); } stream = object instanceof ReadableStream2 ? object : ReadableStreamFrom(object); } - if (typeof source === "string" || util4.isBuffer(source)) { + if (typeof source === "string" || util3.isBuffer(source)) { length = Buffer.byteLength(source); } if (action5 != null) { @@ -5439,8 +5439,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r ReadableStream2 = require("stream/web").ReadableStream; } if (object instanceof ReadableStream2) { - assert2(!util4.isDisturbed(object), "The body has already been consumed."); - assert2(!object.locked, "The stream is locked."); + assert3(!util3.isDisturbed(object), "The body has already been consumed."); + assert3(!object.locked, "The stream is locked."); } return extractBody(object, keepalive); } @@ -5461,7 +5461,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r yield body2; } else { const stream = body2.stream; - if (util4.isDisturbed(stream)) { + if (util3.isDisturbed(stream)) { throw new TypeError("The body has already been consumed."); } if (stream.locked) { @@ -5611,7 +5611,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r return promise.promise; } function bodyUnusable(body2) { - return body2 != null && (body2.stream.locked || util4.isDisturbed(body2.stream)); + return body2 != null && (body2.stream.locked || util3.isDisturbed(body2.stream)); } function utf8DecodeBytes(buffer2) { if (buffer2.length === 0) { @@ -5651,9 +5651,9 @@ var require_request = __commonJS({ InvalidArgumentError, NotSupportedError } = require_errors(); - var assert2 = require("assert"); + var assert3 = require("assert"); var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols(); - var util4 = require_util(); + var util3 = require_util(); var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; @@ -5724,12 +5724,12 @@ var require_request = __commonJS({ this.abort = null; if (body2 == null) { this.body = null; - } else if (util4.isStream(body2)) { + } else if (util3.isStream(body2)) { this.body = body2; const rState = this.body._readableState; if (!rState || !rState.autoDestroy) { this.endHandler = function autoDestroy() { - util4.destroy(this); + util3.destroy(this); }; this.body.on("end", this.endHandler); } @@ -5741,7 +5741,7 @@ var require_request = __commonJS({ } }; this.body.on("error", this.errorHandler); - } else if (util4.isBuffer(body2)) { + } else if (util3.isBuffer(body2)) { this.body = body2.byteLength ? body2 : null; } else if (ArrayBuffer.isView(body2)) { this.body = body2.buffer.byteLength ? Buffer.from(body2.buffer, body2.byteOffset, body2.byteLength) : null; @@ -5749,7 +5749,7 @@ var require_request = __commonJS({ this.body = body2.byteLength ? Buffer.from(body2) : null; } else if (typeof body2 === "string") { this.body = body2.length ? Buffer.from(body2) : null; - } else if (util4.isFormDataLike(body2) || util4.isIterable(body2) || util4.isBlobLike(body2)) { + } else if (util3.isFormDataLike(body2) || util3.isIterable(body2) || util3.isBlobLike(body2)) { this.body = body2; } else { throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); @@ -5757,7 +5757,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util4.buildURL(path4, query) : path4; + this.path = query ? util3.buildURL(path4, query) : path4; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -5783,8 +5783,8 @@ var require_request = __commonJS({ } else if (headers != null) { throw new InvalidArgumentError("headers must be an object or an array"); } - if (util4.isFormDataLike(this.body)) { - if (util4.nodeMajor < 16 || util4.nodeMajor === 16 && util4.nodeMinor < 8) { + if (util3.isFormDataLike(this.body)) { + if (util3.nodeMajor < 16 || util3.nodeMajor === 16 && util3.nodeMinor < 8) { throw new InvalidArgumentError("Form-Data bodies are only supported in node v16.8 and newer."); } if (!extractBody) { @@ -5798,13 +5798,13 @@ var require_request = __commonJS({ } this.body = bodyStream.stream; this.contentLength = bodyStream.length; - } else if (util4.isBlobLike(body2) && this.contentType == null && body2.type) { + } else if (util3.isBlobLike(body2) && this.contentType == null && body2.type) { this.contentType = body2.type; this.headers += `content-type: ${body2.type}\r `; } - util4.validateHandler(handler, method, upgrade); - this.servername = util4.getServerName(this.host); + util3.validateHandler(handler, method, upgrade); + this.servername = util3.getServerName(this.host); this[kHandler] = handler; if (channels.create.hasSubscribers) { channels.create.publish({ request: this }); @@ -5832,8 +5832,8 @@ var require_request = __commonJS({ } } onConnect(abort) { - assert2(!this.aborted); - assert2(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); if (this.error) { abort(this.error); } else { @@ -5842,8 +5842,8 @@ var require_request = __commonJS({ } } onHeaders(statusCode, headers, resume, statusText) { - assert2(!this.aborted); - assert2(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); if (channels.headers.hasSubscribers) { channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); } @@ -5854,8 +5854,8 @@ var require_request = __commonJS({ } } onData(chunk) { - assert2(!this.aborted); - assert2(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); try { return this[kHandler].onData(chunk); } catch (err) { @@ -5864,13 +5864,13 @@ var require_request = __commonJS({ } } onUpgrade(statusCode, headers, socket) { - assert2(!this.aborted); - assert2(!this.completed); + assert3(!this.aborted); + assert3(!this.completed); return this[kHandler].onUpgrade(statusCode, headers, socket); } onComplete(trailers) { this.onFinally(); - assert2(!this.aborted); + assert3(!this.aborted); this.completed = true; if (channels.trailers.hasSubscribers) { channels.trailers.publish({ request: this, trailers }); @@ -6201,8 +6201,8 @@ var require_connect = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/connect.js"(exports2, module2) { "use strict"; var net = require("net"); - var assert2 = require("assert"); - var util4 = require_util(); + var assert3 = require("assert"); + var util3 = require_util(); var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); var tls; var SessionCache; @@ -6262,16 +6262,16 @@ var require_connect = __commonJS({ const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); timeout = timeout == null ? 1e4 : timeout; allowH2 = allowH2 != null ? allowH2 : false; - return function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + return function connect({ hostname: hostname2, host, protocol, port, servername, localAddress, httpSocket }, callback) { let socket; if (protocol === "https:") { if (!tls) { tls = require("tls"); } - servername = servername || options2.servername || util4.getServerName(host) || null; - const sessionKey = servername || hostname; + servername = servername || options2.servername || util3.getServerName(host) || null; + const sessionKey = servername || hostname2; const session = sessionCache.get(sessionKey) || null; - assert2(sessionKey); + assert3(sessionKey); socket = tls.connect({ highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... @@ -6284,20 +6284,20 @@ var require_connect = __commonJS({ socket: httpSocket, // upgrade socket connection port: port || 443, - host: hostname + host: hostname2 }); socket.on("session", function(session2) { sessionCache.set(sessionKey, session2); }); } else { - assert2(!httpSocket, "httpSocket can only be sent on TLS update"); + assert3(!httpSocket, "httpSocket can only be sent on TLS update"); socket = net.connect({ highWaterMark: 64 * 1024, // Same as nodejs fs streams. ...options2, localAddress, port: port || 80, - host: hostname + host: hostname2 }); } if (options2.keepAlive == null || options2.keepAlive) { @@ -6346,7 +6346,7 @@ var require_connect = __commonJS({ }; } function onConnectTimeout(socket) { - util4.destroy(socket, new ConnectTimeoutError()); + util3.destroy(socket, new ConnectTimeoutError()); } module2.exports = buildConnector; } @@ -6697,9 +6697,9 @@ var require_constants3 = __commonJS({ var require_RedirectHandler = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RedirectHandler.js"(exports2, module2) { "use strict"; - var util4 = require_util(); + var util3 = require_util(); var { kBodyUsed } = require_symbols(); - var assert2 = require("assert"); + var assert3 = require("assert"); var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; @@ -6710,7 +6710,7 @@ var require_RedirectHandler = __commonJS({ this[kBodyUsed] = false; } async *[Symbol.asyncIterator]() { - assert2(!this[kBodyUsed], "disturbed"); + assert3(!this[kBodyUsed], "disturbed"); this[kBodyUsed] = true; yield* this[kBody]; } @@ -6720,7 +6720,7 @@ var require_RedirectHandler = __commonJS({ if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } - util4.validateHandler(handler, opts.method, opts.upgrade); + util3.validateHandler(handler, opts.method, opts.upgrade); this.dispatch = dispatch; this.location = null; this.abort = null; @@ -6728,10 +6728,10 @@ var require_RedirectHandler = __commonJS({ this.maxRedirections = maxRedirections; this.handler = handler; this.history = []; - if (util4.isStream(this.opts.body)) { - if (util4.bodyLength(this.opts.body) === 0) { + if (util3.isStream(this.opts.body)) { + if (util3.bodyLength(this.opts.body) === 0) { this.opts.body.on("data", function() { - assert2(false); + assert3(false); }); } if (typeof this.opts.body.readableDidRead !== "boolean") { @@ -6742,7 +6742,7 @@ var require_RedirectHandler = __commonJS({ } } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { this.opts.body = new BodyAsyncIterable(this.opts.body); - } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util4.isIterable(this.opts.body)) { + } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util3.isIterable(this.opts.body)) { this.opts.body = new BodyAsyncIterable(this.opts.body); } } @@ -6757,14 +6757,14 @@ var require_RedirectHandler = __commonJS({ this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { - this.location = this.history.length >= this.maxRedirections || util4.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); + this.location = this.history.length >= this.maxRedirections || util3.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); if (this.opts.origin) { this.history.push(new URL(this.opts.path, this.opts.origin)); } if (!this.location) { return this.handler.onHeaders(statusCode, headers, resume, statusText); } - const { origin, pathname, search } = util4.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const { origin, pathname, search } = util3.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); const path4 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); this.opts.path = path4; @@ -6809,13 +6809,13 @@ var require_RedirectHandler = __commonJS({ } function shouldRemoveHeader(header, removeContent, unknownOrigin) { if (header.length === 4) { - return util4.headerNameToString(header) === "host"; + return util3.headerNameToString(header) === "host"; } - if (removeContent && util4.headerNameToString(header).startsWith("content-")) { + if (removeContent && util3.headerNameToString(header).startsWith("content-")) { return true; } if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { - const name = util4.headerNameToString(header); + const name = util3.headerNameToString(header); return name === "authorization" || name === "cookie" || name === "proxy-authorization"; } return false; @@ -6835,7 +6835,7 @@ var require_RedirectHandler = __commonJS({ } } } else { - assert2(headers == null, "headers must be an object or an array"); + assert3(headers == null, "headers must be an object or an array"); } return ret; } @@ -6885,11 +6885,11 @@ var require_llhttp_simd_wasm = __commonJS({ var require_client = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/client.js"(exports2, module2) { "use strict"; - var assert2 = require("assert"); + var assert3 = require("assert"); var net = require("net"); var http2 = require("http"); var { pipeline } = require("stream"); - var util4 = require_util(); + var util3 = require_util(); var timers = require_timers(); var Request = require_request(); var DispatcherBase = require_dispatcher_base(); @@ -7100,12 +7100,12 @@ var require_client = __commonJS({ allowH2, socketPath, timeout: connectTimeout, - ...util4.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...util3.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect2 }); } this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })]; - this[kUrl] = util4.parseOrigin(url2); + this[kUrl] = util3.parseOrigin(url2); this[kConnector] = connect2; this[kSocket] = null; this[kPipelining] = pipelining != null ? pipelining : 1; @@ -7174,7 +7174,7 @@ var require_client = __commonJS({ const request3 = this[kHTTPConnVersion] === "h2" ? Request[kHTTP2BuildRequest](origin, opts, handler) : Request[kHTTP1BuildRequest](origin, opts, handler); this[kQueue].push(request3); if (this[kResuming]) { - } else if (util4.bodyLength(request3.body) == null && util4.isIterable(request3.body)) { + } else if (util3.bodyLength(request3.body) == null && util3.isIterable(request3.body)) { this[kResuming] = 1; process.nextTick(resume, this); } else { @@ -7209,21 +7209,21 @@ var require_client = __commonJS({ resolve(); }; if (this[kHTTP2Session] != null) { - util4.destroy(this[kHTTP2Session], err); + util3.destroy(this[kHTTP2Session], err); this[kHTTP2Session] = null; this[kHTTP2SessionState] = null; } if (!this[kSocket]) { queueMicrotask(callback); } else { - util4.destroy(this[kSocket].on("close", callback), err); + util3.destroy(this[kSocket].on("close", callback), err); } resume(this); }); } }; function onHttp2SessionError(err) { - assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert3(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[kSocket][kError] = err; onError(this[kClient], err); } @@ -7235,8 +7235,8 @@ var require_client = __commonJS({ } } function onHttp2SessionEnd() { - util4.destroy(this, new SocketError("other side closed")); - util4.destroy(this[kSocket], new SocketError("other side closed")); + util3.destroy(this, new SocketError("other side closed")); + util3.destroy(this[kSocket], new SocketError("other side closed")); } function onHTTP2GoAway(code) { const client = this[kClient]; @@ -7244,7 +7244,7 @@ var require_client = __commonJS({ client[kSocket] = null; client[kHTTP2Session] = null; if (client.destroyed) { - assert2(this[kPending] === 0); + assert3(this[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request3 = requests[i]; @@ -7256,7 +7256,7 @@ var require_client = __commonJS({ errorRequest(client, request3, err); } client[kPendingIdx] = client[kRunningIdx]; - assert2(client[kRunning] === 0); + assert3(client[kRunning] === 0); client.emit( "disconnect", client[kUrl], @@ -7283,35 +7283,35 @@ var require_client = __commonJS({ return 0; }, wasm_on_status: (p, at, len) => { - assert2.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_begin: (p) => { - assert2.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); return currentParser.onMessageBegin() || 0; }, wasm_on_header_field: (p, at, len) => { - assert2.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_header_value: (p, at, len) => { - assert2.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { - assert2.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; }, wasm_on_body: (p, at, len) => { - assert2.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_complete: (p) => { - assert2.strictEqual(currentParser.ptr, p); + assert3.strictEqual(currentParser.ptr, p); return currentParser.onMessageComplete() || 0; } /* eslint-enable camelcase */ @@ -7330,7 +7330,7 @@ var require_client = __commonJS({ var TIMEOUT_IDLE = 3; var Parser = class { constructor(client, socket, { exports: exports3 }) { - assert2(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); + assert3(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); this.llhttp = exports3; this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE); this.client = client; @@ -7376,10 +7376,10 @@ var require_client = __commonJS({ if (this.socket.destroyed || !this.paused) { return; } - assert2(this.ptr != null); - assert2(currentParser == null); + assert3(this.ptr != null); + assert3(currentParser == null); this.llhttp.llhttp_resume(this.ptr); - assert2(this.timeoutType === TIMEOUT_BODY); + assert3(this.timeoutType === TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); @@ -7399,9 +7399,9 @@ var require_client = __commonJS({ } } execute(data) { - assert2(this.ptr != null); - assert2(currentParser == null); - assert2(!this.paused); + assert3(this.ptr != null); + assert3(currentParser == null); + assert3(!this.paused); const { socket, llhttp } = this; if (data.length > currentBufferSize) { if (currentBufferPtr) { @@ -7439,12 +7439,12 @@ var require_client = __commonJS({ throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)); } } catch (err) { - util4.destroy(socket, err); + util3.destroy(socket, err); } } destroy() { - assert2(this.ptr != null); - assert2(currentParser == null); + assert3(this.ptr != null); + assert3(currentParser == null); this.llhttp.llhttp_free(this.ptr); this.ptr = null; timers.clearTimeout(this.timeout); @@ -7496,22 +7496,22 @@ var require_client = __commonJS({ trackHeader(len) { this.headersSize += len; if (this.headersSize >= this.headersMaxSize) { - util4.destroy(this.socket, new HeadersOverflowError()); + util3.destroy(this.socket, new HeadersOverflowError()); } } onUpgrade(head) { const { upgrade, client, socket, headers, statusCode } = this; - assert2(upgrade); + assert3(upgrade); const request3 = client[kQueue][client[kRunningIdx]]; - assert2(request3); - assert2(!socket.destroyed); - assert2(socket === client[kSocket]); - assert2(!this.paused); - assert2(request3.upgrade || request3.method === "CONNECT"); + assert3(request3); + assert3(!socket.destroyed); + assert3(socket === client[kSocket]); + assert3(!this.paused); + assert3(request3.upgrade || request3.method === "CONNECT"); this.statusCode = null; this.statusText = ""; this.shouldKeepAlive = null; - assert2(this.headers.length % 2 === 0); + assert3(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; socket.unshift(head); @@ -7526,7 +7526,7 @@ var require_client = __commonJS({ try { request3.onUpgrade(statusCode, headers, socket); } catch (err) { - util4.destroy(socket, err); + util3.destroy(socket, err); } resume(client); } @@ -7539,17 +7539,17 @@ var require_client = __commonJS({ if (!request3) { return -1; } - assert2(!this.upgrade); - assert2(this.statusCode < 200); + assert3(!this.upgrade); + assert3(this.statusCode < 200); if (statusCode === 100) { - util4.destroy(socket, new SocketError("bad response", util4.getSocketInfo(socket))); + util3.destroy(socket, new SocketError("bad response", util3.getSocketInfo(socket))); return -1; } if (upgrade && !request3.upgrade) { - util4.destroy(socket, new SocketError("bad upgrade", util4.getSocketInfo(socket))); + util3.destroy(socket, new SocketError("bad upgrade", util3.getSocketInfo(socket))); return -1; } - assert2.strictEqual(this.timeoutType, TIMEOUT_HEADERS); + assert3.strictEqual(this.timeoutType, TIMEOUT_HEADERS); this.statusCode = statusCode; this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. request3.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; @@ -7562,20 +7562,20 @@ var require_client = __commonJS({ } } if (request3.method === "CONNECT") { - assert2(client[kRunning] === 1); + assert3(client[kRunning] === 1); this.upgrade = true; return 2; } if (upgrade) { - assert2(client[kRunning] === 1); + assert3(client[kRunning] === 1); this.upgrade = true; return 2; } - assert2(this.headers.length % 2 === 0); + assert3(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; if (this.shouldKeepAlive && client[kPipelining]) { - const keepAliveTimeout = this.keepAlive ? util4.parseKeepAliveTimeout(this.keepAlive) : null; + const keepAliveTimeout = this.keepAlive ? util3.parseKeepAliveTimeout(this.keepAlive) : null; if (keepAliveTimeout != null) { const timeout = Math.min( keepAliveTimeout - client[kKeepAliveTimeoutThreshold], @@ -7614,16 +7614,16 @@ var require_client = __commonJS({ return -1; } const request3 = client[kQueue][client[kRunningIdx]]; - assert2(request3); - assert2.strictEqual(this.timeoutType, TIMEOUT_BODY); + assert3(request3); + assert3.strictEqual(this.timeoutType, TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } - assert2(statusCode >= 200); + assert3(statusCode >= 200); if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { - util4.destroy(socket, new ResponseExceededMaxSizeError()); + util3.destroy(socket, new ResponseExceededMaxSizeError()); return -1; } this.bytesRead += buf.length; @@ -7640,35 +7640,35 @@ var require_client = __commonJS({ return; } const request3 = client[kQueue][client[kRunningIdx]]; - assert2(request3); - assert2(statusCode >= 100); + assert3(request3); + assert3(statusCode >= 100); this.statusCode = null; this.statusText = ""; this.bytesRead = 0; this.contentLength = ""; this.keepAlive = ""; this.connection = ""; - assert2(this.headers.length % 2 === 0); + assert3(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; if (statusCode < 200) { return; } if (request3.method !== "HEAD" && contentLength2 && bytesRead !== parseInt(contentLength2, 10)) { - util4.destroy(socket, new ResponseContentLengthMismatchError()); + util3.destroy(socket, new ResponseContentLengthMismatchError()); return -1; } request3.onComplete(headers); client[kQueue][client[kRunningIdx]++] = null; if (socket[kWriting]) { - assert2.strictEqual(client[kRunning], 0); - util4.destroy(socket, new InformationalError("reset")); + assert3.strictEqual(client[kRunning], 0); + util3.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (!shouldKeepAlive) { - util4.destroy(socket, new InformationalError("reset")); + util3.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { - util4.destroy(socket, new InformationalError("reset")); + util3.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (client[kPipelining] === 1) { setImmediate(resume, client); @@ -7681,16 +7681,16 @@ var require_client = __commonJS({ const { socket, timeoutType, client } = parser; if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { - assert2(!parser.paused, "cannot be paused while waiting for headers"); - util4.destroy(socket, new HeadersTimeoutError()); + assert3(!parser.paused, "cannot be paused while waiting for headers"); + util3.destroy(socket, new HeadersTimeoutError()); } } else if (timeoutType === TIMEOUT_BODY) { if (!parser.paused) { - util4.destroy(socket, new BodyTimeoutError()); + util3.destroy(socket, new BodyTimeoutError()); } } else if (timeoutType === TIMEOUT_IDLE) { - assert2(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); - util4.destroy(socket, new InformationalError("socket idle timeout")); + assert3(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); + util3.destroy(socket, new InformationalError("socket idle timeout")); } } function onSocketReadable() { @@ -7701,7 +7701,7 @@ var require_client = __commonJS({ } function onSocketError(err) { const { [kClient]: client, [kParser]: parser } = this; - assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert3(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); if (client[kHTTPConnVersion] !== "h2") { if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { parser.onMessageComplete(); @@ -7713,13 +7713,13 @@ var require_client = __commonJS({ } function onError(client, err) { if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { - assert2(client[kPendingIdx] === client[kRunningIdx]); + assert3(client[kPendingIdx] === client[kRunningIdx]); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request3 = requests[i]; errorRequest(client, request3, err); } - assert2(client[kSize] === 0); + assert3(client[kSize] === 0); } } function onSocketEnd() { @@ -7730,7 +7730,7 @@ var require_client = __commonJS({ return; } } - util4.destroy(this, new SocketError("other side closed", util4.getSocketInfo(this))); + util3.destroy(this, new SocketError("other side closed", util3.getSocketInfo(this))); } function onSocketClose() { const { [kClient]: client, [kParser]: parser } = this; @@ -7741,10 +7741,10 @@ var require_client = __commonJS({ this[kParser].destroy(); this[kParser] = null; } - const err = this[kError] || new SocketError("closed", util4.getSocketInfo(this)); + const err = this[kError] || new SocketError("closed", util3.getSocketInfo(this)); client[kSocket] = null; if (client.destroyed) { - assert2(client[kPending] === 0); + assert3(client[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request3 = requests[i]; @@ -7756,27 +7756,27 @@ var require_client = __commonJS({ errorRequest(client, request3, err); } client[kPendingIdx] = client[kRunningIdx]; - assert2(client[kRunning] === 0); + assert3(client[kRunning] === 0); client.emit("disconnect", client[kUrl], [client], err); resume(client); } async function connect(client) { - assert2(!client[kConnecting]); - assert2(!client[kSocket]); - let { host, hostname, protocol, port } = client[kUrl]; - if (hostname[0] === "[") { - const idx = hostname.indexOf("]"); - assert2(idx !== -1); - const ip = hostname.substring(1, idx); - assert2(net.isIP(ip)); - hostname = ip; + assert3(!client[kConnecting]); + assert3(!client[kSocket]); + let { host, hostname: hostname2, protocol, port } = client[kUrl]; + if (hostname2[0] === "[") { + const idx = hostname2.indexOf("]"); + assert3(idx !== -1); + const ip = hostname2.substring(1, idx); + assert3(net.isIP(ip)); + hostname2 = ip; } client[kConnecting] = true; if (channels.beforeConnect.hasSubscribers) { channels.beforeConnect.publish({ connectParams: { host, - hostname, + hostname: hostname2, protocol, port, servername: client[kServerName], @@ -7789,7 +7789,7 @@ var require_client = __commonJS({ const socket = await new Promise((resolve, reject) => { client[kConnector]({ host, - hostname, + hostname: hostname2, protocol, port, servername: client[kServerName], @@ -7803,12 +7803,12 @@ var require_client = __commonJS({ }); }); if (client.destroyed) { - util4.destroy(socket.on("error", () => { + util3.destroy(socket.on("error", () => { }), new ClientDestroyedError()); return; } client[kConnecting] = false; - assert2(socket); + assert3(socket); const isH2 = socket.alpnProtocol === "h2"; if (isH2) { if (!h2ExperimentalWarned) { @@ -7853,7 +7853,7 @@ var require_client = __commonJS({ channels.connected.publish({ connectParams: { host, - hostname, + hostname: hostname2, protocol, port, servername: client[kServerName], @@ -7873,7 +7873,7 @@ var require_client = __commonJS({ channels.connectError.publish({ connectParams: { host, - hostname, + hostname: hostname2, protocol, port, servername: client[kServerName], @@ -7884,7 +7884,7 @@ var require_client = __commonJS({ }); } if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { - assert2(client[kRunning] === 0); + assert3(client[kRunning] === 0); while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request3 = client[kQueue][client[kPendingIdx]++]; errorRequest(client, request3, err); @@ -7916,7 +7916,7 @@ var require_client = __commonJS({ function _resume(client, sync) { while (true) { if (client.destroyed) { - assert2(client[kPending] === 0); + assert3(client[kPending] === 0); return; } if (client[kClosedResolve] && !client[kSize]) { @@ -7971,7 +7971,7 @@ var require_client = __commonJS({ } client[kServerName] = request3.servername; if (socket && socket.servername !== request3.servername) { - util4.destroy(socket, new InformationalError("servername changed")); + util3.destroy(socket, new InformationalError("servername changed")); return; } } @@ -7991,7 +7991,7 @@ var require_client = __commonJS({ if (client[kRunning] > 0 && (request3.upgrade || request3.method === "CONNECT")) { return; } - if (client[kRunning] > 0 && util4.bodyLength(request3.body) !== 0 && (util4.isStream(request3.body) || util4.isAsyncIterable(request3.body))) { + if (client[kRunning] > 0 && util3.bodyLength(request3.body) !== 0 && (util3.isStream(request3.body) || util3.isAsyncIterable(request3.body))) { return; } if (!request3.aborted && write(client, request3)) { @@ -8014,7 +8014,7 @@ var require_client = __commonJS({ if (body2 && typeof body2.read === "function") { body2.read(0); } - const bodyLength = util4.bodyLength(body2); + const bodyLength = util3.bodyLength(body2); let contentLength2 = bodyLength; if (contentLength2 === null) { contentLength2 = request3.contentLength; @@ -8036,7 +8036,7 @@ var require_client = __commonJS({ return; } errorRequest(client, request3, err || new RequestAbortedError()); - util4.destroy(socket, new InformationalError("aborted")); + util3.destroy(socket, new InformationalError("aborted")); }); } catch (err) { errorRequest(client, request3, err); @@ -8088,13 +8088,13 @@ upgrade: ${upgrade}\r \r `, "latin1"); } else { - assert2(contentLength2 === null, "no body must not have content length"); + assert3(contentLength2 === null, "no body must not have content length"); socket.write(`${header}\r `, "latin1"); } request3.onRequestSent(); - } else if (util4.isBuffer(body2)) { - assert2(contentLength2 === body2.byteLength, "buffer body must have content length"); + } else if (util3.isBuffer(body2)) { + assert3(contentLength2 === body2.byteLength, "buffer body must have content length"); socket.cork(); socket.write(`${header}content-length: ${contentLength2}\r \r @@ -8106,18 +8106,18 @@ upgrade: ${upgrade}\r if (!expectsPayload) { socket[kReset] = true; } - } else if (util4.isBlobLike(body2)) { + } else if (util3.isBlobLike(body2)) { if (typeof body2.stream === "function") { writeIterable({ body: body2.stream(), client, request: request3, socket, contentLength: contentLength2, header, expectsPayload }); } else { writeBlob({ body: body2, client, request: request3, socket, contentLength: contentLength2, header, expectsPayload }); } - } else if (util4.isStream(body2)) { + } else if (util3.isStream(body2)) { writeStream({ body: body2, client, request: request3, socket, contentLength: contentLength2, header, expectsPayload }); - } else if (util4.isIterable(body2)) { + } else if (util3.isIterable(body2)) { writeIterable({ body: body2, client, request: request3, socket, contentLength: contentLength2, header, expectsPayload }); } else { - assert2(false); + assert3(false); } return true; } @@ -8171,7 +8171,7 @@ upgrade: ${upgrade}\r if (body2 && typeof body2.read === "function") { body2.read(0); } - let contentLength2 = util4.bodyLength(body2); + let contentLength2 = util3.bodyLength(body2); if (contentLength2 == null) { contentLength2 = request3.contentLength; } @@ -8186,7 +8186,7 @@ upgrade: ${upgrade}\r process.emitWarning(new RequestContentLengthMismatchError()); } if (contentLength2 != null) { - assert2(body2, "no body must not have content length"); + assert3(body2, "no body must not have content length"); headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength2}`; } session.ref(); @@ -8226,7 +8226,7 @@ upgrade: ${upgrade}\r stream.once("error", function(err) { if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util4.destroy(stream, err); + util3.destroy(stream, err); } }); stream.once("frameError", (type2, code) => { @@ -8234,22 +8234,22 @@ upgrade: ${upgrade}\r errorRequest(client, request3, err); if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util4.destroy(stream, err); + util3.destroy(stream, err); } }); return true; function writeBodyH2() { if (!body2) { request3.onRequestSent(); - } else if (util4.isBuffer(body2)) { - assert2(contentLength2 === body2.byteLength, "buffer body must have content length"); + } else if (util3.isBuffer(body2)) { + assert3(contentLength2 === body2.byteLength, "buffer body must have content length"); stream.cork(); stream.write(body2); stream.uncork(); stream.end(); request3.onBodySent(body2); request3.onRequestSent(); - } else if (util4.isBlobLike(body2)) { + } else if (util3.isBlobLike(body2)) { if (typeof body2.stream === "function") { writeIterable({ client, @@ -8273,7 +8273,7 @@ upgrade: ${upgrade}\r socket: client[kSocket] }); } - } else if (util4.isStream(body2)) { + } else if (util3.isStream(body2)) { writeStream({ body: body2, client, @@ -8284,7 +8284,7 @@ upgrade: ${upgrade}\r h2stream: stream, header: "" }); - } else if (util4.isIterable(body2)) { + } else if (util3.isIterable(body2)) { writeIterable({ body: body2, client, @@ -8296,32 +8296,32 @@ upgrade: ${upgrade}\r socket: client[kSocket] }); } else { - assert2(false); + assert3(false); } } } function writeStream({ h2stream, body: body2, client, request: request3, socket, contentLength: contentLength2, header, expectsPayload }) { - assert2(contentLength2 !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + assert3(contentLength2 !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); if (client[kHTTPConnVersion] === "h2") { let onPipeData = function(chunk) { request3.onBodySent(chunk); }; - const pipe = pipeline( + const pipe2 = pipeline( body2, h2stream, (err) => { if (err) { - util4.destroy(body2, err); - util4.destroy(h2stream, err); + util3.destroy(body2, err); + util3.destroy(h2stream, err); } else { request3.onRequestSent(); } } ); - pipe.on("data", onPipeData); - pipe.once("end", () => { - pipe.removeListener("data", onPipeData); - util4.destroy(pipe); + pipe2.on("data", onPipeData); + pipe2.once("end", () => { + pipe2.removeListener("data", onPipeData); + util3.destroy(pipe2); }); return; } @@ -8336,7 +8336,7 @@ upgrade: ${upgrade}\r this.pause(); } } catch (err) { - util4.destroy(this, err); + util3.destroy(this, err); } }; const onDrain = function() { @@ -8359,7 +8359,7 @@ upgrade: ${upgrade}\r return; } finished = true; - assert2(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); + assert3(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); socket.off("drain", onDrain).off("error", onFinished); body2.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort); if (!err) { @@ -8371,9 +8371,9 @@ upgrade: ${upgrade}\r } writer.destroy(err); if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { - util4.destroy(body2, err); + util3.destroy(body2, err); } else { - util4.destroy(body2); + util3.destroy(body2); } }; body2.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort); @@ -8383,7 +8383,7 @@ upgrade: ${upgrade}\r socket.on("drain", onDrain).on("error", onFinished); } async function writeBlob({ h2stream, body: body2, client, request: request3, socket, contentLength: contentLength2, header, expectsPayload }) { - assert2(contentLength2 === body2.size, "blob body must have content length"); + assert3(contentLength2 === body2.size, "blob body must have content length"); const isH2 = client[kHTTPConnVersion] === "h2"; try { if (contentLength2 != null && contentLength2 !== body2.size) { @@ -8409,11 +8409,11 @@ upgrade: ${upgrade}\r } resume(client); } catch (err) { - util4.destroy(isH2 ? h2stream : socket, err); + util3.destroy(isH2 ? h2stream : socket, err); } } async function writeIterable({ h2stream, body: body2, client, request: request3, socket, contentLength: contentLength2, header, expectsPayload }) { - assert2(contentLength2 !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); + assert3(contentLength2 !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { if (callback) { @@ -8423,7 +8423,7 @@ upgrade: ${upgrade}\r } } const waitForDrain = () => new Promise((resolve, reject) => { - assert2(callback === null); + assert3(callback === null); if (socket[kError]) { reject(socket[kError]); } else { @@ -8571,15 +8571,15 @@ ${len.toString(16)}\r const { socket, client } = this; socket[kWriting] = false; if (err) { - assert2(client[kRunning] <= 1, "pipeline should only contain this request"); - util4.destroy(socket, err); + assert3(client[kRunning] <= 1, "pipeline should only contain this request"); + util3.destroy(socket, err); } } }; function errorRequest(client, request3, err) { try { request3.onError(err); - assert2(request3.aborted); + assert3(request3.aborted); } catch (err2) { client.emit("error", err2); } @@ -8848,7 +8848,7 @@ var require_pool = __commonJS({ var { InvalidArgumentError } = require_errors(); - var util4 = require_util(); + var util3 = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); var kOptions = Symbol("options"); @@ -8888,14 +8888,14 @@ var require_pool = __commonJS({ allowH2, socketPath, timeout: connectTimeout, - ...util4.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...util3.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect }); } this[kInterceptors] = options2.interceptors && options2.interceptors.Pool && Array.isArray(options2.interceptors.Pool) ? options2.interceptors.Pool : []; this[kConnections] = connections || null; - this[kUrl] = util4.parseOrigin(origin); - this[kOptions] = { ...util4.deepClone(options2), connect, allowH2 }; + this[kUrl] = util3.parseOrigin(origin); + this[kOptions] = { ...util3.deepClone(options2), connect, allowH2 }; this[kOptions].interceptors = options2.interceptors ? { ...options2.interceptors } : void 0; this[kFactory] = factory; this.on("connectionError", (origin2, targets, error3) => { @@ -9109,7 +9109,7 @@ var require_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var Pool = require_pool(); var Client = require_client(); - var util4 = require_util(); + var util3 = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); var kOnConnect = Symbol("onConnect"); @@ -9139,7 +9139,7 @@ var require_agent = __commonJS({ connect = { ...connect }; } this[kInterceptors] = options2.interceptors && options2.interceptors.Agent && Array.isArray(options2.interceptors.Agent) ? options2.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; - this[kOptions] = { ...util4.deepClone(options2), connect }; + this[kOptions] = { ...util3.deepClone(options2), connect }; this[kOptions].interceptors = options2.interceptors ? { ...options2.interceptors } : void 0; this[kMaxRedirections] = maxRedirections; this[kFactory] = factory; @@ -9222,10 +9222,10 @@ var require_agent = __commonJS({ var require_readable = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/readable.js"(exports2, module2) { "use strict"; - var assert2 = require("assert"); + var assert3 = require("assert"); var { Readable: Readable5 } = require("stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors(); - var util4 = require_util(); + var util3 = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; var kConsume = Symbol("kConsume"); @@ -9323,7 +9323,7 @@ var require_readable = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-body-bodyused get bodyUsed() { - return util4.isDisturbed(this); + return util3.isDisturbed(this); } // https://fetch.spec.whatwg.org/#dom-body-body get body() { @@ -9331,7 +9331,7 @@ var require_readable = __commonJS({ this[kBody] = ReadableStreamFrom(this); if (this[kConsume]) { this[kBody].getReader(); - assert2(this[kBody].locked); + assert3(this[kBody].locked); } } return this[kBody]; @@ -9344,7 +9344,7 @@ var require_readable = __commonJS({ if (typeof signal !== "object" || !("aborted" in signal)) { throw new InvalidArgumentError("signal must be an AbortSignal"); } - util4.throwIfAborted(signal); + util3.throwIfAborted(signal); } catch (err) { return Promise.reject(err); } @@ -9353,7 +9353,7 @@ var require_readable = __commonJS({ return Promise.resolve(null); } return new Promise((resolve, reject) => { - const signalListenerCleanup = signal ? util4.addAbortListener(signal, () => { + const signalListenerCleanup = signal ? util3.addAbortListener(signal, () => { this.destroy(); }) : noop; this.on("close", function() { @@ -9376,13 +9376,13 @@ var require_readable = __commonJS({ return self2[kBody] && self2[kBody].locked === true || self2[kConsume]; } function isUnusable(self2) { - return util4.isDisturbed(self2) || isLocked(self2); + return util3.isDisturbed(self2) || isLocked(self2); } async function consume(stream, type2) { if (isUnusable(stream)) { throw new TypeError("unusable"); } - assert2(!stream[kConsume]); + assert3(!stream[kConsume]); return new Promise((resolve, reject) => { stream[kConsume] = { type: type2, @@ -9474,13 +9474,13 @@ var require_readable = __commonJS({ var require_util3 = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/util.js"(exports2, module2) { "use strict"; - var assert2 = require("assert"); + var assert3 = require("assert"); var { ResponseStatusCodeError } = require_errors(); var { toUSVString } = require_util(); async function getResolveErrorBodyCallback({ callback, body: body2, contentType: contentType2, statusCode, statusMessage, headers }) { - assert2(body2); + assert3(body2); let chunks = []; let limit = 0; for await (const chunk of body2) { @@ -9573,7 +9573,7 @@ var require_api_request = __commonJS({ InvalidArgumentError, RequestAbortedError } = require_errors(); - var util4 = require_util(); + var util3 = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); @@ -9601,8 +9601,8 @@ var require_api_request = __commonJS({ } super("UNDICI_REQUEST"); } catch (err) { - if (util4.isStream(body2)) { - util4.destroy(body2.on("error", util4.nop), err); + if (util3.isStream(body2)) { + util3.destroy(body2.on("error", util3.nop), err); } throw err; } @@ -9617,7 +9617,7 @@ var require_api_request = __commonJS({ this.onInfo = onInfo || null; this.throwOnError = throwOnError; this.highWaterMark = highWaterMark; - if (util4.isStream(body2)) { + if (util3.isStream(body2)) { body2.on("error", (err) => { this.onError(err); }); @@ -9633,14 +9633,14 @@ var require_api_request = __commonJS({ } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this; - const headers = responseHeaders === "raw" ? util4.parseRawHeaders(rawHeaders) : util4.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); } return; } - const parsedHeaders = responseHeaders === "raw" ? util4.parseHeaders(rawHeaders) : headers; + const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; const contentType2 = parsedHeaders["content-type"]; const body2 = new Readable5({ resume, abort, contentType: contentType2, highWaterMark }); this.callback = null; @@ -9671,7 +9671,7 @@ var require_api_request = __commonJS({ onComplete(trailers) { const { res } = this; removeSignal(this); - util4.parseHeaders(trailers, this.trailers); + util3.parseHeaders(trailers, this.trailers); res.push(null); } onError(err) { @@ -9686,12 +9686,12 @@ var require_api_request = __commonJS({ if (res) { this.res = null; queueMicrotask(() => { - util4.destroy(res, err); + util3.destroy(res, err); }); } if (body2) { this.body = null; - util4.destroy(body2, err); + util3.destroy(body2, err); } } }; @@ -9728,7 +9728,7 @@ var require_api_stream = __commonJS({ InvalidReturnValueError, RequestAbortedError } = require_errors(); - var util4 = require_util(); + var util3 = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); @@ -9756,8 +9756,8 @@ var require_api_stream = __commonJS({ } super("UNDICI_STREAM"); } catch (err) { - if (util4.isStream(body2)) { - util4.destroy(body2.on("error", util4.nop), err); + if (util3.isStream(body2)) { + util3.destroy(body2.on("error", util3.nop), err); } throw err; } @@ -9772,7 +9772,7 @@ var require_api_stream = __commonJS({ this.body = body2; this.onInfo = onInfo || null; this.throwOnError = throwOnError || false; - if (util4.isStream(body2)) { + if (util3.isStream(body2)) { body2.on("error", (err) => { this.onError(err); }); @@ -9788,7 +9788,7 @@ var require_api_stream = __commonJS({ } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { factory, opaque, context, callback, responseHeaders } = this; - const headers = responseHeaders === "raw" ? util4.parseRawHeaders(rawHeaders) : util4.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); @@ -9798,7 +9798,7 @@ var require_api_stream = __commonJS({ this.factory = null; let res; if (this.throwOnError && statusCode >= 400) { - const parsedHeaders = responseHeaders === "raw" ? util4.parseHeaders(rawHeaders) : headers; + const parsedHeaders = responseHeaders === "raw" ? util3.parseHeaders(rawHeaders) : headers; const contentType2 = parsedHeaders["content-type"]; res = new PassThrough(); this.callback = null; @@ -9824,7 +9824,7 @@ var require_api_stream = __commonJS({ const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; if (err || !res2.readable) { - util4.destroy(res2, err); + util3.destroy(res2, err); } this.callback = null; this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); @@ -9848,7 +9848,7 @@ var require_api_stream = __commonJS({ if (!res) { return; } - this.trailers = util4.parseHeaders(trailers); + this.trailers = util3.parseHeaders(trailers); res.end(); } onError(err) { @@ -9857,7 +9857,7 @@ var require_api_stream = __commonJS({ this.factory = null; if (res) { this.res = null; - util4.destroy(res, err); + util3.destroy(res, err); } else if (callback) { this.callback = null; queueMicrotask(() => { @@ -9866,7 +9866,7 @@ var require_api_stream = __commonJS({ } if (body2) { this.body = null; - util4.destroy(body2, err); + util3.destroy(body2, err); } } }; @@ -9906,10 +9906,10 @@ var require_api_pipeline = __commonJS({ InvalidReturnValueError, RequestAbortedError } = require_errors(); - var util4 = require_util(); + var util3 = require_util(); var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); - var assert2 = require("assert"); + var assert3 = require("assert"); var kResume = Symbol("resume"); var PipelineRequest = class extends Readable5 { constructor() { @@ -9968,7 +9968,7 @@ var require_api_pipeline = __commonJS({ this.abort = null; this.context = null; this.onInfo = onInfo || null; - this.req = new PipelineRequest().on("error", util4.nop); + this.req = new PipelineRequest().on("error", util3.nop); this.ret = new Duplex({ readableObjectMode: opts.objectMode, autoDestroy: true, @@ -9994,9 +9994,9 @@ var require_api_pipeline = __commonJS({ if (abort && err) { abort(); } - util4.destroy(body2, err); - util4.destroy(req, err); - util4.destroy(res, err); + util3.destroy(body2, err); + util3.destroy(req, err); + util3.destroy(res, err); removeSignal(this); callback(err); } @@ -10009,7 +10009,7 @@ var require_api_pipeline = __commonJS({ } onConnect(abort, context) { const { ret, res } = this; - assert2(!res, "pipeline cannot be retried"); + assert3(!res, "pipeline cannot be retried"); if (ret.destroyed) { throw new RequestAbortedError(); } @@ -10020,7 +10020,7 @@ var require_api_pipeline = __commonJS({ const { opaque, handler, context } = this; if (statusCode < 200) { if (this.onInfo) { - const headers = this.responseHeaders === "raw" ? util4.parseRawHeaders(rawHeaders) : util4.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); this.onInfo({ statusCode, headers }); } return; @@ -10029,7 +10029,7 @@ var require_api_pipeline = __commonJS({ let body2; try { this.handler = null; - const headers = this.responseHeaders === "raw" ? util4.parseRawHeaders(rawHeaders) : util4.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); body2 = this.runInAsyncScope(handler, null, { statusCode, headers, @@ -10038,7 +10038,7 @@ var require_api_pipeline = __commonJS({ context }); } catch (err) { - this.res.on("error", util4.nop); + this.res.on("error", util3.nop); throw err; } if (!body2 || typeof body2.on !== "function") { @@ -10051,14 +10051,14 @@ var require_api_pipeline = __commonJS({ } }).on("error", (err) => { const { ret } = this; - util4.destroy(ret, err); + util3.destroy(ret, err); }).on("end", () => { const { ret } = this; ret.push(null); }).on("close", () => { const { ret } = this; if (!ret._readableState.ended) { - util4.destroy(ret, new RequestAbortedError()); + util3.destroy(ret, new RequestAbortedError()); } }); this.body = body2; @@ -10074,7 +10074,7 @@ var require_api_pipeline = __commonJS({ onError(err) { const { ret } = this; this.handler = null; - util4.destroy(ret, err); + util3.destroy(ret, err); } }; function pipeline(opts, handler) { @@ -10096,9 +10096,9 @@ var require_api_upgrade = __commonJS({ "use strict"; var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); var { AsyncResource } = require("async_hooks"); - var util4 = require_util(); + var util3 = require_util(); var { addSignal, removeSignal } = require_abort_signal(); - var assert2 = require("assert"); + var assert3 = require("assert"); var UpgradeHandler = class extends AsyncResource { constructor(opts, callback) { if (!opts || typeof opts !== "object") { @@ -10131,10 +10131,10 @@ var require_api_upgrade = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { const { callback, opaque, context } = this; - assert2.strictEqual(statusCode, 101); + assert3.strictEqual(statusCode, 101); removeSignal(this); this.callback = null; - const headers = this.responseHeaders === "raw" ? util4.parseRawHeaders(rawHeaders) : util4.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); this.runInAsyncScope(callback, null, null, { headers, socket, @@ -10186,7 +10186,7 @@ var require_api_connect = __commonJS({ "use strict"; var { AsyncResource } = require("async_hooks"); var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); - var util4 = require_util(); + var util3 = require_util(); var { addSignal, removeSignal } = require_abort_signal(); var ConnectHandler = class extends AsyncResource { constructor(opts, callback) { @@ -10223,7 +10223,7 @@ var require_api_connect = __commonJS({ this.callback = null; let headers = rawHeaders; if (headers != null) { - headers = this.responseHeaders === "raw" ? util4.parseRawHeaders(rawHeaders) : util4.parseHeaders(rawHeaders); + headers = this.responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders); } this.runInAsyncScope(callback, null, null, { statusCode, @@ -10380,10 +10380,10 @@ var require_mock_utils = __commonJS({ } } function buildHeadersFromArray(headers) { - const clone = headers.slice(); + const clone2 = headers.slice(); const entries = []; - for (let index = 0; index < clone.length; index += 2) { - entries.push([clone[index], clone[index + 1]]); + for (let index = 0; index < clone2.length; index += 2) { + entries.push([clone2[index], clone2[index + 1]]); } return Object.fromEntries(entries); } @@ -11239,7 +11239,7 @@ var require_proxy_agent = __commonJS({ var require_RetryHandler = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RetryHandler.js"(exports2, module2) { "use strict"; - var assert2 = require("assert"); + var assert3 = require("assert"); var { kRetryHandlerDefaultRetry } = require_symbols(); var { RequestRetryError } = require_errors(); var { isDisturbed, parseHeaders, parseRangeHeader } = require_util(); @@ -11404,8 +11404,8 @@ var require_RetryHandler = __commonJS({ return false; } const { start, size, end = size } = contentRange; - assert2(this.start === start, "content-range mismatch"); - assert2(this.end == null || this.end === end, "content-range mismatch"); + assert3(this.start === start, "content-range mismatch"); + assert3(this.end == null || this.end === end, "content-range mismatch"); this.resume = resume; return true; } @@ -11421,12 +11421,12 @@ var require_RetryHandler = __commonJS({ ); } const { start, size, end = size } = range2; - assert2( + assert3( start != null && Number.isFinite(start) && this.start !== start, "content-range mismatch" ); - assert2(Number.isFinite(start)); - assert2( + assert3(Number.isFinite(start)); + assert3( end != null && Number.isFinite(end) && this.end !== end, "invalid content-length" ); @@ -11437,8 +11437,8 @@ var require_RetryHandler = __commonJS({ const contentLength2 = headers["content-length"]; this.end = contentLength2 != null ? Number(contentLength2) : null; } - assert2(Number.isFinite(this.start)); - assert2( + assert3(Number.isFinite(this.start)); + assert3( this.end == null || Number.isFinite(this.end), "invalid content-length" ); @@ -11579,9 +11579,9 @@ var require_headers = __commonJS({ isValidHeaderName, isValidHeaderValue } = require_util2(); - var util4 = require("util"); + var util3 = require("util"); var { webidl } = require_webidl(); - var assert2 = require("assert"); + var assert3 = require("assert"); var kHeadersMap = Symbol("headers map"); var kHeadersSortedMap = Symbol("headers map sorted"); function isHTTPWhiteSpaceCharCode(code) { @@ -11839,7 +11839,7 @@ var require_headers = __commonJS({ headers.push([name, cookies[j]]); } } else { - assert2(value !== null); + assert3(value !== null); headers.push([name, value]); } } @@ -11932,7 +11932,7 @@ var require_headers = __commonJS({ value: "Headers", configurable: true }, - [util4.inspect.custom]: { + [util3.inspect.custom]: { enumerable: false } }); @@ -11963,12 +11963,12 @@ var require_response = __commonJS({ "use strict"; var { Headers, HeadersList, fill } = require_headers(); var { extractBody, cloneBody, mixinBody } = require_body(); - var util4 = require_util(); - var { kEnumerableProperty } = util4; + var util3 = require_util(); + var { kEnumerableProperty } = util3; var { isValidReasonPhrase, isCancelled, - isAborted: isAborted2, + isAborted, isBlobLike, serializeJavascriptValueToJSONString, isErrorLike, @@ -11985,7 +11985,7 @@ var require_response = __commonJS({ var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); var { kHeadersList, kConstruct } = require_symbols(); - var assert2 = require("assert"); + var assert3 = require("assert"); var { types } = require("util"); var ReadableStream2 = globalThis.ReadableStream || require("stream/web").ReadableStream; var textEncoder = new TextEncoder("utf-8"); @@ -12110,7 +12110,7 @@ var require_response = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Response); - return !!this[kState].body && util4.isDisturbed(this[kState].body.stream); + return !!this[kState].body && util3.isDisturbed(this[kState].body.stream); } // Returns a clone of response. clone() { @@ -12201,7 +12201,7 @@ var require_response = __commonJS({ return p in state3 ? state3[p] : target[p]; }, set(target, p, value) { - assert2(!(p in state3)); + assert3(!(p in state3)); target[p] = value; return true; } @@ -12235,12 +12235,12 @@ var require_response = __commonJS({ body: null }); } else { - assert2(false); + assert3(false); } } function makeAppropriateNetworkError(fetchParams, err = null) { - assert2(isCancelled(fetchParams)); - return isAborted2(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); + assert3(isCancelled(fetchParams)); + return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); } function initializeResponse(response, init, body2) { if (init.status !== null && (init.status < 200 || init.status > 599)) { @@ -12292,7 +12292,7 @@ var require_response = __commonJS({ if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { return webidl.converters.BufferSource(V); } - if (util4.isFormDataLike(V)) { + if (util3.isFormDataLike(V)) { return webidl.converters.FormData(V, { strict: false }); } if (V instanceof URLSearchParams) { @@ -12343,7 +12343,7 @@ var require_request2 = __commonJS({ var { extractBody, mixinBody, cloneBody } = require_body(); var { Headers, fill: fillHeaders, HeadersList } = require_headers(); var { FinalizationRegistry } = require_dispatcher_weakref()(); - var util4 = require_util(); + var util3 = require_util(); var { isValidHTTPToken, sameOrigin, @@ -12361,13 +12361,13 @@ var require_request2 = __commonJS({ requestCache, requestDuplex } = require_constants2(); - var { kEnumerableProperty } = util4; + var { kEnumerableProperty } = util3; var { kHeaders, kSignal, kState, kGuard, kRealm } = require_symbols2(); var { webidl } = require_webidl(); var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); var { kHeadersList, kConstruct } = require_symbols(); - var assert2 = require("assert"); + var assert3 = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; var kAbortController = Symbol("abortController"); @@ -12411,7 +12411,7 @@ var require_request2 = __commonJS({ request3 = makeRequest({ urlList: [parsedURL] }); fallbackMode = "cors"; } else { - assert2(input instanceof _Request); + assert3(input instanceof _Request); request3 = input[kState]; signal = input[kSignal]; } @@ -12581,7 +12581,7 @@ var require_request2 = __commonJS({ } } catch { } - util4.addAbortListener(signal, abort); + util3.addAbortListener(signal, abort); requestFinalizer.register(ac, { signal, abort }); } } @@ -12639,7 +12639,7 @@ var require_request2 = __commonJS({ } let finalBody = inputOrInitBody; if (initBody == null && inputBody != null) { - if (util4.isDisturbed(inputBody.stream) || inputBody.stream.locked) { + if (util3.isDisturbed(inputBody.stream) || inputBody.stream.locked) { throw new TypeError( "Cannot construct a Request with a Request object that has already been used." ); @@ -12768,7 +12768,7 @@ var require_request2 = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Request); - return !!this[kState].body && util4.isDisturbed(this[kState].body.stream); + return !!this[kState].body && util3.isDisturbed(this[kState].body.stream); } get duplex() { webidl.brandCheck(this, _Request); @@ -12792,7 +12792,7 @@ var require_request2 = __commonJS({ if (this.signal.aborted) { ac.abort(this.signal.reason); } else { - util4.addAbortListener( + util3.addAbortListener( this.signal, () => { ac.abort(this.signal.reason); @@ -13010,7 +13010,7 @@ var require_fetch = __commonJS({ isBlobLike, sameOrigin, isCancelled, - isAborted: isAborted2, + isAborted, isErrorLike, fullyReadBody, readableStreamClose, @@ -13020,7 +13020,7 @@ var require_fetch = __commonJS({ urlHasHttpsScheme } = require_util2(); var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); - var assert2 = require("assert"); + var assert3 = require("assert"); var { safelyExtractBody } = require_body(); var { redirectStatusSet, @@ -13100,7 +13100,7 @@ var require_fetch = __commonJS({ requestObject.signal, () => { locallyAborted = true; - assert2(controller != null); + assert3(controller != null); controller.abort(requestObject.signal.reason); abortFetch(p, request3, responseObject, requestObject.signal.reason); } @@ -13233,7 +13233,7 @@ var require_fetch = __commonJS({ taskDestination, crossOriginIsolatedCapability }; - assert2(!request3.body || request3.body.stream); + assert3(!request3.body || request3.body.stream); if (request3.window === "client") { request3.window = request3.client?.globalObject?.constructor?.name === "Window" ? request3.client : "no-window"; } @@ -13326,7 +13326,7 @@ var require_fetch = __commonJS({ } else if (request3.responseTainting === "opaque") { response = filterResponse(response, "opaque"); } else { - assert2(false); + assert3(false); } } let internalResponse = response.status === 0 ? response : response.internalResponse; @@ -13518,7 +13518,7 @@ var require_fetch = __commonJS({ } else if (request3.redirect === "follow") { response = await httpRedirectFetch(fetchParams, response); } else { - assert2(false); + assert3(false); } } response.timingInfo = timingInfo; @@ -13571,7 +13571,7 @@ var require_fetch = __commonJS({ request3.headersList.delete("host"); } if (request3.body != null) { - assert2(request3.body.source != null); + assert3(request3.body.source != null); request3.body = safelyExtractBody(request3.body.source)[0]; } const timingInfo = fetchParams.timingInfo; @@ -13704,7 +13704,7 @@ var require_fetch = __commonJS({ return response; } async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { - assert2(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); + assert3(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); fetchParams.controller.connection = { abort: null, destroyed: false, @@ -13818,7 +13818,7 @@ var require_fetch = __commonJS({ let isFailure; try { const { done, value } = await fetchParams.controller.next(); - if (isAborted2(fetchParams)) { + if (isAborted(fetchParams)) { break; } bytes = done ? void 0 : value; @@ -13851,7 +13851,7 @@ var require_fetch = __commonJS({ } }; function onAborted(reason) { - if (isAborted2(fetchParams)) { + if (isAborted(fetchParams)) { response.aborted = true; if (isReadable(stream)) { fetchParams.controller.controller.error( @@ -14839,7 +14839,7 @@ var require_symbols4 = __commonJS({ var require_util5 = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/util.js"(exports2, module2) { "use strict"; - var assert2 = require("assert"); + var assert3 = require("assert"); var { URLSerializer } = require_dataURL(); var { isValidHeaderName } = require_util2(); function urlEquals(A, B, excludeFragment = false) { @@ -14848,7 +14848,7 @@ var require_util5 = __commonJS({ return serializedA === serializedB; } function fieldValues(header) { - assert2(header !== null); + assert3(header !== null); const values = []; for (let value of header.split(",")) { value = value.trim(); @@ -14882,7 +14882,7 @@ var require_cache = __commonJS({ var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); var { fetching } = require_fetch(); var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2(); - var assert2 = require("assert"); + var assert3 = require("assert"); var { getGlobalDispatcher } = require_global2(); var _relevantRequestResponseList, _Cache_instances, batchCacheOperations_fn, queryCache_fn, requestMatchesCachedItem_fn; var _Cache = class _Cache { @@ -15145,7 +15145,7 @@ var require_cache = __commonJS({ return false; } } else { - assert2(typeof request3 === "string"); + assert3(typeof request3 === "string"); r = new Request(request3)[kState]; } const operations = []; @@ -15257,7 +15257,7 @@ var require_cache = __commonJS({ } for (const requestResponse of requestResponses) { const idx = cache2.indexOf(requestResponse); - assert2(idx !== -1); + assert3(idx !== -1); cache2.splice(idx, 1); } } else if (operation.type === "put") { @@ -15289,7 +15289,7 @@ var require_cache = __commonJS({ requestResponses = __privateMethod(this, _Cache_instances, queryCache_fn).call(this, operation.request); for (const requestResponse of requestResponses) { const idx = cache2.indexOf(requestResponse); - assert2(idx !== -1); + assert3(idx !== -1); cache2.splice(idx, 1); } cache2.push([operation.request, operation.response]); @@ -15572,9 +15572,9 @@ var require_util6 = __commonJS({ throw new Error("Invalid cookie domain"); } } - function toIMFDate(date) { - if (typeof date === "number") { - date = new Date(date); + function toIMFDate(date3) { + if (typeof date3 === "number") { + date3 = new Date(date3); } const days = [ "Sun", @@ -15599,13 +15599,13 @@ var require_util6 = __commonJS({ "Nov", "Dec" ]; - const dayName = days[date.getUTCDay()]; - const day = date.getUTCDate().toString().padStart(2, "0"); - const month = months[date.getUTCMonth()]; - const year = date.getUTCFullYear(); - const hour = date.getUTCHours().toString().padStart(2, "0"); - const minute = date.getUTCMinutes().toString().padStart(2, "0"); - const second = date.getUTCSeconds().toString().padStart(2, "0"); + const dayName = days[date3.getUTCDay()]; + const day = date3.getUTCDate().toString().padStart(2, "0"); + const month = months[date3.getUTCMonth()]; + const year = date3.getUTCFullYear(); + const hour = date3.getUTCHours().toString().padStart(2, "0"); + const minute = date3.getUTCMinutes().toString().padStart(2, "0"); + const second = date3.getUTCSeconds().toString().padStart(2, "0"); return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`; } function validateCookieMaxAge(maxAge) { @@ -15679,7 +15679,7 @@ var require_parse = __commonJS({ var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4(); var { isCTLExcludingHtab } = require_util6(); var { collectASequenceOfCodePointsFast } = require_dataURL(); - var assert2 = require("assert"); + var assert3 = require("assert"); function parseSetCookie(header) { if (isCTLExcludingHtab(header)) { return null; @@ -15721,7 +15721,7 @@ var require_parse = __commonJS({ if (unparsedAttributes.length === 0) { return cookieAttributeList; } - assert2(unparsedAttributes[0] === ";"); + assert3(unparsedAttributes[0] === ";"); unparsedAttributes = unparsedAttributes.slice(1); let cookieAv = ""; if (unparsedAttributes.includes(";")) { @@ -17214,7 +17214,7 @@ var require_undici = __commonJS({ var Pool = require_pool(); var BalancedPool = require_balanced_pool(); var Agent3 = require_agent(); - var util4 = require_util(); + var util3 = require_util(); var { InvalidArgumentError } = errors; var api = require_api(); var buildConnector = require_connect(); @@ -17268,12 +17268,12 @@ var require_undici = __commonJS({ if (!opts.path.startsWith("/")) { path4 = `/${path4}`; } - url2 = new URL(util4.parseOrigin(url2).origin + path4); + url2 = new URL(util3.parseOrigin(url2).origin + path4); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; } - url2 = util4.parseURL(url2); + url2 = util3.parseURL(url2); } const { agent, dispatcher = getGlobalDispatcher() } = opts; if (agent) { @@ -17289,7 +17289,7 @@ var require_undici = __commonJS({ } module2.exports.setGlobalDispatcher = setGlobalDispatcher; module2.exports.getGlobalDispatcher = getGlobalDispatcher; - if (util4.nodeMajor > 16 || util4.nodeMajor === 16 && util4.nodeMinor >= 8) { + if (util3.nodeMajor > 16 || util3.nodeMajor === 16 && util3.nodeMinor >= 8) { let fetchImpl = null; module2.exports.fetch = async function fetch(resource) { if (!fetchImpl) { @@ -17317,7 +17317,7 @@ var require_undici = __commonJS({ const { kConstruct } = require_symbols4(); module2.exports.caches = new CacheStorage(kConstruct); } - if (util4.nodeMajor >= 16) { + if (util3.nodeMajor >= 16) { const { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies(); module2.exports.deleteCookie = deleteCookie; module2.exports.getCookies = getCookies; @@ -17327,7 +17327,7 @@ var require_undici = __commonJS({ module2.exports.parseMIMEType = parseMIMEType; module2.exports.serializeAMimeType = serializeAMimeType; } - if (util4.nodeMajor >= 18 && hasCrypto) { + if (util3.nodeMajor >= 18 && hasCrypto) { const { WebSocket } = require_websocket(); module2.exports.WebSocket = WebSocket; } @@ -17738,7 +17738,7 @@ var require_lib = __commonJS({ info5.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } let callbackCalled = false; - function handleResult2(err, res) { + function handleResult(err, res) { if (!callbackCalled) { callbackCalled = true; onResult(err, res); @@ -17746,7 +17746,7 @@ var require_lib = __commonJS({ } const req = info5.httpModule.request(info5.options, (msg) => { const res = new HttpClientResponse(msg); - handleResult2(void 0, res); + handleResult(void 0, res); }); let socket; req.on("socket", (sock) => { @@ -17756,10 +17756,10 @@ var require_lib = __commonJS({ if (socket) { socket.end(); } - handleResult2(new Error(`Request timeout: ${info5.options.path}`)); + handleResult(new Error(`Request timeout: ${info5.options.path}`)); }); req.on("error", function(err) { - handleResult2(err); + handleResult(err); }); if (data && typeof data === "string") { req.write(data, "utf8"); @@ -17820,12 +17820,12 @@ var require_lib = __commonJS({ } return lowercaseKeys(headers || {}); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - return additionalHeaders[header] || clientHeader || _default; + return additionalHeaders[header] || clientHeader || _default2; } _getAgent(parsedUrl) { let agent; @@ -19585,7 +19585,7 @@ var require_platform = __commonJS({ var os_1 = __importDefault(require("os")); var exec2 = __importStar(require_exec()); var getWindowsInfo = () => __awaiter6(void 0, void 0, void 0, function* () { - const { stdout: version2 } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version3 } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { @@ -19593,7 +19593,7 @@ var require_platform = __commonJS({ }); return { name: name.trim(), - version: version2.trim() + version: version3.trim() }; }); var getMacOsInfo = () => __awaiter6(void 0, void 0, void 0, function* () { @@ -19601,21 +19601,21 @@ var require_platform = __commonJS({ const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { silent: true }); - const version2 = (_b2 = (_a3 = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a3 === void 0 ? void 0 : _a3[1]) !== null && _b2 !== void 0 ? _b2 : ""; + const version3 = (_b2 = (_a3 = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a3 === void 0 ? void 0 : _a3[1]) !== null && _b2 !== void 0 ? _b2 : ""; const name = (_d2 = (_c2 = stdout.match(/ProductName:\s*(.+)/)) === null || _c2 === void 0 ? void 0 : _c2[1]) !== null && _d2 !== void 0 ? _d2 : ""; return { name, - version: version2 + version: version3 }; }); var getLinuxInfo = () => __awaiter6(void 0, void 0, void 0, function* () { const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); - const [name, version2] = stdout.trim().split("\n"); + const [name, version3] = stdout.trim().split("\n"); return { name, - version: version2 + version: version3 }; }); exports2.platform = os_1.default.platform(); @@ -20005,74 +20005,74 @@ var require_semver = __commonJS({ } } var i; - exports2.parse = parse3; - function parse3(version2, options2) { + exports2.parse = parse4; + function parse4(version3, options2) { if (!options2 || typeof options2 !== "object") { options2 = { loose: !!options2, includePrerelease: false }; } - if (version2 instanceof SemVer) { - return version2; + if (version3 instanceof SemVer) { + return version3; } - if (typeof version2 !== "string") { + if (typeof version3 !== "string") { return null; } - if (version2.length > MAX_LENGTH) { + if (version3.length > MAX_LENGTH) { return null; } var r = options2.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; - if (!r.test(version2)) { + if (!r.test(version3)) { return null; } try { - return new SemVer(version2, options2); + return new SemVer(version3, options2); } catch (er) { return null; } } exports2.valid = valid; - function valid(version2, options2) { - var v = parse3(version2, options2); + function valid(version3, options2) { + var v = parse4(version3, options2); return v ? v.version : null; } exports2.clean = clean; - function clean(version2, options2) { - var s = parse3(version2.trim().replace(/^[=v]+/, ""), options2); + function clean(version3, options2) { + var s = parse4(version3.trim().replace(/^[=v]+/, ""), options2); return s ? s.version : null; } exports2.SemVer = SemVer; - function SemVer(version2, options2) { + function SemVer(version3, options2) { if (!options2 || typeof options2 !== "object") { options2 = { loose: !!options2, includePrerelease: false }; } - if (version2 instanceof SemVer) { - if (version2.loose === options2.loose) { - return version2; + if (version3 instanceof SemVer) { + if (version3.loose === options2.loose) { + return version3; } else { - version2 = version2.version; + version3 = version3.version; } - } else if (typeof version2 !== "string") { - throw new TypeError("Invalid Version: " + version2); + } else if (typeof version3 !== "string") { + throw new TypeError("Invalid Version: " + version3); } - if (version2.length > MAX_LENGTH) { + if (version3.length > MAX_LENGTH) { throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); } if (!(this instanceof SemVer)) { - return new SemVer(version2, options2); + return new SemVer(version3, options2); } - debug6("SemVer", version2, options2); + debug6("SemVer", version3, options2); this.options = options2; this.loose = !!options2.loose; - var m = version2.trim().match(options2.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); + var m = version3.trim().match(options2.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); if (!m) { - throw new TypeError("Invalid Version: " + version2); + throw new TypeError("Invalid Version: " + version3); } - this.raw = version2; + this.raw = version3; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; @@ -20259,24 +20259,24 @@ var require_semver = __commonJS({ return this; }; exports2.inc = inc; - function inc(version2, release2, loose, identifier) { + function inc(version3, release2, loose, identifier) { if (typeof loose === "string") { identifier = loose; loose = void 0; } try { - return new SemVer(version2, loose).inc(release2, identifier).version; + return new SemVer(version3, loose).inc(release2, identifier).version; } catch (er) { return null; } } exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { + function diff(version1, version22) { + if (eq(version1, version22)) { return null; } else { - var v1 = parse3(version1); - var v2 = parse3(version2); + var v1 = parse4(version1); + var v2 = parse4(version22); var prefix2 = ""; if (v1.prerelease.length || v2.prerelease.length) { prefix2 = "pre"; @@ -20456,19 +20456,19 @@ var require_semver = __commonJS({ Comparator.prototype.toString = function() { return this.value; }; - Comparator.prototype.test = function(version2) { - debug6("Comparator.test", version2, this.options.loose); - if (this.semver === ANY || version2 === ANY) { + Comparator.prototype.test = function(version3) { + debug6("Comparator.test", version3, this.options.loose); + if (this.semver === ANY || version3 === ANY) { return true; } - if (typeof version2 === "string") { + if (typeof version3 === "string") { try { - version2 = new SemVer(version2, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } - return cmp(version2, this.operator, this.semver, this.options); + return cmp(version3, this.operator, this.semver, this.options); }; Comparator.prototype.intersects = function(comp26, options2) { if (!(comp26 instanceof Comparator)) { @@ -20778,31 +20778,31 @@ var require_semver = __commonJS({ } return (from + " " + to).trim(); } - Range.prototype.test = function(version2) { - if (!version2) { + Range.prototype.test = function(version3) { + if (!version3) { return false; } - if (typeof version2 === "string") { + if (typeof version3 === "string") { try { - version2 = new SemVer(version2, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version2, this.options)) { + if (testSet(this.set[i2], version3, this.options)) { return true; } } return false; }; - function testSet(set, version2, options2) { + function testSet(set, version3, options2) { for (var i2 = 0; i2 < set.length; i2++) { - if (!set[i2].test(version2)) { + if (!set[i2].test(version3)) { return false; } } - if (version2.prerelease.length && !options2.includePrerelease) { + if (version3.prerelease.length && !options2.includePrerelease) { for (i2 = 0; i2 < set.length; i2++) { debug6(set[i2].semver); if (set[i2].semver === ANY) { @@ -20810,7 +20810,7 @@ var require_semver = __commonJS({ } if (set[i2].semver.prerelease.length > 0) { var allowed = set[i2].semver; - if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) { + if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) { return true; } } @@ -20820,13 +20820,13 @@ var require_semver = __commonJS({ return true; } exports2.satisfies = satisfies; - function satisfies(version2, range2, options2) { + function satisfies(version3, range2, options2) { try { range2 = new Range(range2, options2); } catch (er) { return false; } - return range2.test(version2); + return range2.test(version3); } exports2.maxSatisfying = maxSatisfying; function maxSatisfying(versions2, range2, options2) { @@ -20920,16 +20920,16 @@ var require_semver = __commonJS({ } } exports2.ltr = ltr; - function ltr(version2, range2, options2) { - return outside(version2, range2, "<", options2); + function ltr(version3, range2, options2) { + return outside(version3, range2, "<", options2); } exports2.gtr = gtr; - function gtr(version2, range2, options2) { - return outside(version2, range2, ">", options2); + function gtr(version3, range2, options2) { + return outside(version3, range2, ">", options2); } exports2.outside = outside; - function outside(version2, range2, hilo, options2) { - version2 = new SemVer(version2, options2); + function outside(version3, range2, hilo, options2) { + version3 = new SemVer(version3, options2); range2 = new Range(range2, options2); var gtfn, ltefn, ltfn, comp26, ecomp; switch (hilo) { @@ -20950,7 +20950,7 @@ var require_semver = __commonJS({ default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (satisfies(version2, range2, options2)) { + if (satisfies(version3, range2, options2)) { return false; } for (var i2 = 0; i2 < range2.set.length; ++i2) { @@ -20972,17 +20972,17 @@ var require_semver = __commonJS({ if (high.operator === comp26 || high.operator === ecomp) { return false; } - if ((!low.operator || low.operator === comp26) && ltefn(version2, low.semver)) { + if ((!low.operator || low.operator === comp26) && ltefn(version3, low.semver)) { return false; - } else if (low.operator === ecomp && ltfn(version2, low.semver)) { + } else if (low.operator === ecomp && ltfn(version3, low.semver)) { return false; } } return true; } exports2.prerelease = prerelease; - function prerelease(version2, options2) { - var parsed = parse3(version2, options2); + function prerelease(version3, options2) { + var parsed = parse4(version3, options2); return parsed && parsed.prerelease.length ? parsed.prerelease : null; } exports2.intersects = intersects; @@ -20992,23 +20992,23 @@ var require_semver = __commonJS({ return r1.intersects(r2); } exports2.coerce = coerce; - function coerce(version2, options2) { - if (version2 instanceof SemVer) { - return version2; + function coerce(version3, options2) { + if (version3 instanceof SemVer) { + return version3; } - if (typeof version2 === "number") { - version2 = String(version2); + if (typeof version3 === "number") { + version3 = String(version3); } - if (typeof version2 !== "string") { + if (typeof version3 !== "string") { return null; } options2 = options2 || {}; var match = null; if (!options2.rtl) { - match = version2.match(safeRe[t.COERCE]); + match = version3.match(safeRe[t.COERCE]); } else { var next; - while ((next = safeRe[t.COERCERTL].exec(version2)) && (!match || match.index + match[0].length !== version2.length)) { + while ((next = safeRe[t.COERCERTL].exec(version3)) && (!match || match.index + match[0].length !== version3.length)) { if (!match || next.index + next[0].length !== match.index + match[0].length) { match = next; } @@ -21019,7 +21019,7 @@ var require_semver = __commonJS({ if (match === null) { return null; } - return parse3(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options2); + return parse4(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options2); } } }); @@ -21096,9 +21096,9 @@ var require_manifest = __commonJS({ let match; let file; for (const candidate of candidates) { - const version2 = candidate.version; - (0, core_1.debug)(`check ${version2} satisfies ${versionSpec}`); - if (semver.satisfies(version2, versionSpec) && (!stable || candidate.stable === stable)) { + const version3 = candidate.version; + (0, core_1.debug)(`check ${version3} satisfies ${versionSpec}`); + if (semver.satisfies(version3, versionSpec) && (!stable || candidate.stable === stable)) { file = candidate.files.find((item) => { (0, core_1.debug)(`${item.arch}===${archFilter} && ${item.platform}===${platFilter}`); let chk = item.arch === archFilter && item.platform === platFilter; @@ -21129,9 +21129,9 @@ var require_manifest = __commonJS({ exports2._findMatch = _findMatch; function _getOsVersion() { const plat = os7.platform(); - let version2 = ""; + let version3 = ""; if (plat === "darwin") { - version2 = cp.execSync("sw_vers -productVersion").toString(); + version3 = cp.execSync("sw_vers -productVersion").toString(); } else if (plat === "linux") { const lsbContents = module2.exports._readLinuxVersionFile(); if (lsbContents) { @@ -21139,13 +21139,13 @@ var require_manifest = __commonJS({ for (const line of lines) { const parts = line.split("="); if (parts.length === 2 && (parts[0].trim() === "VERSION_ID" || parts[0].trim() === "DISTRIB_RELEASE")) { - version2 = parts[1].trim().replace(/^"/, "").replace(/"$/, ""); + version3 = parts[1].trim().replace(/^"/, "").replace(/"$/, ""); break; } } } } - return version2; + return version3; } exports2._getOsVersion = _getOsVersion; function _readLinuxVersionFile() { @@ -21339,7 +21339,7 @@ var require_tool_cache = __commonJS({ var httpm = __importStar(require_lib()); var semver = __importStar(require_semver()); var stream = __importStar(require("stream")); - var util4 = __importStar(require("util")); + var util3 = __importStar(require("util")); var assert_1 = require("assert"); var exec_1 = require_exec(); var retry_helper_1 = require_retry_helper(); @@ -21398,7 +21398,7 @@ var require_tool_cache = __commonJS({ core6.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); throw err; } - const pipeline = util4.promisify(stream.pipeline); + const pipeline = util3.promisify(stream.pipeline); const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); const readStream = responseMessageFactory(); let succeeded = false; @@ -21609,39 +21609,39 @@ var require_tool_cache = __commonJS({ yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); }); } - function cacheDir(sourceDir, tool, version2, arch2) { + function cacheDir(sourceDir, tool, version3, arch2) { return __awaiter6(this, void 0, void 0, function* () { - version2 = semver.clean(version2) || version2; + version3 = semver.clean(version3) || version3; arch2 = arch2 || os7.arch(); - core6.debug(`Caching tool ${tool} ${version2} ${arch2}`); + core6.debug(`Caching tool ${tool} ${version3} ${arch2}`); core6.debug(`source dir: ${sourceDir}`); if (!fs4.statSync(sourceDir).isDirectory()) { throw new Error("sourceDir is not a directory"); } - const destPath = yield _createToolPath(tool, version2, arch2); + const destPath = yield _createToolPath(tool, version3, arch2); for (const itemName of fs4.readdirSync(sourceDir)) { const s = path4.join(sourceDir, itemName); yield io.cp(s, destPath, { recursive: true }); } - _completeToolPath(tool, version2, arch2); + _completeToolPath(tool, version3, arch2); return destPath; }); } exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version2, arch2) { + function cacheFile(sourceFile, targetFile, tool, version3, arch2) { return __awaiter6(this, void 0, void 0, function* () { - version2 = semver.clean(version2) || version2; + version3 = semver.clean(version3) || version3; arch2 = arch2 || os7.arch(); - core6.debug(`Caching tool ${tool} ${version2} ${arch2}`); + core6.debug(`Caching tool ${tool} ${version3} ${arch2}`); core6.debug(`source file: ${sourceFile}`); if (!fs4.statSync(sourceFile).isFile()) { throw new Error("sourceFile is not a file"); } - const destFolder = yield _createToolPath(tool, version2, arch2); + const destFolder = yield _createToolPath(tool, version3, arch2); const destPath = path4.join(destFolder, targetFile); core6.debug(`destination file ${destPath}`); yield io.cp(sourceFile, destPath); - _completeToolPath(tool, version2, arch2); + _completeToolPath(tool, version3, arch2); return destFolder; }); } @@ -21743,9 +21743,9 @@ var require_tool_cache = __commonJS({ return dest; }); } - function _createToolPath(tool, version2, arch2) { + function _createToolPath(tool, version3, arch2) { return __awaiter6(this, void 0, void 0, function* () { - const folderPath = path4.join(_getCacheDirectory(), tool, semver.clean(version2) || version2, arch2 || ""); + const folderPath = path4.join(_getCacheDirectory(), tool, semver.clean(version3) || version3, arch2 || ""); core6.debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield io.rmRF(folderPath); @@ -21754,8 +21754,8 @@ var require_tool_cache = __commonJS({ return folderPath; }); } - function _completeToolPath(tool, version2, arch2) { - const folderPath = path4.join(_getCacheDirectory(), tool, semver.clean(version2) || version2, arch2 || ""); + function _completeToolPath(tool, version3, arch2) { + const folderPath = path4.join(_getCacheDirectory(), tool, semver.clean(version3) || version3, arch2 || ""); const markerPath = `${folderPath}.complete`; fs4.writeFileSync(markerPath, ""); core6.debug("finished caching tool"); @@ -21769,7 +21769,7 @@ var require_tool_cache = __commonJS({ } exports2.isExplicitVersion = isExplicitVersion; function evaluateVersions(versions2, versionSpec) { - let version2 = ""; + let version3 = ""; core6.debug(`evaluating ${versions2.length} versions`); versions2 = versions2.sort((a, b) => { if (semver.gt(a, b)) { @@ -21781,16 +21781,16 @@ var require_tool_cache = __commonJS({ const potential = versions2[i]; const satisfied = semver.satisfies(potential, versionSpec); if (satisfied) { - version2 = potential; + version3 = potential; break; } } - if (version2) { - core6.debug(`matched: ${version2}`); + if (version3) { + core6.debug(`matched: ${version3}`); } else { core6.debug("match not found"); } - return version2; + return version3; } exports2.evaluateVersions = evaluateVersions; function _getCacheDirectory() { @@ -22067,7 +22067,7 @@ var require_utils3 = __commonJS({ "node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/utils.js"(exports2) { "use strict"; exports2.__esModule = true; - exports2.extend = extend2; + exports2.extend = extend3; exports2.indexOf = indexOf; exports2.escapeExpression = escapeExpression; exports2.isEmpty = isEmpty; @@ -22088,7 +22088,7 @@ var require_utils3 = __commonJS({ function escapeChar(chr) { return escape2[chr]; } - function extend2(obj) { + function extend3(obj) { for (var i = 1; i < arguments.length; i++) { for (var key in arguments[i]) { if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { @@ -22113,29 +22113,29 @@ var require_utils3 = __commonJS({ return value && typeof value === "object" ? toString3.call(value) === "[object Array]" : false; }; exports2.isArray = isArray; - function indexOf(array, value) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { + function indexOf(array2, value) { + for (var i = 0, len = array2.length; i < len; i++) { + if (array2[i] === value) { return i; } } return -1; } - function escapeExpression(string) { - if (typeof string !== "string") { - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { + function escapeExpression(string3) { + if (typeof string3 !== "string") { + if (string3 && string3.toHTML) { + return string3.toHTML(); + } else if (string3 == null) { return ""; - } else if (!string) { - return string + ""; + } else if (!string3) { + return string3 + ""; } - string = "" + string; + string3 = "" + string3; } - if (!possible.test(string)) { - return string; + if (!possible.test(string3)) { + return string3; } - return string.replace(badChars, escapeChar); + return string3.replace(badChars, escapeChar); } function isEmpty(value) { if (!value && value !== 0) { @@ -22147,7 +22147,7 @@ var require_utils3 = __commonJS({ } } function createFrame(object) { - var frame = extend2({}, object); + var frame = extend3({}, object); frame._parent = object; return frame; } @@ -22719,7 +22719,7 @@ var require_base = __commonJS({ 8: ">= 4.3.0" }; exports2.REVISION_CHANGES = REVISION_CHANGES; - var objectType2 = "[object Object]"; + var objectType = "[object Object]"; function HandlebarsEnvironment(helpers, partials, decorators) { this.helpers = helpers || {}; this.partials = partials || {}; @@ -22732,7 +22732,7 @@ var require_base = __commonJS({ logger: _logger2["default"], log: _logger2["default"].log, registerHelper: function registerHelper(name, fn) { - if (_utils.toString.call(name) === objectType2) { + if (_utils.toString.call(name) === objectType) { if (fn) { throw new _exception2["default"]("Arg not supported with multiple helpers"); } @@ -22744,21 +22744,21 @@ var require_base = __commonJS({ unregisterHelper: function unregisterHelper(name) { delete this.helpers[name]; }, - registerPartial: function registerPartial(name, partial) { - if (_utils.toString.call(name) === objectType2) { + registerPartial: function registerPartial(name, partial2) { + if (_utils.toString.call(name) === objectType) { _utils.extend(this.partials, name); } else { - if (typeof partial === "undefined") { + if (typeof partial2 === "undefined") { throw new _exception2["default"]('Attempting to register a partial called "' + name + '" as undefined'); } - this.partials[name] = partial; + this.partials[name] = partial2; } }, unregisterPartial: function unregisterPartial(name) { delete this.partials[name]; }, registerDecorator: function registerDecorator(name, fn) { - if (_utils.toString.call(name) === objectType2) { + if (_utils.toString.call(name) === objectType) { if (fn) { throw new _exception2["default"]("Arg not supported with multiple decorators"); } @@ -22790,8 +22790,8 @@ var require_safe_string = __commonJS({ "node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(exports2, module2) { "use strict"; exports2.__esModule = true; - function SafeString(string) { - this.string = string; + function SafeString(string3) { + this.string = string3; } SafeString.prototype.toString = SafeString.prototype.toHTML = function() { return "" + this.string; @@ -22879,21 +22879,21 @@ var require_runtime = __commonJS({ templateSpec.main.decorator = templateSpec.main_d; env.VM.checkRevision(templateSpec.compiler); var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7; - function invokePartialWrapper(partial, context, options2) { + function invokePartialWrapper(partial2, context, options2) { if (options2.hash) { context = Utils.extend({}, context, options2.hash); if (options2.ids) { options2.ids[0] = true; } } - partial = env.VM.resolvePartial.call(this, partial, context, options2); + partial2 = env.VM.resolvePartial.call(this, partial2, context, options2); var extendedOptions = Utils.extend({}, options2, { hooks: this.hooks, protoAccessControl: this.protoAccessControl }); - var result = env.VM.invokePartial.call(this, partial, context, extendedOptions); + var result = env.VM.invokePartial.call(this, partial2, context, extendedOptions); if (result == null && env.compile) { - options2.partials[options2.name] = env.compile(partial, templateSpec.compilerOptions, env); + options2.partials[options2.name] = env.compile(partial2, templateSpec.compilerOptions, env); result = options2.partials[options2.name](context, extendedOptions); } if (result != null) { @@ -23053,20 +23053,20 @@ var require_runtime = __commonJS({ prog.blockParams = declaredBlockParams || 0; return prog; } - function resolvePartial(partial, context, options2) { - if (!partial) { + function resolvePartial(partial2, context, options2) { + if (!partial2) { if (options2.name === "@partial-block") { - partial = options2.data["partial-block"]; + partial2 = options2.data["partial-block"]; } else { - partial = options2.partials[options2.name]; + partial2 = options2.partials[options2.name]; } - } else if (!partial.call && !options2.name) { - options2.name = partial; - partial = options2.partials[partial]; + } else if (!partial2.call && !options2.name) { + options2.name = partial2; + partial2 = options2.partials[partial2]; } - return partial; + return partial2; } - function invokePartial(partial, context, options2) { + function invokePartial(partial2, context, options2) { var currentPartialBlock = options2.data && options2.data["partial-block"]; options2.partial = true; if (options2.ids) { @@ -23088,13 +23088,13 @@ var require_runtime = __commonJS({ } })(); } - if (partial === void 0 && partialBlock) { - partial = partialBlock; + if (partial2 === void 0 && partialBlock) { + partial2 = partialBlock; } - if (partial === void 0) { + if (partial2 === void 0) { throw new _exception2["default"]("The partial " + options2.name + " could not be found"); - } else if (partial instanceof Function) { - return partial(context, options2); + } else if (partial2 instanceof Function) { + return partial2(context, options2); } } function noop() { @@ -23504,7 +23504,7 @@ var require_parser = __commonJS({ parseError: function parseError(str, hash) { throw new Error(str); }, - parse: function parse3(input) { + parse: function parse4(input) { var self2 = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; this.lexer.setInput(input); this.lexer.yy = this.yy; @@ -23987,11 +23987,11 @@ var require_visitor = __commonJS({ }, // Traverses a given array. If mutating, empty respnses will be removed // for child elements. - acceptArray: function acceptArray(array) { - for (var i = 0, l = array.length; i < l; i++) { - this.acceptKey(array, i); - if (!array[i]) { - array.splice(i, 1); + acceptArray: function acceptArray(array2) { + for (var i = 0, l = array2.length; i < l; i++) { + this.acceptKey(array2, i); + if (!array2[i]) { + array2.splice(i, 1); i--; l--; } @@ -24024,9 +24024,9 @@ var require_visitor = __commonJS({ BlockStatement: visitBlock, DecoratorBlock: visitBlock, PartialStatement: visitPartial, - PartialBlockStatement: function PartialBlockStatement(partial) { - visitPartial.call(this, partial); - this.acceptKey(partial, "program"); + PartialBlockStatement: function PartialBlockStatement(partial2) { + visitPartial.call(this, partial2); + this.acceptKey(partial2, "program"); }, ContentStatement: function ContentStatement() { }, @@ -24062,10 +24062,10 @@ var require_visitor = __commonJS({ this.acceptKey(block, "program"); this.acceptKey(block, "inverse"); } - function visitPartial(partial) { - this.acceptRequired(partial, "name"); - this.acceptArray(partial.params); - this.acceptKey(partial, "hash"); + function visitPartial(partial2) { + this.acceptRequired(partial2, "name"); + this.acceptArray(partial2.params); + this.acceptKey(partial2, "hash"); } exports2["default"] = Visitor; module2.exports = exports2["default"]; @@ -24417,7 +24417,7 @@ var require_base2 = __commonJS({ "use strict"; exports2.__esModule = true; exports2.parseWithoutProcessing = parseWithoutProcessing; - exports2.parse = parse3; + exports2.parse = parse4; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; @@ -24456,7 +24456,7 @@ var require_base2 = __commonJS({ var ast = _parser2["default"].parse(input); return ast; } - function parse3(input, options2) { + function parse4(input, options2) { var ast = parseWithoutProcessing(input, options2); var strip = new _whitespaceControl2["default"](options2); return strip.accept(ast); @@ -24526,11 +24526,11 @@ var require_compiler = __commonJS({ return this.accept(program); }, compileProgram: function compileProgram(program) { - var childCompiler = new this.compiler(), result = childCompiler.compile(program, this.options), guid = this.guid++; + var childCompiler = new this.compiler(), result = childCompiler.compile(program, this.options), guid2 = this.guid++; this.usePartial = this.usePartial || result.usePartial; - this.children[guid] = result; + this.children[guid2] = result; this.useDepths = this.useDepths || result.useDepths; - return guid; + return guid2; }, accept: function accept3(node) { if (!this[node.type]) { @@ -24581,15 +24581,15 @@ var require_compiler = __commonJS({ this.useDecorators = true; this.opcode("registerDecorator", params.length, path4.original); }, - PartialStatement: function PartialStatement(partial) { + PartialStatement: function PartialStatement(partial2) { this.usePartial = true; - var program = partial.program; + var program = partial2.program; if (program) { - program = this.compileProgram(partial.program); + program = this.compileProgram(partial2.program); } - var params = partial.params; + var params = partial2.params; if (params.length > 1) { - throw new _exception2["default"]("Unsupported number of partial arguments: " + params.length, partial); + throw new _exception2["default"]("Unsupported number of partial arguments: " + params.length, partial2); } else if (!params.length) { if (this.options.explicitPartialContext) { this.opcode("pushLiteral", "undefined"); @@ -24597,12 +24597,12 @@ var require_compiler = __commonJS({ params.push({ type: "PathExpression", parts: [], depth: 0 }); } } - var partialName = partial.name.original, isDynamic = partial.name.type === "SubExpression"; + var partialName = partial2.name.original, isDynamic = partial2.name.type === "SubExpression"; if (isDynamic) { - this.accept(partial.name); + this.accept(partial2.name); } - this.setupFullMustacheParams(partial, program, void 0, true); - var indent = partial.indent || ""; + this.setupFullMustacheParams(partial2, program, void 0, true); + var indent = partial2.indent || ""; if (this.options.preventIndent && indent) { this.opcode("appendContent", indent); indent = ""; @@ -24685,11 +24685,11 @@ var require_compiler = __commonJS({ this.opcode("lookupOnContext", path4.parts, path4.falsy, path4.strict, scoped); } }, - StringLiteral: function StringLiteral(string) { - this.opcode("pushString", string.value); + StringLiteral: function StringLiteral(string3) { + this.opcode("pushString", string3.value); }, - NumberLiteral: function NumberLiteral(number) { - this.opcode("pushLiteral", number.value); + NumberLiteral: function NumberLiteral(number2) { + this.opcode("pushLiteral", number2.value); }, BooleanLiteral: function BooleanLiteral(bool) { this.opcode("pushLiteral", bool.value); @@ -24872,14 +24872,14 @@ var require_compiler = __commonJS({ } function transformLiteralToPath(sexpr) { if (!sexpr.path.parts) { - var literal = sexpr.path; + var literal2 = sexpr.path; sexpr.path = { type: "PathExpression", data: false, depth: 0, - parts: [literal.original + ""], - original: literal.original + "", - loc: literal.loc + parts: [literal2.original + ""], + original: literal2.original + "", + loc: literal2.loc }; } } @@ -24891,11 +24891,11 @@ var require_base64 = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js"(exports2) { "use strict"; var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); - exports2.encode = function(number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; + exports2.encode = function(number2) { + if (0 <= number2 && number2 < intToCharMap.length) { + return intToCharMap[number2]; } - throw new TypeError("Must be between 0 and 63: " + number); + throw new TypeError("Must be between 0 and 63: " + number2); }; exports2.decode = function(charCode) { var bigA = 65; @@ -24932,7 +24932,7 @@ var require_base64 = __commonJS({ var require_base64_vlq = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(exports2) { "use strict"; - var base64 = require_base64(); + var base642 = require_base64(); var VLQ_BASE_SHIFT = 5; var VLQ_BASE = 1 << VLQ_BASE_SHIFT; var VLQ_BASE_MASK = VLQ_BASE - 1; @@ -24955,7 +24955,7 @@ var require_base64_vlq = __commonJS({ if (vlq > 0) { digit |= VLQ_CONTINUATION_BIT; } - encoded += base64.encode(digit); + encoded += base642.encode(digit); } while (vlq > 0); return encoded; }; @@ -24968,7 +24968,7 @@ var require_base64_vlq = __commonJS({ if (aIndex >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); } - digit = base64.decode(aStr.charCodeAt(aIndex++)); + digit = base642.decode(aStr.charCodeAt(aIndex++)); if (digit === -1) { throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); } @@ -25289,7 +25289,7 @@ var require_util8 = __commonJS({ var require_array_set = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js"(exports2) { "use strict"; - var util4 = require_util8(); + var util3 = require_util8(); var has = Object.prototype.hasOwnProperty; var hasNativeMap = typeof Map !== "undefined"; function ArraySet() { @@ -25307,7 +25307,7 @@ var require_array_set = __commonJS({ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; }; ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util4.toSetString(aStr); + var sStr = hasNativeMap ? aStr : util3.toSetString(aStr); var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { @@ -25325,7 +25325,7 @@ var require_array_set = __commonJS({ if (hasNativeMap) { return this._set.has(aStr); } else { - var sStr = util4.toSetString(aStr); + var sStr = util3.toSetString(aStr); return has.call(this._set, sStr); } }; @@ -25336,7 +25336,7 @@ var require_array_set = __commonJS({ return idx; } } else { - var sStr = util4.toSetString(aStr); + var sStr = util3.toSetString(aStr); if (has.call(this._set, sStr)) { return this._set[sStr]; } @@ -25360,13 +25360,13 @@ var require_array_set = __commonJS({ var require_mapping_list = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js"(exports2) { "use strict"; - var util4 = require_util8(); + var util3 = require_util8(); function generatedPositionAfter(mappingA, mappingB) { var lineA = mappingA.generatedLine; var lineB = mappingB.generatedLine; var columnA = mappingA.generatedColumn; var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || util4.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + return lineB > lineA || lineB == lineA && columnB >= columnA || util3.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; } function MappingList() { this._array = []; @@ -25387,7 +25387,7 @@ var require_mapping_list = __commonJS({ }; MappingList.prototype.toArray = function MappingList_toArray() { if (!this._sorted) { - this._array.sort(util4.compareByGeneratedPositionsInflated); + this._array.sort(util3.compareByGeneratedPositionsInflated); this._sorted = true; } return this._array; @@ -25401,16 +25401,16 @@ var require_source_map_generator = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js"(exports2) { "use strict"; var base64VLQ = require_base64_vlq(); - var util4 = require_util8(); + var util3 = require_util8(); var ArraySet = require_array_set().ArraySet; var MappingList = require_mapping_list().MappingList; function SourceMapGenerator(aArgs) { if (!aArgs) { aArgs = {}; } - this._file = util4.getArg(aArgs, "file", null); - this._sourceRoot = util4.getArg(aArgs, "sourceRoot", null); - this._skipValidation = util4.getArg(aArgs, "skipValidation", false); + this._file = util3.getArg(aArgs, "file", null); + this._sourceRoot = util3.getArg(aArgs, "sourceRoot", null); + this._skipValidation = util3.getArg(aArgs, "skipValidation", false); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = new MappingList(); @@ -25433,7 +25433,7 @@ var require_source_map_generator = __commonJS({ if (mapping.source != null) { newMapping.source = mapping.source; if (sourceRoot != null) { - newMapping.source = util4.relative(sourceRoot, newMapping.source); + newMapping.source = util3.relative(sourceRoot, newMapping.source); } newMapping.original = { line: mapping.originalLine, @@ -25448,7 +25448,7 @@ var require_source_map_generator = __commonJS({ aSourceMapConsumer.sources.forEach(function(sourceFile) { var sourceRelative = sourceFile; if (sourceRoot !== null) { - sourceRelative = util4.relative(sourceRoot, sourceFile); + sourceRelative = util3.relative(sourceRoot, sourceFile); } if (!generator._sources.has(sourceRelative)) { generator._sources.add(sourceRelative); @@ -25461,10 +25461,10 @@ var require_source_map_generator = __commonJS({ return generator; }; SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { - var generated = util4.getArg(aArgs, "generated"); - var original = util4.getArg(aArgs, "original", null); - var source = util4.getArg(aArgs, "source", null); - var name = util4.getArg(aArgs, "name", null); + var generated = util3.getArg(aArgs, "generated"); + var original = util3.getArg(aArgs, "original", null); + var source = util3.getArg(aArgs, "source", null); + var name = util3.getArg(aArgs, "name", null); if (!this._skipValidation) { this._validateMapping(generated, original, source, name); } @@ -25492,15 +25492,15 @@ var require_source_map_generator = __commonJS({ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { var source = aSourceFile; if (this._sourceRoot != null) { - source = util4.relative(this._sourceRoot, source); + source = util3.relative(this._sourceRoot, source); } if (aSourceContent != null) { if (!this._sourcesContents) { this._sourcesContents = /* @__PURE__ */ Object.create(null); } - this._sourcesContents[util4.toSetString(source)] = aSourceContent; + this._sourcesContents[util3.toSetString(source)] = aSourceContent; } else if (this._sourcesContents) { - delete this._sourcesContents[util4.toSetString(source)]; + delete this._sourcesContents[util3.toSetString(source)]; if (Object.keys(this._sourcesContents).length === 0) { this._sourcesContents = null; } @@ -25518,7 +25518,7 @@ var require_source_map_generator = __commonJS({ } var sourceRoot = this._sourceRoot; if (sourceRoot != null) { - sourceFile = util4.relative(sourceRoot, sourceFile); + sourceFile = util3.relative(sourceRoot, sourceFile); } var newSources = new ArraySet(); var newNames = new ArraySet(); @@ -25531,10 +25531,10 @@ var require_source_map_generator = __commonJS({ if (original.source != null) { mapping.source = original.source; if (aSourceMapPath != null) { - mapping.source = util4.join(aSourceMapPath, mapping.source); + mapping.source = util3.join(aSourceMapPath, mapping.source); } if (sourceRoot != null) { - mapping.source = util4.relative(sourceRoot, mapping.source); + mapping.source = util3.relative(sourceRoot, mapping.source); } mapping.originalLine = original.line; mapping.originalColumn = original.column; @@ -25558,10 +25558,10 @@ var require_source_map_generator = __commonJS({ var content = aSourceMapConsumer.sourceContentFor(sourceFile2); if (content != null) { if (aSourceMapPath != null) { - sourceFile2 = util4.join(aSourceMapPath, sourceFile2); + sourceFile2 = util3.join(aSourceMapPath, sourceFile2); } if (sourceRoot != null) { - sourceFile2 = util4.relative(sourceRoot, sourceFile2); + sourceFile2 = util3.relative(sourceRoot, sourceFile2); } this.setSourceContent(sourceFile2, content); } @@ -25610,7 +25610,7 @@ var require_source_map_generator = __commonJS({ } } else { if (i > 0) { - if (!util4.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + if (!util3.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { continue; } next += ","; @@ -25642,9 +25642,9 @@ var require_source_map_generator = __commonJS({ return null; } if (aSourceRoot != null) { - source = util4.relative(aSourceRoot, source); + source = util3.relative(aSourceRoot, source); } - var key = util4.toSetString(source); + var key = util3.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); }; @@ -25770,7 +25770,7 @@ var require_quick_sort = __commonJS({ var require_source_map_consumer = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js"(exports2) { "use strict"; - var util4 = require_util8(); + var util3 = require_util8(); var binarySearch = require_binary_search(); var ArraySet = require_array_set().ArraySet; var base64VLQ = require_base64_vlq(); @@ -25778,7 +25778,7 @@ var require_source_map_consumer = __commonJS({ function SourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { - sourceMap = util4.parseSourceMapInput(aSourceMap); + sourceMap = util3.parseSourceMapInput(aSourceMap); } return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); } @@ -25836,7 +25836,7 @@ var require_source_map_consumer = __commonJS({ var sourceRoot = this.sourceRoot; mappings.map(function(mapping) { var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util4.computeSourceURL(sourceRoot, source, this._sourceMapURL); + source = util3.computeSourceURL(sourceRoot, source, this._sourceMapURL); return { source, generatedLine: mapping.generatedLine, @@ -25848,11 +25848,11 @@ var require_source_map_consumer = __commonJS({ }, this).forEach(aCallback, context); }; SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util4.getArg(aArgs, "line"); + var line = util3.getArg(aArgs, "line"); var needle = { - source: util4.getArg(aArgs, "source"), + source: util3.getArg(aArgs, "source"), originalLine: line, - originalColumn: util4.getArg(aArgs, "column", 0) + originalColumn: util3.getArg(aArgs, "column", 0) }; needle.source = this._findSourceIndex(needle.source); if (needle.source < 0) { @@ -25864,7 +25864,7 @@ var require_source_map_consumer = __commonJS({ this._originalMappings, "originalLine", "originalColumn", - util4.compareByOriginalPositions, + util3.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND ); if (index >= 0) { @@ -25873,9 +25873,9 @@ var require_source_map_consumer = __commonJS({ var originalLine = mapping.originalLine; while (mapping && mapping.originalLine === originalLine) { mappings.push({ - line: util4.getArg(mapping, "generatedLine", null), - column: util4.getArg(mapping, "generatedColumn", null), - lastColumn: util4.getArg(mapping, "lastGeneratedColumn", null) + line: util3.getArg(mapping, "generatedLine", null), + column: util3.getArg(mapping, "generatedColumn", null), + lastColumn: util3.getArg(mapping, "lastGeneratedColumn", null) }); mapping = this._originalMappings[++index]; } @@ -25883,9 +25883,9 @@ var require_source_map_consumer = __commonJS({ var originalColumn = mapping.originalColumn; while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { mappings.push({ - line: util4.getArg(mapping, "generatedLine", null), - column: util4.getArg(mapping, "generatedColumn", null), - lastColumn: util4.getArg(mapping, "lastGeneratedColumn", null) + line: util3.getArg(mapping, "generatedLine", null), + column: util3.getArg(mapping, "generatedColumn", null), + lastColumn: util3.getArg(mapping, "lastGeneratedColumn", null) }); mapping = this._originalMappings[++index]; } @@ -25897,28 +25897,28 @@ var require_source_map_consumer = __commonJS({ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { - sourceMap = util4.parseSourceMapInput(aSourceMap); - } - var version2 = util4.getArg(sourceMap, "version"); - var sources = util4.getArg(sourceMap, "sources"); - var names = util4.getArg(sourceMap, "names", []); - var sourceRoot = util4.getArg(sourceMap, "sourceRoot", null); - var sourcesContent = util4.getArg(sourceMap, "sourcesContent", null); - var mappings = util4.getArg(sourceMap, "mappings"); - var file = util4.getArg(sourceMap, "file", null); - if (version2 != this._version) { - throw new Error("Unsupported version: " + version2); + sourceMap = util3.parseSourceMapInput(aSourceMap); + } + var version3 = util3.getArg(sourceMap, "version"); + var sources = util3.getArg(sourceMap, "sources"); + var names = util3.getArg(sourceMap, "names", []); + var sourceRoot = util3.getArg(sourceMap, "sourceRoot", null); + var sourcesContent = util3.getArg(sourceMap, "sourcesContent", null); + var mappings = util3.getArg(sourceMap, "mappings"); + var file = util3.getArg(sourceMap, "file", null); + if (version3 != this._version) { + throw new Error("Unsupported version: " + version3); } if (sourceRoot) { - sourceRoot = util4.normalize(sourceRoot); + sourceRoot = util3.normalize(sourceRoot); } - sources = sources.map(String).map(util4.normalize).map(function(source) { - return sourceRoot && util4.isAbsolute(sourceRoot) && util4.isAbsolute(source) ? util4.relative(sourceRoot, source) : source; + sources = sources.map(String).map(util3.normalize).map(function(source) { + return sourceRoot && util3.isAbsolute(sourceRoot) && util3.isAbsolute(source) ? util3.relative(sourceRoot, source) : source; }); this._names = ArraySet.fromArray(names.map(String), true); this._sources = ArraySet.fromArray(sources, true); this._absoluteSources = this._sources.toArray().map(function(s) { - return util4.computeSourceURL(sourceRoot, s, aSourceMapURL); + return util3.computeSourceURL(sourceRoot, s, aSourceMapURL); }); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; @@ -25931,7 +25931,7 @@ var require_source_map_consumer = __commonJS({ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { var relativeSource = aSource; if (this.sourceRoot != null) { - relativeSource = util4.relative(this.sourceRoot, relativeSource); + relativeSource = util3.relative(this.sourceRoot, relativeSource); } if (this._sources.has(relativeSource)) { return this._sources.indexOf(relativeSource); @@ -25956,7 +25956,7 @@ var require_source_map_consumer = __commonJS({ smc.file = aSourceMap._file; smc._sourceMapURL = aSourceMapURL; smc._absoluteSources = smc._sources.toArray().map(function(s) { - return util4.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + return util3.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); }); var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; @@ -25977,7 +25977,7 @@ var require_source_map_consumer = __commonJS({ } destGeneratedMappings.push(destMapping); } - quickSort(smc.__originalMappings, util4.compareByOriginalPositions); + quickSort(smc.__originalMappings, util3.compareByOriginalPositions); return smc; }; BasicSourceMapConsumer.prototype._version = 3; @@ -26064,9 +26064,9 @@ var require_source_map_consumer = __commonJS({ } } } - quickSort(generatedMappings, util4.compareByGeneratedPositionsDeflated); + quickSort(generatedMappings, util3.compareByGeneratedPositionsDeflated); this.__generatedMappings = generatedMappings; - quickSort(originalMappings, util4.compareByOriginalPositions); + quickSort(originalMappings, util3.compareByOriginalPositions); this.__originalMappings = originalMappings; }; BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { @@ -26093,33 +26093,33 @@ var require_source_map_consumer = __commonJS({ }; BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { - generatedLine: util4.getArg(aArgs, "line"), - generatedColumn: util4.getArg(aArgs, "column") + generatedLine: util3.getArg(aArgs, "line"), + generatedColumn: util3.getArg(aArgs, "column") }; var index = this._findMapping( needle, this._generatedMappings, "generatedLine", "generatedColumn", - util4.compareByGeneratedPositionsDeflated, - util4.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) + util3.compareByGeneratedPositionsDeflated, + util3.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._generatedMappings[index]; if (mapping.generatedLine === needle.generatedLine) { - var source = util4.getArg(mapping, "source", null); + var source = util3.getArg(mapping, "source", null); if (source !== null) { source = this._sources.at(source); - source = util4.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + source = util3.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); } - var name = util4.getArg(mapping, "name", null); + var name = util3.getArg(mapping, "name", null); if (name !== null) { name = this._names.at(name); } return { source, - line: util4.getArg(mapping, "originalLine", null), - column: util4.getArg(mapping, "originalColumn", null), + line: util3.getArg(mapping, "originalLine", null), + column: util3.getArg(mapping, "originalColumn", null), name }; } @@ -26149,10 +26149,10 @@ var require_source_map_consumer = __commonJS({ } var relativeSource = aSource; if (this.sourceRoot != null) { - relativeSource = util4.relative(this.sourceRoot, relativeSource); + relativeSource = util3.relative(this.sourceRoot, relativeSource); } var url2; - if (this.sourceRoot != null && (url2 = util4.urlParse(this.sourceRoot))) { + if (this.sourceRoot != null && (url2 = util3.urlParse(this.sourceRoot))) { var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); if (url2.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; @@ -26168,7 +26168,7 @@ var require_source_map_consumer = __commonJS({ } }; BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util4.getArg(aArgs, "source"); + var source = util3.getArg(aArgs, "source"); source = this._findSourceIndex(source); if (source < 0) { return { @@ -26179,24 +26179,24 @@ var require_source_map_consumer = __commonJS({ } var needle = { source, - originalLine: util4.getArg(aArgs, "line"), - originalColumn: util4.getArg(aArgs, "column") + originalLine: util3.getArg(aArgs, "line"), + originalColumn: util3.getArg(aArgs, "column") }; var index = this._findMapping( needle, this._originalMappings, "originalLine", "originalColumn", - util4.compareByOriginalPositions, - util4.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) + util3.compareByOriginalPositions, + util3.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._originalMappings[index]; if (mapping.source === needle.source) { return { - line: util4.getArg(mapping, "generatedLine", null), - column: util4.getArg(mapping, "generatedColumn", null), - lastColumn: util4.getArg(mapping, "lastGeneratedColumn", null) + line: util3.getArg(mapping, "generatedLine", null), + column: util3.getArg(mapping, "generatedColumn", null), + lastColumn: util3.getArg(mapping, "lastGeneratedColumn", null) }; } } @@ -26210,12 +26210,12 @@ var require_source_map_consumer = __commonJS({ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { - sourceMap = util4.parseSourceMapInput(aSourceMap); + sourceMap = util3.parseSourceMapInput(aSourceMap); } - var version2 = util4.getArg(sourceMap, "version"); - var sections = util4.getArg(sourceMap, "sections"); - if (version2 != this._version) { - throw new Error("Unsupported version: " + version2); + var version3 = util3.getArg(sourceMap, "version"); + var sections = util3.getArg(sourceMap, "sections"); + if (version3 != this._version) { + throw new Error("Unsupported version: " + version3); } this._sources = new ArraySet(); this._names = new ArraySet(); @@ -26227,9 +26227,9 @@ var require_source_map_consumer = __commonJS({ if (s.url) { throw new Error("Support for url field in sections not implemented."); } - var offset = util4.getArg(s, "offset"); - var offsetLine = util4.getArg(offset, "line"); - var offsetColumn = util4.getArg(offset, "column"); + var offset = util3.getArg(s, "offset"); + var offsetLine = util3.getArg(offset, "line"); + var offsetColumn = util3.getArg(offset, "column"); if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) { throw new Error("Section offsets must be ordered and non-overlapping."); } @@ -26241,7 +26241,7 @@ var require_source_map_consumer = __commonJS({ generatedLine: offsetLine + 1, generatedColumn: offsetColumn + 1 }, - consumer: new SourceMapConsumer(util4.getArg(s, "map"), aSourceMapURL) + consumer: new SourceMapConsumer(util3.getArg(s, "map"), aSourceMapURL) }; }); } @@ -26261,8 +26261,8 @@ var require_source_map_consumer = __commonJS({ }); IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { var needle = { - generatedLine: util4.getArg(aArgs, "line"), - generatedColumn: util4.getArg(aArgs, "column") + generatedLine: util3.getArg(aArgs, "line"), + generatedColumn: util3.getArg(aArgs, "column") }; var sectionIndex = binarySearch.search( needle, @@ -26312,7 +26312,7 @@ var require_source_map_consumer = __commonJS({ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; - if (section.consumer._findSourceIndex(util4.getArg(aArgs, "source")) === -1) { + if (section.consumer._findSourceIndex(util3.getArg(aArgs, "source")) === -1) { continue; } var generatedPosition = section.consumer.generatedPositionFor(aArgs); @@ -26338,7 +26338,7 @@ var require_source_map_consumer = __commonJS({ for (var j = 0; j < sectionMappings.length; j++) { var mapping = sectionMappings[j]; var source = section.consumer._sources.at(mapping.source); - source = util4.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + source = util3.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); this._sources.add(source); source = this._sources.indexOf(source); var name = null; @@ -26361,8 +26361,8 @@ var require_source_map_consumer = __commonJS({ } } } - quickSort(this.__generatedMappings, util4.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util4.compareByOriginalPositions); + quickSort(this.__generatedMappings, util3.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util3.compareByOriginalPositions); }; exports2.IndexedSourceMapConsumer = IndexedSourceMapConsumer; } @@ -26373,7 +26373,7 @@ var require_source_node = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js"(exports2) { "use strict"; var SourceMapGenerator = require_source_map_generator().SourceMapGenerator; - var util4 = require_util8(); + var util3 = require_util8(); var REGEX_NEWLINE = /(\r?\n)/; var NEWLINE_CODE = 10; var isSourceNode = "$$$isSourceNode$$$"; @@ -26439,7 +26439,7 @@ var require_source_node = __commonJS({ var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aRelativePath != null) { - sourceFile = util4.join(aRelativePath, sourceFile); + sourceFile = util3.join(aRelativePath, sourceFile); } node.setSourceContent(sourceFile, content); } @@ -26449,7 +26449,7 @@ var require_source_node = __commonJS({ if (mapping === null || mapping.source === void 0) { node.add(code); } else { - var source = aRelativePath ? util4.join(aRelativePath, mapping.source) : mapping.source; + var source = aRelativePath ? util3.join(aRelativePath, mapping.source) : mapping.source; node.add(new SourceNode( mapping.originalLine, mapping.originalColumn, @@ -26535,7 +26535,7 @@ var require_source_node = __commonJS({ return this; }; SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util4.toSetString(aSourceFile)] = aSourceContent; + this.sourceContents[util3.toSetString(aSourceFile)] = aSourceContent; }; SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { @@ -26545,7 +26545,7 @@ var require_source_node = __commonJS({ } var sources = Object.keys(this.sourceContents); for (var i = 0, len = sources.length; i < len; i++) { - aFn(util4.fromSetString(sources[i]), this.sourceContents[sources[i]]); + aFn(util3.fromSetString(sources[i]), this.sourceContents[sources[i]]); } }; SourceNode.prototype.toString = function SourceNode_toString() { @@ -26713,7 +26713,7 @@ var require_code_gen = __commonJS({ push: function push(source, loc) { this.source.push(this.wrap(source, loc)); }, - merge: function merge() { + merge: function merge2() { var source = this.empty(); this.each(function(line) { source.add([" ", line, "\n"]); @@ -27202,14 +27202,14 @@ var require_javascript_compiler = __commonJS({ // This opcode is designed for use in string mode, which // provides the string value of a parameter along with its // depth rather than resolving it immediately. - pushStringParam: function pushStringParam(string, type2) { + pushStringParam: function pushStringParam(string3, type2) { this.pushContext(); this.pushString(type2); if (type2 !== "SubExpression") { - if (typeof string === "string") { - this.pushString(string); + if (typeof string3 === "string") { + this.pushString(string3); } else { - this.pushStackLiteral(string); + this.pushStackLiteral(string3); } } }, @@ -27247,8 +27247,8 @@ var require_javascript_compiler = __commonJS({ // On stack, after: quotedString(string), ... // // Push a quoted version of `string` onto the stack - pushString: function pushString(string) { - this.pushStackLiteral(this.quotedString(string)); + pushString: function pushString(string3) { + this.pushStackLiteral(this.quotedString(string3)); }, // [pushLiteral] // @@ -27269,9 +27269,9 @@ var require_javascript_compiler = __commonJS({ // Push a program expression onto the stack. This takes // a compile-time guid and converts it into a runtime-accessible // expression. - pushProgram: function pushProgram(guid) { - if (guid != null) { - this.pushStackLiteral(this.programExpression(guid)); + pushProgram: function pushProgram(guid2) { + if (guid2 != null) { + this.pushStackLiteral(this.programExpression(guid2)); } else { this.pushStackLiteral(null); } @@ -27459,8 +27459,8 @@ var require_javascript_compiler = __commonJS({ } } }, - programExpression: function programExpression(guid) { - var child = this.environment.children[guid], programParams = [child.index, "data", child.blockParams]; + programExpression: function programExpression(guid2) { + var child = this.environment.children[guid2], programParams = [child.index, "data", child.blockParams]; if (this.useBlockParams || this.useDepths) { programParams.push("blockParams"); } @@ -27762,12 +27762,12 @@ var require_printer = __commonJS({ this.padding = 0; } PrintVisitor.prototype = new _visitor2["default"](); - PrintVisitor.prototype.pad = function(string) { + PrintVisitor.prototype.pad = function(string3) { var out = ""; for (var i = 0, l = this.padding; i < l; i++) { out += " "; } - out += string + "\n"; + out += string3 + "\n"; return out; }; PrintVisitor.prototype.Program = function(program) { @@ -27818,27 +27818,27 @@ var require_printer = __commonJS({ this.padding--; return out; }; - PrintVisitor.prototype.PartialStatement = function(partial) { - var content = "PARTIAL:" + partial.name.original; - if (partial.params[0]) { - content += " " + this.accept(partial.params[0]); + PrintVisitor.prototype.PartialStatement = function(partial2) { + var content = "PARTIAL:" + partial2.name.original; + if (partial2.params[0]) { + content += " " + this.accept(partial2.params[0]); } - if (partial.hash) { - content += " " + this.accept(partial.hash); + if (partial2.hash) { + content += " " + this.accept(partial2.hash); } return this.pad("{{> " + content + " }}"); }; - PrintVisitor.prototype.PartialBlockStatement = function(partial) { - var content = "PARTIAL BLOCK:" + partial.name.original; - if (partial.params[0]) { - content += " " + this.accept(partial.params[0]); + PrintVisitor.prototype.PartialBlockStatement = function(partial2) { + var content = "PARTIAL BLOCK:" + partial2.name.original; + if (partial2.params[0]) { + content += " " + this.accept(partial2.params[0]); } - if (partial.hash) { - content += " " + this.accept(partial.hash); + if (partial2.hash) { + content += " " + this.accept(partial2.hash); } content += " " + this.pad("PROGRAM:"); this.padding++; - content += this.accept(partial.program); + content += this.accept(partial2.program); this.padding--; return this.pad("{{> " + content + " }}"); }; @@ -27861,11 +27861,11 @@ var require_printer = __commonJS({ var path4 = id.parts.join("/"); return (id.data ? "@" : "") + "PATH:" + path4; }; - PrintVisitor.prototype.StringLiteral = function(string) { - return '"' + string.value + '"'; + PrintVisitor.prototype.StringLiteral = function(string3) { + return '"' + string3.value + '"'; }; - PrintVisitor.prototype.NumberLiteral = function(number) { - return "NUMBER{" + number.value + "}"; + PrintVisitor.prototype.NumberLiteral = function(number2) { + return "NUMBER{" + number2.value + "}"; }; PrintVisitor.prototype.BooleanLiteral = function(bool) { return "BOOLEAN{" + bool.value + "}"; @@ -28610,9 +28610,9 @@ var require_minimatch = __commonJS({ throw new TypeError("pattern is too long"); } }; - Minimatch.prototype.parse = parse3; + Minimatch.prototype.parse = parse4; var SUBPARSE = {}; - function parse3(pattern, isSub) { + function parse4(pattern, isSub) { assertValidPattern(pattern); var options2 = this.options; if (pattern === "**") { @@ -28884,12 +28884,12 @@ var require_minimatch = __commonJS({ } return list; }; - Minimatch.prototype.match = function match(f, partial) { - if (typeof partial === "undefined") partial = this.partial; + Minimatch.prototype.match = function match(f, partial2) { + if (typeof partial2 === "undefined") partial2 = this.partial; this.debug("match", f, this.pattern); if (this.comment) return false; if (this.empty) return f === ""; - if (f === "/" && partial) return true; + if (f === "/" && partial2) return true; var options2 = this.options; if (path4.sep !== "/") { f = f.split(path4.sep).join("/"); @@ -28910,7 +28910,7 @@ var require_minimatch = __commonJS({ if (options2.matchBase && pattern.length === 1) { file = [filename]; } - var hit = this.matchOne(file, pattern, partial); + var hit = this.matchOne(file, pattern, partial2); if (hit) { if (options2.flipNegate) return true; return !this.negate; @@ -28919,7 +28919,7 @@ var require_minimatch = __commonJS({ if (options2.flipNegate) return false; return this.negate; }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { + Minimatch.prototype.matchOne = function(file, pattern, partial2) { var options2 = this.options; this.debug( "matchOne", @@ -28946,7 +28946,7 @@ var require_minimatch = __commonJS({ while (fr < fl) { var swallowee = file[fr]; this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial2)) { this.debug("globstar found match!", fr, fl, swallowee); return true; } else { @@ -28958,7 +28958,7 @@ var require_minimatch = __commonJS({ fr++; } } - if (partial) { + if (partial2) { this.debug("\n>>> no match, partial?", file, fr, pattern, pr); if (fr === fl) return true; } @@ -28977,7 +28977,7 @@ var require_minimatch = __commonJS({ if (fi === fl && pi === pl) { return true; } else if (fi === fl) { - return partial; + return partial2; } else if (pi === pl) { return fi === fl - 1 && file[fi] === ""; } @@ -29240,11 +29240,11 @@ var require_internal_pattern = __commonJS({ * Otherwise returns empty string. */ static getLiteral(segment) { - let literal = ""; + let literal2 = ""; for (let i = 0; i < segment.length; i++) { const c = segment[i]; if (c === "\\" && !IS_WINDOWS && i + 1 < segment.length) { - literal += segment[++i]; + literal2 += segment[++i]; continue; } else if (c === "*" || c === "?") { return ""; @@ -29268,15 +29268,15 @@ var require_internal_pattern = __commonJS({ return ""; } if (set) { - literal += set; + literal2 += set; i = closed; continue; } } } - literal += c; + literal2 += c; } - return literal; + return literal2; } /** * Escapes regexp special characters @@ -29732,7 +29732,7 @@ var require_cacheUtils = __commonJS({ var fs4 = __importStar(require("fs")); var path4 = __importStar(require("path")); var semver = __importStar(require_semver()); - var util4 = __importStar(require("util")); + var util3 = __importStar(require("util")); var constants_1 = require_constants6(); var versionSalt = "1.0"; function createTempDirectory() { @@ -29799,7 +29799,7 @@ var require_cacheUtils = __commonJS({ exports2.resolvePaths = resolvePaths; function unlinkFile(filePath) { return __awaiter6(this, void 0, void 0, function* () { - return util4.promisify(fs4.unlink)(filePath); + return util3.promisify(fs4.unlink)(filePath); }); } exports2.unlinkFile = unlinkFile; @@ -29828,8 +29828,8 @@ var require_cacheUtils = __commonJS({ function getCompressionMethod() { return __awaiter6(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version2 = semver.clean(versionOutput); - core6.debug(`zstd version: ${version2}`); + const version3 = semver.clean(versionOutput); + core6.debug(`zstd version: ${version3}`); if (versionOutput === "") { return constants_1.CompressionMethod.Gzip; } else { @@ -30128,7 +30128,7 @@ function createDebugger(namespace) { destroy, log: debugObj.log, namespace, - extend + extend: extend2 }); function debug6(...args) { if (!newDebugger.enabled) { @@ -30150,7 +30150,7 @@ function destroy() { } return false; } -function extend(namespace) { +function extend2(namespace) { const newDebugger = createDebugger(`${this.namespace}:${namespace}`); newDebugger.log = this.log; return newDebugger; @@ -30350,9 +30350,9 @@ function delay(timeInMs, options2) { abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage }); } -function calculateRetryDelay(retryAttempt, config) { - const exponentialDelay = config.retryDelayInMs * Math.pow(2, retryAttempt); - const clampedDelay = Math.min(config.maxRetryDelayInMs, exponentialDelay); +function calculateRetryDelay(retryAttempt, config2) { + const exponentialDelay = config2.retryDelayInMs * Math.pow(2, retryAttempt); + const clampedDelay = Math.min(config2.maxRetryDelayInMs, exponentialDelay); const retryAfterInMs = clampedDelay / 2 + getRandomIntegerInclusive(0, clampedDelay / 2); return { retryAfterInMs }; } @@ -30374,7 +30374,7 @@ var init_aborterUtils = __esm({ }); // node_modules/.pnpm/@azure+core-util@1.11.0/node_modules/@azure/core-util/dist/esm/object.js -function isObject(input) { +function isObject2(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } var init_object = __esm({ @@ -30385,7 +30385,7 @@ var init_object = __esm({ // node_modules/.pnpm/@azure+core-util@1.11.0/node_modules/@azure/core-util/dist/esm/error.js function isError(e) { - if (isObject(e)) { + if (isObject2(e)) { const hasName = typeof e.name === "string"; const hasMessage = typeof e.message === "string"; return hasName && hasMessage; @@ -30560,7 +30560,7 @@ var init_sanitizer = __esm({ return void 0; } else if (key === "operationSpec") { return void 0; - } else if (Array.isArray(value) || isObject(value)) { + } else if (Array.isArray(value) || isObject2(value)) { if (seen.has(value)) { return "[Circular]"; } @@ -31178,8 +31178,8 @@ function getRetryAfterInMs(response) { const retryAfterHeader = response.headers.get(RetryAfterHeader); if (!retryAfterHeader) return; - const date = Date.parse(retryAfterHeader); - const diff = date - Date.now(); + const date3 = Date.parse(retryAfterHeader); + const diff = date3 - Date.now(); return Number.isFinite(diff) ? Math.max(0, diff) : void 0; } catch (_a3) { return void 0; @@ -31564,7 +31564,7 @@ var require_ms = __commonJS({ options2 = options2 || {}; var type2 = typeof val; if (type2 === "string" && val.length > 0) { - return parse3(val); + return parse4(val); } else if (type2 === "number" && isFinite(val)) { return options2.long ? fmtLong(val) : fmtShort(val); } @@ -31572,7 +31572,7 @@ var require_ms = __commonJS({ "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; - function parse3(str) { + function parse4(str) { str = String(str); if (str.length > 100) { return; @@ -31737,7 +31737,7 @@ var require_common = __commonJS({ debug6.namespace = namespace; debug6.useColors = createDebug.useColors(); debug6.color = createDebug.selectColor(namespace); - debug6.extend = extend2; + debug6.extend = extend3; debug6.destroy = createDebug.destroy; Object.defineProperty(debug6, "enabled", { enumerable: true, @@ -31761,7 +31761,7 @@ var require_common = __commonJS({ } return debug6; } - function extend2(namespace, delimiter3) { + function extend3(namespace, delimiter3) { const newDebug = createDebug(this.namespace + (typeof delimiter3 === "undefined" ? ":" : delimiter3) + namespace); newDebug.log = this.log; return newDebug; @@ -32100,10 +32100,10 @@ var require_supports_color = __commonJS({ return 3; } if ("TERM_PROGRAM" in env) { - const version2 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": - return version2 >= 3 ? 3 : 2; + return version3 >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } @@ -32136,14 +32136,14 @@ var require_node = __commonJS({ "node_modules/.pnpm/debug@4.4.1/node_modules/debug/src/node.js"(exports2, module2) { "use strict"; var tty = require("tty"); - var util4 = require("util"); + var util3 = require("util"); exports2.init = init; exports2.log = log2; exports2.formatArgs = formatArgs; exports2.save = save; exports2.load = load; exports2.useColors = useColors; - exports2.destroy = util4.deprecate( + exports2.destroy = util3.deprecate( () => { }, "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`." @@ -32274,7 +32274,7 @@ var require_node = __commonJS({ return (/* @__PURE__ */ new Date()).toISOString() + " "; } function log2(...args) { - return process.stderr.write(util4.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + return process.stderr.write(util3.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); } function save(namespaces) { if (namespaces) { @@ -32297,11 +32297,11 @@ var require_node = __commonJS({ var { formatters } = module2.exports; formatters.o = function(v) { this.inspectOpts.colors = this.useColors; - return util4.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); + return util3.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" "); }; formatters.O = function(v) { this.inspectOpts.colors = this.useColors; - return util4.inspect(v, this.inspectOpts); + return util3.inspect(v, this.inspectOpts); }; } }); @@ -32705,7 +32705,7 @@ var require_dist2 = __commonJS({ this.connectOpts = { // Attempt to negotiate http/1.1 for proxy servers that support http/2 ALPNProtocols: ["http/1.1"], - ...opts ? omit(opts, "headers") : null, + ...opts ? omit2(opts, "headers") : null, host, port }; @@ -32754,7 +32754,7 @@ var require_dist2 = __commonJS({ if (opts.secureEndpoint) { debug6("Upgrading socket connection to TLS"); return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + ...omit2(setServernameFromNonIpHost(opts), "host", "path", "port"), socket }); } @@ -32777,7 +32777,7 @@ var require_dist2 = __commonJS({ function resume(socket) { socket.resume(); } - function omit(obj, ...keys) { + function omit2(obj, ...keys) { const ret = {}; let key; for (key in obj) { @@ -32842,7 +32842,7 @@ var require_dist3 = __commonJS({ const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, ""); const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80; this.connectOpts = { - ...opts ? omit(opts, "headers") : null, + ...opts ? omit2(opts, "headers") : null, host, port }; @@ -32855,8 +32855,8 @@ var require_dist3 = __commonJS({ setRequestProps(req, opts) { const { proxy } = this; const protocol = opts.secureEndpoint ? "https:" : "http:"; - const hostname = req.getHeader("host") || "localhost"; - const base = `${protocol}//${hostname}`; + const hostname2 = req.getHeader("host") || "localhost"; + const base = `${protocol}//${hostname2}`; const url2 = new url_1.URL(req.path, base); if (opts.port !== 80) { url2.port = String(opts.port); @@ -32907,7 +32907,7 @@ var require_dist3 = __commonJS({ }; HttpProxyAgent2.protocols = ["http", "https"]; exports2.HttpProxyAgent = HttpProxyAgent2; - function omit(obj, ...keys) { + function omit2(obj, ...keys) { const ret = {}; let key; for (key in obj) { @@ -34356,8 +34356,8 @@ function isPrimitiveBody(value, mapperTypeName) { function isDuration(value) { return validateISODuration.test(value); } -function isValidUuid(uuid) { - return validUuidRegex.test(uuid); +function isValidUuid(uuid2) { + return validUuidRegex.test(uuid2); } function handleNullableResponseAndWrappableBody(responseObject) { const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); @@ -34493,11 +34493,11 @@ function serializeBasicTypes(typeName, objectName, value) { throw new Error(`${objectName} with value ${value} must be of type boolean.`); } } else if (typeName.match(/^Stream$/i) !== null) { - const objectType2 = typeof value; - if (objectType2 !== "string" && typeof value.pipe !== "function" && // NodeJS.ReadableStream + const objectType = typeof value; + if (objectType !== "string" && typeof value.pipe !== "function" && // NodeJS.ReadableStream typeof value.tee !== "function" && // browser ReadableStream !(value instanceof ArrayBuffer) && !ArrayBuffer.isView(value) && // File objects count as a type of Blob, so we want to use instanceof explicitly - !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob) && objectType2 !== "function") { + !((typeof Blob === "function" || typeof Blob === "object") && value instanceof Blob) && objectType !== "function") { throw new Error(`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, ReadableStream, or () => ReadableStream.`); } } @@ -35021,14 +35021,14 @@ var init_serializer = __esm({ if (mapper.isConstant) { object = mapper.defaultValue; } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { + const { required: required2, nullable: nullable2 } = mapper; + if (required2 && nullable2 && object === void 0) { throw new Error(`${objectName} cannot be undefined.`); } - if (required && !nullable && (object === void 0 || object === null)) { + if (required2 && !nullable2 && (object === void 0 || object === null)) { throw new Error(`${objectName} cannot be null or undefined.`); } - if (!required && nullable === false && object === null) { + if (!required2 && nullable2 === false && object === null) { throw new Error(`${objectName} cannot be null.`); } if (object === void 0 || object === null) { @@ -35317,7 +35317,7 @@ function shouldDeserializeResponse(parsedResponse) { return result; } async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options2, parseXML2) { - const parsedResponse = await parse2(jsonContentTypes, xmlContentTypes, response, options2, parseXML2); + const parsedResponse = await parse3(jsonContentTypes, xmlContentTypes, response, options2, parseXML2); if (!shouldDeserializeResponse(parsedResponse)) { return parsedResponse; } @@ -35419,7 +35419,7 @@ function handleErrorResponse(parsedResponse, operationSpec, responseSpec, option } return { error: error3, shouldReturnResponse: false }; } -async function parse2(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML2) { +async function parse3(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML2) { var _a3; if (!((_a3 = operationResponse.request.streamResponseStatusCodes) === null || _a3 === void 0 ? void 0 : _a3.has(operationResponse.status)) && operationResponse.bodyAsText) { const text = operationResponse.bodyAsText; @@ -35553,10 +35553,10 @@ function serializeRequestBody(request3, operationArguments, operationSpec, strin if (operationSpec.requestBody && operationSpec.requestBody.mapper) { request3.body = getOperationArgumentValueFromParameter(operationArguments, operationSpec.requestBody); const bodyMapper = operationSpec.requestBody.mapper; - const { required, serializedName, xmlName, xmlElementName, xmlNamespace, xmlNamespacePrefix, nullable } = bodyMapper; + const { required: required2, serializedName, xmlName, xmlElementName, xmlNamespace, xmlNamespacePrefix, nullable: nullable2 } = bodyMapper; const typeName = bodyMapper.type.name; try { - if (request3.body !== void 0 && request3.body !== null || nullable && request3.body === null || required) { + if (request3.body !== void 0 && request3.body !== null || nullable2 && request3.body === null || required2) { const requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody); request3.body = operationSpec.serializer.serialize(bodyMapper, request3.body, requestBodyParameterPathString, updatedOptions); const isStream = typeName === MapperTypeNames.Stream; @@ -36545,9 +36545,9 @@ var init_esm8 = __esm({ }); // node_modules/.pnpm/fast-xml-parser@5.0.9/node_modules/fast-xml-parser/src/util.js -function getAllMatches(string, regex) { +function getAllMatches(string3, regex) { const matches = []; - let match = regex.exec(string); + let match = regex.exec(string3); while (match) { const allmatches = []; allmatches.startIndex = regex.lastIndex - match[0].length; @@ -36556,7 +36556,7 @@ function getAllMatches(string, regex) { allmatches.push(match[index]); } matches.push(allmatches); - match = regex.exec(string); + match = regex.exec(string3); } return matches; } @@ -36571,8 +36571,8 @@ var init_util2 = __esm({ nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; regexName = new RegExp("^" + nameRegexp + "$"); - isName = function(string) { - const match = regexName.exec(string); + isName = function(string3) { + const match = regexName.exec(string3); return !(match === null || typeof match === "undefined"); }; } @@ -36631,11 +36631,11 @@ function validate(xmlData, options2) { if (attrStr[attrStr.length - 1] === "/") { const attrStrStart = i - attrStr.length; attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid2 = validateAttributeString(attrStr, options2); - if (isValid2 === true) { + const isValid = validateAttributeString(attrStr, options2); + if (isValid === true) { tagFound = true; } else { - return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid2.err.line)); + return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); } } else if (closingTag) { if (!result.tagClosed) { @@ -36659,9 +36659,9 @@ function validate(xmlData, options2) { } } } else { - const isValid2 = validateAttributeString(attrStr, options2); - if (isValid2 !== true) { - return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid2.err.line)); + const isValid = validateAttributeString(attrStr, options2); + if (isValid !== true) { + return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); } if (reachedRoot === true) { return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); @@ -38742,8 +38742,8 @@ function appendToURLQuery(url2, queryParts) { urlParsed.search = query; return urlParsed.toString(); } -function truncatedISO8061Date(date, withMilliseconds = true) { - const dateString = date.toISOString(); +function truncatedISO8061Date(date3, withMilliseconds = true) { + const dateString = date3.toISOString(); return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z"; } function base64encode(content) { @@ -39765,8 +39765,8 @@ var init_StorageSharedKeyCredentialPolicy = __esm({ headersArray.sort((a, b) => { return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + headersArray = headersArray.filter((value, index, array2) => { + if (index > 0 && value.name.toLowerCase() === array2[index - 1].name.toLowerCase()) { return false; } return true; @@ -40138,8 +40138,8 @@ function storageSharedKeyCredentialPolicy(options2) { headersArray.sort((a, b) => { return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + headersArray = headersArray.filter((value, index, array2) => { + if (index > 0 && value.name.toLowerCase() === array2[index - 1].name.toLowerCase()) { return false; } return true; @@ -49049,7 +49049,7 @@ var init_mappers = __esm({ }); // node_modules/.pnpm/@azure+storage-blob@12.27.0/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/models/parameters.js -var contentType, blobServiceProperties, accept, url, restype, comp, timeoutInSeconds, version, requestId, accept1, comp1, comp2, prefix, marker, maxPageSize, include, keyInfo, comp3, restype1, body, comp4, contentLength, multipartContentType, comp5, where, restype2, metadata, access, defaultEncryptionScope, preventEncryptionScopeOverride, leaseId, ifModifiedSince, ifUnmodifiedSince, comp6, comp7, containerAcl, comp8, deletedContainerName, deletedContainerVersion, comp9, sourceContainerName, sourceLeaseId, comp10, action, duration, proposedLeaseId, action1, leaseId1, action2, action3, breakPeriod, action4, proposedLeaseId1, include1, delimiter, snapshot, versionId, range, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifMatch, ifNoneMatch, ifTags, deleteSnapshots, blobDeleteType, comp11, expiryOptions, expiresOn, blobCacheControl, blobContentType, blobContentMD5, blobContentEncoding, blobContentLanguage, blobContentDisposition, comp12, immutabilityPolicyExpiry, immutabilityPolicyMode, comp13, legalHold, encryptionScope, comp14, tier, rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, copySource, blobTagsString, sealBlob, legalHold1, xMsRequiresSync, sourceContentMD5, copySourceAuthorization, copySourceTags, comp15, copyActionAbortConstant, copyId, comp16, tier1, queryRequest, comp17, comp18, tags, transactionalContentMD5, transactionalContentCrc64, blobType, blobContentLength, blobSequenceNumber, contentType1, body1, accept2, comp19, pageWrite, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, pageWrite1, sourceUrl, sourceRange, sourceContentCrc64, range1, comp20, prevsnapshot, prevSnapshotUrl, sequenceNumberAction, comp21, blobType1, comp22, maxSize, appendPosition, sourceRange1, comp23, blobType2, copySourceBlobProperties, comp24, blockId, blocks, comp25, listType; +var contentType, blobServiceProperties, accept, url, restype, comp, timeoutInSeconds, version2, requestId, accept1, comp1, comp2, prefix, marker, maxPageSize, include, keyInfo, comp3, restype1, body, comp4, contentLength, multipartContentType, comp5, where, restype2, metadata, access, defaultEncryptionScope, preventEncryptionScopeOverride, leaseId, ifModifiedSince, ifUnmodifiedSince, comp6, comp7, containerAcl, comp8, deletedContainerName, deletedContainerVersion, comp9, sourceContainerName, sourceLeaseId, comp10, action, duration3, proposedLeaseId, action1, leaseId1, action2, action3, breakPeriod, action4, proposedLeaseId1, include1, delimiter, snapshot, versionId, range, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey, encryptionKeySha256, encryptionAlgorithm, ifMatch, ifNoneMatch, ifTags, deleteSnapshots, blobDeleteType, comp11, expiryOptions, expiresOn, blobCacheControl, blobContentType, blobContentMD5, blobContentEncoding, blobContentLanguage, blobContentDisposition, comp12, immutabilityPolicyExpiry, immutabilityPolicyMode, comp13, legalHold, encryptionScope, comp14, tier, rehydratePriority, sourceIfModifiedSince, sourceIfUnmodifiedSince, sourceIfMatch, sourceIfNoneMatch, sourceIfTags, copySource, blobTagsString, sealBlob, legalHold1, xMsRequiresSync, sourceContentMD5, copySourceAuthorization, copySourceTags, comp15, copyActionAbortConstant, copyId, comp16, tier1, queryRequest, comp17, comp18, tags, transactionalContentMD5, transactionalContentCrc64, blobType, blobContentLength, blobSequenceNumber, contentType1, body1, accept2, comp19, pageWrite, ifSequenceNumberLessThanOrEqualTo, ifSequenceNumberLessThan, ifSequenceNumberEqualTo, pageWrite1, sourceUrl, sourceRange, sourceContentCrc64, range1, comp20, prevsnapshot, prevSnapshotUrl, sequenceNumberAction, comp21, blobType1, comp22, maxSize, appendPosition, sourceRange1, comp23, blobType2, copySourceBlobProperties, comp24, blockId, blocks, comp25, listType; var init_parameters = __esm({ "node_modules/.pnpm/@azure+storage-blob@12.27.0/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/generated/src/models/parameters.js"() { "use strict"; @@ -49127,7 +49127,7 @@ var init_parameters = __esm({ } } }; - version = { + version2 = { parameterPath: "version", mapper: { defaultValue: "2025-05-05", @@ -49540,7 +49540,7 @@ var init_parameters = __esm({ } } }; - duration = { + duration3 = { parameterPath: ["options", "duration"], mapper: { serializedName: "x-ms-lease-duration", @@ -50771,7 +50771,7 @@ var init_service = __esm({ headerParameters: [ contentType, accept, - version, + version2, requestId ], isXML: true, @@ -50799,7 +50799,7 @@ var init_service = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -50826,7 +50826,7 @@ var init_service = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -50856,7 +50856,7 @@ var init_service = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -50886,7 +50886,7 @@ var init_service = __esm({ headerParameters: [ contentType, accept, - version, + version2, requestId ], isXML: true, @@ -50913,7 +50913,7 @@ var init_service = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -50941,7 +50941,7 @@ var init_service = __esm({ urlParameters: [url], headerParameters: [ accept, - version, + version2, requestId, contentLength, multipartContentType @@ -50973,7 +50973,7 @@ var init_service = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -51172,7 +51172,7 @@ var init_container = __esm({ queryParameters: [timeoutInSeconds, restype2], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, metadata, @@ -51198,7 +51198,7 @@ var init_container = __esm({ queryParameters: [timeoutInSeconds, restype2], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId @@ -51221,7 +51221,7 @@ var init_container = __esm({ queryParameters: [timeoutInSeconds, restype2], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -51250,7 +51250,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, metadata, @@ -51291,7 +51291,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId @@ -51321,7 +51321,7 @@ var init_container = __esm({ headerParameters: [ contentType, accept, - version, + version2, requestId, access, leaseId, @@ -51352,7 +51352,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, deletedContainerName, @@ -51380,7 +51380,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, sourceContainerName, @@ -51414,7 +51414,7 @@ var init_container = __esm({ urlParameters: [url], headerParameters: [ accept, - version, + version2, requestId, contentLength, multipartContentType @@ -51447,7 +51447,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -51473,13 +51473,13 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, ifUnmodifiedSince, action, - duration, + duration3, proposedLeaseId ], isXML: true, @@ -51504,7 +51504,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, @@ -51534,7 +51534,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, @@ -51564,7 +51564,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, @@ -51594,7 +51594,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, @@ -51630,7 +51630,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -51662,7 +51662,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -51688,7 +51688,7 @@ var init_container = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -51963,7 +51963,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -52001,7 +52001,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -52037,7 +52037,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -52066,7 +52066,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds, comp8], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -52088,7 +52088,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds, comp11], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, expiryOptions, @@ -52112,7 +52112,7 @@ var init_blob = __esm({ queryParameters: [comp, timeoutInSeconds], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -52151,7 +52151,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifUnmodifiedSince, @@ -52181,7 +52181,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -52208,7 +52208,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, legalHold @@ -52231,7 +52231,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds, comp6], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, metadata, @@ -52264,13 +52264,13 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds, comp10], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, ifUnmodifiedSince, action, - duration, + duration3, proposedLeaseId, ifMatch, ifNoneMatch, @@ -52294,7 +52294,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds, comp10], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, @@ -52323,7 +52323,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds, comp10], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, @@ -52352,7 +52352,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds, comp10], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, @@ -52382,7 +52382,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds, comp10], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, @@ -52411,7 +52411,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds, comp14], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, metadata, @@ -52444,7 +52444,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, metadata, @@ -52486,7 +52486,7 @@ var init_blob = __esm({ queryParameters: [timeoutInSeconds], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, metadata, @@ -52534,7 +52534,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -52566,7 +52566,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -52596,7 +52596,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1 ], @@ -52636,7 +52636,7 @@ var init_blob = __esm({ headerParameters: [ contentType, accept, - version, + version2, requestId, leaseId, ifModifiedSince, @@ -52674,7 +52674,7 @@ var init_blob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -52705,7 +52705,7 @@ var init_blob = __esm({ headerParameters: [ contentType, accept, - version, + version2, requestId, leaseId, ifTags, @@ -52848,7 +52848,7 @@ var init_pageBlob = __esm({ queryParameters: [timeoutInSeconds], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, contentLength, @@ -52897,7 +52897,7 @@ var init_pageBlob = __esm({ queryParameters: [timeoutInSeconds, comp19], urlParameters: [url], headerParameters: [ - version, + version2, requestId, contentLength, leaseId, @@ -52940,7 +52940,7 @@ var init_pageBlob = __esm({ queryParameters: [timeoutInSeconds, comp19], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, contentLength, @@ -52978,7 +52978,7 @@ var init_pageBlob = __esm({ queryParameters: [timeoutInSeconds, comp19], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, contentLength, @@ -53032,7 +53032,7 @@ var init_pageBlob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -53069,7 +53069,7 @@ var init_pageBlob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -53099,7 +53099,7 @@ var init_pageBlob = __esm({ queryParameters: [comp, timeoutInSeconds], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -53132,7 +53132,7 @@ var init_pageBlob = __esm({ queryParameters: [comp, timeoutInSeconds], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -53162,7 +53162,7 @@ var init_pageBlob = __esm({ queryParameters: [timeoutInSeconds, comp21], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, ifModifiedSince, @@ -53254,7 +53254,7 @@ var init_appendBlob = __esm({ queryParameters: [timeoutInSeconds], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, contentLength, @@ -53300,7 +53300,7 @@ var init_appendBlob = __esm({ queryParameters: [timeoutInSeconds, comp22], urlParameters: [url], headerParameters: [ - version, + version2, requestId, contentLength, leaseId, @@ -53340,7 +53340,7 @@ var init_appendBlob = __esm({ queryParameters: [timeoutInSeconds, comp22], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, contentLength, @@ -53385,7 +53385,7 @@ var init_appendBlob = __esm({ queryParameters: [timeoutInSeconds, comp23], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -53516,7 +53516,7 @@ var init_blockBlob = __esm({ queryParameters: [timeoutInSeconds], urlParameters: [url], headerParameters: [ - version, + version2, requestId, contentLength, metadata, @@ -53567,7 +53567,7 @@ var init_blockBlob = __esm({ queryParameters: [timeoutInSeconds], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, contentLength, @@ -53626,7 +53626,7 @@ var init_blockBlob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, contentLength, leaseId, @@ -53663,7 +53663,7 @@ var init_blockBlob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, contentLength, @@ -53703,7 +53703,7 @@ var init_blockBlob = __esm({ headerParameters: [ contentType, accept, - version, + version2, requestId, metadata, leaseId, @@ -53756,7 +53756,7 @@ var init_blockBlob = __esm({ ], urlParameters: [url], headerParameters: [ - version, + version2, requestId, accept1, leaseId, @@ -54354,8 +54354,8 @@ var init_SASQueryParameters = __esm({ } return void 0; } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; + constructor(version3, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { + this.version = version3; this.signature = signature; if (permissionsOrOptions !== void 0 && typeof permissionsOrOptions !== "string") { this.permissions = permissionsOrOptions.permissions; @@ -54557,7 +54557,7 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; } function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + const version3 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; let userDelegationKeyCredential; if (sharedKeyCredential === void 0 && accountName !== void 0) { @@ -54566,25 +54566,25 @@ function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKe if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - if (version2 >= "2020-12-06") { + if (version3 >= "2020-12-06") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); } else { return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); } } - if (version2 >= "2018-11-09") { + if (version3 >= "2018-11-09") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); } else { - if (version2 >= "2020-02-10") { + if (version3 >= "2020-02-10") { return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); } else { return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); } } } - if (version2 >= "2015-04-05") { + if (version3 >= "2015-04-05") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential); } else { @@ -54899,44 +54899,44 @@ function getCanonicalName(accountName, containerName, blobName) { return elements.join(""); } function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "2018-11-09") { + const version3 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + if (blobSASSignatureValues.snapshotTime && version3 < "2018-11-09") { throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); } if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { + if (blobSASSignatureValues.versionId && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version3 < "2020-08-04") { throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version3 < "2019-12-12") { throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - if (version2 < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { + if (version3 < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission."); } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + if (version3 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + if (version3 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { + if (blobSASSignatureValues.encryptionScope && version3 < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - blobSASSignatureValues.version = version2; + blobSASSignatureValues.version = version3; return blobSASSignatureValues; } var init_BlobSASSignatureValues = __esm({ @@ -55011,7 +55011,7 @@ var init_BlobLeaseClient = __esm({ * @param options - option to configure lease management operations. * @returns Response data for acquire lease operation. */ - async acquireLease(duration2, options2 = {}) { + async acquireLease(duration4, options2 = {}) { var _a3, _b2, _c2, _d2, _e; if (this._isContainer && (((_a3 = options2.conditions) === null || _a3 === void 0 ? void 0 : _a3.ifMatch) && ((_b2 = options2.conditions) === null || _b2 === void 0 ? void 0 : _b2.ifMatch) !== ETagNone || ((_c2 = options2.conditions) === null || _c2 === void 0 ? void 0 : _c2.ifNoneMatch) && ((_d2 = options2.conditions) === null || _d2 === void 0 ? void 0 : _d2.ifNoneMatch) !== ETagNone || ((_e = options2.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) { throw new RangeError("The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable."); @@ -55020,7 +55020,7 @@ var init_BlobLeaseClient = __esm({ var _a4; return assertResponse(await this._containerOrBlobOperation.acquireLease({ abortSignal: options2.abortSignal, - duration: duration2, + duration: duration4, modifiedAccessConditions: Object.assign(Object.assign({}, options2.conditions), { ifTags: (_a4 = options2.conditions) === null || _a4 === void 0 ? void 0 : _a4.tagConditions }), proposedLeaseId: this._leaseId, tracingOptions: updatedOptions.tracingOptions @@ -55997,14 +55997,14 @@ var init_AvroParser = __esm({ } // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types async read(stream, options2 = {}) { - const record = {}; - record["$schema"] = this._name; + const record2 = {}; + record2["$schema"] = this._name; for (const key in this._fields) { if (Object.prototype.hasOwnProperty.call(this._fields, key)) { - record[key] = await this._fields[key].read(stream, options2); + record2[key] = await this._fields[key].read(stream, options2); } } - return record; + return record2; } }; } @@ -57840,14 +57840,14 @@ async function readStreamToLocalFile(rs, file) { rs.pipe(ws); }); } -var fs, util3, fsStat, fsCreateReadStream; +var fs, util2, fsStat, fsCreateReadStream; var init_utils_node = __esm({ "node_modules/.pnpm/@azure+storage-blob@12.27.0/node_modules/@azure/storage-blob/dist-esm/storage-blob/src/utils/utils.node.js"() { "use strict"; fs = __toESM(require("fs")); - util3 = __toESM(require("util")); + util2 = __toESM(require("util")); init_constants2(); - fsStat = util3.promisify(fs.stat); + fsStat = util2.promisify(fs.stat); fsCreateReadStream = fs.createReadStream; } }); @@ -62307,30 +62307,30 @@ function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyC return generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential).sasQueryParameters; } function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential) { - const version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + const version3 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version3 < "2020-08-04") { throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission."); } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version2 < "2019-12-12") { + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version3 < "2019-12-12") { throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version2 < "2019-12-12") { + if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version3 < "2019-12-12") { throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); } - if (accountSASSignatureValues.encryptionScope && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version3 < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); let stringToSign; - if (version2 >= "2020-12-06") { + if (version3 >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, @@ -62340,7 +62340,7 @@ function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sh truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version2, + version3, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -62355,14 +62355,14 @@ function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sh truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version2, + version3, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, accountSASSignatureValues.encryptionScope), + sasQueryParameters: new SASQueryParameters(version3, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, void 0, accountSASSignatureValues.encryptionScope), stringToSign }; } @@ -63836,14 +63836,14 @@ var require_downloadUtils = __commonJS({ var buffer2 = __importStar(require("buffer")); var fs4 = __importStar(require("fs")); var stream = __importStar(require("stream")); - var util4 = __importStar(require("util")); + var util3 = __importStar(require("util")); var utils = __importStar(require_cacheUtils()); var constants_1 = require_constants6(); var requestUtils_1 = require_requestUtils(); var abort_controller_1 = (init_src5(), __toCommonJS(src_exports2)); function pipeResponseToStream(response, output) { return __awaiter6(this, void 0, void 0, function* () { - const pipeline = util4.promisify(stream.pipeline); + const pipeline = util3.promisify(stream.pipeline); yield pipeline(response.message, output); }); } @@ -64242,10 +64242,10 @@ var require_config = __commonJS({ exports2.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); - const hostname = ghUrl.hostname.trimEnd().toUpperCase(); - const isGitHubHost = hostname === "GITHUB.COM"; - const isGheHost = hostname.endsWith(".GHE.COM"); - const isLocalHost = hostname.endsWith(".LOCALHOST"); + const hostname2 = ghUrl.hostname.trimEnd().toUpperCase(); + const isGitHubHost = hostname2 === "GITHUB.COM"; + const isGheHost = hostname2.endsWith(".GHE.COM"); + const isLocalHost = hostname2.endsWith(".LOCALHOST"); return !isGitHubHost && !isGheHost && !isLocalHost; } exports2.isGhes = isGhes; @@ -64256,14 +64256,14 @@ var require_config = __commonJS({ } exports2.getCacheServiceVersion = getCacheServiceVersion; function getCacheServiceURL() { - const version2 = getCacheServiceVersion(); - switch (version2) { + const version3 = getCacheServiceVersion(); + switch (version3) { case "v1": return process.env["ACTIONS_CACHE_URL"] || process.env["ACTIONS_RESULTS_URL"] || ""; case "v2": return process.env["ACTIONS_RESULTS_URL"] || ""; default: - throw new Error(`Unsupported cache service version: ${version2}`); + throw new Error(`Unsupported cache service version: ${version3}`); } } exports2.getCacheServiceURL = getCacheServiceURL; @@ -64446,14 +64446,14 @@ var require_cacheHttpClient = __commonJS({ function getCacheEntry(keys, paths, options2) { return __awaiter6(this, void 0, void 0, function* () { const httpClient = createHttpClient(); - const version2 = utils.getCacheVersion(paths, options2 === null || options2 === void 0 ? void 0 : options2.compressionMethod, options2 === null || options2 === void 0 ? void 0 : options2.enableCrossOsArchive); - const resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version2}`; + const version3 = utils.getCacheVersion(paths, options2 === null || options2 === void 0 ? void 0 : options2.compressionMethod, options2 === null || options2 === void 0 ? void 0 : options2.enableCrossOsArchive); + const resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version3}`; const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter6(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { if (core6.isDebug()) { - yield printCachesListForDiagnostics(keys[0], httpClient, version2); + yield printCachesListForDiagnostics(keys[0], httpClient, version3); } return null; } @@ -64472,7 +64472,7 @@ var require_cacheHttpClient = __commonJS({ }); } exports2.getCacheEntry = getCacheEntry; - function printCachesListForDiagnostics(key, httpClient, version2) { + function printCachesListForDiagnostics(key, httpClient, version3) { return __awaiter6(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter6(this, void 0, void 0, function* () { @@ -64482,7 +64482,7 @@ var require_cacheHttpClient = __commonJS({ const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - core6.debug(`No matching cache found for cache key '${key}', version '${version2} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + core6.debug(`No matching cache found for cache key '${key}', version '${version3} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`); for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { core6.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); @@ -64512,10 +64512,10 @@ Other caches with similar key:`); function reserveCache(key, paths, options2) { return __awaiter6(this, void 0, void 0, function* () { const httpClient = createHttpClient(); - const version2 = utils.getCacheVersion(paths, options2 === null || options2 === void 0 ? void 0 : options2.compressionMethod, options2 === null || options2 === void 0 ? void 0 : options2.enableCrossOsArchive); + const version3 = utils.getCacheVersion(paths, options2 === null || options2 === void 0 ? void 0 : options2.compressionMethod, options2 === null || options2 === void 0 ? void 0 : options2.enableCrossOsArchive); const reserveCacheRequest = { key, - version: version2, + version: version3, cacheSize: options2 === null || options2 === void 0 ? void 0 : options2.cacheSize }; const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter6(this, void 0, void 0, function* () { @@ -64683,34 +64683,34 @@ function base64decode(base64Str) { return bytes.subarray(0, bytePos); } function base64encode2(bytes) { - let base64 = "", groupPos = 0, b, p = 0; + let base642 = "", groupPos = 0, b, p = 0; for (let i = 0; i < bytes.length; i++) { b = bytes[i]; switch (groupPos) { case 0: - base64 += encTable[b >> 2]; + base642 += encTable[b >> 2]; p = (b & 3) << 4; groupPos = 1; break; case 1: - base64 += encTable[p | b >> 4]; + base642 += encTable[p | b >> 4]; p = (b & 15) << 2; groupPos = 2; break; case 2: - base64 += encTable[p | b >> 6]; - base64 += encTable[b & 63]; + base642 += encTable[p | b >> 6]; + base642 += encTable[b & 63]; groupPos = 0; break; } } if (groupPos) { - base64 += encTable[p]; - base64 += "="; + base642 += encTable[p]; + base642 += "="; if (groupPos == 1) - base64 += "="; + base642 += "="; } - return base64; + return base642; } var encTable, decTable; var init_base642 = __esm({ @@ -64900,11 +64900,11 @@ function int64toString(bitsLow, bitsHigh) { digitB %= base; } function decimalFrom1e7(digit1e7, needLeadingZeros) { - let partial = digit1e7 ? String(digit1e7) : ""; + let partial2 = digit1e7 ? String(digit1e7) : ""; if (needLeadingZeros) { - return "0000000".slice(partial.length) + partial; + return "0000000".slice(partial2.length) + partial2; } - return partial; + return partial2; } return decimalFrom1e7( digitC, @@ -65367,12 +65367,12 @@ var init_binary_reader = __esm({ }); // node_modules/.pnpm/@protobuf-ts+runtime@2.9.6/node_modules/@protobuf-ts/runtime/build/es2015/assert.js -function assert(condition, msg) { +function assert2(condition, msg) { if (!condition) { throw new Error(msg); } } -function assertNever(value, msg) { +function assertNever2(value, msg) { throw new Error(msg !== null && msg !== void 0 ? msg : "Unexpected object: " + value); } function assertInt32(arg) { @@ -66205,12 +66205,12 @@ var init_reflection_json_reader = __esm({ */ enum(type2, json, fieldName, ignoreUnknownFields) { if (type2[0] == "google.protobuf.NullValue") - assert(json === null || json === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); + assert2(json === null || json === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); if (json === null) return 0; switch (typeof json) { case "number": - assert(Number.isInteger(json), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json}.`); + assert2(Number.isInteger(json), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json}.`); return json; case "string": let localEnumName = json; @@ -66220,10 +66220,10 @@ var init_reflection_json_reader = __esm({ if (typeof enumNumber === "undefined" && ignoreUnknownFields) { return false; } - assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json}".`); + assert2(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json}".`); return enumNumber; } - assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json}".`); + assert2(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json}".`); } scalar(json, type2, longType, fieldName) { let e; @@ -66377,7 +66377,7 @@ var init_reflection_json_writer = __esm({ continue; const opt = field.kind == "scalar" || field.kind == "enum" ? Object.assign(Object.assign({}, options2), { emitDefaultValues: true }) : options2; let jsonValue = this.field(field, group3[field.localName], opt); - assert(jsonValue !== void 0); + assert2(jsonValue !== void 0); json[options2.useProtoFieldName ? field.name : field.jsonName] = jsonValue; } return json; @@ -66385,13 +66385,13 @@ var init_reflection_json_writer = __esm({ field(field, value, options2) { let jsonValue = void 0; if (field.kind == "map") { - assert(typeof value == "object" && value !== null); + assert2(typeof value == "object" && value !== null); const jsonObj = {}; switch (field.V.kind) { case "scalar": for (const [entryKey, entryValue] of Object.entries(value)) { const val = this.scalar(field.V.T, entryValue, field.name, false, true); - assert(val !== void 0); + assert2(val !== void 0); jsonObj[entryKey.toString()] = val; } break; @@ -66399,16 +66399,16 @@ var init_reflection_json_writer = __esm({ const messageType = field.V.T(); for (const [entryKey, entryValue] of Object.entries(value)) { const val = this.message(messageType, entryValue, field.name, options2); - assert(val !== void 0); + assert2(val !== void 0); jsonObj[entryKey.toString()] = val; } break; case "enum": const enumInfo = field.V.T(); for (const [entryKey, entryValue] of Object.entries(value)) { - assert(entryValue === void 0 || typeof entryValue == "number"); + assert2(entryValue === void 0 || typeof entryValue == "number"); const val = this.enum(enumInfo, entryValue, field.name, false, true, options2.enumAsInteger); - assert(val !== void 0); + assert2(val !== void 0); jsonObj[entryKey.toString()] = val; } break; @@ -66416,22 +66416,22 @@ var init_reflection_json_writer = __esm({ if (options2.emitDefaultValues || Object.keys(jsonObj).length > 0) jsonValue = jsonObj; } else if (field.repeat) { - assert(Array.isArray(value)); + assert2(Array.isArray(value)); const jsonArr = []; switch (field.kind) { case "scalar": for (let i = 0; i < value.length; i++) { const val = this.scalar(field.T, value[i], field.name, field.opt, true); - assert(val !== void 0); + assert2(val !== void 0); jsonArr.push(val); } break; case "enum": const enumInfo = field.T(); for (let i = 0; i < value.length; i++) { - assert(value[i] === void 0 || typeof value[i] == "number"); + assert2(value[i] === void 0 || typeof value[i] == "number"); const val = this.enum(enumInfo, value[i], field.name, field.opt, true, options2.enumAsInteger); - assert(val !== void 0); + assert2(val !== void 0); jsonArr.push(val); } break; @@ -66439,7 +66439,7 @@ var init_reflection_json_writer = __esm({ const messageType = field.T(); for (let i = 0; i < value.length; i++) { const val = this.message(messageType, value[i], field.name, options2); - assert(val !== void 0); + assert2(val !== void 0); jsonArr.push(val); } break; @@ -66464,17 +66464,17 @@ var init_reflection_json_writer = __esm({ /** * Returns `null` as the default for google.protobuf.NullValue. */ - enum(type2, value, fieldName, optional, emitDefaultValues, enumAsInteger) { + enum(type2, value, fieldName, optional2, emitDefaultValues, enumAsInteger) { if (type2[0] == "google.protobuf.NullValue") - return !emitDefaultValues && !optional ? void 0 : null; + return !emitDefaultValues && !optional2 ? void 0 : null; if (value === void 0) { - assert(optional); + assert2(optional2); return void 0; } - if (value === 0 && !emitDefaultValues && !optional) + if (value === 0 && !emitDefaultValues && !optional2) return void 0; - assert(typeof value == "number"); - assert(Number.isInteger(value)); + assert2(typeof value == "number"); + assert2(Number.isInteger(value)); if (enumAsInteger || !type2[1].hasOwnProperty(value)) return value; if (type2[2]) @@ -66486,12 +66486,12 @@ var init_reflection_json_writer = __esm({ return options2.emitDefaultValues ? null : void 0; return type2.internalJsonWrite(value, options2); } - scalar(type2, value, fieldName, optional, emitDefaultValues) { + scalar(type2, value, fieldName, optional2, emitDefaultValues) { if (value === void 0) { - assert(optional); + assert2(optional2); return void 0; } - const ed = emitDefaultValues || optional; + const ed = emitDefaultValues || optional2; switch (type2) { // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted. case ScalarType.INT32: @@ -66514,7 +66514,7 @@ var init_reflection_json_writer = __esm({ case ScalarType.DOUBLE: if (value === 0) return ed ? 0 : void 0; - assert(typeof value == "number"); + assert2(typeof value == "number"); if (Number.isNaN(value)) return "NaN"; if (value === Number.POSITIVE_INFINITY) @@ -66526,18 +66526,18 @@ var init_reflection_json_writer = __esm({ case ScalarType.STRING: if (value === "") return ed ? "" : void 0; - assert(typeof value == "string"); + assert2(typeof value == "string"); return value; // bool: case ScalarType.BOOL: if (value === false) return ed ? false : void 0; - assert(typeof value == "boolean"); + assert2(typeof value == "boolean"); return value; // JSON value will be a decimal string. Either numbers or strings are accepted. case ScalarType.UINT64: case ScalarType.FIXED64: - assert(typeof value == "number" || typeof value == "string" || typeof value == "bigint"); + assert2(typeof value == "number" || typeof value == "string" || typeof value == "bigint"); let ulong = PbULong.from(value); if (ulong.isZero() && !ed) return void 0; @@ -66546,7 +66546,7 @@ var init_reflection_json_writer = __esm({ case ScalarType.INT64: case ScalarType.SFIXED64: case ScalarType.SINT64: - assert(typeof value == "number" || typeof value == "string" || typeof value == "bigint"); + assert2(typeof value == "number" || typeof value == "string" || typeof value == "bigint"); let long = PbLong.from(value); if (long.isZero() && !ed) return void 0; @@ -66554,7 +66554,7 @@ var init_reflection_json_writer = __esm({ // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings. // Either standard or URL-safe base64 encoding with/without paddings are accepted. case ScalarType.BYTES: - assert(value instanceof Uint8Array); + assert2(value instanceof Uint8Array); if (!value.byteLength) return ed ? "" : void 0; return base64encode2(value); @@ -66809,20 +66809,20 @@ var init_reflection_binary_writer = __esm({ case "enum": let T = field.kind == "enum" ? ScalarType.INT32 : field.T; if (repeated) { - assert(Array.isArray(value)); + assert2(Array.isArray(value)); if (repeated == RepeatType.PACKED) this.packed(writer, T, field.no, value); else for (const item of value) this.scalar(writer, T, field.no, item, true); } else if (value === void 0) - assert(field.opt); + assert2(field.opt); else this.scalar(writer, T, field.no, value, emitDefault || field.opt); break; case "message": if (repeated) { - assert(Array.isArray(value)); + assert2(Array.isArray(value)); for (const item of value) this.message(writer, options2, field.T(), field.no, item); } else { @@ -66830,7 +66830,7 @@ var init_reflection_binary_writer = __esm({ } break; case "map": - assert(typeof value == "object" && value !== null); + assert2(typeof value == "object" && value !== null); for (const [key, val] of Object.entries(value)) this.mapEntry(writer, options2, field, key, val); break; @@ -66853,7 +66853,7 @@ var init_reflection_binary_writer = __esm({ keyValue = Number.parseInt(key); break; case ScalarType.BOOL: - assert(key == "true" || key == "false"); + assert2(key == "true" || key == "false"); keyValue = key == "true"; break; } @@ -66893,7 +66893,7 @@ var init_reflection_binary_writer = __esm({ packed(writer, type2, fieldNo, value) { if (!value.length) return; - assert(type2 !== ScalarType.BYTES && type2 !== ScalarType.STRING); + assert2(type2 !== ScalarType.BYTES && type2 !== ScalarType.STRING); writer.tag(fieldNo, WireType.LengthDelimited); writer.fork(); let [, method] = this.scalarInfo(type2); @@ -67373,9 +67373,9 @@ function listEnumValues(enumObject) { if (!isEnumObject(enumObject)) throw new Error("not a typescript enum object"); let values = []; - for (let [name, number] of Object.entries(enumObject)) - if (typeof number == "number") - values.push({ name, number }); + for (let [name, number2] of Object.entries(enumObject)) + if (typeof number2 == "number") + values.push({ name, number: number2 }); return values; } function listEnumNames(enumObject) { @@ -67409,10 +67409,10 @@ __export(es2015_exports, { ScalarType: () => ScalarType, UnknownFieldHandler: () => UnknownFieldHandler, WireType: () => WireType, - assert: () => assert, + assert: () => assert2, assertFloat32: () => assertFloat32, assertInt32: () => assertInt32, - assertNever: () => assertNever, + assertNever: () => assertNever2, assertUInt32: () => assertUInt32, base64decode: () => base64decode, base64encode: () => base64encode2, @@ -67761,7 +67761,7 @@ var init_rpc_output_stream = __esm({ * Can be used to wrap a stream by using the other stream's `onNext`. */ notifyNext(message, error3, complete) { - assert((message ? 1 : 0) + (error3 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); + assert2((message ? 1 : 0) + (error3 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); if (message) this.notifyMessage(message); if (error3) @@ -67775,7 +67775,7 @@ var init_rpc_output_stream = __esm({ * Triggers onNext and onMessage callbacks. */ notifyMessage(message) { - assert(!this.closed, "stream is closed"); + assert2(!this.closed, "stream is closed"); this.pushIt({ value: message, done: false }); this._lis.msg.forEach((l) => l(message)); this._lis.nxt.forEach((l) => l(message, void 0, false)); @@ -67786,7 +67786,7 @@ var init_rpc_output_stream = __esm({ * Triggers onNext and onError callbacks. */ notifyError(error3) { - assert(!this.closed, "stream is closed"); + assert2(!this.closed, "stream is closed"); this._closed = error3; this.pushIt(error3); this._lis.err.forEach((l) => l(error3)); @@ -67799,7 +67799,7 @@ var init_rpc_output_stream = __esm({ * Triggers onNext and onComplete callbacks. */ notifyComplete() { - assert(!this.closed, "stream is closed"); + assert2(!this.closed, "stream is closed"); this._closed = true; this.pushIt({ value: null, done: true }); this._lis.cmp.forEach((l) => l()); @@ -67830,8 +67830,8 @@ var init_rpc_output_stream = __esm({ return { next: () => { let state3 = this._itState; - assert(state3, "bad state"); - assert(!state3.p, "iterator contract broken"); + assert2(state3, "bad state"); + assert2(!state3.p, "iterator contract broken"); let first = state3.q.shift(); if (first) return "value" in first ? Promise.resolve(first) : Promise.reject(first); @@ -67848,7 +67848,7 @@ var init_rpc_output_stream = __esm({ return; if (state3.p) { const p = state3.p; - assert(p.state == DeferredState.PENDING, "iterator contract broken"); + assert2(p.state == DeferredState.PENDING, "iterator contract broken"); "value" in result ? p.resolve(result) : p.reject(result); delete state3.p; } else { @@ -68229,14 +68229,14 @@ var init_test_transport = __esm({ } let r; if (Array.isArray(this.data.response)) { - assert(this.data.response.length > 0); + assert2(this.data.response.length > 0); r = this.data.response[0]; } else if (this.data.response !== void 0) { r = this.data.response; } else { r = method.O.create(); } - assert(method.O.is(r)); + assert2(method.O.is(r)); return Promise.resolve(r); } /** @@ -68255,11 +68255,11 @@ var init_test_transport = __esm({ messages.push(method.O.create()); } else if (Array.isArray(this.data.response)) { for (let msg of this.data.response) { - assert(method.O.is(msg)); + assert2(method.O.is(msg)); messages.push(msg); } } else if (!(this.data.response instanceof RpcError)) { - assert(method.O.is(this.data.response)); + assert2(method.O.is(this.data.response)); messages.push(this.data.response); } try { @@ -68432,7 +68432,7 @@ function stackIntercept(kind, transport, method, options2, input) { } return tail(method, options2); } - assertNever(kind); + assertNever2(kind); } function stackUnaryInterceptors(transport, method, input, options2) { return stackIntercept("unary", transport, method, options2, input); @@ -70028,10 +70028,10 @@ var require_cache3 = __commonJS({ } options2.archiveSizeBytes = archiveFileSize; core6.debug("Reserving Cache"); - const version2 = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const version3 = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); const request3 = { key, - version: version2 + version: version3 }; let signedUploadUrl; try { @@ -70048,7 +70048,7 @@ var require_cache3 = __commonJS({ yield cacheHttpClient.saveCache(cacheId, archivePath, signedUploadUrl, options2); const finalizeRequest = { key, - version: version2, + version: version3, sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); @@ -70094,3877 +70094,2962 @@ var import_process = require("process"); var import_fs = require("fs"); var core2 = __toESM(require_core()); -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/helpers/util.js -var util; -(function(util4) { - util4.assertEqual = (_) => { - }; - function assertIs(_arg) { +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/core.js +var NEVER = Object.freeze({ + status: "aborted" +}); +// @__NO_SIDE_EFFECTS__ +function $constructor(name, initializer3, params) { + function init(inst, def) { + var _a3; + Object.defineProperty(inst, "_zod", { + value: inst._zod ?? {}, + enumerable: false + }); + (_a3 = inst._zod).traits ?? (_a3.traits = /* @__PURE__ */ new Set()); + inst._zod.traits.add(name); + initializer3(inst, def); + for (const k in _.prototype) { + if (!(k in inst)) + Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) }); + } + inst._zod.constr = _; + inst._zod.def = def; } - util4.assertIs = assertIs; - function assertNever2(_x) { - throw new Error(); + const Parent = params?.Parent ?? Object; + class Definition extends Parent { } - util4.assertNever = assertNever2; - util4.arrayToEnum = (items) => { - const obj = {}; - for (const item of items) { - obj[item] = item; - } - return obj; - }; - util4.getValidEnumValues = (obj) => { - const validKeys = util4.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); - const filtered = {}; - for (const k of validKeys) { - filtered[k] = obj[k]; + Object.defineProperty(Definition, "name", { value: name }); + function _(def) { + var _a3; + const inst = params?.Parent ? new Definition() : this; + init(inst, def); + (_a3 = inst._zod).deferred ?? (_a3.deferred = []); + for (const fn of inst._zod.deferred) { + fn(); + } + return inst; + } + Object.defineProperty(_, "init", { value: init }); + Object.defineProperty(_, Symbol.hasInstance, { + value: (inst) => { + if (params?.Parent && inst instanceof params.Parent) + return true; + return inst?._zod?.traits?.has(name); } - return util4.objectValues(filtered); - }; - util4.objectValues = (obj) => { - return util4.objectKeys(obj).map(function(e) { - return obj[e]; - }); - }; - util4.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => { - const keys = []; - for (const key in object) { - if (Object.prototype.hasOwnProperty.call(object, key)) { - keys.push(key); + }); + Object.defineProperty(_, "name", { value: name }); + return _; +} +var $brand = Symbol("zod_brand"); +var $ZodAsyncError = class extends Error { + constructor() { + super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); + } +}; +var globalConfig = {}; +function config(newConfig) { + if (newConfig) + Object.assign(globalConfig, newConfig); + return globalConfig; +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/util.js +var util_exports = {}; +__export(util_exports, { + BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES, + Class: () => Class, + NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES, + aborted: () => aborted, + allowsEval: () => allowsEval, + assert: () => assert, + assertEqual: () => assertEqual, + assertIs: () => assertIs, + assertNever: () => assertNever, + assertNotEqual: () => assertNotEqual, + assignProp: () => assignProp, + cached: () => cached, + captureStackTrace: () => captureStackTrace, + cleanEnum: () => cleanEnum, + cleanRegex: () => cleanRegex, + clone: () => clone, + cloneDef: () => cloneDef, + createTransparentProxy: () => createTransparentProxy, + defineLazy: () => defineLazy, + esc: () => esc, + escapeRegex: () => escapeRegex, + extend: () => extend, + finalizeIssue: () => finalizeIssue, + floatSafeRemainder: () => floatSafeRemainder, + getElementAtPath: () => getElementAtPath, + getEnumValues: () => getEnumValues, + getLengthableOrigin: () => getLengthableOrigin, + getParsedType: () => getParsedType, + getSizableOrigin: () => getSizableOrigin, + isObject: () => isObject, + isPlainObject: () => isPlainObject, + issue: () => issue, + joinValues: () => joinValues, + jsonStringifyReplacer: () => jsonStringifyReplacer, + merge: () => merge, + mergeDefs: () => mergeDefs, + normalizeParams: () => normalizeParams, + nullish: () => nullish, + numKeys: () => numKeys, + omit: () => omit, + optionalKeys: () => optionalKeys, + partial: () => partial, + pick: () => pick, + prefixIssues: () => prefixIssues, + primitiveTypes: () => primitiveTypes, + promiseAllObject: () => promiseAllObject, + propertyKeyTypes: () => propertyKeyTypes, + randomString: () => randomString, + required: () => required, + stringifyPrimitive: () => stringifyPrimitive, + unwrapMessage: () => unwrapMessage +}); +function assertEqual(val) { + return val; +} +function assertNotEqual(val) { + return val; +} +function assertIs(_arg) { +} +function assertNever(_x) { + throw new Error(); +} +function assert(_) { +} +function getEnumValues(entries) { + const numericValues = Object.values(entries).filter((v) => typeof v === "number"); + const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); + return values; +} +function joinValues(array2, separator = "|") { + return array2.map((val) => stringifyPrimitive(val)).join(separator); +} +function jsonStringifyReplacer(_, value) { + if (typeof value === "bigint") + return value.toString(); + return value; +} +function cached(getter) { + const set = false; + return { + get value() { + if (!set) { + const value = getter(); + Object.defineProperty(this, "value", { value }); + return value; } + throw new Error("cached value already set"); } - return keys; }; - util4.find = (arr, checker) => { - for (const item of arr) { - if (checker(item)) - return item; +} +function nullish(input) { + return input === null || input === void 0; +} +function cleanRegex(source) { + const start = source.startsWith("^") ? 1 : 0; + const end = source.endsWith("$") ? source.length - 1 : source.length; + return source.slice(start, end); +} +function floatSafeRemainder(val, step) { + const valDecCount = (val.toString().split(".")[1] || "").length; + const stepString = step.toString(); + let stepDecCount = (stepString.split(".")[1] || "").length; + if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) { + const match = stepString.match(/\d?e-(\d?)/); + if (match?.[1]) { + stepDecCount = Number.parseInt(match[1]); } - return void 0; - }; - util4.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val; - function joinValues(array, separator = " | ") { - return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator); } - util4.joinValues = joinValues; - util4.jsonStringifyReplacer = (_, value) => { - if (typeof value === "bigint") { - return value.toString(); + const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; + const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); + const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); + return valInt % stepInt / 10 ** decCount; +} +var EVALUATING = Symbol("evaluating"); +function defineLazy(object, key, getter) { + let value = void 0; + Object.defineProperty(object, key, { + get() { + if (value === EVALUATING) { + return void 0; + } + if (value === void 0) { + value = EVALUATING; + value = getter(); + } + return value; + }, + set(v) { + Object.defineProperty(object, key, { + value: v + // configurable: true, + }); + }, + configurable: true + }); +} +function assignProp(target, prop, value) { + Object.defineProperty(target, prop, { + value, + writable: true, + enumerable: true, + configurable: true + }); +} +function mergeDefs(...defs) { + const mergedDescriptors = {}; + for (const def of defs) { + const descriptors = Object.getOwnPropertyDescriptors(def); + Object.assign(mergedDescriptors, descriptors); + } + return Object.defineProperties({}, mergedDescriptors); +} +function cloneDef(schema) { + return mergeDefs(schema._zod.def); +} +function getElementAtPath(obj, path4) { + if (!path4) + return obj; + return path4.reduce((acc, key) => acc?.[key], obj); +} +function promiseAllObject(promisesObj) { + const keys = Object.keys(promisesObj); + const promises = keys.map((key) => promisesObj[key]); + return Promise.all(promises).then((results) => { + const resolvedObj = {}; + for (let i = 0; i < keys.length; i++) { + resolvedObj[keys[i]] = results[i]; + } + return resolvedObj; + }); +} +function randomString(length = 10) { + const chars = "abcdefghijklmnopqrstuvwxyz"; + let str = ""; + for (let i = 0; i < length; i++) { + str += chars[Math.floor(Math.random() * chars.length)]; + } + return str; +} +function esc(str) { + return JSON.stringify(str); +} +var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => { +}; +function isObject(data) { + return typeof data === "object" && data !== null && !Array.isArray(data); +} +var allowsEval = cached(() => { + if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) { + return false; + } + try { + const F = Function; + new F(""); + return true; + } catch (_) { + return false; + } +}); +function isPlainObject(o) { + if (isObject(o) === false) + return false; + const ctor = o.constructor; + if (ctor === void 0) + return true; + const prot = ctor.prototype; + if (isObject(prot) === false) + return false; + if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) { + return false; + } + return true; +} +function numKeys(data) { + let keyCount = 0; + for (const key in data) { + if (Object.prototype.hasOwnProperty.call(data, key)) { + keyCount++; } - return value; - }; -})(util || (util = {})); -var objectUtil; -(function(objectUtil2) { - objectUtil2.mergeShapes = (first, second) => { - return { - ...first, - ...second - // second overwrites first - }; - }; -})(objectUtil || (objectUtil = {})); -var ZodParsedType = util.arrayToEnum([ - "string", - "nan", - "number", - "integer", - "float", - "boolean", - "date", - "bigint", - "symbol", - "function", - "undefined", - "null", - "array", - "object", - "unknown", - "promise", - "void", - "never", - "map", - "set" -]); + } + return keyCount; +} var getParsedType = (data) => { const t = typeof data; switch (t) { case "undefined": - return ZodParsedType.undefined; + return "undefined"; case "string": - return ZodParsedType.string; + return "string"; case "number": - return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number; + return Number.isNaN(data) ? "nan" : "number"; case "boolean": - return ZodParsedType.boolean; + return "boolean"; case "function": - return ZodParsedType.function; + return "function"; case "bigint": - return ZodParsedType.bigint; + return "bigint"; case "symbol": - return ZodParsedType.symbol; + return "symbol"; case "object": if (Array.isArray(data)) { - return ZodParsedType.array; + return "array"; } if (data === null) { - return ZodParsedType.null; + return "null"; } if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { - return ZodParsedType.promise; + return "promise"; } if (typeof Map !== "undefined" && data instanceof Map) { - return ZodParsedType.map; + return "map"; } if (typeof Set !== "undefined" && data instanceof Set) { - return ZodParsedType.set; + return "set"; } if (typeof Date !== "undefined" && data instanceof Date) { - return ZodParsedType.date; + return "date"; } - return ZodParsedType.object; + if (typeof File !== "undefined" && data instanceof File) { + return "file"; + } + return "object"; default: - return ZodParsedType.unknown; + throw new Error(`Unknown data type: ${t}`); } }; - -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/ZodError.js -var ZodIssueCode = util.arrayToEnum([ - "invalid_type", - "invalid_literal", - "custom", - "invalid_union", - "invalid_union_discriminator", - "invalid_enum_value", - "unrecognized_keys", - "invalid_arguments", - "invalid_return_type", - "invalid_date", - "invalid_string", - "too_small", - "too_big", - "invalid_intersection_types", - "not_multiple_of", - "not_finite" -]); -var ZodError = class _ZodError extends Error { - get errors() { - return this.issues; - } - constructor(issues) { - super(); - this.issues = []; - this.addIssue = (sub) => { - this.issues = [...this.issues, sub]; - }; - this.addIssues = (subs = []) => { - this.issues = [...this.issues, ...subs]; - }; - const actualProto = new.target.prototype; - if (Object.setPrototypeOf) { - Object.setPrototypeOf(this, actualProto); - } else { - this.__proto__ = actualProto; - } - this.name = "ZodError"; - this.issues = issues; - } - format(_mapper) { - const mapper = _mapper || function(issue) { - return issue.message; - }; - const fieldErrors = { _errors: [] }; - const processError = (error3) => { - for (const issue of error3.issues) { - if (issue.code === "invalid_union") { - issue.unionErrors.map(processError); - } else if (issue.code === "invalid_return_type") { - processError(issue.returnTypeError); - } else if (issue.code === "invalid_arguments") { - processError(issue.argumentsError); - } else if (issue.path.length === 0) { - fieldErrors._errors.push(mapper(issue)); - } else { - let curr = fieldErrors; - let i = 0; - while (i < issue.path.length) { - const el = issue.path[i]; - const terminal = i === issue.path.length - 1; - if (!terminal) { - curr[el] = curr[el] || { _errors: [] }; - } else { - curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue)); - } - curr = curr[el]; - i++; - } - } - } - }; - processError(this); - return fieldErrors; - } - static assert(value) { - if (!(value instanceof _ZodError)) { - throw new Error(`Not a ZodError: ${value}`); - } - } - toString() { - return this.message; - } - get message() { - return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2); - } - get isEmpty() { - return this.issues.length === 0; - } - flatten(mapper = (issue) => issue.message) { - const fieldErrors = {}; - const formErrors = []; - for (const sub of this.issues) { - if (sub.path.length > 0) { - fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; - fieldErrors[sub.path[0]].push(mapper(sub)); - } else { - formErrors.push(mapper(sub)); - } +var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]); +var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]); +function escapeRegex(str) { + return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); +} +function clone(inst, def, params) { + const cl = new inst._zod.constr(def ?? inst._zod.def); + if (!def || params?.parent) + cl._zod.parent = inst; + return cl; +} +function normalizeParams(_params) { + const params = _params; + if (!params) + return {}; + if (typeof params === "string") + return { error: () => params }; + if (params?.message !== void 0) { + if (params?.error !== void 0) + throw new Error("Cannot specify both `message` and `error` params"); + params.error = params.message; + } + delete params.message; + if (typeof params.error === "string") + return { ...params, error: () => params.error }; + return params; +} +function createTransparentProxy(getter) { + let target; + return new Proxy({}, { + get(_, prop, receiver) { + target ?? (target = getter()); + return Reflect.get(target, prop, receiver); + }, + set(_, prop, value, receiver) { + target ?? (target = getter()); + return Reflect.set(target, prop, value, receiver); + }, + has(_, prop) { + target ?? (target = getter()); + return Reflect.has(target, prop); + }, + deleteProperty(_, prop) { + target ?? (target = getter()); + return Reflect.deleteProperty(target, prop); + }, + ownKeys(_) { + target ?? (target = getter()); + return Reflect.ownKeys(target); + }, + getOwnPropertyDescriptor(_, prop) { + target ?? (target = getter()); + return Reflect.getOwnPropertyDescriptor(target, prop); + }, + defineProperty(_, prop, descriptor) { + target ?? (target = getter()); + return Reflect.defineProperty(target, prop, descriptor); } - return { formErrors, fieldErrors }; - } - get formErrors() { - return this.flatten(); - } + }); +} +function stringifyPrimitive(value) { + if (typeof value === "bigint") + return value.toString() + "n"; + if (typeof value === "string") + return `"${value}"`; + return `${value}`; +} +function optionalKeys(shape) { + return Object.keys(shape).filter((k) => { + return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; + }); +} +var NUMBER_FORMAT_RANGES = { + safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], + int32: [-2147483648, 2147483647], + uint32: [0, 4294967295], + float32: [-34028234663852886e22, 34028234663852886e22], + float64: [-Number.MAX_VALUE, Number.MAX_VALUE] }; -ZodError.create = (issues) => { - const error3 = new ZodError(issues); - return error3; +var BIGINT_FORMAT_RANGES = { + int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")], + uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")] }; - -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/locales/en.js -var errorMap = (issue, _ctx) => { - let message; - switch (issue.code) { - case ZodIssueCode.invalid_type: - if (issue.received === ZodParsedType.undefined) { - message = "Required"; +function pick(schema, mask) { + const currDef = schema._zod.def; + const def = mergeDefs(schema._zod.def, { + get shape() { + const newShape = {}; + for (const key in mask) { + if (!(key in currDef.shape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + newShape[key] = currDef.shape[key]; + } + assignProp(this, "shape", newShape); + return newShape; + }, + checks: [] + }); + return clone(schema, def); +} +function omit(schema, mask) { + const currDef = schema._zod.def; + const def = mergeDefs(schema._zod.def, { + get shape() { + const newShape = { ...schema._zod.def.shape }; + for (const key in mask) { + if (!(key in currDef.shape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + delete newShape[key]; + } + assignProp(this, "shape", newShape); + return newShape; + }, + checks: [] + }); + return clone(schema, def); +} +function extend(schema, shape) { + if (!isPlainObject(shape)) { + throw new Error("Invalid input to extend: expected a plain object"); + } + const def = mergeDefs(schema._zod.def, { + get shape() { + const _shape = { ...schema._zod.def.shape, ...shape }; + assignProp(this, "shape", _shape); + return _shape; + }, + checks: [] + }); + return clone(schema, def); +} +function merge(a, b) { + const def = mergeDefs(a._zod.def, { + get shape() { + const _shape = { ...a._zod.def.shape, ...b._zod.def.shape }; + assignProp(this, "shape", _shape); + return _shape; + }, + get catchall() { + return b._zod.def.catchall; + }, + checks: [] + // delete existing checks + }); + return clone(a, def); +} +function partial(Class2, schema, mask) { + const def = mergeDefs(schema._zod.def, { + get shape() { + const oldShape = schema._zod.def.shape; + const shape = { ...oldShape }; + if (mask) { + for (const key in mask) { + if (!(key in oldShape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + shape[key] = Class2 ? new Class2({ + type: "optional", + innerType: oldShape[key] + }) : oldShape[key]; + } } else { - message = `Expected ${issue.expected}, received ${issue.received}`; + for (const key in oldShape) { + shape[key] = Class2 ? new Class2({ + type: "optional", + innerType: oldShape[key] + }) : oldShape[key]; + } } - break; - case ZodIssueCode.invalid_literal: - message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`; - break; - case ZodIssueCode.unrecognized_keys: - message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`; - break; - case ZodIssueCode.invalid_union: - message = `Invalid input`; - break; - case ZodIssueCode.invalid_union_discriminator: - message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`; - break; - case ZodIssueCode.invalid_enum_value: - message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`; - break; - case ZodIssueCode.invalid_arguments: - message = `Invalid function arguments`; - break; - case ZodIssueCode.invalid_return_type: - message = `Invalid function return type`; - break; - case ZodIssueCode.invalid_date: - message = `Invalid date`; - break; - case ZodIssueCode.invalid_string: - if (typeof issue.validation === "object") { - if ("includes" in issue.validation) { - message = `Invalid input: must include "${issue.validation.includes}"`; - if (typeof issue.validation.position === "number") { - message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; - } - } else if ("startsWith" in issue.validation) { - message = `Invalid input: must start with "${issue.validation.startsWith}"`; - } else if ("endsWith" in issue.validation) { - message = `Invalid input: must end with "${issue.validation.endsWith}"`; - } else { - util.assertNever(issue.validation); + assignProp(this, "shape", shape); + return shape; + }, + checks: [] + }); + return clone(schema, def); +} +function required(Class2, schema, mask) { + const def = mergeDefs(schema._zod.def, { + get shape() { + const oldShape = schema._zod.def.shape; + const shape = { ...oldShape }; + if (mask) { + for (const key in mask) { + if (!(key in shape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + shape[key] = new Class2({ + type: "nonoptional", + innerType: oldShape[key] + }); } - } else if (issue.validation !== "regex") { - message = `Invalid ${issue.validation}`; } else { - message = "Invalid"; + for (const key in oldShape) { + shape[key] = new Class2({ + type: "nonoptional", + innerType: oldShape[key] + }); + } } - break; - case ZodIssueCode.too_small: - if (issue.type === "array") - message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; - else if (issue.type === "string") - message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; - else if (issue.type === "number") - message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`; - else if (issue.type === "date") - message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode.too_big: - if (issue.type === "array") - message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; - else if (issue.type === "string") - message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; - else if (issue.type === "number") - message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; - else if (issue.type === "bigint") - message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; - else if (issue.type === "date") - message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode.custom: - message = `Invalid input`; - break; - case ZodIssueCode.invalid_intersection_types: - message = `Intersection results could not be merged`; - break; - case ZodIssueCode.not_multiple_of: - message = `Number must be a multiple of ${issue.multipleOf}`; - break; - case ZodIssueCode.not_finite: - message = "Number must be finite"; - break; - default: - message = _ctx.defaultError; - util.assertNever(issue); + assignProp(this, "shape", shape); + return shape; + }, + checks: [] + }); + return clone(schema, def); +} +function aborted(x, startIndex = 0) { + for (let i = startIndex; i < x.issues.length; i++) { + if (x.issues[i]?.continue !== true) { + return true; + } } - return { message }; -}; -var en_default = errorMap; - -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/errors.js -var overrideErrorMap = en_default; -function getErrorMap() { - return overrideErrorMap; + return false; } - -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/helpers/parseUtil.js -var makeIssue = (params) => { - const { data, path: path4, errorMaps, issueData } = params; - const fullPath = [...path4, ...issueData.path || []]; - const fullIssue = { - ...issueData, - path: fullPath - }; - if (issueData.message !== void 0) { +function prefixIssues(path4, issues) { + return issues.map((iss) => { + var _a3; + (_a3 = iss).path ?? (_a3.path = []); + iss.path.unshift(path4); + return iss; + }); +} +function unwrapMessage(message) { + return typeof message === "string" ? message : message?.message; +} +function finalizeIssue(iss, ctx, config2) { + const full = { ...iss, path: iss.path ?? [] }; + if (!iss.message) { + const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input"; + full.message = message; + } + delete full.inst; + delete full.continue; + if (!ctx?.reportInput) { + delete full.input; + } + return full; +} +function getSizableOrigin(input) { + if (input instanceof Set) + return "set"; + if (input instanceof Map) + return "map"; + if (input instanceof File) + return "file"; + return "unknown"; +} +function getLengthableOrigin(input) { + if (Array.isArray(input)) + return "array"; + if (typeof input === "string") + return "string"; + return "unknown"; +} +function issue(...args) { + const [iss, input, inst] = args; + if (typeof iss === "string") { return { - ...issueData, - path: fullPath, - message: issueData.message + message: iss, + code: "custom", + input, + inst }; } - let errorMessage = ""; - const maps = errorMaps.filter((m) => !!m).slice().reverse(); - for (const map of maps) { - errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message; + return { ...iss }; +} +function cleanEnum(obj) { + return Object.entries(obj).filter(([k, _]) => { + return Number.isNaN(Number.parseInt(k, 10)); + }).map((el) => el[1]); +} +var Class = class { + constructor(..._args) { } - return { - ...issueData, - path: fullPath, - message: errorMessage - }; }; -function addIssueToContext(ctx, issueData) { - const overrideMap = getErrorMap(); - const issue = makeIssue({ - issueData, - data: ctx.data, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - // contextual error map is first priority - ctx.schemaErrorMap, - // then schema-bound map if available - overrideMap, - // then global override map - overrideMap === en_default ? void 0 : en_default - // then global default map - ].filter((x) => !!x) + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/errors.js +var initializer = (inst, def) => { + inst.name = "$ZodError"; + Object.defineProperty(inst, "_zod", { + value: inst._zod, + enumerable: false }); - ctx.common.issues.push(issue); -} -var ParseStatus = class _ParseStatus { - constructor() { - this.value = "valid"; - } - dirty() { - if (this.value === "valid") - this.value = "dirty"; - } - abort() { - if (this.value !== "aborted") - this.value = "aborted"; - } - static mergeArray(status, results) { - const arrayValue = []; - for (const s of results) { - if (s.status === "aborted") - return INVALID; - if (s.status === "dirty") - status.dirty(); - arrayValue.push(s.value); - } - return { status: status.value, value: arrayValue }; - } - static async mergeObjectAsync(status, pairs) { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - syncPairs.push({ - key, - value - }); + Object.defineProperty(inst, "issues", { + value: def, + enumerable: false + }); + inst.message = JSON.stringify(def, jsonStringifyReplacer, 2); + Object.defineProperty(inst, "toString", { + value: () => inst.message, + enumerable: false + }); +}; +var $ZodError = $constructor("$ZodError", initializer); +var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error }); +function flattenError(error3, mapper = (issue2) => issue2.message) { + const fieldErrors = {}; + const formErrors = []; + for (const sub of error3.issues) { + if (sub.path.length > 0) { + fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; + fieldErrors[sub.path[0]].push(mapper(sub)); + } else { + formErrors.push(mapper(sub)); } - return _ParseStatus.mergeObjectSync(status, syncPairs); } - static mergeObjectSync(status, pairs) { - const finalObject = {}; - for (const pair of pairs) { - const { key, value } = pair; - if (key.status === "aborted") - return INVALID; - if (value.status === "aborted") - return INVALID; - if (key.status === "dirty") - status.dirty(); - if (value.status === "dirty") - status.dirty(); - if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) { - finalObject[key.value] = value.value; + return { formErrors, fieldErrors }; +} +function formatError(error3, _mapper) { + const mapper = _mapper || function(issue2) { + return issue2.message; + }; + const fieldErrors = { _errors: [] }; + const processError = (error4) => { + for (const issue2 of error4.issues) { + if (issue2.code === "invalid_union" && issue2.errors.length) { + issue2.errors.map((issues) => processError({ issues })); + } else if (issue2.code === "invalid_key") { + processError({ issues: issue2.issues }); + } else if (issue2.code === "invalid_element") { + processError({ issues: issue2.issues }); + } else if (issue2.path.length === 0) { + fieldErrors._errors.push(mapper(issue2)); + } else { + let curr = fieldErrors; + let i = 0; + while (i < issue2.path.length) { + const el = issue2.path[i]; + const terminal = i === issue2.path.length - 1; + if (!terminal) { + curr[el] = curr[el] || { _errors: [] }; + } else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue2)); + } + curr = curr[el]; + i++; + } } } - return { status: status.value, value: finalObject }; + }; + processError(error3); + return fieldErrors; +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/parse.js +var _parse = (_Err) => (schema, value, _ctx, _params) => { + const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false }; + const result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) { + throw new $ZodAsyncError(); + } + if (result.issues.length) { + const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + captureStackTrace(e, _params?.callee); + throw e; } + return result.value; }; -var INVALID = Object.freeze({ - status: "aborted" -}); -var DIRTY = (value) => ({ status: "dirty", value }); -var OK = (value) => ({ status: "valid", value }); -var isAborted = (x) => x.status === "aborted"; -var isDirty = (x) => x.status === "dirty"; -var isValid = (x) => x.status === "valid"; -var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise; +var _parseAsync = (_Err) => async (schema, value, _ctx, params) => { + const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; + let result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) + result = await result; + if (result.issues.length) { + const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + captureStackTrace(e, params?.callee); + throw e; + } + return result.value; +}; +var _safeParse = (_Err) => (schema, value, _ctx) => { + const ctx = _ctx ? { ..._ctx, async: false } : { async: false }; + const result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) { + throw new $ZodAsyncError(); + } + return result.issues.length ? { + success: false, + error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + } : { success: true, data: result.value }; +}; +var safeParse = /* @__PURE__ */ _safeParse($ZodRealError); +var _safeParseAsync = (_Err) => async (schema, value, _ctx) => { + const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; + let result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) + result = await result; + return result.issues.length ? { + success: false, + error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + } : { success: true, data: result.value }; +}; +var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError); -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/helpers/errorUtil.js -var errorUtil; -(function(errorUtil2) { - errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {}; - errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message; -})(errorUtil || (errorUtil = {})); +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/regexes.js +var cuid = /^[cC][^\s-]{8,}$/; +var cuid2 = /^[0-9a-z]+$/; +var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; +var xid = /^[0-9a-vA-V]{20}$/; +var ksuid = /^[A-Za-z0-9]{27}$/; +var nanoid = /^[a-zA-Z0-9_-]{21}$/; +var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; +var 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})$/; +var uuid = (version3) => { + if (!version3) + return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/; + return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version3}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); +}; +var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; +var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +function emoji() { + return new RegExp(_emoji, "u"); +} +var 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])$/; +var 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})$/; +var 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])$/; +var 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])$/; +var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; +var base64url = /^[A-Za-z0-9_-]*$/; +var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/; +var e164 = /^\+(?:[0-9]){6,14}[0-9]$/; +var 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])))`; +var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`); +function timeSource(args) { + const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; + const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; + return regex; +} +function time(args) { + return new RegExp(`^${timeSource(args)}$`); +} +function datetime(args) { + const time3 = timeSource({ precision: args.precision }); + const opts = ["Z"]; + if (args.local) + opts.push(""); + if (args.offset) + opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); + const timeRegex = `${time3}(?:${opts.join("|")})`; + return new RegExp(`^${dateSource}T(?:${timeRegex})$`); +} +var string = (params) => { + const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; + return new RegExp(`^${regex}$`); +}; +var boolean = /true|false/i; +var lowercase = /^[^A-Z]*$/; +var uppercase = /^[^a-z]*$/; -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/types.js -var ParseInputLazyPath = class { - constructor(parent, value, path4, key) { - this._cachedPath = []; - this.parent = parent; - this.data = value; - this._path = path4; - this._key = key; - } - get path() { - if (!this._cachedPath.length) { - if (Array.isArray(this._key)) { - this._cachedPath.push(...this._path, ...this._key); - } else { - this._cachedPath.push(...this._path, this._key); - } +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/checks.js +var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => { + var _a3; + inst._zod ?? (inst._zod = {}); + inst._zod.def = def; + (_a3 = inst._zod).onattach ?? (_a3.onattach = []); +}); +var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => { + var _a3; + $ZodCheck.init(inst, def); + (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== void 0; + }); + inst._zod.onattach.push((inst2) => { + const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY; + if (def.maximum < curr) + inst2._zod.bag.maximum = def.maximum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length <= def.maximum) + return; + const origin = getLengthableOrigin(input); + payload.issues.push({ + origin, + code: "too_big", + maximum: def.maximum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => { + var _a3; + $ZodCheck.init(inst, def); + (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== void 0; + }); + inst._zod.onattach.push((inst2) => { + const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; + if (def.minimum > curr) + inst2._zod.bag.minimum = def.minimum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length >= def.minimum) + return; + const origin = getLengthableOrigin(input); + payload.issues.push({ + origin, + code: "too_small", + minimum: def.minimum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => { + var _a3; + $ZodCheck.init(inst, def); + (_a3 = inst._zod.def).when ?? (_a3.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== void 0; + }); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.minimum = def.length; + bag.maximum = def.length; + bag.length = def.length; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length === def.length) + return; + const origin = getLengthableOrigin(input); + const tooBig = length > def.length; + payload.issues.push({ + origin, + ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length }, + inclusive: true, + exact: true, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => { + var _a3, _b2; + $ZodCheck.init(inst, def); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.format = def.format; + if (def.pattern) { + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(def.pattern); } - return this._cachedPath; - } + }); + if (def.pattern) + (_a3 = inst._zod).check ?? (_a3.check = (payload) => { + def.pattern.lastIndex = 0; + if (def.pattern.test(payload.value)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: def.format, + input: payload.value, + ...def.pattern ? { pattern: def.pattern.toString() } : {}, + inst, + continue: !def.abort + }); + }); + else + (_b2 = inst._zod).check ?? (_b2.check = () => { + }); +}); +var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => { + $ZodCheckStringFormat.init(inst, def); + inst._zod.check = (payload) => { + def.pattern.lastIndex = 0; + if (def.pattern.test(payload.value)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "regex", + input: payload.value, + pattern: def.pattern.toString(), + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => { + def.pattern ?? (def.pattern = lowercase); + $ZodCheckStringFormat.init(inst, def); +}); +var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => { + def.pattern ?? (def.pattern = uppercase); + $ZodCheckStringFormat.init(inst, def); +}); +var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => { + $ZodCheck.init(inst, def); + const escapedRegex = escapeRegex(def.includes); + const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex); + def.pattern = pattern; + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.includes(def.includes, def.position)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "includes", + includes: def.includes, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => { + $ZodCheck.init(inst, def); + const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`); + def.pattern ?? (def.pattern = pattern); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.startsWith(def.prefix)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "starts_with", + prefix: def.prefix, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => { + $ZodCheck.init(inst, def); + const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`); + def.pattern ?? (def.pattern = pattern); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.endsWith(def.suffix)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "ends_with", + suffix: def.suffix, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => { + $ZodCheck.init(inst, def); + inst._zod.check = (payload) => { + payload.value = def.tx(payload.value); + }; +}); + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/versions.js +var version = { + major: 4, + minor: 0, + patch: 14 }; -var handleResult = (ctx, result) => { - if (isValid(result)) { - return { success: true, data: result.value }; + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/schemas.js +var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { + var _a3; + inst ?? (inst = {}); + inst._zod.def = def; + inst._zod.bag = inst._zod.bag || {}; + inst._zod.version = version; + const checks = [...inst._zod.def.checks ?? []]; + if (inst._zod.traits.has("$ZodCheck")) { + checks.unshift(inst); + } + for (const ch of checks) { + for (const fn of ch._zod.onattach) { + fn(inst); + } + } + if (checks.length === 0) { + (_a3 = inst._zod).deferred ?? (_a3.deferred = []); + inst._zod.deferred?.push(() => { + inst._zod.run = inst._zod.parse; + }); } else { - if (!ctx.common.issues.length) { - throw new Error("Validation failed but no issues detected."); - } - return { - success: false, - get error() { - if (this._error) - return this._error; - const error3 = new ZodError(ctx.common.issues); - this._error = error3; - return this._error; + const runChecks = (payload, checks2, ctx) => { + let isAborted = aborted(payload); + let asyncResult; + for (const ch of checks2) { + if (ch._zod.def.when) { + const shouldRun = ch._zod.def.when(payload); + if (!shouldRun) + continue; + } else if (isAborted) { + continue; + } + const currLen = payload.issues.length; + const _ = ch._zod.check(payload); + if (_ instanceof Promise && ctx?.async === false) { + throw new $ZodAsyncError(); + } + if (asyncResult || _ instanceof Promise) { + asyncResult = (asyncResult ?? Promise.resolve()).then(async () => { + await _; + const nextLen = payload.issues.length; + if (nextLen === currLen) + return; + if (!isAborted) + isAborted = aborted(payload, currLen); + }); + } else { + const nextLen = payload.issues.length; + if (nextLen === currLen) + continue; + if (!isAborted) + isAborted = aborted(payload, currLen); + } } + if (asyncResult) { + return asyncResult.then(() => { + return payload; + }); + } + return payload; }; - } -}; -function processCreateParams(params) { - if (!params) - return {}; - const { errorMap: errorMap2, invalid_type_error, required_error, description } = params; - if (errorMap2 && (invalid_type_error || required_error)) { - throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); - } - if (errorMap2) - return { errorMap: errorMap2, description }; - const customMap = (iss, ctx) => { - const { message } = params; - if (iss.code === "invalid_enum_value") { - return { message: message ?? ctx.defaultError }; - } - if (typeof ctx.data === "undefined") { - return { message: message ?? required_error ?? ctx.defaultError }; - } - if (iss.code !== "invalid_type") - return { message: ctx.defaultError }; - return { message: message ?? invalid_type_error ?? ctx.defaultError }; - }; - return { errorMap: customMap, description }; -} -var ZodType = class { - get description() { - return this._def.description; - } - _getType(input) { - return getParsedType(input.data); - } - _getOrReturnCtx(input, ctx) { - return ctx || { - common: input.parent.common, - data: input.data, - parsedType: getParsedType(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent - }; - } - _processInputParams(input) { - return { - status: new ParseStatus(), - ctx: { - common: input.parent.common, - data: input.data, - parsedType: getParsedType(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent + inst._zod.run = (payload, ctx) => { + const result = inst._zod.parse(payload, ctx); + if (result instanceof Promise) { + if (ctx.async === false) + throw new $ZodAsyncError(); + return result.then((result2) => runChecks(result2, checks, ctx)); } + return runChecks(result, checks, ctx); }; } - _parseSync(input) { - const result = this._parse(input); - if (isAsync(result)) { - throw new Error("Synchronous parse encountered promise."); - } - return result; - } - _parseAsync(input) { - const result = this._parse(input); - return Promise.resolve(result); - } - parse(data, params) { - const result = this.safeParse(data, params); - if (result.success) - return result.data; - throw result.error; - } - safeParse(data, params) { - const ctx = { - common: { - issues: [], - async: params?.async ?? false, - contextualErrorMap: params?.errorMap - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - const result = this._parseSync({ data, path: ctx.path, parent: ctx }); - return handleResult(ctx, result); - } - "~validate"(data) { - const ctx = { - common: { - issues: [], - async: !!this["~standard"].async - }, - path: [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - if (!this["~standard"].async) { + inst["~standard"] = { + validate: (value) => { try { - const result = this._parseSync({ data, path: [], parent: ctx }); - return isValid(result) ? { - value: result.value - } : { - issues: ctx.common.issues - }; - } catch (err) { - if (err?.message?.toLowerCase()?.includes("encountered")) { - this["~standard"].async = true; - } - ctx.common = { - issues: [], - async: true - }; + const r = safeParse(inst, value); + return r.success ? { value: r.data } : { issues: r.error?.issues }; + } catch (_) { + return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues }); } - } - return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? { - value: result.value - } : { - issues: ctx.common.issues + }, + vendor: "zod", + version: 1 + }; +}); +var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag); + inst._zod.parse = (payload, _) => { + if (def.coerce) + try { + payload.value = String(payload.value); + } catch (_2) { + } + if (typeof payload.value === "string") + return payload; + payload.issues.push({ + expected: "string", + code: "invalid_type", + input: payload.value, + inst }); - } - async parseAsync(data, params) { - const result = await this.safeParseAsync(data, params); - if (result.success) - return result.data; - throw result.error; - } - async safeParseAsync(data, params) { - const ctx = { - common: { - issues: [], - contextualErrorMap: params?.errorMap, - async: true - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); - const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); - return handleResult(ctx, result); - } - refine(check, message) { - const getIssueProperties = (val) => { - if (typeof message === "string" || typeof message === "undefined") { - return { message }; - } else if (typeof message === "function") { - return message(val); - } else { - return message; - } - }; - return this._refinement((val, ctx) => { - const result = check(val); - const setError = () => ctx.addIssue({ - code: ZodIssueCode.custom, - ...getIssueProperties(val) - }); - if (typeof Promise !== "undefined" && result instanceof Promise) { - return result.then((data) => { - if (!data) { - setError(); - return false; - } else { - return true; - } - }); + return payload; + }; +}); +var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => { + $ZodCheckStringFormat.init(inst, def); + $ZodString.init(inst, def); +}); +var $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => { + def.pattern ?? (def.pattern = guid); + $ZodStringFormat.init(inst, def); +}); +var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => { + if (def.version) { + const versionMap = { + v1: 1, + v2: 2, + v3: 3, + v4: 4, + v5: 5, + v6: 6, + v7: 7, + v8: 8 + }; + const v = versionMap[def.version]; + if (v === void 0) + throw new Error(`Invalid UUID version: "${def.version}"`); + def.pattern ?? (def.pattern = uuid(v)); + } else + def.pattern ?? (def.pattern = uuid()); + $ZodStringFormat.init(inst, def); +}); +var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => { + def.pattern ?? (def.pattern = email); + $ZodStringFormat.init(inst, def); +}); +var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => { + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + try { + const trimmed = payload.value.trim(); + const url2 = new URL(trimmed); + if (def.hostname) { + def.hostname.lastIndex = 0; + if (!def.hostname.test(url2.hostname)) { + payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid hostname", + pattern: hostname.source, + input: payload.value, + inst, + continue: !def.abort + }); + } } - if (!result) { - setError(); - return false; - } else { - return true; + if (def.protocol) { + def.protocol.lastIndex = 0; + if (!def.protocol.test(url2.protocol.endsWith(":") ? url2.protocol.slice(0, -1) : url2.protocol)) { + payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid protocol", + pattern: def.protocol.source, + input: payload.value, + inst, + continue: !def.abort + }); + } } - }); - } - refinement(check, refinementData) { - return this._refinement((val, ctx) => { - if (!check(val)) { - ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); - return false; + if (def.normalize) { + payload.value = url2.href; } else { - return true; + payload.value = trimmed; } - }); - } - _refinement(refinement) { - return new ZodEffects({ - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { type: "refinement", refinement } - }); - } - superRefine(refinement) { - return this._refinement(refinement); - } - constructor(def) { - this.spa = this.safeParseAsync; - this._def = def; - this.parse = this.parse.bind(this); - this.safeParse = this.safeParse.bind(this); - this.parseAsync = this.parseAsync.bind(this); - this.safeParseAsync = this.safeParseAsync.bind(this); - this.spa = this.spa.bind(this); - this.refine = this.refine.bind(this); - this.refinement = this.refinement.bind(this); - this.superRefine = this.superRefine.bind(this); - this.optional = this.optional.bind(this); - this.nullable = this.nullable.bind(this); - this.nullish = this.nullish.bind(this); - this.array = this.array.bind(this); - this.promise = this.promise.bind(this); - this.or = this.or.bind(this); - this.and = this.and.bind(this); - this.transform = this.transform.bind(this); - this.brand = this.brand.bind(this); - this.default = this.default.bind(this); - this.catch = this.catch.bind(this); - this.describe = this.describe.bind(this); - this.pipe = this.pipe.bind(this); - this.readonly = this.readonly.bind(this); - this.isNullable = this.isNullable.bind(this); - this.isOptional = this.isOptional.bind(this); - this["~standard"] = { - version: 1, - vendor: "zod", - validate: (data) => this["~validate"](data) - }; - } - optional() { - return ZodOptional.create(this, this._def); - } - nullable() { - return ZodNullable.create(this, this._def); - } - nullish() { - return this.nullable().optional(); - } - array() { - return ZodArray.create(this); - } - promise() { - return ZodPromise.create(this, this._def); - } - or(option) { - return ZodUnion.create([this, option], this._def); - } - and(incoming) { - return ZodIntersection.create(this, incoming, this._def); - } - transform(transform) { - return new ZodEffects({ - ...processCreateParams(this._def), - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { type: "transform", transform } - }); - } - default(def) { - const defaultValueFunc = typeof def === "function" ? def : () => def; - return new ZodDefault({ - ...processCreateParams(this._def), - innerType: this, - defaultValue: defaultValueFunc, - typeName: ZodFirstPartyTypeKind.ZodDefault - }); - } - brand() { - return new ZodBranded({ - typeName: ZodFirstPartyTypeKind.ZodBranded, - type: this, - ...processCreateParams(this._def) - }); - } - catch(def) { - const catchValueFunc = typeof def === "function" ? def : () => def; - return new ZodCatch({ - ...processCreateParams(this._def), - innerType: this, - catchValue: catchValueFunc, - typeName: ZodFirstPartyTypeKind.ZodCatch - }); - } - describe(description) { - const This = this.constructor; - return new This({ - ...this._def, - description - }); - } - pipe(target) { - return ZodPipeline.create(this, target); - } - readonly() { - return ZodReadonly.create(this); - } - isOptional() { - return this.safeParse(void 0).success; - } - isNullable() { - return this.safeParse(null).success; - } -}; -var cuidRegex = /^c[^\s-]{8,}$/i; -var cuid2Regex = /^[0-9a-z]+$/; -var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i; -var 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; -var nanoidRegex = /^[a-z0-9_-]{21}$/i; -var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/; -var 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)?)??$/; -var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; -var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; -var emojiRegex; -var 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])$/; -var 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])$/; -var 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]))$/; -var 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])$/; -var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; -var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; -var 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])))`; -var dateRegex = new RegExp(`^${dateRegexSource}$`); -function timeRegexSource(args) { - let secondsRegexSource = `[0-5]\\d`; - if (args.precision) { - secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`; - } else if (args.precision == null) { - secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; - } - const secondsQuantifier = args.precision ? "+" : "?"; - return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`; -} -function timeRegex(args) { - return new RegExp(`^${timeRegexSource(args)}$`); -} -function datetimeRegex(args) { - let regex = `${dateRegexSource}T${timeRegexSource(args)}`; - const opts = []; - opts.push(args.local ? `Z?` : `Z`); - if (args.offset) - opts.push(`([+-]\\d{2}:?\\d{2})`); - regex = `${regex}(${opts.join("|")})`; - return new RegExp(`^${regex}$`); -} -function isValidIP(ip, version2) { - if ((version2 === "v4" || !version2) && ipv4Regex.test(ip)) { + return; + } catch (_) { + payload.issues.push({ + code: "invalid_format", + format: "url", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => { + def.pattern ?? (def.pattern = emoji()); + $ZodStringFormat.init(inst, def); +}); +var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => { + def.pattern ?? (def.pattern = nanoid); + $ZodStringFormat.init(inst, def); +}); +var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => { + def.pattern ?? (def.pattern = cuid); + $ZodStringFormat.init(inst, def); +}); +var $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => { + def.pattern ?? (def.pattern = cuid2); + $ZodStringFormat.init(inst, def); +}); +var $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => { + def.pattern ?? (def.pattern = ulid); + $ZodStringFormat.init(inst, def); +}); +var $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => { + def.pattern ?? (def.pattern = xid); + $ZodStringFormat.init(inst, def); +}); +var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => { + def.pattern ?? (def.pattern = ksuid); + $ZodStringFormat.init(inst, def); +}); +var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => { + def.pattern ?? (def.pattern = datetime(def)); + $ZodStringFormat.init(inst, def); +}); +var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => { + def.pattern ?? (def.pattern = date); + $ZodStringFormat.init(inst, def); +}); +var $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => { + def.pattern ?? (def.pattern = time(def)); + $ZodStringFormat.init(inst, def); +}); +var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => { + def.pattern ?? (def.pattern = duration); + $ZodStringFormat.init(inst, def); +}); +var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => { + def.pattern ?? (def.pattern = ipv4); + $ZodStringFormat.init(inst, def); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.format = `ipv4`; + }); +}); +var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => { + def.pattern ?? (def.pattern = ipv6); + $ZodStringFormat.init(inst, def); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.format = `ipv6`; + }); + inst._zod.check = (payload) => { + try { + new URL(`http://[${payload.value}]`); + } catch { + payload.issues.push({ + code: "invalid_format", + format: "ipv6", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => { + def.pattern ?? (def.pattern = cidrv4); + $ZodStringFormat.init(inst, def); +}); +var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => { + def.pattern ?? (def.pattern = cidrv6); + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + const [address, prefix2] = payload.value.split("/"); + try { + if (!prefix2) + throw new Error(); + const prefixNum = Number(prefix2); + if (`${prefixNum}` !== prefix2) + throw new Error(); + if (prefixNum < 0 || prefixNum > 128) + throw new Error(); + new URL(`http://[${address}]`); + } catch { + payload.issues.push({ + code: "invalid_format", + format: "cidrv6", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +function isValidBase64(data) { + if (data === "") return true; - } - if ((version2 === "v6" || !version2) && ipv6Regex.test(ip)) { + if (data.length % 4 !== 0) + return false; + try { + atob(data); return true; + } catch { + return false; } - return false; } -function isValidJWT(jwt, alg) { - if (!jwtRegex.test(jwt)) +var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => { + def.pattern ?? (def.pattern = base64); + $ZodStringFormat.init(inst, def); + inst._zod.onattach.push((inst2) => { + inst2._zod.bag.contentEncoding = "base64"; + }); + inst._zod.check = (payload) => { + if (isValidBase64(payload.value)) + return; + payload.issues.push({ + code: "invalid_format", + format: "base64", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +function isValidBase64URL(data) { + if (!base64url.test(data)) return false; + const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); + const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "="); + return isValidBase64(padded); +} +var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => { + def.pattern ?? (def.pattern = base64url); + $ZodStringFormat.init(inst, def); + inst._zod.onattach.push((inst2) => { + inst2._zod.bag.contentEncoding = "base64url"; + }); + inst._zod.check = (payload) => { + if (isValidBase64URL(payload.value)) + return; + payload.issues.push({ + code: "invalid_format", + format: "base64url", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => { + def.pattern ?? (def.pattern = e164); + $ZodStringFormat.init(inst, def); +}); +function isValidJWT(token, algorithm = null) { try { - const [header] = jwt.split("."); - const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); - const decoded = JSON.parse(atob(base64)); - if (typeof decoded !== "object" || decoded === null) + const tokensParts = token.split("."); + if (tokensParts.length !== 3) return false; - if ("typ" in decoded && decoded?.typ !== "JWT") + const [header] = tokensParts; + if (!header) return false; - if (!decoded.alg) + const parsedHeader = JSON.parse(atob(header)); + if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false; - if (alg && decoded.alg !== alg) + if (!parsedHeader.alg) + return false; + if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false; return true; } catch { return false; } } -function isValidCidr(ip, version2) { - if ((version2 === "v4" || !version2) && ipv4CidrRegex.test(ip)) { - return true; - } - if ((version2 === "v6" || !version2) && ipv6CidrRegex.test(ip)) { - return true; +var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => { + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + if (isValidJWT(payload.value, def.alg)) + return; + payload.issues.push({ + code: "invalid_format", + format: "jwt", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = boolean; + inst._zod.parse = (payload, _ctx) => { + if (def.coerce) + try { + payload.value = Boolean(payload.value); + } catch (_) { + } + const input = payload.value; + if (typeof input === "boolean") + return payload; + payload.issues.push({ + expected: "boolean", + code: "invalid_type", + input, + inst + }); + return payload; + }; +}); +function handleArrayResult(result, final, index) { + if (result.issues.length) { + final.issues.push(...prefixIssues(index, result.issues)); } - return false; + final.value[index] = result.value; } -var ZodString = class _ZodString extends ZodType { - _parse(input) { - if (this._def.coerce) { - input.data = String(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.string) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.string, - received: ctx2.parsedType +var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!Array.isArray(input)) { + payload.issues.push({ + expected: "array", + code: "invalid_type", + input, + inst }); - return INVALID; - } - const status = new ParseStatus(); - let ctx = void 0; - for (const check of this._def.checks) { - if (check.kind === "min") { - if (input.data.length < check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "string", - inclusive: true, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (input.data.length > check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "string", - inclusive: true, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "length") { - const tooBig = input.data.length > check.value; - const tooSmall = input.data.length < check.value; - if (tooBig || tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - if (tooBig) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "string", - inclusive: true, - exact: true, - message: check.message - }); - } else if (tooSmall) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "string", - inclusive: true, - exact: true, - message: check.message - }); - } - status.dirty(); - } - } else if (check.kind === "email") { - if (!emailRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "email", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "emoji") { - if (!emojiRegex) { - emojiRegex = new RegExp(_emojiRegex, "u"); - } - if (!emojiRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "emoji", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "uuid") { - if (!uuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "uuid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "nanoid") { - if (!nanoidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "nanoid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cuid") { - if (!cuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cuid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cuid2") { - if (!cuid2Regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cuid2", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "ulid") { - if (!ulidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "ulid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "url") { - try { - new URL(input.data); - } catch { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "url", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "regex") { - check.regex.lastIndex = 0; - const testResult = check.regex.test(input.data); - if (!testResult) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "regex", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "trim") { - input.data = input.data.trim(); - } else if (check.kind === "includes") { - if (!input.data.includes(check.value, check.position)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { includes: check.value, position: check.position }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "toLowerCase") { - input.data = input.data.toLowerCase(); - } else if (check.kind === "toUpperCase") { - input.data = input.data.toUpperCase(); - } else if (check.kind === "startsWith") { - if (!input.data.startsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { startsWith: check.value }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "endsWith") { - if (!input.data.endsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { endsWith: check.value }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "datetime") { - const regex = datetimeRegex(check); - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "datetime", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "date") { - const regex = dateRegex; - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "date", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "time") { - const regex = timeRegex(check); - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "time", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "duration") { - if (!durationRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "duration", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "ip") { - if (!isValidIP(input.data, check.version)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "ip", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "jwt") { - if (!isValidJWT(input.data, check.alg)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "jwt", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cidr") { - if (!isValidCidr(input.data, check.version)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cidr", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "base64") { - if (!base64Regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "base64", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "base64url") { - if (!base64urlRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "base64url", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } + return payload; + } + payload.value = Array(input.length); + const proms = []; + for (let i = 0; i < input.length; i++) { + const item = input[i]; + const result = def.element._zod.run({ + value: item, + issues: [] + }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => handleArrayResult(result2, payload, i))); } else { - util.assertNever(check); + handleArrayResult(result, payload, i); } } - return { status: status.value, value: input.data }; - } - _regex(regex, validation, message) { - return this.refinement((data) => regex.test(data), { - validation, - code: ZodIssueCode.invalid_string, - ...errorUtil.errToObj(message) - }); - } - _addCheck(check) { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - email(message) { - return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) }); - } - url(message) { - return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) }); - } - emoji(message) { - return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) }); - } - uuid(message) { - return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) }); - } - nanoid(message) { - return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) }); - } - cuid(message) { - return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) }); - } - cuid2(message) { - return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) }); - } - ulid(message) { - return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) }); - } - base64(message) { - return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) }); - } - base64url(message) { - return this._addCheck({ - kind: "base64url", - ...errorUtil.errToObj(message) - }); - } - jwt(options2) { - return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options2) }); - } - ip(options2) { - return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options2) }); - } - cidr(options2) { - return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options2) }); - } - datetime(options2) { - if (typeof options2 === "string") { - return this._addCheck({ - kind: "datetime", - precision: null, - offset: false, - local: false, - message: options2 - }); + if (proms.length) { + return Promise.all(proms).then(() => payload); } - return this._addCheck({ - kind: "datetime", - precision: typeof options2?.precision === "undefined" ? null : options2?.precision, - offset: options2?.offset ?? false, - local: options2?.local ?? false, - ...errorUtil.errToObj(options2?.message) - }); - } - date(message) { - return this._addCheck({ kind: "date", message }); - } - time(options2) { - if (typeof options2 === "string") { - return this._addCheck({ - kind: "time", - precision: null, - message: options2 - }); - } - return this._addCheck({ - kind: "time", - precision: typeof options2?.precision === "undefined" ? null : options2?.precision, - ...errorUtil.errToObj(options2?.message) - }); - } - duration(message) { - return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) }); - } - regex(regex, message) { - return this._addCheck({ - kind: "regex", - regex, - ...errorUtil.errToObj(message) - }); - } - includes(value, options2) { - return this._addCheck({ - kind: "includes", - value, - position: options2?.position, - ...errorUtil.errToObj(options2?.message) - }); - } - startsWith(value, message) { - return this._addCheck({ - kind: "startsWith", - value, - ...errorUtil.errToObj(message) - }); - } - endsWith(value, message) { - return this._addCheck({ - kind: "endsWith", - value, - ...errorUtil.errToObj(message) - }); - } - min(minLength, message) { - return this._addCheck({ - kind: "min", - value: minLength, - ...errorUtil.errToObj(message) - }); - } - max(maxLength, message) { - return this._addCheck({ - kind: "max", - value: maxLength, - ...errorUtil.errToObj(message) - }); - } - length(len, message) { - return this._addCheck({ - kind: "length", - value: len, - ...errorUtil.errToObj(message) - }); - } - /** - * Equivalent to `.min(1)` - */ - nonempty(message) { - return this.min(1, errorUtil.errToObj(message)); - } - trim() { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "trim" }] - }); - } - toLowerCase() { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toLowerCase" }] - }); - } - toUpperCase() { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toUpperCase" }] - }); - } - get isDatetime() { - return !!this._def.checks.find((ch) => ch.kind === "datetime"); - } - get isDate() { - return !!this._def.checks.find((ch) => ch.kind === "date"); - } - get isTime() { - return !!this._def.checks.find((ch) => ch.kind === "time"); - } - get isDuration() { - return !!this._def.checks.find((ch) => ch.kind === "duration"); - } - get isEmail() { - return !!this._def.checks.find((ch) => ch.kind === "email"); - } - get isURL() { - return !!this._def.checks.find((ch) => ch.kind === "url"); - } - get isEmoji() { - return !!this._def.checks.find((ch) => ch.kind === "emoji"); - } - get isUUID() { - return !!this._def.checks.find((ch) => ch.kind === "uuid"); - } - get isNANOID() { - return !!this._def.checks.find((ch) => ch.kind === "nanoid"); - } - get isCUID() { - return !!this._def.checks.find((ch) => ch.kind === "cuid"); - } - get isCUID2() { - return !!this._def.checks.find((ch) => ch.kind === "cuid2"); - } - get isULID() { - return !!this._def.checks.find((ch) => ch.kind === "ulid"); - } - get isIP() { - return !!this._def.checks.find((ch) => ch.kind === "ip"); - } - get isCIDR() { - return !!this._def.checks.find((ch) => ch.kind === "cidr"); - } - get isBase64() { - return !!this._def.checks.find((ch) => ch.kind === "base64"); - } - get isBase64url() { - return !!this._def.checks.find((ch) => ch.kind === "base64url"); - } - get minLength() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } + return payload; + }; +}); +function handleUnionResults(results, final, inst, ctx) { + for (const result of results) { + if (result.issues.length === 0) { + final.value = result.value; + return final; + } + } + const nonaborted = results.filter((r) => !aborted(r)); + if (nonaborted.length === 1) { + final.value = nonaborted[0].value; + return nonaborted[0]; + } + final.issues.push({ + code: "invalid_union", + input: final.value, + inst, + errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + }); + return final; +} +var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0); + defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0); + defineLazy(inst._zod, "values", () => { + if (def.options.every((o) => o._zod.values)) { + return new Set(def.options.flatMap((option) => Array.from(option._zod.values))); } - return min; - } - get maxLength() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } + return void 0; + }); + defineLazy(inst._zod, "pattern", () => { + if (def.options.every((o) => o._zod.pattern)) { + const patterns = def.options.map((o) => o._zod.pattern); + return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`); } - return max; - } -}; -ZodString.create = (params) => { - return new ZodString({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodString, - coerce: params?.coerce ?? false, - ...processCreateParams(params) + return void 0; }); -}; -function floatSafeRemainder(val, step) { - const valDecCount = (val.toString().split(".")[1] || "").length; - const stepDecCount = (step.toString().split(".")[1] || "").length; - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; - const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); - const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); - return valInt % stepInt / 10 ** decCount; -} -var ZodNumber = class _ZodNumber extends ZodType { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - this.step = this.multipleOf; - } - _parse(input) { - if (this._def.coerce) { - input.data = Number(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.number) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.number, - received: ctx2.parsedType - }); - return INVALID; - } - let ctx = void 0; - const status = new ParseStatus(); - for (const check of this._def.checks) { - if (check.kind === "int") { - if (!util.isInteger(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: "integer", - received: "float", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "min") { - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "number", - inclusive: check.inclusive, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "number", - inclusive: check.inclusive, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "multipleOf") { - if (floatSafeRemainder(input.data, check.value) !== 0) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "finite") { - if (!Number.isFinite(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_finite, - message: check.message - }); - status.dirty(); - } + const single = def.options.length === 1; + const first = def.options[0]._zod.run; + inst._zod.parse = (payload, ctx) => { + if (single) { + return first(payload, ctx); + } + let async = false; + const results = []; + for (const option of def.options) { + const result = option._zod.run({ + value: payload.value, + issues: [] + }, ctx); + if (result instanceof Promise) { + results.push(result); + async = true; } else { - util.assertNever(check); + if (result.issues.length === 0) + return result; + results.push(result); } } - return { status: status.value, value: input.data }; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new _ZodNumber({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil.toString(message) - } - ] - }); - } - _addCheck(check) { - return new _ZodNumber({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - int(message) { - return this._addCheck({ - kind: "int", - message: errorUtil.toString(message) - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil.toString(message) - }); - } - finite(message) { - return this._addCheck({ - kind: "finite", - message: errorUtil.toString(message) + if (!async) + return handleUnionResults(results, payload, inst, ctx); + return Promise.all(results).then((results2) => { + return handleUnionResults(results2, payload, inst, ctx); }); + }; +}); +var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + const left = def.left._zod.run({ value: input, issues: [] }, ctx); + const right = def.right._zod.run({ value: input, issues: [] }, ctx); + const async = left instanceof Promise || right instanceof Promise; + if (async) { + return Promise.all([left, right]).then(([left2, right2]) => { + return handleIntersectionResults(payload, left2, right2); + }); + } + return handleIntersectionResults(payload, left, right); + }; +}); +function mergeValues(a, b) { + if (a === b) { + return { valid: true, data: a }; } - safe(message) { - return this._addCheck({ - kind: "min", - inclusive: true, - value: Number.MIN_SAFE_INTEGER, - message: errorUtil.toString(message) - })._addCheck({ - kind: "max", - inclusive: true, - value: Number.MAX_SAFE_INTEGER, - message: errorUtil.toString(message) - }); + if (a instanceof Date && b instanceof Date && +a === +b) { + return { valid: true, data: a }; } - get minValue() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; + if (isPlainObject(a) && isPlainObject(b)) { + const bKeys = Object.keys(b); + const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { ...a, ...b }; + for (const key of sharedKeys) { + const sharedValue = mergeValues(a[key], b[key]); + if (!sharedValue.valid) { + return { + valid: false, + mergeErrorPath: [key, ...sharedValue.mergeErrorPath] + }; } + newObj[key] = sharedValue.data; } - return min; + return { valid: true, data: newObj }; } - get maxValue() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; + if (Array.isArray(a) && Array.isArray(b)) { + if (a.length !== b.length) { + return { valid: false, mergeErrorPath: [] }; + } + const newArray = []; + for (let index = 0; index < a.length; index++) { + const itemA = a[index]; + const itemB = b[index]; + const sharedValue = mergeValues(itemA, itemB); + if (!sharedValue.valid) { + return { + valid: false, + mergeErrorPath: [index, ...sharedValue.mergeErrorPath] + }; } + newArray.push(sharedValue.data); } - return max; + return { valid: true, data: newArray }; } - get isInt() { - return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value)); + return { valid: false, mergeErrorPath: [] }; +} +function handleIntersectionResults(result, left, right) { + if (left.issues.length) { + result.issues.push(...left.issues); } - get isFinite() { - let max = null; - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") { - return true; - } else if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } else if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return Number.isFinite(min) && Number.isFinite(max); + if (right.issues.length) { + result.issues.push(...right.issues); } -}; -ZodNumber.create = (params) => { - return new ZodNumber({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodNumber, - coerce: params?.coerce || false, - ...processCreateParams(params) - }); -}; -var ZodBigInt = class _ZodBigInt extends ZodType { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; + if (aborted(result)) + return result; + const merged = mergeValues(left.value, right.value); + if (!merged.valid) { + throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`); } - _parse(input) { - if (this._def.coerce) { - try { - input.data = BigInt(input.data); - } catch { - return this._getInvalidInput(input); - } - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.bigint) { - return this._getInvalidInput(input); - } - let ctx = void 0; - const status = new ParseStatus(); - for (const check of this._def.checks) { - if (check.kind === "min") { - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - type: "bigint", - minimum: check.value, - inclusive: check.inclusive, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - type: "bigint", - maximum: check.value, - inclusive: check.inclusive, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "multipleOf") { - if (input.data % check.value !== BigInt(0)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message - }); - status.dirty(); + result.value = merged.data; + return result; +} +var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!isPlainObject(input)) { + payload.issues.push({ + expected: "record", + code: "invalid_type", + input, + inst + }); + return payload; + } + const proms = []; + if (def.keyType._zod.values) { + const values = def.keyType._zod.values; + payload.value = {}; + for (const key of values) { + if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") { + const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => { + if (result2.issues.length) { + payload.issues.push(...prefixIssues(key, result2.issues)); + } + payload.value[key] = result2.value; + })); + } else { + if (result.issues.length) { + payload.issues.push(...prefixIssues(key, result.issues)); + } + payload.value[key] = result.value; + } } - } else { - util.assertNever(check); } - } - return { status: status.value, value: input.data }; - } - _getInvalidInput(input) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.bigint, - received: ctx.parsedType - }); - return INVALID; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new _ZodBigInt({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil.toString(message) + let unrecognized; + for (const key in input) { + if (!values.has(key)) { + unrecognized = unrecognized ?? []; + unrecognized.push(key); } - ] - }); - } - _addCheck(check) { - return new _ZodBigInt({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) - }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil.toString(message) - }); - } - get minValue() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; } - } - return min; - } - get maxValue() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; + if (unrecognized && unrecognized.length > 0) { + payload.issues.push({ + code: "unrecognized_keys", + input, + inst, + keys: unrecognized + }); } - } - return max; - } -}; -ZodBigInt.create = (params) => { - return new ZodBigInt({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodBigInt, - coerce: params?.coerce ?? false, - ...processCreateParams(params) - }); -}; -var ZodBoolean = class extends ZodType { - _parse(input) { - if (this._def.coerce) { - input.data = Boolean(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.boolean) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.boolean, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodBoolean.create = (params) => { - return new ZodBoolean({ - typeName: ZodFirstPartyTypeKind.ZodBoolean, - coerce: params?.coerce || false, - ...processCreateParams(params) - }); -}; -var ZodDate = class _ZodDate extends ZodType { - _parse(input) { - if (this._def.coerce) { - input.data = new Date(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.date) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.date, - received: ctx2.parsedType - }); - return INVALID; - } - if (Number.isNaN(input.data.getTime())) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_date - }); - return INVALID; - } - const status = new ParseStatus(); - let ctx = void 0; - for (const check of this._def.checks) { - if (check.kind === "min") { - if (input.data.getTime() < check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - message: check.message, - inclusive: true, - exact: false, - minimum: check.value, - type: "date" - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (input.data.getTime() > check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - message: check.message, - inclusive: true, - exact: false, - maximum: check.value, - type: "date" + } else { + payload.value = {}; + for (const key of Reflect.ownKeys(input)) { + if (key === "__proto__") + continue; + const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx); + if (keyResult instanceof Promise) { + throw new Error("Async schemas not supported in object keys currently"); + } + if (keyResult.issues.length) { + payload.issues.push({ + code: "invalid_key", + origin: "record", + issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())), + input: key, + path: [key], + inst }); - status.dirty(); + payload.value[keyResult.value] = keyResult.value; + continue; + } + const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => { + if (result2.issues.length) { + payload.issues.push(...prefixIssues(key, result2.issues)); + } + payload.value[keyResult.value] = result2.value; + })); + } else { + if (result.issues.length) { + payload.issues.push(...prefixIssues(key, result.issues)); + } + payload.value[keyResult.value] = result.value; } - } else { - util.assertNever(check); } } - return { - status: status.value, - value: new Date(input.data.getTime()) - }; - } - _addCheck(check) { - return new _ZodDate({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - min(minDate, message) { - return this._addCheck({ - kind: "min", - value: minDate.getTime(), - message: errorUtil.toString(message) + if (proms.length) { + return Promise.all(proms).then(() => payload); + } + return payload; + }; +}); +var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => { + $ZodType.init(inst, def); + const values = getEnumValues(def.entries); + const valuesSet = new Set(values); + inst._zod.values = valuesSet; + inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (valuesSet.has(input)) { + return payload; + } + payload.issues.push({ + code: "invalid_value", + values, + input, + inst }); - } - max(maxDate, message) { - return this._addCheck({ - kind: "max", - value: maxDate.getTime(), - message: errorUtil.toString(message) + return payload; + }; +}); +var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => { + $ZodType.init(inst, def); + if (def.values.length === 0) { + throw new Error("Cannot create literal schema with no valid values"); + } + inst._zod.values = new Set(def.values); + inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (inst._zod.values.has(input)) { + return payload; + } + payload.issues.push({ + code: "invalid_value", + values: def.values, + input, + inst }); - } - get minDate() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } + return payload; + }; +}); +var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + const _out = def.transform(payload.value, payload); + if (_ctx.async) { + const output = _out instanceof Promise ? _out : Promise.resolve(_out); + return output.then((output2) => { + payload.value = output2; + return payload; + }); } - return min != null ? new Date(min) : null; - } - get maxDate() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } + if (_out instanceof Promise) { + throw new $ZodAsyncError(); } - return max != null ? new Date(max) : null; + payload.value = _out; + return payload; + }; +}); +function handleOptionalResult(result, input) { + if (result.issues.length && input === void 0) { + return { issues: [], value: void 0 }; } -}; -ZodDate.create = (params) => { - return new ZodDate({ - checks: [], - coerce: params?.coerce || false, - typeName: ZodFirstPartyTypeKind.ZodDate, - ...processCreateParams(params) + return result; +} +var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + inst._zod.optout = "optional"; + defineLazy(inst._zod, "values", () => { + return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0; }); -}; -var ZodSymbol = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.symbol) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.symbol, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodSymbol.create = (params) => { - return new ZodSymbol({ - typeName: ZodFirstPartyTypeKind.ZodSymbol, - ...processCreateParams(params) + defineLazy(inst._zod, "pattern", () => { + const pattern = def.innerType._zod.pattern; + return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0; }); -}; -var ZodUndefined = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.undefined, - received: ctx.parsedType - }); - return INVALID; + inst._zod.parse = (payload, ctx) => { + if (def.innerType._zod.optin === "optional") { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) + return result.then((r) => handleOptionalResult(r, payload.value)); + return handleOptionalResult(result, payload.value); } - return OK(input.data); - } -}; -ZodUndefined.create = (params) => { - return new ZodUndefined({ - typeName: ZodFirstPartyTypeKind.ZodUndefined, - ...processCreateParams(params) - }); -}; -var ZodNull = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.null) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.null, - received: ctx.parsedType - }); - return INVALID; + if (payload.value === void 0) { + return payload; } - return OK(input.data); - } -}; -ZodNull.create = (params) => { - return new ZodNull({ - typeName: ZodFirstPartyTypeKind.ZodNull, - ...processCreateParams(params) - }); -}; -var ZodAny = class extends ZodType { - constructor() { - super(...arguments); - this._any = true; - } - _parse(input) { - return OK(input.data); - } -}; -ZodAny.create = (params) => { - return new ZodAny({ - typeName: ZodFirstPartyTypeKind.ZodAny, - ...processCreateParams(params) - }); -}; -var ZodUnknown = class extends ZodType { - constructor() { - super(...arguments); - this._unknown = true; - } - _parse(input) { - return OK(input.data); - } -}; -ZodUnknown.create = (params) => { - return new ZodUnknown({ - typeName: ZodFirstPartyTypeKind.ZodUnknown, - ...processCreateParams(params) + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + defineLazy(inst._zod, "pattern", () => { + const pattern = def.innerType._zod.pattern; + return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0; }); -}; -var ZodNever = class extends ZodType { - _parse(input) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.never, - received: ctx.parsedType - }); - return INVALID; - } -}; -ZodNever.create = (params) => { - return new ZodNever({ - typeName: ZodFirstPartyTypeKind.ZodNever, - ...processCreateParams(params) + defineLazy(inst._zod, "values", () => { + return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0; }); -}; -var ZodVoid = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.void, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); + inst._zod.parse = (payload, ctx) => { + if (payload.value === null) + return payload; + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (payload.value === void 0) { + payload.value = def.defaultValue; + return payload; + } + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => handleDefaultResult(result2, def)); + } + return handleDefaultResult(result, def); + }; +}); +function handleDefaultResult(payload, def) { + if (payload.value === void 0) { + payload.value = def.defaultValue; } -}; -ZodVoid.create = (params) => { - return new ZodVoid({ - typeName: ZodFirstPartyTypeKind.ZodVoid, - ...processCreateParams(params) + return payload; +} +var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (payload.value === void 0) { + payload.value = def.defaultValue; + } + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "values", () => { + const v = def.innerType._zod.values; + return v ? new Set([...v].filter((x) => x !== void 0)) : void 0; }); -}; -var ZodArray = class _ZodArray extends ZodType { - _parse(input) { - const { ctx, status } = this._processInputParams(input); - const def = this._def; - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }); - return INVALID; - } - if (def.exactLength !== null) { - const tooBig = ctx.data.length > def.exactLength.value; - const tooSmall = ctx.data.length < def.exactLength.value; - if (tooBig || tooSmall) { - addIssueToContext(ctx, { - code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, - minimum: tooSmall ? def.exactLength.value : void 0, - maximum: tooBig ? def.exactLength.value : void 0, - type: "array", - inclusive: true, - exact: true, - message: def.exactLength.message - }); - status.dirty(); - } - } - if (def.minLength !== null) { - if (ctx.data.length < def.minLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.minLength.message - }); - status.dirty(); - } - } - if (def.maxLength !== null) { - if (ctx.data.length > def.maxLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.maxLength.message - }); - status.dirty(); - } + inst._zod.parse = (payload, ctx) => { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => handleNonOptionalResult(result2, inst)); } - if (ctx.common.async) { - return Promise.all([...ctx.data].map((item, i) => { - return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); - })).then((result2) => { - return ParseStatus.mergeArray(status, result2); - }); - } - const result = [...ctx.data].map((item, i) => { - return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); - }); - return ParseStatus.mergeArray(status, result); - } - get element() { - return this._def.type; - } - min(minLength, message) { - return new _ZodArray({ - ...this._def, - minLength: { value: minLength, message: errorUtil.toString(message) } - }); - } - max(maxLength, message) { - return new _ZodArray({ - ...this._def, - maxLength: { value: maxLength, message: errorUtil.toString(message) } - }); - } - length(len, message) { - return new _ZodArray({ - ...this._def, - exactLength: { value: len, message: errorUtil.toString(message) } - }); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodArray.create = (schema, params) => { - return new ZodArray({ - type: schema, - minLength: null, - maxLength: null, - exactLength: null, - typeName: ZodFirstPartyTypeKind.ZodArray, - ...processCreateParams(params) - }); -}; -function deepPartialify(schema) { - if (schema instanceof ZodObject) { - const newShape = {}; - for (const key in schema.shape) { - const fieldSchema = schema.shape[key]; - newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); - } - return new ZodObject({ - ...schema._def, - shape: () => newShape - }); - } else if (schema instanceof ZodArray) { - return new ZodArray({ - ...schema._def, - type: deepPartialify(schema.element) + return handleNonOptionalResult(result, inst); + }; +}); +function handleNonOptionalResult(payload, inst) { + if (!payload.issues.length && payload.value === void 0) { + payload.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: payload.value, + inst }); - } else if (schema instanceof ZodOptional) { - return ZodOptional.create(deepPartialify(schema.unwrap())); - } else if (schema instanceof ZodNullable) { - return ZodNullable.create(deepPartialify(schema.unwrap())); - } else if (schema instanceof ZodTuple) { - return ZodTuple.create(schema.items.map((item) => deepPartialify(item))); - } else { - return schema; } + return payload; } -var ZodObject = class _ZodObject extends ZodType { - constructor() { - super(...arguments); - this._cached = null; - this.nonstrict = this.passthrough; - this.augment = this.extend; - } - _getCached() { - if (this._cached !== null) - return this._cached; - const shape = this._def.shape(); - const keys = util.objectKeys(shape); - this._cached = { shape, keys }; - return this._cached; - } - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.object) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx2.parsedType - }); - return INVALID; - } - const { status, ctx } = this._processInputParams(input); - const { shape, keys: shapeKeys } = this._getCached(); - const extraKeys = []; - if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) { - for (const key in ctx.data) { - if (!shapeKeys.includes(key)) { - extraKeys.push(key); - } - } - } - const pairs = []; - for (const key of shapeKeys) { - const keyValidator = shape[key]; - const value = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (this._def.catchall instanceof ZodNever) { - const unknownKeys = this._def.unknownKeys; - if (unknownKeys === "passthrough") { - for (const key of extraKeys) { - pairs.push({ - key: { status: "valid", value: key }, - value: { status: "valid", value: ctx.data[key] } - }); - } - } else if (unknownKeys === "strict") { - if (extraKeys.length > 0) { - addIssueToContext(ctx, { - code: ZodIssueCode.unrecognized_keys, - keys: extraKeys +var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => { + payload.value = result2.value; + if (result2.issues.length) { + payload.value = def.catchValue({ + ...payload, + error: { + issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config())) + }, + input: payload.value }); - status.dirty(); + payload.issues = []; } - } else if (unknownKeys === "strip") { - } else { - throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); - } - } else { - const catchall = this._def.catchall; - for (const key of extraKeys) { - const value = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: catchall._parse( - new ParseInputLazyPath(ctx, value, ctx.path, key) - //, ctx.child(key), value, getParsedType(value) - ), - alwaysSet: key in ctx.data - }); - } + return payload; + }); } - if (ctx.common.async) { - return Promise.resolve().then(async () => { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - syncPairs.push({ - key, - value, - alwaysSet: pair.alwaysSet - }); - } - return syncPairs; - }).then((syncPairs) => { - return ParseStatus.mergeObjectSync(status, syncPairs); + payload.value = result.value; + if (result.issues.length) { + payload.value = def.catchValue({ + ...payload, + error: { + issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) + }, + input: payload.value }); - } else { - return ParseStatus.mergeObjectSync(status, pairs); + payload.issues = []; } + return payload; + }; +}); +var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "values", () => def.in._zod.values); + defineLazy(inst._zod, "optin", () => def.in._zod.optin); + defineLazy(inst._zod, "optout", () => def.out._zod.optout); + defineLazy(inst._zod, "propValues", () => def.in._zod.propValues); + inst._zod.parse = (payload, ctx) => { + const left = def.in._zod.run(payload, ctx); + if (left instanceof Promise) { + return left.then((left2) => handlePipeResult(left2, def, ctx)); + } + return handlePipeResult(left, def, ctx); + }; +}); +function handlePipeResult(left, def, ctx) { + if (left.issues.length) { + return left; } - get shape() { - return this._def.shape(); - } - strict(message) { - errorUtil.errToObj; - return new _ZodObject({ - ...this._def, - unknownKeys: "strict", - ...message !== void 0 ? { - errorMap: (issue, ctx) => { - const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError; - if (issue.code === "unrecognized_keys") - return { - message: errorUtil.errToObj(message).message ?? defaultError - }; - return { - message: defaultError - }; - } - } : {} - }); - } - strip() { - return new _ZodObject({ - ...this._def, - unknownKeys: "strip" - }); - } - passthrough() { - return new _ZodObject({ - ...this._def, - unknownKeys: "passthrough" - }); - } - // const AugmentFactory = - // (def: Def) => - // ( - // augmentation: Augmentation - // ): ZodObject< - // extendShape, Augmentation>, - // Def["unknownKeys"], - // Def["catchall"] - // > => { - // return new ZodObject({ - // ...def, - // shape: () => ({ - // ...def.shape(), - // ...augmentation, - // }), - // }) as any; - // }; - extend(augmentation) { - return new _ZodObject({ - ...this._def, - shape: () => ({ - ...this._def.shape(), - ...augmentation - }) - }); + return def.out._zod.run({ value: left.value, issues: left.issues }, ctx); +} +var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + inst._zod.parse = (payload, ctx) => { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then(handleReadonlyResult); + } + return handleReadonlyResult(result); + }; +}); +function handleReadonlyResult(payload) { + payload.value = Object.freeze(payload.value); + return payload; +} +var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => { + $ZodCheck.init(inst, def); + $ZodType.init(inst, def); + inst._zod.parse = (payload, _) => { + return payload; + }; + inst._zod.check = (payload) => { + const input = payload.value; + const r = def.fn(input); + if (r instanceof Promise) { + return r.then((r2) => handleRefineResult(r2, payload, input, inst)); + } + handleRefineResult(r, payload, input, inst); + return; + }; +}); +function handleRefineResult(result, payload, input, inst) { + if (!result) { + const _iss = { + code: "custom", + input, + inst, + // incorporates params.error into issue reporting + path: [...inst._zod.def.path ?? []], + // incorporates params.error into issue reporting + continue: !inst._zod.def.abort + // params: inst._zod.def.params, + }; + if (inst._zod.def.params) + _iss.params = inst._zod.def.params; + payload.issues.push(issue(_iss)); } - /** - * Prior to zod@1.0.12 there was a bug in the - * inferred type of merged objects. Please - * upgrade if you are experiencing issues. - */ - merge(merging) { - const merged = new _ZodObject({ - unknownKeys: merging._def.unknownKeys, - catchall: merging._def.catchall, - shape: () => ({ - ...this._def.shape(), - ...merging._def.shape() - }), - typeName: ZodFirstPartyTypeKind.ZodObject - }); - return merged; - } - // merge< - // Incoming extends AnyZodObject, - // Augmentation extends Incoming["shape"], - // NewOutput extends { - // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation - // ? Augmentation[k]["_output"] - // : k extends keyof Output - // ? Output[k] - // : never; - // }, - // NewInput extends { - // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation - // ? Augmentation[k]["_input"] - // : k extends keyof Input - // ? Input[k] - // : never; - // } - // >( - // merging: Incoming - // ): ZodObject< - // extendShape>, - // Incoming["_def"]["unknownKeys"], - // Incoming["_def"]["catchall"], - // NewOutput, - // NewInput - // > { - // const merged: any = new ZodObject({ - // unknownKeys: merging._def.unknownKeys, - // catchall: merging._def.catchall, - // shape: () => - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), - // typeName: ZodFirstPartyTypeKind.ZodObject, - // }) as any; - // return merged; - // } - setKey(key, schema) { - return this.augment({ [key]: schema }); - } - // merge( - // merging: Incoming - // ): //ZodObject = (merging) => { - // ZodObject< - // extendShape>, - // Incoming["_def"]["unknownKeys"], - // Incoming["_def"]["catchall"] - // > { - // // const mergedShape = objectUtil.mergeShapes( - // // this._def.shape(), - // // merging._def.shape() - // // ); - // const merged: any = new ZodObject({ - // unknownKeys: merging._def.unknownKeys, - // catchall: merging._def.catchall, - // shape: () => - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), - // typeName: ZodFirstPartyTypeKind.ZodObject, - // }) as any; - // return merged; - // } - catchall(index) { - return new _ZodObject({ - ...this._def, - catchall: index - }); +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/registries.js +var $output = Symbol("ZodOutput"); +var $input = Symbol("ZodInput"); +var $ZodRegistry = class { + constructor() { + this._map = /* @__PURE__ */ new Map(); + this._idmap = /* @__PURE__ */ new Map(); } - pick(mask) { - const shape = {}; - for (const key of util.objectKeys(mask)) { - if (mask[key] && this.shape[key]) { - shape[key] = this.shape[key]; + add(schema, ..._meta) { + const meta = _meta[0]; + this._map.set(schema, meta); + if (meta && typeof meta === "object" && "id" in meta) { + if (this._idmap.has(meta.id)) { + throw new Error(`ID ${meta.id} already exists in the registry`); } + this._idmap.set(meta.id, schema); } - return new _ZodObject({ - ...this._def, - shape: () => shape - }); + return this; } - omit(mask) { - const shape = {}; - for (const key of util.objectKeys(this.shape)) { - if (!mask[key]) { - shape[key] = this.shape[key]; - } - } - return new _ZodObject({ - ...this._def, - shape: () => shape - }); + clear() { + this._map = /* @__PURE__ */ new Map(); + this._idmap = /* @__PURE__ */ new Map(); + return this; } - /** - * @deprecated - */ - deepPartial() { - return deepPartialify(this); - } - partial(mask) { - const newShape = {}; - for (const key of util.objectKeys(this.shape)) { - const fieldSchema = this.shape[key]; - if (mask && !mask[key]) { - newShape[key] = fieldSchema; - } else { - newShape[key] = fieldSchema.optional(); - } + remove(schema) { + const meta = this._map.get(schema); + if (meta && typeof meta === "object" && "id" in meta) { + this._idmap.delete(meta.id); } - return new _ZodObject({ - ...this._def, - shape: () => newShape - }); + this._map.delete(schema); + return this; } - required(mask) { - const newShape = {}; - for (const key of util.objectKeys(this.shape)) { - if (mask && !mask[key]) { - newShape[key] = this.shape[key]; - } else { - const fieldSchema = this.shape[key]; - let newField = fieldSchema; - while (newField instanceof ZodOptional) { - newField = newField._def.innerType; - } - newShape[key] = newField; - } + get(schema) { + const p = schema._zod.parent; + if (p) { + const pm = { ...this.get(p) ?? {} }; + delete pm.id; + const f = { ...pm, ...this._map.get(schema) }; + return Object.keys(f).length ? f : void 0; } - return new _ZodObject({ - ...this._def, - shape: () => newShape - }); + return this._map.get(schema); } - keyof() { - return createZodEnum(util.objectKeys(this.shape)); + has(schema) { + return this._map.has(schema); } }; -ZodObject.create = (shape, params) => { - return new ZodObject({ - shape: () => shape, - unknownKeys: "strip", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) +function registry() { + return new $ZodRegistry(); +} +var globalRegistry = /* @__PURE__ */ registry(); + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/api.js +function _string(Class2, params) { + return new Class2({ + type: "string", + ...normalizeParams(params) }); -}; -ZodObject.strictCreate = (shape, params) => { - return new ZodObject({ - shape: () => shape, - unknownKeys: "strict", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) +} +function _email(Class2, params) { + return new Class2({ + type: "string", + format: "email", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -ZodObject.lazycreate = (shape, params) => { - return new ZodObject({ - shape, - unknownKeys: "strip", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) +} +function _guid(Class2, params) { + return new Class2({ + type: "string", + format: "guid", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var ZodUnion = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const options2 = this._def.options; - function handleResults(results) { - for (const result of results) { - if (result.result.status === "valid") { - return result.result; - } - } - for (const result of results) { - if (result.result.status === "dirty") { - ctx.common.issues.push(...result.ctx.common.issues); - return result.result; - } - } - const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues)); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }); - return INVALID; - } - if (ctx.common.async) { - return Promise.all(options2.map(async (option) => { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - return { - result: await option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }), - ctx: childCtx - }; - })).then(handleResults); - } else { - let dirty = void 0; - const issues = []; - for (const option of options2) { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - const result = option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }); - if (result.status === "valid") { - return result; - } else if (result.status === "dirty" && !dirty) { - dirty = { result, ctx: childCtx }; - } - if (childCtx.common.issues.length) { - issues.push(childCtx.common.issues); - } - } - if (dirty) { - ctx.common.issues.push(...dirty.ctx.common.issues); - return dirty.result; +} +function _uuid(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _uuidv4(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v4", + ...normalizeParams(params) + }); +} +function _uuidv6(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v6", + ...normalizeParams(params) + }); +} +function _uuidv7(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v7", + ...normalizeParams(params) + }); +} +function _url(Class2, params) { + return new Class2({ + type: "string", + format: "url", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _emoji2(Class2, params) { + return new Class2({ + type: "string", + format: "emoji", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _nanoid(Class2, params) { + return new Class2({ + type: "string", + format: "nanoid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cuid(Class2, params) { + return new Class2({ + type: "string", + format: "cuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cuid2(Class2, params) { + return new Class2({ + type: "string", + format: "cuid2", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ulid(Class2, params) { + return new Class2({ + type: "string", + format: "ulid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _xid(Class2, params) { + return new Class2({ + type: "string", + format: "xid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ksuid(Class2, params) { + return new Class2({ + type: "string", + format: "ksuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ipv4(Class2, params) { + return new Class2({ + type: "string", + format: "ipv4", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ipv6(Class2, params) { + return new Class2({ + type: "string", + format: "ipv6", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cidrv4(Class2, params) { + return new Class2({ + type: "string", + format: "cidrv4", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cidrv6(Class2, params) { + return new Class2({ + type: "string", + format: "cidrv6", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _base64(Class2, params) { + return new Class2({ + type: "string", + format: "base64", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _base64url(Class2, params) { + return new Class2({ + type: "string", + format: "base64url", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _e164(Class2, params) { + return new Class2({ + type: "string", + format: "e164", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _jwt(Class2, params) { + return new Class2({ + type: "string", + format: "jwt", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _isoDateTime(Class2, params) { + return new Class2({ + type: "string", + format: "datetime", + check: "string_format", + offset: false, + local: false, + precision: null, + ...normalizeParams(params) + }); +} +function _isoDate(Class2, params) { + return new Class2({ + type: "string", + format: "date", + check: "string_format", + ...normalizeParams(params) + }); +} +function _isoTime(Class2, params) { + return new Class2({ + type: "string", + format: "time", + check: "string_format", + precision: null, + ...normalizeParams(params) + }); +} +function _isoDuration(Class2, params) { + return new Class2({ + type: "string", + format: "duration", + check: "string_format", + ...normalizeParams(params) + }); +} +function _boolean(Class2, params) { + return new Class2({ + type: "boolean", + ...normalizeParams(params) + }); +} +function _maxLength(maximum, params) { + const ch = new $ZodCheckMaxLength({ + check: "max_length", + ...normalizeParams(params), + maximum + }); + return ch; +} +function _minLength(minimum, params) { + return new $ZodCheckMinLength({ + check: "min_length", + ...normalizeParams(params), + minimum + }); +} +function _length(length, params) { + return new $ZodCheckLengthEquals({ + check: "length_equals", + ...normalizeParams(params), + length + }); +} +function _regex(pattern, params) { + return new $ZodCheckRegex({ + check: "string_format", + format: "regex", + ...normalizeParams(params), + pattern + }); +} +function _lowercase(params) { + return new $ZodCheckLowerCase({ + check: "string_format", + format: "lowercase", + ...normalizeParams(params) + }); +} +function _uppercase(params) { + return new $ZodCheckUpperCase({ + check: "string_format", + format: "uppercase", + ...normalizeParams(params) + }); +} +function _includes(includes, params) { + return new $ZodCheckIncludes({ + check: "string_format", + format: "includes", + ...normalizeParams(params), + includes + }); +} +function _startsWith(prefix2, params) { + return new $ZodCheckStartsWith({ + check: "string_format", + format: "starts_with", + ...normalizeParams(params), + prefix: prefix2 + }); +} +function _endsWith(suffix, params) { + return new $ZodCheckEndsWith({ + check: "string_format", + format: "ends_with", + ...normalizeParams(params), + suffix + }); +} +function _overwrite(tx) { + return new $ZodCheckOverwrite({ + check: "overwrite", + tx + }); +} +function _normalize(form) { + return _overwrite((input) => input.normalize(form)); +} +function _trim() { + return _overwrite((input) => input.trim()); +} +function _toLowerCase() { + return _overwrite((input) => input.toLowerCase()); +} +function _toUpperCase() { + return _overwrite((input) => input.toUpperCase()); +} +function _array(Class2, element, params) { + return new Class2({ + type: "array", + element, + // get element() { + // return element; + // }, + ...normalizeParams(params) + }); +} +function _refine(Class2, fn, _params) { + const schema = new Class2({ + type: "custom", + check: "custom", + fn, + ...normalizeParams(_params) + }); + return schema; +} +function _superRefine(fn) { + const ch = _check((payload) => { + payload.addIssue = (issue2) => { + if (typeof issue2 === "string") { + payload.issues.push(issue(issue2, payload.value, ch._zod.def)); + } else { + const _issue = issue2; + if (_issue.fatal) + _issue.continue = false; + _issue.code ?? (_issue.code = "custom"); + _issue.input ?? (_issue.input = payload.value); + _issue.inst ?? (_issue.inst = ch); + _issue.continue ?? (_issue.continue = !ch._zod.def.abort); + payload.issues.push(issue(_issue)); } - const unionErrors = issues.map((issues2) => new ZodError(issues2)); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }); - return INVALID; - } - } - get options() { - return this._def.options; - } -}; -ZodUnion.create = (types, params) => { - return new ZodUnion({ - options: types, - typeName: ZodFirstPartyTypeKind.ZodUnion, - ...processCreateParams(params) + }; + return fn(payload.value, payload); }); -}; -var getDiscriminator = (type2) => { - if (type2 instanceof ZodLazy) { - return getDiscriminator(type2.schema); - } else if (type2 instanceof ZodEffects) { - return getDiscriminator(type2.innerType()); - } else if (type2 instanceof ZodLiteral) { - return [type2.value]; - } else if (type2 instanceof ZodEnum) { - return type2.options; - } else if (type2 instanceof ZodNativeEnum) { - return util.objectValues(type2.enum); - } else if (type2 instanceof ZodDefault) { - return getDiscriminator(type2._def.innerType); - } else if (type2 instanceof ZodUndefined) { - return [void 0]; - } else if (type2 instanceof ZodNull) { - return [null]; - } else if (type2 instanceof ZodOptional) { - return [void 0, ...getDiscriminator(type2.unwrap())]; - } else if (type2 instanceof ZodNullable) { - return [null, ...getDiscriminator(type2.unwrap())]; - } else if (type2 instanceof ZodBranded) { - return getDiscriminator(type2.unwrap()); - } else if (type2 instanceof ZodReadonly) { - return getDiscriminator(type2.unwrap()); - } else if (type2 instanceof ZodCatch) { - return getDiscriminator(type2._def.innerType); - } else { - return []; - } -}; -var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }); - return INVALID; - } - const discriminator = this.discriminator; - const discriminatorValue = ctx.data[discriminator]; - const option = this.optionsMap.get(discriminatorValue); - if (!option) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union_discriminator, - options: Array.from(this.optionsMap.keys()), - path: [discriminator] - }); - return INVALID; - } - if (ctx.common.async) { - return option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } else { - return option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } - } - get discriminator() { - return this._def.discriminator; - } - get options() { - return this._def.options; - } - get optionsMap() { - return this._def.optionsMap; - } - /** - * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. - * However, it only allows a union of objects, all of which need to share a discriminator property. This property must - * have a different value for each object in the union. - * @param discriminator the name of the discriminator property - * @param types an array of object schemas - * @param params - */ - static create(discriminator, options2, params) { - const optionsMap = /* @__PURE__ */ new Map(); - for (const type2 of options2) { - const discriminatorValues = getDiscriminator(type2.shape[discriminator]); - if (!discriminatorValues.length) { - throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); + return ch; +} +function _check(fn, params) { + const ch = new $ZodCheck({ + check: "custom", + ...normalizeParams(params) + }); + ch._zod.check = fn; + return ch; +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/classic/iso.js +var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => { + $ZodISODateTime.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function datetime2(params) { + return _isoDateTime(ZodISODateTime, params); +} +var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => { + $ZodISODate.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function date2(params) { + return _isoDate(ZodISODate, params); +} +var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => { + $ZodISOTime.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function time2(params) { + return _isoTime(ZodISOTime, params); +} +var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => { + $ZodISODuration.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function duration2(params) { + return _isoDuration(ZodISODuration, params); +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/classic/errors.js +var initializer2 = (inst, issues) => { + $ZodError.init(inst, issues); + inst.name = "ZodError"; + Object.defineProperties(inst, { + format: { + value: (mapper) => formatError(inst, mapper) + // enumerable: false, + }, + flatten: { + value: (mapper) => flattenError(inst, mapper) + // enumerable: false, + }, + addIssue: { + value: (issue2) => { + inst.issues.push(issue2); + inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); } - for (const value of discriminatorValues) { - if (optionsMap.has(value)) { - throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); - } - optionsMap.set(value, type2); + // enumerable: false, + }, + addIssues: { + value: (issues2) => { + inst.issues.push(...issues2); + inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); } - } - return new _ZodDiscriminatedUnion({ - typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, - discriminator, - options: options2, - optionsMap, - ...processCreateParams(params) - }); - } -}; -function mergeValues(a, b) { - const aType = getParsedType(a); - const bType = getParsedType(b); - if (a === b) { - return { valid: true, data: a }; - } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { - const bKeys = util.objectKeys(b); - const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1); - const newObj = { ...a, ...b }; - for (const key of sharedKeys) { - const sharedValue = mergeValues(a[key], b[key]); - if (!sharedValue.valid) { - return { valid: false }; + // enumerable: false, + }, + isEmpty: { + get() { + return inst.issues.length === 0; } - newObj[key] = sharedValue.data; + // enumerable: false, } - return { valid: true, data: newObj }; - } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { - if (a.length !== b.length) { - return { valid: false }; - } - const newArray = []; - for (let index = 0; index < a.length; index++) { - const itemA = a[index]; - const itemB = b[index]; - const sharedValue = mergeValues(itemA, itemB); - if (!sharedValue.valid) { - return { valid: false }; + }); +}; +var ZodError = $constructor("ZodError", initializer2); +var ZodRealError = $constructor("ZodError", initializer2, { + Parent: Error +}); + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/classic/parse.js +var parse = /* @__PURE__ */ _parse(ZodRealError); +var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError); +var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError); +var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError); + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/classic/schemas.js +var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { + $ZodType.init(inst, def); + inst.def = def; + Object.defineProperty(inst, "_def", { value: def }); + inst.check = (...checks) => { + return inst.clone( + { + ...def, + checks: [ + ...def.checks ?? [], + ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch) + ] } - newArray.push(sharedValue.data); + // { parent: true } + ); + }; + inst.clone = (def2, params) => clone(inst, def2, params); + inst.brand = () => inst; + inst.register = (reg, meta) => { + reg.add(inst, meta); + return inst; + }; + inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse }); + inst.safeParse = (data, params) => safeParse2(inst, data, params); + inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync }); + inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params); + inst.spa = inst.safeParseAsync; + inst.refine = (check, params) => inst.check(refine(check, params)); + inst.superRefine = (refinement) => inst.check(superRefine(refinement)); + inst.overwrite = (fn) => inst.check(_overwrite(fn)); + inst.optional = () => optional(inst); + inst.nullable = () => nullable(inst); + inst.nullish = () => optional(nullable(inst)); + inst.nonoptional = (params) => nonoptional(inst, params); + inst.array = () => array(inst); + inst.or = (arg) => union([inst, arg]); + inst.and = (arg) => intersection(inst, arg); + inst.transform = (tx) => pipe(inst, transform(tx)); + inst.default = (def2) => _default(inst, def2); + inst.prefault = (def2) => prefault(inst, def2); + inst.catch = (params) => _catch(inst, params); + inst.pipe = (target) => pipe(inst, target); + inst.readonly = () => readonly(inst); + inst.describe = (description) => { + const cl = inst.clone(); + globalRegistry.add(cl, { description }); + return cl; + }; + Object.defineProperty(inst, "description", { + get() { + return globalRegistry.get(inst)?.description; + }, + configurable: true + }); + inst.meta = (...args) => { + if (args.length === 0) { + return globalRegistry.get(inst); } - return { valid: true, data: newArray }; - } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) { - return { valid: true, data: a }; - } else { - return { valid: false }; - } + const cl = inst.clone(); + globalRegistry.add(cl, args[0]); + return cl; + }; + inst.isOptional = () => inst.safeParse(void 0).success; + inst.isNullable = () => inst.safeParse(null).success; + return inst; +}); +var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => { + $ZodString.init(inst, def); + ZodType.init(inst, def); + const bag = inst._zod.bag; + inst.format = bag.format ?? null; + inst.minLength = bag.minimum ?? null; + inst.maxLength = bag.maximum ?? null; + inst.regex = (...args) => inst.check(_regex(...args)); + inst.includes = (...args) => inst.check(_includes(...args)); + inst.startsWith = (...args) => inst.check(_startsWith(...args)); + inst.endsWith = (...args) => inst.check(_endsWith(...args)); + inst.min = (...args) => inst.check(_minLength(...args)); + inst.max = (...args) => inst.check(_maxLength(...args)); + inst.length = (...args) => inst.check(_length(...args)); + inst.nonempty = (...args) => inst.check(_minLength(1, ...args)); + inst.lowercase = (params) => inst.check(_lowercase(params)); + inst.uppercase = (params) => inst.check(_uppercase(params)); + inst.trim = () => inst.check(_trim()); + inst.normalize = (...args) => inst.check(_normalize(...args)); + inst.toLowerCase = () => inst.check(_toLowerCase()); + inst.toUpperCase = () => inst.check(_toUpperCase()); +}); +var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => { + $ZodString.init(inst, def); + _ZodString.init(inst, def); + inst.email = (params) => inst.check(_email(ZodEmail, params)); + inst.url = (params) => inst.check(_url(ZodURL, params)); + inst.jwt = (params) => inst.check(_jwt(ZodJWT, params)); + inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params)); + inst.guid = (params) => inst.check(_guid(ZodGUID, params)); + inst.uuid = (params) => inst.check(_uuid(ZodUUID, params)); + inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params)); + inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params)); + inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params)); + inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params)); + inst.guid = (params) => inst.check(_guid(ZodGUID, params)); + inst.cuid = (params) => inst.check(_cuid(ZodCUID, params)); + inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params)); + inst.ulid = (params) => inst.check(_ulid(ZodULID, params)); + inst.base64 = (params) => inst.check(_base64(ZodBase64, params)); + inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params)); + inst.xid = (params) => inst.check(_xid(ZodXID, params)); + inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params)); + inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params)); + inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params)); + inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params)); + inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params)); + inst.e164 = (params) => inst.check(_e164(ZodE164, params)); + inst.datetime = (params) => inst.check(datetime2(params)); + inst.date = (params) => inst.check(date2(params)); + inst.time = (params) => inst.check(time2(params)); + inst.duration = (params) => inst.check(duration2(params)); +}); +function string2(params) { + return _string(ZodString, params); } -var ZodIntersection = class extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const handleParsed = (parsedLeft, parsedRight) => { - if (isAborted(parsedLeft) || isAborted(parsedRight)) { - return INVALID; - } - const merged = mergeValues(parsedLeft.value, parsedRight.value); - if (!merged.valid) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_intersection_types - }); - return INVALID; - } - if (isDirty(parsedLeft) || isDirty(parsedRight)) { - status.dirty(); - } - return { status: status.value, value: merged.data }; - }; - if (ctx.common.async) { - return Promise.all([ - this._def.left._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), - this._def.right._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }) - ]).then(([left, right]) => handleParsed(left, right)); - } else { - return handleParsed(this._def.left._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), this._def.right._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - })); - } - } -}; -ZodIntersection.create = (left, right, params) => { +var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => { + $ZodStringFormat.init(inst, def); + _ZodString.init(inst, def); +}); +var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => { + $ZodEmail.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => { + $ZodGUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => { + $ZodUUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => { + $ZodURL.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => { + $ZodEmoji.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => { + $ZodNanoID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => { + $ZodCUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => { + $ZodCUID2.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => { + $ZodULID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => { + $ZodXID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => { + $ZodKSUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => { + $ZodIPv4.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => { + $ZodIPv6.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => { + $ZodCIDRv4.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => { + $ZodCIDRv6.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => { + $ZodBase64.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => { + $ZodBase64URL.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => { + $ZodE164.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => { + $ZodJWT.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => { + $ZodBoolean.init(inst, def); + ZodType.init(inst, def); +}); +function boolean2(params) { + return _boolean(ZodBoolean, params); +} +var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => { + $ZodArray.init(inst, def); + ZodType.init(inst, def); + inst.element = def.element; + inst.min = (minLength, params) => inst.check(_minLength(minLength, params)); + inst.nonempty = (params) => inst.check(_minLength(1, params)); + inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params)); + inst.length = (len, params) => inst.check(_length(len, params)); + inst.unwrap = () => inst.element; +}); +function array(element, params) { + return _array(ZodArray, element, params); +} +var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => { + $ZodUnion.init(inst, def); + ZodType.init(inst, def); + inst.options = def.options; +}); +function union(options2, params) { + return new ZodUnion({ + type: "union", + options: options2, + ...util_exports.normalizeParams(params) + }); +} +var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => { + $ZodIntersection.init(inst, def); + ZodType.init(inst, def); +}); +function intersection(left, right) { return new ZodIntersection({ + type: "intersection", left, - right, - typeName: ZodFirstPartyTypeKind.ZodIntersection, - ...processCreateParams(params) - }); -}; -var ZodTuple = class _ZodTuple extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }); - return INVALID; - } - if (ctx.data.length < this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - return INVALID; - } - const rest = this._def.rest; - if (!rest && ctx.data.length > this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - status.dirty(); - } - const items = [...ctx.data].map((item, itemIndex) => { - const schema = this._def.items[itemIndex] || this._def.rest; - if (!schema) - return null; - return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); - }).filter((x) => !!x); - if (ctx.common.async) { - return Promise.all(items).then((results) => { - return ParseStatus.mergeArray(status, results); - }); - } else { - return ParseStatus.mergeArray(status, items); - } - } - get items() { - return this._def.items; - } - rest(rest) { - return new _ZodTuple({ - ...this._def, - rest - }); - } -}; -ZodTuple.create = (schemas, params) => { - if (!Array.isArray(schemas)) { - throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); - } - return new ZodTuple({ - items: schemas, - typeName: ZodFirstPartyTypeKind.ZodTuple, - rest: null, - ...processCreateParams(params) + right }); -}; -var ZodRecord = class _ZodRecord extends ZodType { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }); - return INVALID; - } - const pairs = []; - const keyType = this._def.keyType; - const valueType = this._def.valueType; - for (const key in ctx.data) { - pairs.push({ - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), - value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (ctx.common.async) { - return ParseStatus.mergeObjectAsync(status, pairs); - } else { - return ParseStatus.mergeObjectSync(status, pairs); - } - } - get element() { - return this._def.valueType; - } - static create(first, second, third) { - if (second instanceof ZodType) { - return new _ZodRecord({ - keyType: first, - valueType: second, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(third) - }); - } - return new _ZodRecord({ - keyType: ZodString.create(), - valueType: first, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(second) - }); - } -}; -var ZodMap = class extends ZodType { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.map) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.map, - received: ctx.parsedType - }); - return INVALID; - } - const keyType = this._def.keyType; - const valueType = this._def.valueType; - const pairs = [...ctx.data.entries()].map(([key, value], index) => { - return { - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])), - value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])) - }; - }); - if (ctx.common.async) { - const finalMap = /* @__PURE__ */ new Map(); - return Promise.resolve().then(async () => { - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - if (key.status === "aborted" || value.status === "aborted") { - return INVALID; - } - if (key.status === "dirty" || value.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value.value); - } - return { status: status.value, value: finalMap }; - }); - } else { - const finalMap = /* @__PURE__ */ new Map(); - for (const pair of pairs) { - const key = pair.key; - const value = pair.value; - if (key.status === "aborted" || value.status === "aborted") { - return INVALID; - } - if (key.status === "dirty" || value.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value.value); - } - return { status: status.value, value: finalMap }; - } - } -}; -ZodMap.create = (keyType, valueType, params) => { - return new ZodMap({ - valueType, +} +var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => { + $ZodRecord.init(inst, def); + ZodType.init(inst, def); + inst.keyType = def.keyType; + inst.valueType = def.valueType; +}); +function record(keyType, valueType, params) { + return new ZodRecord({ + type: "record", keyType, - typeName: ZodFirstPartyTypeKind.ZodMap, - ...processCreateParams(params) - }); -}; -var ZodSet = class _ZodSet extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.set) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.set, - received: ctx.parsedType - }); - return INVALID; - } - const def = this._def; - if (def.minSize !== null) { - if (ctx.data.size < def.minSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.minSize.message - }); - status.dirty(); - } - } - if (def.maxSize !== null) { - if (ctx.data.size > def.maxSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.maxSize.message - }); - status.dirty(); - } - } - const valueType = this._def.valueType; - function finalizeSet(elements2) { - const parsedSet = /* @__PURE__ */ new Set(); - for (const element of elements2) { - if (element.status === "aborted") - return INVALID; - if (element.status === "dirty") - status.dirty(); - parsedSet.add(element.value); - } - return { status: status.value, value: parsedSet }; - } - const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); - if (ctx.common.async) { - return Promise.all(elements).then((elements2) => finalizeSet(elements2)); - } else { - return finalizeSet(elements); - } - } - min(minSize, message) { - return new _ZodSet({ - ...this._def, - minSize: { value: minSize, message: errorUtil.toString(message) } - }); - } - max(maxSize2, message) { - return new _ZodSet({ - ...this._def, - maxSize: { value: maxSize2, message: errorUtil.toString(message) } - }); - } - size(size, message) { - return this.min(size, message).max(size, message); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodSet.create = (valueType, params) => { - return new ZodSet({ valueType, - minSize: null, - maxSize: null, - typeName: ZodFirstPartyTypeKind.ZodSet, - ...processCreateParams(params) + ...util_exports.normalizeParams(params) }); -}; -var ZodFunction = class _ZodFunction extends ZodType { - constructor() { - super(...arguments); - this.validate = this.implement; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.function) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.function, - received: ctx.parsedType - }); - return INVALID; - } - function makeArgsIssue(args, error3) { - return makeIssue({ - data: args, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x), - issueData: { - code: ZodIssueCode.invalid_arguments, - argumentsError: error3 - } - }); - } - function makeReturnsIssue(returns, error3) { - return makeIssue({ - data: returns, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x), - issueData: { - code: ZodIssueCode.invalid_return_type, - returnTypeError: error3 - } - }); - } - const params = { errorMap: ctx.common.contextualErrorMap }; - const fn = ctx.data; - if (this._def.returns instanceof ZodPromise) { - const me = this; - return OK(async function(...args) { - const error3 = new ZodError([]); - const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => { - error3.addIssue(makeArgsIssue(args, e)); - throw error3; - }); - const result = await Reflect.apply(fn, this, parsedArgs); - const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => { - error3.addIssue(makeReturnsIssue(result, e)); - throw error3; - }); - return parsedReturns; - }); - } else { - const me = this; - return OK(function(...args) { - const parsedArgs = me._def.args.safeParse(args, params); - if (!parsedArgs.success) { - throw new ZodError([makeArgsIssue(args, parsedArgs.error)]); - } - const result = Reflect.apply(fn, this, parsedArgs.data); - const parsedReturns = me._def.returns.safeParse(result, params); - if (!parsedReturns.success) { - throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]); - } - return parsedReturns.data; - }); - } - } - parameters() { - return this._def.args; - } - returnType() { - return this._def.returns; - } - args(...items) { - return new _ZodFunction({ - ...this._def, - args: ZodTuple.create(items).rest(ZodUnknown.create()) - }); - } - returns(returnType) { - return new _ZodFunction({ - ...this._def, - returns: returnType +} +var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => { + $ZodEnum.init(inst, def); + ZodType.init(inst, def); + inst.enum = def.entries; + inst.options = Object.values(def.entries); + const keys = new Set(Object.keys(def.entries)); + inst.extract = (values, params) => { + const newEntries = {}; + for (const value of values) { + if (keys.has(value)) { + newEntries[value] = def.entries[value]; + } else + throw new Error(`Key ${value} not found in enum`); + } + return new ZodEnum({ + ...def, + checks: [], + ...util_exports.normalizeParams(params), + entries: newEntries }); - } - implement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - strictImplement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - static create(args, returns, params) { - return new _ZodFunction({ - args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()), - returns: returns || ZodUnknown.create(), - typeName: ZodFirstPartyTypeKind.ZodFunction, - ...processCreateParams(params) + }; + inst.exclude = (values, params) => { + const newEntries = { ...def.entries }; + for (const value of values) { + if (keys.has(value)) { + delete newEntries[value]; + } else + throw new Error(`Key ${value} not found in enum`); + } + return new ZodEnum({ + ...def, + checks: [], + ...util_exports.normalizeParams(params), + entries: newEntries }); - } -}; -var ZodLazy = class extends ZodType { - get schema() { - return this._def.getter(); - } - _parse(input) { - const { ctx } = this._processInputParams(input); - const lazySchema = this._def.getter(); - return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); - } -}; -ZodLazy.create = (getter, params) => { - return new ZodLazy({ - getter, - typeName: ZodFirstPartyTypeKind.ZodLazy, - ...processCreateParams(params) - }); -}; -var ZodLiteral = class extends ZodType { - _parse(input) { - if (input.data !== this._def.value) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_literal, - expected: this._def.value - }); - return INVALID; - } - return { status: "valid", value: input.data }; - } - get value() { - return this._def.value; - } -}; -ZodLiteral.create = (value, params) => { - return new ZodLiteral({ - value, - typeName: ZodFirstPartyTypeKind.ZodLiteral, - ...processCreateParams(params) - }); -}; -function createZodEnum(values, params) { + }; +}); +function _enum(values, params) { + const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values; return new ZodEnum({ - values, - typeName: ZodFirstPartyTypeKind.ZodEnum, - ...processCreateParams(params) + type: "enum", + entries, + ...util_exports.normalizeParams(params) }); } -var ZodEnum = class _ZodEnum extends ZodType { - _parse(input) { - if (typeof input.data !== "string") { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }); - return INVALID; - } - if (!this._cache) { - this._cache = new Set(this._def.values); - } - if (!this._cache.has(input.data)) { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }); - return INVALID; - } - return OK(input.data); - } - get options() { - return this._def.values; - } - get enum() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - get Values() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - get Enum() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - extract(values, newDef = this._def) { - return _ZodEnum.create(values, { - ...this._def, - ...newDef - }); - } - exclude(values, newDef = this._def) { - return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), { - ...this._def, - ...newDef - }); - } -}; -ZodEnum.create = createZodEnum; -var ZodNativeEnum = class extends ZodType { - _parse(input) { - const nativeEnumValues = util.getValidEnumValues(this._def.values); - const ctx = this._getOrReturnCtx(input); - if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) { - const expectedValues = util.objectValues(nativeEnumValues); - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }); - return INVALID; - } - if (!this._cache) { - this._cache = new Set(util.getValidEnumValues(this._def.values)); - } - if (!this._cache.has(input.data)) { - const expectedValues = util.objectValues(nativeEnumValues); - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }); - return INVALID; +var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => { + $ZodLiteral.init(inst, def); + ZodType.init(inst, def); + inst.values = new Set(def.values); + Object.defineProperty(inst, "value", { + get() { + if (def.values.length > 1) { + throw new Error("This schema contains multiple valid literal values. Use `.values` instead."); + } + return def.values[0]; } - return OK(input.data); - } - get enum() { - return this._def.values; - } -}; -ZodNativeEnum.create = (values, params) => { - return new ZodNativeEnum({ - values, - typeName: ZodFirstPartyTypeKind.ZodNativeEnum, - ...processCreateParams(params) }); -}; -var ZodPromise = class extends ZodType { - unwrap() { - return this._def.type; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.promise, - received: ctx.parsedType - }); - return INVALID; - } - const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); - return OK(promisified.then((data) => { - return this._def.type.parseAsync(data, { - path: ctx.path, - errorMap: ctx.common.contextualErrorMap - }); - })); - } -}; -ZodPromise.create = (schema, params) => { - return new ZodPromise({ - type: schema, - typeName: ZodFirstPartyTypeKind.ZodPromise, - ...processCreateParams(params) +}); +function literal(value, params) { + return new ZodLiteral({ + type: "literal", + values: Array.isArray(value) ? value : [value], + ...util_exports.normalizeParams(params) }); -}; -var ZodEffects = class extends ZodType { - innerType() { - return this._def.schema; - } - sourceType() { - return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const effect = this._def.effect || null; - const checkCtx = { - addIssue: (arg) => { - addIssueToContext(ctx, arg); - if (arg.fatal) { - status.abort(); - } else { - status.dirty(); - } - }, - get path() { - return ctx.path; - } - }; - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); - if (effect.type === "preprocess") { - const processed = effect.transform(ctx.data, checkCtx); - if (ctx.common.async) { - return Promise.resolve(processed).then(async (processed2) => { - if (status.value === "aborted") - return INVALID; - const result = await this._def.schema._parseAsync({ - data: processed2, - path: ctx.path, - parent: ctx - }); - if (result.status === "aborted") - return INVALID; - if (result.status === "dirty") - return DIRTY(result.value); - if (status.value === "dirty") - return DIRTY(result.value); - return result; - }); - } else { - if (status.value === "aborted") - return INVALID; - const result = this._def.schema._parseSync({ - data: processed, - path: ctx.path, - parent: ctx - }); - if (result.status === "aborted") - return INVALID; - if (result.status === "dirty") - return DIRTY(result.value); - if (status.value === "dirty") - return DIRTY(result.value); - return result; - } - } - if (effect.type === "refinement") { - const executeRefinement = (acc) => { - const result = effect.refinement(acc, checkCtx); - if (ctx.common.async) { - return Promise.resolve(result); - } - if (result instanceof Promise) { - throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); - } - return acc; - }; - if (ctx.common.async === false) { - const inner = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inner.status === "aborted") - return INVALID; - if (inner.status === "dirty") - status.dirty(); - executeRefinement(inner.value); - return { status: status.value, value: inner.value }; - } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => { - if (inner.status === "aborted") - return INVALID; - if (inner.status === "dirty") - status.dirty(); - return executeRefinement(inner.value).then(() => { - return { status: status.value, value: inner.value }; - }); - }); - } - } - if (effect.type === "transform") { - if (ctx.common.async === false) { - const base = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (!isValid(base)) - return INVALID; - const result = effect.transform(base.value, checkCtx); - if (result instanceof Promise) { - throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); - } - return { status: status.value, value: result }; +} +var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => { + $ZodTransform.init(inst, def); + ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + payload.addIssue = (issue2) => { + if (typeof issue2 === "string") { + payload.issues.push(util_exports.issue(issue2, payload.value, def)); } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => { - if (!isValid(base)) - return INVALID; - return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ - status: status.value, - value: result - })); - }); - } + const _issue = issue2; + if (_issue.fatal) + _issue.continue = false; + _issue.code ?? (_issue.code = "custom"); + _issue.input ?? (_issue.input = payload.value); + _issue.inst ?? (_issue.inst = inst); + payload.issues.push(util_exports.issue(_issue)); + } + }; + const output = def.transform(payload.value, payload); + if (output instanceof Promise) { + return output.then((output2) => { + payload.value = output2; + return payload; + }); } - util.assertNever(effect); - } -}; -ZodEffects.create = (schema, effect, params) => { - return new ZodEffects({ - schema, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect, - ...processCreateParams(params) - }); -}; -ZodEffects.createWithPreprocess = (preprocess, schema, params) => { - return new ZodEffects({ - schema, - effect: { type: "preprocess", transform: preprocess }, - typeName: ZodFirstPartyTypeKind.ZodEffects, - ...processCreateParams(params) + payload.value = output; + return payload; + }; +}); +function transform(fn) { + return new ZodTransform({ + type: "transform", + transform: fn }); -}; -var ZodOptional = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType === ZodParsedType.undefined) { - return OK(void 0); - } - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodOptional.create = (type2, params) => { +} +var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => { + $ZodOptional.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function optional(innerType) { return new ZodOptional({ - innerType: type2, - typeName: ZodFirstPartyTypeKind.ZodOptional, - ...processCreateParams(params) + type: "optional", + innerType }); -}; -var ZodNullable = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType === ZodParsedType.null) { - return OK(null); - } - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodNullable.create = (type2, params) => { +} +var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => { + $ZodNullable.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function nullable(innerType) { return new ZodNullable({ - innerType: type2, - typeName: ZodFirstPartyTypeKind.ZodNullable, - ...processCreateParams(params) + type: "nullable", + innerType }); -}; -var ZodDefault = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - let data = ctx.data; - if (ctx.parsedType === ZodParsedType.undefined) { - data = this._def.defaultValue(); - } - return this._def.innerType._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - removeDefault() { - return this._def.innerType; - } -}; -ZodDefault.create = (type2, params) => { +} +var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => { + $ZodDefault.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; + inst.removeDefault = inst.unwrap; +}); +function _default(innerType, defaultValue) { return new ZodDefault({ - innerType: type2, - typeName: ZodFirstPartyTypeKind.ZodDefault, - defaultValue: typeof params.default === "function" ? params.default : () => params.default, - ...processCreateParams(params) + type: "default", + innerType, + get defaultValue() { + return typeof defaultValue === "function" ? defaultValue() : defaultValue; + } }); -}; -var ZodCatch = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const newCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - } - }; - const result = this._def.innerType._parse({ - data: newCtx.data, - path: newCtx.path, - parent: { - ...newCtx - } - }); - if (isAsync(result)) { - return result.then((result2) => { - return { - status: "valid", - value: result2.status === "valid" ? result2.value : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - }); - } else { - return { - status: "valid", - value: result.status === "valid" ? result.value : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues); - }, - input: newCtx.data - }) - }; +} +var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => { + $ZodPrefault.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function prefault(innerType, defaultValue) { + return new ZodPrefault({ + type: "prefault", + innerType, + get defaultValue() { + return typeof defaultValue === "function" ? defaultValue() : defaultValue; } - } - removeCatch() { - return this._def.innerType; - } -}; -ZodCatch.create = (type2, params) => { + }); +} +var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => { + $ZodNonOptional.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function nonoptional(innerType, params) { + return new ZodNonOptional({ + type: "nonoptional", + innerType, + ...util_exports.normalizeParams(params) + }); +} +var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => { + $ZodCatch.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; + inst.removeCatch = inst.unwrap; +}); +function _catch(innerType, catchValue) { return new ZodCatch({ - innerType: type2, - typeName: ZodFirstPartyTypeKind.ZodCatch, - catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, - ...processCreateParams(params) + type: "catch", + innerType, + catchValue: typeof catchValue === "function" ? catchValue : () => catchValue }); -}; -var ZodNaN = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.nan) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.nan, - received: ctx.parsedType - }); - return INVALID; - } - return { status: "valid", value: input.data }; - } -}; -ZodNaN.create = (params) => { - return new ZodNaN({ - typeName: ZodFirstPartyTypeKind.ZodNaN, - ...processCreateParams(params) +} +var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => { + $ZodPipe.init(inst, def); + ZodType.init(inst, def); + inst.in = def.in; + inst.out = def.out; +}); +function pipe(in_, out) { + return new ZodPipe({ + type: "pipe", + in: in_, + out + // ...util.normalizeParams(params), }); -}; -var BRAND = Symbol("zod_brand"); -var ZodBranded = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const data = ctx.data; - return this._def.type._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - unwrap() { - return this._def.type; - } -}; -var ZodPipeline = class _ZodPipeline extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.common.async) { - const handleAsync = async () => { - const inResult = await this._def.in._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID; - if (inResult.status === "dirty") { - status.dirty(); - return DIRTY(inResult.value); - } else { - return this._def.out._parseAsync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - }; - return handleAsync(); - } else { - const inResult = this._def.in._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID; - if (inResult.status === "dirty") { - status.dirty(); - return { - status: "dirty", - value: inResult.value - }; - } else { - return this._def.out._parseSync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - } - } - static create(a, b) { - return new _ZodPipeline({ - in: a, - out: b, - typeName: ZodFirstPartyTypeKind.ZodPipeline - }); - } -}; -var ZodReadonly = class extends ZodType { - _parse(input) { - const result = this._def.innerType._parse(input); - const freeze = (data) => { - if (isValid(data)) { - data.value = Object.freeze(data.value); - } - return data; - }; - return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result); - } - unwrap() { - return this._def.innerType; - } -}; -ZodReadonly.create = (type2, params) => { +} +var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => { + $ZodReadonly.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function readonly(innerType) { return new ZodReadonly({ - innerType: type2, - typeName: ZodFirstPartyTypeKind.ZodReadonly, - ...processCreateParams(params) + type: "readonly", + innerType }); -}; -var late = { - object: ZodObject.lazycreate -}; -var ZodFirstPartyTypeKind; -(function(ZodFirstPartyTypeKind2) { - ZodFirstPartyTypeKind2["ZodString"] = "ZodString"; - ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber"; - ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN"; - ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt"; - ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean"; - ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate"; - ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol"; - ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined"; - ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull"; - ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny"; - ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown"; - ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever"; - ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid"; - ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray"; - ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject"; - ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion"; - ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; - ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection"; - ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple"; - ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord"; - ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap"; - ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet"; - ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction"; - ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy"; - ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral"; - ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum"; - ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects"; - ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum"; - ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional"; - ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable"; - ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault"; - ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch"; - ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise"; - ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded"; - ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline"; - ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly"; -})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); -var stringType = ZodString.create; -var numberType = ZodNumber.create; -var nanType = ZodNaN.create; -var bigIntType = ZodBigInt.create; -var booleanType = ZodBoolean.create; -var dateType = ZodDate.create; -var symbolType = ZodSymbol.create; -var undefinedType = ZodUndefined.create; -var nullType = ZodNull.create; -var anyType = ZodAny.create; -var unknownType = ZodUnknown.create; -var neverType = ZodNever.create; -var voidType = ZodVoid.create; -var arrayType = ZodArray.create; -var objectType = ZodObject.create; -var strictObjectType = ZodObject.strictCreate; -var unionType = ZodUnion.create; -var discriminatedUnionType = ZodDiscriminatedUnion.create; -var intersectionType = ZodIntersection.create; -var tupleType = ZodTuple.create; -var recordType = ZodRecord.create; -var mapType = ZodMap.create; -var setType = ZodSet.create; -var functionType = ZodFunction.create; -var lazyType = ZodLazy.create; -var literalType = ZodLiteral.create; -var enumType = ZodEnum.create; -var nativeEnumType = ZodNativeEnum.create; -var promiseType = ZodPromise.create; -var effectsType = ZodEffects.create; -var optionalType = ZodOptional.create; -var nullableType = ZodNullable.create; -var preprocessType = ZodEffects.createWithPreprocess; -var pipelineType = ZodPipeline.create; +} +var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => { + $ZodCustom.init(inst, def); + ZodType.init(inst, def); +}); +function refine(fn, _params = {}) { + return _refine(ZodCustom, fn, _params); +} +function superRefine(fn) { + return _superRefine(fn); +} // node_modules/.pnpm/untildify@5.0.0/node_modules/untildify/index.js var import_node_os = __toESM(require("os"), 1); @@ -73976,13 +73061,13 @@ function untildify(pathWithTilde) { return homeDirectory ? pathWithTilde.replace(/^~(?=$|\/|\\)/, homeDirectory) : pathWithTilde; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/error.js -function getLineColFromPtr(string, ptr) { - let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g); +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/error.js +function getLineColFromPtr(string3, ptr) { + let lines = string3.slice(0, ptr).split(/\r\n|\n|\r/g); return [lines.length, lines.pop().length + 1]; } -function makeCodeBlock(string, line, column) { - let lines = string.split(/\r\n|\n|\r/g); +function makeCodeBlock(string3, line, column) { + let lines = string3.split(/\r\n|\n|\r/g); let codeblock = ""; let numberLen = (Math.log10(line + 1) | 0) + 1; for (let i = line - 1; i <= line + 1; i++) { @@ -74016,7 +73101,7 @@ ${codeblock}`, options2); } }; -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/util.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/util.js function indexOfNewline(str, start = 0, end = str.length) { let idx = str.indexOf("\n", start); if (str[idx - 1] === "\r") @@ -74084,36 +73169,36 @@ function getStringEnd(str, seek) { return seek; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/date.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/date.js var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i; var _hasDate, _hasTime, _offset; var _TomlDate = class _TomlDate extends Date { - constructor(date) { + constructor(date3) { let hasDate = true; let hasTime = true; let offset = "Z"; - if (typeof date === "string") { - let match = date.match(DATE_TIME_RE); + if (typeof date3 === "string") { + let match = date3.match(DATE_TIME_RE); if (match) { if (!match[1]) { hasDate = false; - date = `0000-01-01T${date}`; + date3 = `0000-01-01T${date3}`; } hasTime = !!match[2]; - hasTime && date[10] === " " && (date = date.replace(" ", "T")); + hasTime && date3[10] === " " && (date3 = date3.replace(" ", "T")); if (match[2] && +match[2] > 23) { - date = ""; + date3 = ""; } else { offset = match[3] || null; - date = date.toUpperCase(); + date3 = date3.toUpperCase(); if (!offset && hasTime) - date += "Z"; + date3 += "Z"; } } else { - date = ""; + date3 = ""; } } - super(date); + super(date3); __privateAdd(this, _hasDate, false); __privateAdd(this, _hasTime, false); __privateAdd(this, _offset, null); @@ -74154,26 +73239,26 @@ var _TomlDate = class _TomlDate extends Date { return offsetDate.toISOString().slice(0, -1) + __privateGet(this, _offset); } static wrapAsOffsetDateTime(jsDate, offset = "Z") { - let date = new _TomlDate(jsDate); - __privateSet(date, _offset, offset); - return date; + let date3 = new _TomlDate(jsDate); + __privateSet(date3, _offset, offset); + return date3; } static wrapAsLocalDateTime(jsDate) { - let date = new _TomlDate(jsDate); - __privateSet(date, _offset, null); - return date; + let date3 = new _TomlDate(jsDate); + __privateSet(date3, _offset, null); + return date3; } static wrapAsLocalDate(jsDate) { - let date = new _TomlDate(jsDate); - __privateSet(date, _hasTime, false); - __privateSet(date, _offset, null); - return date; + let date3 = new _TomlDate(jsDate); + __privateSet(date3, _hasTime, false); + __privateSet(date3, _offset, null); + return date3; } static wrapAsLocalTime(jsDate) { - let date = new _TomlDate(jsDate); - __privateSet(date, _hasDate, false); - __privateSet(date, _offset, null); - return date; + let date3 = new _TomlDate(jsDate); + __privateSet(date3, _hasDate, false); + __privateSet(date3, _offset, null); + return date3; } }; _hasDate = new WeakMap(); @@ -74181,7 +73266,7 @@ _hasTime = new WeakMap(); _offset = new WeakMap(); var TomlDate = _TomlDate; -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/primitive.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/primitive.js var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; var LEADING_ZERO = /^[+-]?0[0-9_]/; @@ -74304,22 +73389,22 @@ function parseValue(value, toml, ptr, integersAsBigInt) { ptr }); } - if (isInt || integersAsBigInt) + if (isInt || integersAsBigInt === true) numeric = BigInt(value); } return numeric; } - const date = new TomlDate(value); - if (!date.isValid()) { + const date3 = new TomlDate(value); + if (!date3.isValid()) { throw new TomlError("invalid value", { toml, ptr }); } - return date; + return date3; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/extract.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/extract.js function sliceAndTrimEndOf(str, startPtr, endPtr, allowNewLines) { let value = str.slice(startPtr, endPtr); let commentIdx = value.indexOf("#"); @@ -74395,7 +73480,7 @@ function extractValue(str, ptr, end, depth, integersAsBigInt) { ]; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/struct.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/struct.js var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; function parseKey(str, ptr, end = "=") { let dot = ptr - 1; @@ -74551,7 +73636,7 @@ function parseArray(str, ptr, depth, integersAsBigInt) { return [res, ptr]; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/parse.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/parse.js function peekTable(key, table, meta, type2) { let t = table; let m = meta; @@ -74611,7 +73696,7 @@ function peekTable(key, table, meta, type2) { } return [k, t, state3.c]; } -function parse(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { +function parse2(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { let res = {}; let meta = {}; let tbl = res; @@ -74730,14 +73815,14 @@ var getArch = () => { throw new Error(`Unsupported architecture: ${arch2}`); } }; -var renderPixiUrl = (urlTemplate, version2) => { - const latest = version2 == "latest"; +var renderPixiUrl = (urlTemplate, version3) => { + const latest = version3 == "latest"; const arch2 = getArch(); const platform = getPlatform(); const pixiFile = `pixi-${arch2}-${platform}${platform === "pc-windows-msvc" ? ".exe" : ""}`; const template = import_handlebars.default.compile(urlTemplate); return template({ - version: version2, + version: version3, latest, pixiFile }); @@ -74781,7 +73866,7 @@ var pixiCmd = (command, withManifestPath = true) => { // src/options.ts var pixiPath = "pixi.toml"; var pyprojectPath = "pyproject.toml"; -var logLevelSchema = enumType(["q", "default", "v", "vv", "vvv"]); +var logLevelSchema = _enum(["q", "default", "v", "vv", "vvv"]); var PATHS = { pixiBin: import_path.default.join(import_os2.default.homedir(), ".pixi", "bin", `pixi${import_os2.default.platform() === "win32" ? ".exe" : ""}`) }; @@ -74930,7 +74015,7 @@ var inferOptions = (inputs) => { } else if ((0, import_fs.existsSync)(pyprojectPath)) { try { const fileContent = (0, import_fs.readFileSync)(pyprojectPath, "utf-8"); - const parsedContent = parse(fileContent); + const parsedContent = parse2(fileContent); if (parsedContent.tool && typeof parsedContent.tool === "object" && "pixi" in parsedContent.tool) { core2.debug(`The tool.pixi table found, using ${pyprojectPath} as manifest file.`); manifestPath = pyprojectPath; @@ -75002,35 +74087,35 @@ var getOptions = () => { const inputs = { pixiVersion: parseOrUndefined( "pixi-version", - unionType([literalType("latest"), stringType().regex(/^v\d+\.\d+\.\d+$/)]), + union([literal("latest"), string2().regex(/^v\d+\.\d+\.\d+$/)]), "pixi-version must either be `latest` or a version string matching `vX.Y.Z`." ), - pixiUrl: parseOrUndefined("pixi-url", stringType()), - pixiUrlHeaders: parseOrUndefinedJSON("pixi-url-headers", recordType(stringType(), stringType())), + pixiUrl: parseOrUndefined("pixi-url", string2()), + pixiUrlHeaders: parseOrUndefinedJSON("pixi-url-headers", record(string2(), string2())), logLevel: parseOrUndefined( "log-level", logLevelSchema, "log-level must be one of `q`, `default`, `v`, `vv`, `vvv`." ), - manifestPath: parseOrUndefined("manifest-path", stringType()), - runInstall: parseOrUndefinedJSON("run-install", booleanType()), - environments: parseOrUndefinedList("environments", stringType()), - activateEnvironment: parseOrUndefined("activate-environment", stringType()), - locked: parseOrUndefinedJSON("locked", booleanType()), - frozen: parseOrUndefinedJSON("frozen", booleanType()), - cache: parseOrUndefinedJSON("cache", booleanType()), - cacheKey: parseOrUndefined("cache-key", stringType()), - cacheWrite: parseOrUndefinedJSON("cache-write", booleanType()), - pixiBinPath: parseOrUndefined("pixi-bin-path", stringType()), - authHost: parseOrUndefined("auth-host", stringType()), - authToken: parseOrUndefined("auth-token", stringType()), - authUsername: parseOrUndefined("auth-username", stringType()), - authPassword: parseOrUndefined("auth-password", stringType()), - authCondaToken: parseOrUndefined("auth-conda-token", stringType()), - authS3AccessKeyId: parseOrUndefined("auth-s3-access-key-id", stringType()), - authS3SecretAccessKey: parseOrUndefined("auth-s3-secret-access-key", stringType()), - authS3SessionToken: parseOrUndefined("auth-s3-session-token", stringType()), - postCleanup: parseOrUndefinedJSON("post-cleanup", booleanType()) + manifestPath: parseOrUndefined("manifest-path", string2()), + runInstall: parseOrUndefinedJSON("run-install", boolean2()), + environments: parseOrUndefinedList("environments", string2()), + activateEnvironment: parseOrUndefined("activate-environment", string2()), + locked: parseOrUndefinedJSON("locked", boolean2()), + frozen: parseOrUndefinedJSON("frozen", boolean2()), + cache: parseOrUndefinedJSON("cache", boolean2()), + cacheKey: parseOrUndefined("cache-key", string2()), + cacheWrite: parseOrUndefinedJSON("cache-write", boolean2()), + pixiBinPath: parseOrUndefined("pixi-bin-path", string2()), + authHost: parseOrUndefined("auth-host", string2()), + authToken: parseOrUndefined("auth-token", string2()), + authUsername: parseOrUndefined("auth-username", string2()), + authPassword: parseOrUndefined("auth-password", string2()), + authCondaToken: parseOrUndefined("auth-conda-token", string2()), + authS3AccessKeyId: parseOrUndefined("auth-s3-access-key-id", string2()), + authS3SecretAccessKey: parseOrUndefined("auth-s3-secret-access-key", string2()), + authS3SessionToken: parseOrUndefined("auth-s3-session-token", string2()), + postCleanup: parseOrUndefinedJSON("post-cleanup", boolean2()) }; core2.debug(`Inputs: ${JSON.stringify(inputs)}`); validateInputs(inputs); diff --git a/dist/post.js b/dist/post.js index c99b10f..4ff3670 100644 --- a/dist/post.js +++ b/dist/post.js @@ -12,6 +12,10 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) @@ -107,10 +111,10 @@ var require_command = __commonJS({ process.stdout.write(cmd.toString() + os4.EOL); } exports2.issueCommand = issueCommand; - function issue(name, message = "") { + function issue2(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; + exports2.issue = issue2; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -309,8 +313,8 @@ var require_tunnel = __commonJS({ var http = require("http"); var https = require("https"); var events = require("events"); - var assert = require("assert"); - var util2 = require("util"); + var assert2 = require("assert"); + var util = require("util"); exports2.httpOverHttp = httpOverHttp; exports2.httpsOverHttp = httpsOverHttp; exports2.httpOverHttps = httpOverHttps; @@ -360,7 +364,7 @@ var require_tunnel = __commonJS({ self.removeSocket(socket); }); } - util2.inherits(TunnelingAgent, events.EventEmitter); + util.inherits(TunnelingAgent, events.EventEmitter); TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) { var self = this; var options2 = mergeOptions({ request: req }, self.options, toOptions(host, port, localAddress)); @@ -942,7 +946,7 @@ var require_constants = __commonJS({ var require_util = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/util.js"(exports2, module2) { "use strict"; - var assert = require("assert"); + var assert2 = require("assert"); var { kDestroyed, kBodyUsed } = require_symbols(); var { IncomingMessage } = require("http"); var stream = require("stream"); @@ -1024,7 +1028,7 @@ var require_util = __commonJS({ function getHostname(host) { if (host[0] === "[") { const idx2 = host.indexOf("]"); - assert(idx2 !== -1); + assert2(idx2 !== -1); return host.substring(1, idx2); } const idx = host.indexOf(":"); @@ -1035,7 +1039,7 @@ var require_util = __commonJS({ if (!host) { return null; } - assert.strictEqual(typeof host, "string"); + assert2.strictEqual(typeof host, "string"); const servername = getHostname(host); if (net.isIP(servername)) { return ""; @@ -3638,7 +3642,7 @@ var require_util2 = __commonJS({ var { getGlobalOrigin } = require_global(); var { performance: performance2 } = require("perf_hooks"); var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util(); - var assert = require("assert"); + var assert2 = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; var crypto; @@ -3828,7 +3832,7 @@ var require_util2 = __commonJS({ } function determineRequestsReferrer(request) { const policy = request.referrerPolicy; - assert(policy); + assert2(policy); let referrerSource = null; if (request.referrer === "client") { const globalOrigin = getGlobalOrigin(); @@ -3886,7 +3890,7 @@ var require_util2 = __commonJS({ } } function stripURLForReferrer(url, originOnly) { - assert(url instanceof URL); + assert2(url instanceof URL); if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") { return "no-referrer"; } @@ -4036,7 +4040,7 @@ var require_util2 = __commonJS({ }); return { promise, resolve: res, reject: rej }; } - function isAborted2(fetchParams) { + function isAborted(fetchParams) { return fetchParams.controller.state === "aborted"; } function isCancelled(fetchParams) { @@ -4065,7 +4069,7 @@ var require_util2 = __commonJS({ if (result === void 0) { throw new TypeError("Value is not JSON serializable"); } - assert(typeof result === "string"); + assert2(typeof result === "string"); return result; } var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); @@ -4159,7 +4163,7 @@ var require_util2 = __commonJS({ } function isomorphicEncode(input) { for (let i = 0; i < input.length; i++) { - assert(input.charCodeAt(i) <= 255); + assert2(input.charCodeAt(i) <= 255); } return input; } @@ -4179,7 +4183,7 @@ var require_util2 = __commonJS({ } } function urlIsLocal(url) { - assert("protocol" in url); + assert2("protocol" in url); const protocol = url.protocol; return protocol === "about:" || protocol === "blob:" || protocol === "data:"; } @@ -4190,13 +4194,13 @@ var require_util2 = __commonJS({ return url.protocol === "https:"; } function urlIsHttpHttpsScheme(url) { - assert("protocol" in url); + assert2("protocol" in url); const protocol = url.protocol; return protocol === "http:" || protocol === "https:"; } var hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key)); module2.exports = { - isAborted: isAborted2, + isAborted, isCancelled, createDeferredPromise, ReadableStreamFrom, @@ -4474,8 +4478,8 @@ var require_webidl = __commonJS({ }); } for (const options2 of converters) { - const { key, defaultValue, required, converter } = options2; - if (required === true) { + const { key, defaultValue, required: required2, converter } = options2; + if (required2 === true) { if (!hasOwn(dictionary, key)) { throw webidl.errors.exception({ header: "Dictionary", @@ -4488,7 +4492,7 @@ var require_webidl = __commonJS({ if (hasDefault && value !== null) { value = value ?? defaultValue; } - if (required || hasDefault || value !== void 0) { + if (required2 || hasDefault || value !== void 0) { value = converter(value); if (options2.allowedValues && !options2.allowedValues.includes(value)) { throw webidl.errors.exception({ @@ -4633,7 +4637,7 @@ var require_webidl = __commonJS({ var require_dataURL = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/dataURL.js"(exports2, module2) { "use strict"; - var assert = require("assert"); + var assert2 = require("assert"); var { atob: atob2 } = require("buffer"); var { isomorphicDecode } = require_util2(); var encoder = new TextEncoder(); @@ -4641,7 +4645,7 @@ var require_dataURL = __commonJS({ var HTTP_WHITESPACE_REGEX = /(\u000A|\u000D|\u0009|\u0020)/; var HTTP_QUOTED_STRING_TOKENS = /[\u0009|\u0020-\u007E|\u0080-\u00FF]/; function dataURLProcessor(dataURL) { - assert(dataURL.protocol === "data:"); + assert2(dataURL.protocol === "data:"); let input = URLSerializer(dataURL, true); input = input.slice(5); const position = { position: 0 }; @@ -4827,7 +4831,7 @@ var require_dataURL = __commonJS({ function collectAnHTTPQuotedString(input, position, extractValue2) { const positionStart = position.position; let value = ""; - assert(input[position.position] === '"'); + assert2(input[position.position] === '"'); position.position++; while (true) { value += collectASequenceOfCodePoints( @@ -4848,7 +4852,7 @@ var require_dataURL = __commonJS({ value += input[position.position]; position.position++; } else { - assert(quoteOrBackslash === '"'); + assert2(quoteOrBackslash === '"'); break; } } @@ -4858,7 +4862,7 @@ var require_dataURL = __commonJS({ return input.slice(positionStart, position.position); } function serializeAMimeType(mimeType) { - assert(mimeType !== "failure"); + assert2(mimeType !== "failure"); const { parameters, essence } = mimeType; let serialization = essence; for (let [name, value] of parameters.entries()) { @@ -4927,7 +4931,7 @@ var require_file = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var { kEnumerableProperty } = require_util(); var encoder = new TextEncoder(); - var File = class _File extends Blob2 { + var File2 = class _File extends Blob2 { constructor(fileBits, fileName, options2 = {}) { webidl.argumentLengthCheck(arguments, 2, { header: "File constructor" }); fileBits = webidl.converters["sequence"](fileBits); @@ -5015,7 +5019,7 @@ var require_file = __commonJS({ return "File"; } }; - Object.defineProperties(File.prototype, { + Object.defineProperties(File2.prototype, { [Symbol.toStringTag]: { value: "File", configurable: true @@ -5095,9 +5099,9 @@ var require_file = __commonJS({ return s.replace(/\r?\n/g, nativeLineEnding); } function isFileLike(object) { - return NativeFile && object instanceof NativeFile || object instanceof File || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File"; + return NativeFile && object instanceof NativeFile || object instanceof File2 || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File"; } - module2.exports = { File, FileLike, isFileLike }; + module2.exports = { File: File2, FileLike, isFileLike }; } }); @@ -5110,7 +5114,7 @@ var require_formdata = __commonJS({ var { File: UndiciFile, FileLike, isFileLike } = require_file(); var { webidl } = require_webidl(); var { Blob: Blob2, File: NativeFile } = require("buffer"); - var File = NativeFile ?? UndiciFile; + var File2 = NativeFile ?? UndiciFile; var FormData = class _FormData { constructor(form) { if (form !== void 0) { @@ -5241,14 +5245,14 @@ var require_formdata = __commonJS({ value = Buffer.from(value).toString("utf8"); } else { if (!isFileLike(value)) { - value = value instanceof Blob2 ? new File([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); + value = value instanceof Blob2 ? new File2([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type }); } if (filename !== void 0) { const options2 = { type: value.type, lastModified: value.lastModified }; - value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File([value], filename, options2) : new FileLike(value, filename, options2); + value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File2([value], filename, options2) : new FileLike(value, filename, options2); } } return { name, value }; @@ -5262,7 +5266,7 @@ var require_body = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/fetch/body.js"(exports2, module2) { "use strict"; var Busboy = require_main(); - var util2 = require_util(); + var util = require_util(); var { ReadableStreamFrom, isBlobLike, @@ -5277,7 +5281,7 @@ var require_body = __commonJS({ var { DOMException: DOMException2, structuredClone } = require_constants2(); var { Blob: Blob2, File: NativeFile } = require("buffer"); var { kBodyUsed } = require_symbols(); - var assert = require("assert"); + var assert2 = require("assert"); var { isErrored } = require_util(); var { isUint8Array, isArrayBuffer } = require("util/types"); var { File: UndiciFile } = require_file(); @@ -5290,7 +5294,7 @@ var require_body = __commonJS({ random = (max) => Math.floor(Math.random(max)); } var ReadableStream = globalThis.ReadableStream; - var File = NativeFile ?? UndiciFile; + var File2 = NativeFile ?? UndiciFile; var textEncoder = new TextEncoder(); var textDecoder = new TextDecoder(); function extractBody(object, keepalive = false) { @@ -5315,7 +5319,7 @@ var require_body = __commonJS({ type: void 0 }); } - assert(isReadableStreamLike(stream)); + assert2(isReadableStreamLike(stream)); let action = null; let source = null; let length = null; @@ -5330,7 +5334,7 @@ var require_body = __commonJS({ source = new Uint8Array(object.slice()); } else if (ArrayBuffer.isView(object)) { source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength)); - } else if (util2.isFormDataLike(object)) { + } else if (util.isFormDataLike(object)) { const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, "0")}`; const prefix = `--${boundary}\r Content-Disposition: form-data`; @@ -5388,14 +5392,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r if (keepalive) { throw new TypeError("keepalive"); } - if (util2.isDisturbed(object) || object.locked) { + if (util.isDisturbed(object) || object.locked) { throw new TypeError( "Response body object should not be disturbed or locked" ); } stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object); } - if (typeof source === "string" || util2.isBuffer(source)) { + if (typeof source === "string" || util.isBuffer(source)) { length = Buffer.byteLength(source); } if (action != null) { @@ -5431,8 +5435,8 @@ Content-Type: ${value.type || "application/octet-stream"}\r ReadableStream = require("stream/web").ReadableStream; } if (object instanceof ReadableStream) { - assert(!util2.isDisturbed(object), "The body has already been consumed."); - assert(!object.locked, "The stream is locked."); + assert2(!util.isDisturbed(object), "The body has already been consumed."); + assert2(!object.locked, "The stream is locked."); } return extractBody(object, keepalive); } @@ -5453,7 +5457,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r yield body; } else { const stream = body.stream; - if (util2.isDisturbed(stream)) { + if (util.isDisturbed(stream)) { throw new TypeError("The body has already been consumed."); } if (stream.locked) { @@ -5525,14 +5529,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r }); value.on("end", () => { chunks.push(Buffer.from(base64chunk, "base64")); - responseFormData.append(name, new File(chunks, filename, { type: mimeType })); + responseFormData.append(name, new File2(chunks, filename, { type: mimeType })); }); } else { value.on("data", (chunk) => { chunks.push(chunk); }); value.on("end", () => { - responseFormData.append(name, new File(chunks, filename, { type: mimeType })); + responseFormData.append(name, new File2(chunks, filename, { type: mimeType })); }); } }); @@ -5603,7 +5607,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r return promise.promise; } function bodyUnusable(body) { - return body != null && (body.stream.locked || util2.isDisturbed(body.stream)); + return body != null && (body.stream.locked || util.isDisturbed(body.stream)); } function utf8DecodeBytes(buffer) { if (buffer.length === 0) { @@ -5643,9 +5647,9 @@ var require_request = __commonJS({ InvalidArgumentError, NotSupportedError } = require_errors(); - var assert = require("assert"); + var assert2 = require("assert"); var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols(); - var util2 = require_util(); + var util = require_util(); var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; @@ -5716,12 +5720,12 @@ var require_request = __commonJS({ this.abort = null; if (body == null) { this.body = null; - } else if (util2.isStream(body)) { + } else if (util.isStream(body)) { this.body = body; const rState = this.body._readableState; if (!rState || !rState.autoDestroy) { this.endHandler = function autoDestroy() { - util2.destroy(this); + util.destroy(this); }; this.body.on("end", this.endHandler); } @@ -5733,7 +5737,7 @@ var require_request = __commonJS({ } }; this.body.on("error", this.errorHandler); - } else if (util2.isBuffer(body)) { + } else if (util.isBuffer(body)) { this.body = body.byteLength ? body : null; } else if (ArrayBuffer.isView(body)) { this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null; @@ -5741,7 +5745,7 @@ var require_request = __commonJS({ this.body = body.byteLength ? Buffer.from(body) : null; } else if (typeof body === "string") { this.body = body.length ? Buffer.from(body) : null; - } else if (util2.isFormDataLike(body) || util2.isIterable(body) || util2.isBlobLike(body)) { + } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) { this.body = body; } else { throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"); @@ -5749,7 +5753,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util2.buildURL(path3, query) : path3; + this.path = query ? util.buildURL(path3, query) : path3; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -5775,8 +5779,8 @@ var require_request = __commonJS({ } else if (headers != null) { throw new InvalidArgumentError("headers must be an object or an array"); } - if (util2.isFormDataLike(this.body)) { - if (util2.nodeMajor < 16 || util2.nodeMajor === 16 && util2.nodeMinor < 8) { + if (util.isFormDataLike(this.body)) { + if (util.nodeMajor < 16 || util.nodeMajor === 16 && util.nodeMinor < 8) { throw new InvalidArgumentError("Form-Data bodies are only supported in node v16.8 and newer."); } if (!extractBody) { @@ -5790,13 +5794,13 @@ var require_request = __commonJS({ } this.body = bodyStream.stream; this.contentLength = bodyStream.length; - } else if (util2.isBlobLike(body) && this.contentType == null && body.type) { + } else if (util.isBlobLike(body) && this.contentType == null && body.type) { this.contentType = body.type; this.headers += `content-type: ${body.type}\r `; } - util2.validateHandler(handler, method, upgrade); - this.servername = util2.getServerName(this.host); + util.validateHandler(handler, method, upgrade); + this.servername = util.getServerName(this.host); this[kHandler] = handler; if (channels.create.hasSubscribers) { channels.create.publish({ request: this }); @@ -5824,8 +5828,8 @@ var require_request = __commonJS({ } } onConnect(abort) { - assert(!this.aborted); - assert(!this.completed); + assert2(!this.aborted); + assert2(!this.completed); if (this.error) { abort(this.error); } else { @@ -5834,8 +5838,8 @@ var require_request = __commonJS({ } } onHeaders(statusCode, headers, resume, statusText) { - assert(!this.aborted); - assert(!this.completed); + assert2(!this.aborted); + assert2(!this.completed); if (channels.headers.hasSubscribers) { channels.headers.publish({ request: this, response: { statusCode, headers, statusText } }); } @@ -5846,8 +5850,8 @@ var require_request = __commonJS({ } } onData(chunk) { - assert(!this.aborted); - assert(!this.completed); + assert2(!this.aborted); + assert2(!this.completed); try { return this[kHandler].onData(chunk); } catch (err) { @@ -5856,13 +5860,13 @@ var require_request = __commonJS({ } } onUpgrade(statusCode, headers, socket) { - assert(!this.aborted); - assert(!this.completed); + assert2(!this.aborted); + assert2(!this.completed); return this[kHandler].onUpgrade(statusCode, headers, socket); } onComplete(trailers) { this.onFinally(); - assert(!this.aborted); + assert2(!this.aborted); this.completed = true; if (channels.trailers.hasSubscribers) { channels.trailers.publish({ request: this, trailers }); @@ -6193,8 +6197,8 @@ var require_connect = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/core/connect.js"(exports2, module2) { "use strict"; var net = require("net"); - var assert = require("assert"); - var util2 = require_util(); + var assert2 = require("assert"); + var util = require_util(); var { InvalidArgumentError, ConnectTimeoutError } = require_errors(); var tls; var SessionCache; @@ -6254,16 +6258,16 @@ var require_connect = __commonJS({ const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions); timeout = timeout == null ? 1e4 : timeout; allowH2 = allowH2 != null ? allowH2 : false; - return function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) { + return function connect({ hostname: hostname2, host, protocol, port, servername, localAddress, httpSocket }, callback) { let socket; if (protocol === "https:") { if (!tls) { tls = require("tls"); } - servername = servername || options2.servername || util2.getServerName(host) || null; - const sessionKey = servername || hostname; + servername = servername || options2.servername || util.getServerName(host) || null; + const sessionKey = servername || hostname2; const session = sessionCache.get(sessionKey) || null; - assert(sessionKey); + assert2(sessionKey); socket = tls.connect({ highWaterMark: 16384, // TLS in node can't have bigger HWM anyway... @@ -6276,20 +6280,20 @@ var require_connect = __commonJS({ socket: httpSocket, // upgrade socket connection port: port || 443, - host: hostname + host: hostname2 }); socket.on("session", function(session2) { sessionCache.set(sessionKey, session2); }); } else { - assert(!httpSocket, "httpSocket can only be sent on TLS update"); + assert2(!httpSocket, "httpSocket can only be sent on TLS update"); socket = net.connect({ highWaterMark: 64 * 1024, // Same as nodejs fs streams. ...options2, localAddress, port: port || 80, - host: hostname + host: hostname2 }); } if (options2.keepAlive == null || options2.keepAlive) { @@ -6338,7 +6342,7 @@ var require_connect = __commonJS({ }; } function onConnectTimeout(socket) { - util2.destroy(socket, new ConnectTimeoutError()); + util.destroy(socket, new ConnectTimeoutError()); } module2.exports = buildConnector; } @@ -6689,9 +6693,9 @@ var require_constants3 = __commonJS({ var require_RedirectHandler = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RedirectHandler.js"(exports2, module2) { "use strict"; - var util2 = require_util(); + var util = require_util(); var { kBodyUsed } = require_symbols(); - var assert = require("assert"); + var assert2 = require("assert"); var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; @@ -6702,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ this[kBodyUsed] = false; } async *[Symbol.asyncIterator]() { - assert(!this[kBodyUsed], "disturbed"); + assert2(!this[kBodyUsed], "disturbed"); this[kBodyUsed] = true; yield* this[kBody]; } @@ -6712,7 +6716,7 @@ var require_RedirectHandler = __commonJS({ if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) { throw new InvalidArgumentError("maxRedirections must be a positive number"); } - util2.validateHandler(handler, opts.method, opts.upgrade); + util.validateHandler(handler, opts.method, opts.upgrade); this.dispatch = dispatch; this.location = null; this.abort = null; @@ -6720,10 +6724,10 @@ var require_RedirectHandler = __commonJS({ this.maxRedirections = maxRedirections; this.handler = handler; this.history = []; - if (util2.isStream(this.opts.body)) { - if (util2.bodyLength(this.opts.body) === 0) { + if (util.isStream(this.opts.body)) { + if (util.bodyLength(this.opts.body) === 0) { this.opts.body.on("data", function() { - assert(false); + assert2(false); }); } if (typeof this.opts.body.readableDidRead !== "boolean") { @@ -6734,7 +6738,7 @@ var require_RedirectHandler = __commonJS({ } } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") { this.opts.body = new BodyAsyncIterable(this.opts.body); - } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util2.isIterable(this.opts.body)) { + } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util.isIterable(this.opts.body)) { this.opts.body = new BodyAsyncIterable(this.opts.body); } } @@ -6749,14 +6753,14 @@ var require_RedirectHandler = __commonJS({ this.handler.onError(error2); } onHeaders(statusCode, headers, resume, statusText) { - this.location = this.history.length >= this.maxRedirections || util2.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); + this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); if (this.opts.origin) { this.history.push(new URL(this.opts.path, this.opts.origin)); } if (!this.location) { return this.handler.onHeaders(statusCode, headers, resume, statusText); } - const { origin, pathname, search } = util2.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); + const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); const path3 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); this.opts.path = path3; @@ -6801,13 +6805,13 @@ var require_RedirectHandler = __commonJS({ } function shouldRemoveHeader(header, removeContent, unknownOrigin) { if (header.length === 4) { - return util2.headerNameToString(header) === "host"; + return util.headerNameToString(header) === "host"; } - if (removeContent && util2.headerNameToString(header).startsWith("content-")) { + if (removeContent && util.headerNameToString(header).startsWith("content-")) { return true; } if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) { - const name = util2.headerNameToString(header); + const name = util.headerNameToString(header); return name === "authorization" || name === "cookie" || name === "proxy-authorization"; } return false; @@ -6827,7 +6831,7 @@ var require_RedirectHandler = __commonJS({ } } } else { - assert(headers == null, "headers must be an object or an array"); + assert2(headers == null, "headers must be an object or an array"); } return ret; } @@ -6877,11 +6881,11 @@ var require_llhttp_simd_wasm = __commonJS({ var require_client = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/client.js"(exports2, module2) { "use strict"; - var assert = require("assert"); + var assert2 = require("assert"); var net = require("net"); var http = require("http"); var { pipeline } = require("stream"); - var util2 = require_util(); + var util = require_util(); var timers = require_timers(); var Request = require_request(); var DispatcherBase = require_dispatcher_base(); @@ -7092,12 +7096,12 @@ var require_client = __commonJS({ allowH2, socketPath, timeout: connectTimeout, - ...util2.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect2 }); } this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })]; - this[kUrl] = util2.parseOrigin(url); + this[kUrl] = util.parseOrigin(url); this[kConnector] = connect2; this[kSocket] = null; this[kPipelining] = pipelining != null ? pipelining : 1; @@ -7166,7 +7170,7 @@ var require_client = __commonJS({ const request = this[kHTTPConnVersion] === "h2" ? Request[kHTTP2BuildRequest](origin, opts, handler) : Request[kHTTP1BuildRequest](origin, opts, handler); this[kQueue].push(request); if (this[kResuming]) { - } else if (util2.bodyLength(request.body) == null && util2.isIterable(request.body)) { + } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) { this[kResuming] = 1; process.nextTick(resume, this); } else { @@ -7201,21 +7205,21 @@ var require_client = __commonJS({ resolve(); }; if (this[kHTTP2Session] != null) { - util2.destroy(this[kHTTP2Session], err); + util.destroy(this[kHTTP2Session], err); this[kHTTP2Session] = null; this[kHTTP2SessionState] = null; } if (!this[kSocket]) { queueMicrotask(callback); } else { - util2.destroy(this[kSocket].on("close", callback), err); + util.destroy(this[kSocket].on("close", callback), err); } resume(this); }); } }; function onHttp2SessionError(err) { - assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); this[kSocket][kError] = err; onError(this[kClient], err); } @@ -7227,8 +7231,8 @@ var require_client = __commonJS({ } } function onHttp2SessionEnd() { - util2.destroy(this, new SocketError("other side closed")); - util2.destroy(this[kSocket], new SocketError("other side closed")); + util.destroy(this, new SocketError("other side closed")); + util.destroy(this[kSocket], new SocketError("other side closed")); } function onHTTP2GoAway(code) { const client = this[kClient]; @@ -7236,7 +7240,7 @@ var require_client = __commonJS({ client[kSocket] = null; client[kHTTP2Session] = null; if (client.destroyed) { - assert(this[kPending] === 0); + assert2(this[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request = requests[i]; @@ -7248,7 +7252,7 @@ var require_client = __commonJS({ errorRequest(client, request, err); } client[kPendingIdx] = client[kRunningIdx]; - assert(client[kRunning] === 0); + assert2(client[kRunning] === 0); client.emit( "disconnect", client[kUrl], @@ -7275,35 +7279,35 @@ var require_client = __commonJS({ return 0; }, wasm_on_status: (p, at, len) => { - assert.strictEqual(currentParser.ptr, p); + assert2.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_begin: (p) => { - assert.strictEqual(currentParser.ptr, p); + assert2.strictEqual(currentParser.ptr, p); return currentParser.onMessageBegin() || 0; }, wasm_on_header_field: (p, at, len) => { - assert.strictEqual(currentParser.ptr, p); + assert2.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_header_value: (p, at, len) => { - assert.strictEqual(currentParser.ptr, p); + assert2.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => { - assert.strictEqual(currentParser.ptr, p); + assert2.strictEqual(currentParser.ptr, p); return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0; }, wasm_on_body: (p, at, len) => { - assert.strictEqual(currentParser.ptr, p); + assert2.strictEqual(currentParser.ptr, p); const start = at - currentBufferPtr + currentBufferRef.byteOffset; return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0; }, wasm_on_message_complete: (p) => { - assert.strictEqual(currentParser.ptr, p); + assert2.strictEqual(currentParser.ptr, p); return currentParser.onMessageComplete() || 0; } /* eslint-enable camelcase */ @@ -7322,7 +7326,7 @@ var require_client = __commonJS({ var TIMEOUT_IDLE = 3; var Parser = class { constructor(client, socket, { exports: exports3 }) { - assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); + assert2(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0); this.llhttp = exports3; this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE); this.client = client; @@ -7368,10 +7372,10 @@ var require_client = __commonJS({ if (this.socket.destroyed || !this.paused) { return; } - assert(this.ptr != null); - assert(currentParser == null); + assert2(this.ptr != null); + assert2(currentParser == null); this.llhttp.llhttp_resume(this.ptr); - assert(this.timeoutType === TIMEOUT_BODY); + assert2(this.timeoutType === TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); @@ -7391,9 +7395,9 @@ var require_client = __commonJS({ } } execute(data) { - assert(this.ptr != null); - assert(currentParser == null); - assert(!this.paused); + assert2(this.ptr != null); + assert2(currentParser == null); + assert2(!this.paused); const { socket, llhttp } = this; if (data.length > currentBufferSize) { if (currentBufferPtr) { @@ -7431,12 +7435,12 @@ var require_client = __commonJS({ throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset)); } } catch (err) { - util2.destroy(socket, err); + util.destroy(socket, err); } } destroy() { - assert(this.ptr != null); - assert(currentParser == null); + assert2(this.ptr != null); + assert2(currentParser == null); this.llhttp.llhttp_free(this.ptr); this.ptr = null; timers.clearTimeout(this.timeout); @@ -7488,22 +7492,22 @@ var require_client = __commonJS({ trackHeader(len) { this.headersSize += len; if (this.headersSize >= this.headersMaxSize) { - util2.destroy(this.socket, new HeadersOverflowError()); + util.destroy(this.socket, new HeadersOverflowError()); } } onUpgrade(head) { const { upgrade, client, socket, headers, statusCode } = this; - assert(upgrade); + assert2(upgrade); const request = client[kQueue][client[kRunningIdx]]; - assert(request); - assert(!socket.destroyed); - assert(socket === client[kSocket]); - assert(!this.paused); - assert(request.upgrade || request.method === "CONNECT"); + assert2(request); + assert2(!socket.destroyed); + assert2(socket === client[kSocket]); + assert2(!this.paused); + assert2(request.upgrade || request.method === "CONNECT"); this.statusCode = null; this.statusText = ""; this.shouldKeepAlive = null; - assert(this.headers.length % 2 === 0); + assert2(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; socket.unshift(head); @@ -7518,7 +7522,7 @@ var require_client = __commonJS({ try { request.onUpgrade(statusCode, headers, socket); } catch (err) { - util2.destroy(socket, err); + util.destroy(socket, err); } resume(client); } @@ -7531,17 +7535,17 @@ var require_client = __commonJS({ if (!request) { return -1; } - assert(!this.upgrade); - assert(this.statusCode < 200); + assert2(!this.upgrade); + assert2(this.statusCode < 200); if (statusCode === 100) { - util2.destroy(socket, new SocketError("bad response", util2.getSocketInfo(socket))); + util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket))); return -1; } if (upgrade && !request.upgrade) { - util2.destroy(socket, new SocketError("bad upgrade", util2.getSocketInfo(socket))); + util.destroy(socket, new SocketError("bad upgrade", util.getSocketInfo(socket))); return -1; } - assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS); + assert2.strictEqual(this.timeoutType, TIMEOUT_HEADERS); this.statusCode = statusCode; this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD. request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive"; @@ -7554,20 +7558,20 @@ var require_client = __commonJS({ } } if (request.method === "CONNECT") { - assert(client[kRunning] === 1); + assert2(client[kRunning] === 1); this.upgrade = true; return 2; } if (upgrade) { - assert(client[kRunning] === 1); + assert2(client[kRunning] === 1); this.upgrade = true; return 2; } - assert(this.headers.length % 2 === 0); + assert2(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; if (this.shouldKeepAlive && client[kPipelining]) { - const keepAliveTimeout = this.keepAlive ? util2.parseKeepAliveTimeout(this.keepAlive) : null; + const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null; if (keepAliveTimeout != null) { const timeout = Math.min( keepAliveTimeout - client[kKeepAliveTimeoutThreshold], @@ -7606,16 +7610,16 @@ var require_client = __commonJS({ return -1; } const request = client[kQueue][client[kRunningIdx]]; - assert(request); - assert.strictEqual(this.timeoutType, TIMEOUT_BODY); + assert2(request); + assert2.strictEqual(this.timeoutType, TIMEOUT_BODY); if (this.timeout) { if (this.timeout.refresh) { this.timeout.refresh(); } } - assert(statusCode >= 200); + assert2(statusCode >= 200); if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) { - util2.destroy(socket, new ResponseExceededMaxSizeError()); + util.destroy(socket, new ResponseExceededMaxSizeError()); return -1; } this.bytesRead += buf.length; @@ -7632,35 +7636,35 @@ var require_client = __commonJS({ return; } const request = client[kQueue][client[kRunningIdx]]; - assert(request); - assert(statusCode >= 100); + assert2(request); + assert2(statusCode >= 100); this.statusCode = null; this.statusText = ""; this.bytesRead = 0; this.contentLength = ""; this.keepAlive = ""; this.connection = ""; - assert(this.headers.length % 2 === 0); + assert2(this.headers.length % 2 === 0); this.headers = []; this.headersSize = 0; if (statusCode < 200) { return; } if (request.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) { - util2.destroy(socket, new ResponseContentLengthMismatchError()); + util.destroy(socket, new ResponseContentLengthMismatchError()); return -1; } request.onComplete(headers); client[kQueue][client[kRunningIdx]++] = null; if (socket[kWriting]) { - assert.strictEqual(client[kRunning], 0); - util2.destroy(socket, new InformationalError("reset")); + assert2.strictEqual(client[kRunning], 0); + util.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (!shouldKeepAlive) { - util2.destroy(socket, new InformationalError("reset")); + util.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (socket[kReset] && client[kRunning] === 0) { - util2.destroy(socket, new InformationalError("reset")); + util.destroy(socket, new InformationalError("reset")); return constants.ERROR.PAUSED; } else if (client[kPipelining] === 1) { setImmediate(resume, client); @@ -7673,16 +7677,16 @@ var require_client = __commonJS({ const { socket, timeoutType, client } = parser; if (timeoutType === TIMEOUT_HEADERS) { if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) { - assert(!parser.paused, "cannot be paused while waiting for headers"); - util2.destroy(socket, new HeadersTimeoutError()); + assert2(!parser.paused, "cannot be paused while waiting for headers"); + util.destroy(socket, new HeadersTimeoutError()); } } else if (timeoutType === TIMEOUT_BODY) { if (!parser.paused) { - util2.destroy(socket, new BodyTimeoutError()); + util.destroy(socket, new BodyTimeoutError()); } } else if (timeoutType === TIMEOUT_IDLE) { - assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); - util2.destroy(socket, new InformationalError("socket idle timeout")); + assert2(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]); + util.destroy(socket, new InformationalError("socket idle timeout")); } } function onSocketReadable() { @@ -7693,7 +7697,7 @@ var require_client = __commonJS({ } function onSocketError(err) { const { [kClient]: client, [kParser]: parser } = this; - assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); + assert2(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID"); if (client[kHTTPConnVersion] !== "h2") { if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) { parser.onMessageComplete(); @@ -7705,13 +7709,13 @@ var require_client = __commonJS({ } function onError(client, err) { if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") { - assert(client[kPendingIdx] === client[kRunningIdx]); + assert2(client[kPendingIdx] === client[kRunningIdx]); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request = requests[i]; errorRequest(client, request, err); } - assert(client[kSize] === 0); + assert2(client[kSize] === 0); } } function onSocketEnd() { @@ -7722,7 +7726,7 @@ var require_client = __commonJS({ return; } } - util2.destroy(this, new SocketError("other side closed", util2.getSocketInfo(this))); + util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this))); } function onSocketClose() { const { [kClient]: client, [kParser]: parser } = this; @@ -7733,10 +7737,10 @@ var require_client = __commonJS({ this[kParser].destroy(); this[kParser] = null; } - const err = this[kError] || new SocketError("closed", util2.getSocketInfo(this)); + const err = this[kError] || new SocketError("closed", util.getSocketInfo(this)); client[kSocket] = null; if (client.destroyed) { - assert(client[kPending] === 0); + assert2(client[kPending] === 0); const requests = client[kQueue].splice(client[kRunningIdx]); for (let i = 0; i < requests.length; i++) { const request = requests[i]; @@ -7748,27 +7752,27 @@ var require_client = __commonJS({ errorRequest(client, request, err); } client[kPendingIdx] = client[kRunningIdx]; - assert(client[kRunning] === 0); + assert2(client[kRunning] === 0); client.emit("disconnect", client[kUrl], [client], err); resume(client); } async function connect(client) { - assert(!client[kConnecting]); - assert(!client[kSocket]); - let { host, hostname, protocol, port } = client[kUrl]; - if (hostname[0] === "[") { - const idx = hostname.indexOf("]"); - assert(idx !== -1); - const ip = hostname.substring(1, idx); - assert(net.isIP(ip)); - hostname = ip; + assert2(!client[kConnecting]); + assert2(!client[kSocket]); + let { host, hostname: hostname2, protocol, port } = client[kUrl]; + if (hostname2[0] === "[") { + const idx = hostname2.indexOf("]"); + assert2(idx !== -1); + const ip = hostname2.substring(1, idx); + assert2(net.isIP(ip)); + hostname2 = ip; } client[kConnecting] = true; if (channels.beforeConnect.hasSubscribers) { channels.beforeConnect.publish({ connectParams: { host, - hostname, + hostname: hostname2, protocol, port, servername: client[kServerName], @@ -7781,7 +7785,7 @@ var require_client = __commonJS({ const socket = await new Promise((resolve, reject) => { client[kConnector]({ host, - hostname, + hostname: hostname2, protocol, port, servername: client[kServerName], @@ -7795,12 +7799,12 @@ var require_client = __commonJS({ }); }); if (client.destroyed) { - util2.destroy(socket.on("error", () => { + util.destroy(socket.on("error", () => { }), new ClientDestroyedError()); return; } client[kConnecting] = false; - assert(socket); + assert2(socket); const isH2 = socket.alpnProtocol === "h2"; if (isH2) { if (!h2ExperimentalWarned) { @@ -7845,7 +7849,7 @@ var require_client = __commonJS({ channels.connected.publish({ connectParams: { host, - hostname, + hostname: hostname2, protocol, port, servername: client[kServerName], @@ -7865,7 +7869,7 @@ var require_client = __commonJS({ channels.connectError.publish({ connectParams: { host, - hostname, + hostname: hostname2, protocol, port, servername: client[kServerName], @@ -7876,7 +7880,7 @@ var require_client = __commonJS({ }); } if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") { - assert(client[kRunning] === 0); + assert2(client[kRunning] === 0); while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) { const request = client[kQueue][client[kPendingIdx]++]; errorRequest(client, request, err); @@ -7908,7 +7912,7 @@ var require_client = __commonJS({ function _resume(client, sync) { while (true) { if (client.destroyed) { - assert(client[kPending] === 0); + assert2(client[kPending] === 0); return; } if (client[kClosedResolve] && !client[kSize]) { @@ -7963,7 +7967,7 @@ var require_client = __commonJS({ } client[kServerName] = request.servername; if (socket && socket.servername !== request.servername) { - util2.destroy(socket, new InformationalError("servername changed")); + util.destroy(socket, new InformationalError("servername changed")); return; } } @@ -7983,7 +7987,7 @@ var require_client = __commonJS({ if (client[kRunning] > 0 && (request.upgrade || request.method === "CONNECT")) { return; } - if (client[kRunning] > 0 && util2.bodyLength(request.body) !== 0 && (util2.isStream(request.body) || util2.isAsyncIterable(request.body))) { + if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 && (util.isStream(request.body) || util.isAsyncIterable(request.body))) { return; } if (!request.aborted && write(client, request)) { @@ -8006,7 +8010,7 @@ var require_client = __commonJS({ if (body && typeof body.read === "function") { body.read(0); } - const bodyLength = util2.bodyLength(body); + const bodyLength = util.bodyLength(body); let contentLength = bodyLength; if (contentLength === null) { contentLength = request.contentLength; @@ -8028,7 +8032,7 @@ var require_client = __commonJS({ return; } errorRequest(client, request, err || new RequestAbortedError()); - util2.destroy(socket, new InformationalError("aborted")); + util.destroy(socket, new InformationalError("aborted")); }); } catch (err) { errorRequest(client, request, err); @@ -8080,13 +8084,13 @@ upgrade: ${upgrade}\r \r `, "latin1"); } else { - assert(contentLength === null, "no body must not have content length"); + assert2(contentLength === null, "no body must not have content length"); socket.write(`${header}\r `, "latin1"); } request.onRequestSent(); - } else if (util2.isBuffer(body)) { - assert(contentLength === body.byteLength, "buffer body must have content length"); + } else if (util.isBuffer(body)) { + assert2(contentLength === body.byteLength, "buffer body must have content length"); socket.cork(); socket.write(`${header}content-length: ${contentLength}\r \r @@ -8098,18 +8102,18 @@ upgrade: ${upgrade}\r if (!expectsPayload) { socket[kReset] = true; } - } else if (util2.isBlobLike(body)) { + } else if (util.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload }); } else { writeBlob({ body, client, request, socket, contentLength, header, expectsPayload }); } - } else if (util2.isStream(body)) { + } else if (util.isStream(body)) { writeStream({ body, client, request, socket, contentLength, header, expectsPayload }); - } else if (util2.isIterable(body)) { + } else if (util.isIterable(body)) { writeIterable({ body, client, request, socket, contentLength, header, expectsPayload }); } else { - assert(false); + assert2(false); } return true; } @@ -8163,7 +8167,7 @@ upgrade: ${upgrade}\r if (body && typeof body.read === "function") { body.read(0); } - let contentLength = util2.bodyLength(body); + let contentLength = util.bodyLength(body); if (contentLength == null) { contentLength = request.contentLength; } @@ -8178,7 +8182,7 @@ upgrade: ${upgrade}\r process.emitWarning(new RequestContentLengthMismatchError()); } if (contentLength != null) { - assert(body, "no body must not have content length"); + assert2(body, "no body must not have content length"); headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`; } session.ref(); @@ -8218,7 +8222,7 @@ upgrade: ${upgrade}\r stream.once("error", function(err) { if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util2.destroy(stream, err); + util.destroy(stream, err); } }); stream.once("frameError", (type, code) => { @@ -8226,22 +8230,22 @@ upgrade: ${upgrade}\r errorRequest(client, request, err); if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) { h2State.streams -= 1; - util2.destroy(stream, err); + util.destroy(stream, err); } }); return true; function writeBodyH2() { if (!body) { request.onRequestSent(); - } else if (util2.isBuffer(body)) { - assert(contentLength === body.byteLength, "buffer body must have content length"); + } else if (util.isBuffer(body)) { + assert2(contentLength === body.byteLength, "buffer body must have content length"); stream.cork(); stream.write(body); stream.uncork(); stream.end(); request.onBodySent(body); request.onRequestSent(); - } else if (util2.isBlobLike(body)) { + } else if (util.isBlobLike(body)) { if (typeof body.stream === "function") { writeIterable({ client, @@ -8265,7 +8269,7 @@ upgrade: ${upgrade}\r socket: client[kSocket] }); } - } else if (util2.isStream(body)) { + } else if (util.isStream(body)) { writeStream({ body, client, @@ -8276,7 +8280,7 @@ upgrade: ${upgrade}\r h2stream: stream, header: "" }); - } else if (util2.isIterable(body)) { + } else if (util.isIterable(body)) { writeIterable({ body, client, @@ -8288,32 +8292,32 @@ upgrade: ${upgrade}\r socket: client[kSocket] }); } else { - assert(false); + assert2(false); } } } function writeStream({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { - assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); + assert2(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined"); if (client[kHTTPConnVersion] === "h2") { let onPipeData = function(chunk) { request.onBodySent(chunk); }; - const pipe = pipeline( + const pipe2 = pipeline( body, h2stream, (err) => { if (err) { - util2.destroy(body, err); - util2.destroy(h2stream, err); + util.destroy(body, err); + util.destroy(h2stream, err); } else { request.onRequestSent(); } } ); - pipe.on("data", onPipeData); - pipe.once("end", () => { - pipe.removeListener("data", onPipeData); - util2.destroy(pipe); + pipe2.on("data", onPipeData); + pipe2.once("end", () => { + pipe2.removeListener("data", onPipeData); + util.destroy(pipe2); }); return; } @@ -8328,7 +8332,7 @@ upgrade: ${upgrade}\r this.pause(); } } catch (err) { - util2.destroy(this, err); + util.destroy(this, err); } }; const onDrain = function() { @@ -8351,7 +8355,7 @@ upgrade: ${upgrade}\r return; } finished = true; - assert(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); + assert2(socket.destroyed || socket[kWriting] && client[kRunning] <= 1); socket.off("drain", onDrain).off("error", onFinished); body.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort); if (!err) { @@ -8363,9 +8367,9 @@ upgrade: ${upgrade}\r } writer.destroy(err); if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) { - util2.destroy(body, err); + util.destroy(body, err); } else { - util2.destroy(body); + util.destroy(body); } }; body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort); @@ -8375,7 +8379,7 @@ upgrade: ${upgrade}\r socket.on("drain", onDrain).on("error", onFinished); } async function writeBlob({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { - assert(contentLength === body.size, "blob body must have content length"); + assert2(contentLength === body.size, "blob body must have content length"); const isH2 = client[kHTTPConnVersion] === "h2"; try { if (contentLength != null && contentLength !== body.size) { @@ -8401,11 +8405,11 @@ upgrade: ${upgrade}\r } resume(client); } catch (err) { - util2.destroy(isH2 ? h2stream : socket, err); + util.destroy(isH2 ? h2stream : socket, err); } } async function writeIterable({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) { - assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); + assert2(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined"); let callback = null; function onDrain() { if (callback) { @@ -8415,7 +8419,7 @@ upgrade: ${upgrade}\r } } const waitForDrain = () => new Promise((resolve, reject) => { - assert(callback === null); + assert2(callback === null); if (socket[kError]) { reject(socket[kError]); } else { @@ -8563,15 +8567,15 @@ ${len.toString(16)}\r const { socket, client } = this; socket[kWriting] = false; if (err) { - assert(client[kRunning] <= 1, "pipeline should only contain this request"); - util2.destroy(socket, err); + assert2(client[kRunning] <= 1, "pipeline should only contain this request"); + util.destroy(socket, err); } } }; function errorRequest(client, request, err) { try { request.onError(err); - assert(request.aborted); + assert2(request.aborted); } catch (err2) { client.emit("error", err2); } @@ -8840,7 +8844,7 @@ var require_pool = __commonJS({ var { InvalidArgumentError } = require_errors(); - var util2 = require_util(); + var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); var kOptions = Symbol("options"); @@ -8880,14 +8884,14 @@ var require_pool = __commonJS({ allowH2, socketPath, timeout: connectTimeout, - ...util2.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, + ...util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0, ...connect }); } this[kInterceptors] = options2.interceptors && options2.interceptors.Pool && Array.isArray(options2.interceptors.Pool) ? options2.interceptors.Pool : []; this[kConnections] = connections || null; - this[kUrl] = util2.parseOrigin(origin); - this[kOptions] = { ...util2.deepClone(options2), connect, allowH2 }; + this[kUrl] = util.parseOrigin(origin); + this[kOptions] = { ...util.deepClone(options2), connect, allowH2 }; this[kOptions].interceptors = options2.interceptors ? { ...options2.interceptors } : void 0; this[kFactory] = factory; this.on("connectionError", (origin2, targets, error2) => { @@ -9101,7 +9105,7 @@ var require_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var Pool = require_pool(); var Client = require_client(); - var util2 = require_util(); + var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); var kOnConnect = Symbol("onConnect"); @@ -9131,7 +9135,7 @@ var require_agent = __commonJS({ connect = { ...connect }; } this[kInterceptors] = options2.interceptors && options2.interceptors.Agent && Array.isArray(options2.interceptors.Agent) ? options2.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })]; - this[kOptions] = { ...util2.deepClone(options2), connect }; + this[kOptions] = { ...util.deepClone(options2), connect }; this[kOptions].interceptors = options2.interceptors ? { ...options2.interceptors } : void 0; this[kMaxRedirections] = maxRedirections; this[kFactory] = factory; @@ -9214,10 +9218,10 @@ var require_agent = __commonJS({ var require_readable = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/readable.js"(exports2, module2) { "use strict"; - var assert = require("assert"); + var assert2 = require("assert"); var { Readable } = require("stream"); var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors(); - var util2 = require_util(); + var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; var kConsume = Symbol("kConsume"); @@ -9315,7 +9319,7 @@ var require_readable = __commonJS({ } // https://fetch.spec.whatwg.org/#dom-body-bodyused get bodyUsed() { - return util2.isDisturbed(this); + return util.isDisturbed(this); } // https://fetch.spec.whatwg.org/#dom-body-body get body() { @@ -9323,7 +9327,7 @@ var require_readable = __commonJS({ this[kBody] = ReadableStreamFrom(this); if (this[kConsume]) { this[kBody].getReader(); - assert(this[kBody].locked); + assert2(this[kBody].locked); } } return this[kBody]; @@ -9336,7 +9340,7 @@ var require_readable = __commonJS({ if (typeof signal !== "object" || !("aborted" in signal)) { throw new InvalidArgumentError("signal must be an AbortSignal"); } - util2.throwIfAborted(signal); + util.throwIfAborted(signal); } catch (err) { return Promise.reject(err); } @@ -9345,7 +9349,7 @@ var require_readable = __commonJS({ return Promise.resolve(null); } return new Promise((resolve, reject) => { - const signalListenerCleanup = signal ? util2.addAbortListener(signal, () => { + const signalListenerCleanup = signal ? util.addAbortListener(signal, () => { this.destroy(); }) : noop; this.on("close", function() { @@ -9368,13 +9372,13 @@ var require_readable = __commonJS({ return self[kBody] && self[kBody].locked === true || self[kConsume]; } function isUnusable(self) { - return util2.isDisturbed(self) || isLocked(self); + return util.isDisturbed(self) || isLocked(self); } async function consume(stream, type) { if (isUnusable(stream)) { throw new TypeError("unusable"); } - assert(!stream[kConsume]); + assert2(!stream[kConsume]); return new Promise((resolve, reject) => { stream[kConsume] = { type, @@ -9466,13 +9470,13 @@ var require_readable = __commonJS({ var require_util3 = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/api/util.js"(exports2, module2) { "use strict"; - var assert = require("assert"); + var assert2 = require("assert"); var { ResponseStatusCodeError } = require_errors(); var { toUSVString } = require_util(); async function getResolveErrorBodyCallback({ callback, body, contentType, statusCode, statusMessage, headers }) { - assert(body); + assert2(body); let chunks = []; let limit = 0; for await (const chunk of body) { @@ -9565,7 +9569,7 @@ var require_api_request = __commonJS({ InvalidArgumentError, RequestAbortedError } = require_errors(); - var util2 = require_util(); + var util = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); @@ -9593,8 +9597,8 @@ var require_api_request = __commonJS({ } super("UNDICI_REQUEST"); } catch (err) { - if (util2.isStream(body)) { - util2.destroy(body.on("error", util2.nop), err); + if (util.isStream(body)) { + util.destroy(body.on("error", util.nop), err); } throw err; } @@ -9609,7 +9613,7 @@ var require_api_request = __commonJS({ this.onInfo = onInfo || null; this.throwOnError = throwOnError; this.highWaterMark = highWaterMark; - if (util2.isStream(body)) { + if (util.isStream(body)) { body.on("error", (err) => { this.onError(err); }); @@ -9625,14 +9629,14 @@ var require_api_request = __commonJS({ } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this; - const headers = responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); } return; } - const parsedHeaders = responseHeaders === "raw" ? util2.parseHeaders(rawHeaders) : headers; + const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; const body = new Readable({ resume, abort, contentType, highWaterMark }); this.callback = null; @@ -9663,7 +9667,7 @@ var require_api_request = __commonJS({ onComplete(trailers) { const { res } = this; removeSignal(this); - util2.parseHeaders(trailers, this.trailers); + util.parseHeaders(trailers, this.trailers); res.push(null); } onError(err) { @@ -9678,12 +9682,12 @@ var require_api_request = __commonJS({ if (res) { this.res = null; queueMicrotask(() => { - util2.destroy(res, err); + util.destroy(res, err); }); } if (body) { this.body = null; - util2.destroy(body, err); + util.destroy(body, err); } } }; @@ -9720,7 +9724,7 @@ var require_api_stream = __commonJS({ InvalidReturnValueError, RequestAbortedError } = require_errors(); - var util2 = require_util(); + var util = require_util(); var { getResolveErrorBodyCallback } = require_util3(); var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); @@ -9748,8 +9752,8 @@ var require_api_stream = __commonJS({ } super("UNDICI_STREAM"); } catch (err) { - if (util2.isStream(body)) { - util2.destroy(body.on("error", util2.nop), err); + if (util.isStream(body)) { + util.destroy(body.on("error", util.nop), err); } throw err; } @@ -9764,7 +9768,7 @@ var require_api_stream = __commonJS({ this.body = body; this.onInfo = onInfo || null; this.throwOnError = throwOnError || false; - if (util2.isStream(body)) { + if (util.isStream(body)) { body.on("error", (err) => { this.onError(err); }); @@ -9780,7 +9784,7 @@ var require_api_stream = __commonJS({ } onHeaders(statusCode, rawHeaders, resume, statusMessage) { const { factory, opaque, context, callback, responseHeaders } = this; - const headers = responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + const headers = responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); if (statusCode < 200) { if (this.onInfo) { this.onInfo({ statusCode, headers }); @@ -9790,7 +9794,7 @@ var require_api_stream = __commonJS({ this.factory = null; let res; if (this.throwOnError && statusCode >= 400) { - const parsedHeaders = responseHeaders === "raw" ? util2.parseHeaders(rawHeaders) : headers; + const parsedHeaders = responseHeaders === "raw" ? util.parseHeaders(rawHeaders) : headers; const contentType = parsedHeaders["content-type"]; res = new PassThrough(); this.callback = null; @@ -9816,7 +9820,7 @@ var require_api_stream = __commonJS({ const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this; this.res = null; if (err || !res2.readable) { - util2.destroy(res2, err); + util.destroy(res2, err); } this.callback = null; this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers }); @@ -9840,7 +9844,7 @@ var require_api_stream = __commonJS({ if (!res) { return; } - this.trailers = util2.parseHeaders(trailers); + this.trailers = util.parseHeaders(trailers); res.end(); } onError(err) { @@ -9849,7 +9853,7 @@ var require_api_stream = __commonJS({ this.factory = null; if (res) { this.res = null; - util2.destroy(res, err); + util.destroy(res, err); } else if (callback) { this.callback = null; queueMicrotask(() => { @@ -9858,7 +9862,7 @@ var require_api_stream = __commonJS({ } if (body) { this.body = null; - util2.destroy(body, err); + util.destroy(body, err); } } }; @@ -9898,10 +9902,10 @@ var require_api_pipeline = __commonJS({ InvalidReturnValueError, RequestAbortedError } = require_errors(); - var util2 = require_util(); + var util = require_util(); var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); - var assert = require("assert"); + var assert2 = require("assert"); var kResume = Symbol("resume"); var PipelineRequest = class extends Readable { constructor() { @@ -9960,7 +9964,7 @@ var require_api_pipeline = __commonJS({ this.abort = null; this.context = null; this.onInfo = onInfo || null; - this.req = new PipelineRequest().on("error", util2.nop); + this.req = new PipelineRequest().on("error", util.nop); this.ret = new Duplex({ readableObjectMode: opts.objectMode, autoDestroy: true, @@ -9986,9 +9990,9 @@ var require_api_pipeline = __commonJS({ if (abort && err) { abort(); } - util2.destroy(body, err); - util2.destroy(req, err); - util2.destroy(res, err); + util.destroy(body, err); + util.destroy(req, err); + util.destroy(res, err); removeSignal(this); callback(err); } @@ -10001,7 +10005,7 @@ var require_api_pipeline = __commonJS({ } onConnect(abort, context) { const { ret, res } = this; - assert(!res, "pipeline cannot be retried"); + assert2(!res, "pipeline cannot be retried"); if (ret.destroyed) { throw new RequestAbortedError(); } @@ -10012,7 +10016,7 @@ var require_api_pipeline = __commonJS({ const { opaque, handler, context } = this; if (statusCode < 200) { if (this.onInfo) { - const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); this.onInfo({ statusCode, headers }); } return; @@ -10021,7 +10025,7 @@ var require_api_pipeline = __commonJS({ let body; try { this.handler = null; - const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); body = this.runInAsyncScope(handler, null, { statusCode, headers, @@ -10030,7 +10034,7 @@ var require_api_pipeline = __commonJS({ context }); } catch (err) { - this.res.on("error", util2.nop); + this.res.on("error", util.nop); throw err; } if (!body || typeof body.on !== "function") { @@ -10043,14 +10047,14 @@ var require_api_pipeline = __commonJS({ } }).on("error", (err) => { const { ret } = this; - util2.destroy(ret, err); + util.destroy(ret, err); }).on("end", () => { const { ret } = this; ret.push(null); }).on("close", () => { const { ret } = this; if (!ret._readableState.ended) { - util2.destroy(ret, new RequestAbortedError()); + util.destroy(ret, new RequestAbortedError()); } }); this.body = body; @@ -10066,7 +10070,7 @@ var require_api_pipeline = __commonJS({ onError(err) { const { ret } = this; this.handler = null; - util2.destroy(ret, err); + util.destroy(ret, err); } }; function pipeline(opts, handler) { @@ -10088,9 +10092,9 @@ var require_api_upgrade = __commonJS({ "use strict"; var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); var { AsyncResource } = require("async_hooks"); - var util2 = require_util(); + var util = require_util(); var { addSignal, removeSignal } = require_abort_signal(); - var assert = require("assert"); + var assert2 = require("assert"); var UpgradeHandler = class extends AsyncResource { constructor(opts, callback) { if (!opts || typeof opts !== "object") { @@ -10123,10 +10127,10 @@ var require_api_upgrade = __commonJS({ } onUpgrade(statusCode, rawHeaders, socket) { const { callback, opaque, context } = this; - assert.strictEqual(statusCode, 101); + assert2.strictEqual(statusCode, 101); removeSignal(this); this.callback = null; - const headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + const headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); this.runInAsyncScope(callback, null, null, { headers, socket, @@ -10178,7 +10182,7 @@ var require_api_connect = __commonJS({ "use strict"; var { AsyncResource } = require("async_hooks"); var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors(); - var util2 = require_util(); + var util = require_util(); var { addSignal, removeSignal } = require_abort_signal(); var ConnectHandler = class extends AsyncResource { constructor(opts, callback) { @@ -10215,7 +10219,7 @@ var require_api_connect = __commonJS({ this.callback = null; let headers = rawHeaders; if (headers != null) { - headers = this.responseHeaders === "raw" ? util2.parseRawHeaders(rawHeaders) : util2.parseHeaders(rawHeaders); + headers = this.responseHeaders === "raw" ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders); } this.runInAsyncScope(callback, null, null, { statusCode, @@ -10372,10 +10376,10 @@ var require_mock_utils = __commonJS({ } } function buildHeadersFromArray(headers) { - const clone = headers.slice(); + const clone2 = headers.slice(); const entries = []; - for (let index = 0; index < clone.length; index += 2) { - entries.push([clone[index], clone[index + 1]]); + for (let index = 0; index < clone2.length; index += 2) { + entries.push([clone2[index], clone2[index + 1]]); } return Object.fromEntries(entries); } @@ -11231,7 +11235,7 @@ var require_proxy_agent = __commonJS({ var require_RetryHandler = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/handler/RetryHandler.js"(exports2, module2) { "use strict"; - var assert = require("assert"); + var assert2 = require("assert"); var { kRetryHandlerDefaultRetry } = require_symbols(); var { RequestRetryError } = require_errors(); var { isDisturbed, parseHeaders, parseRangeHeader } = require_util(); @@ -11396,8 +11400,8 @@ var require_RetryHandler = __commonJS({ return false; } const { start, size, end = size } = contentRange; - assert(this.start === start, "content-range mismatch"); - assert(this.end == null || this.end === end, "content-range mismatch"); + assert2(this.start === start, "content-range mismatch"); + assert2(this.end == null || this.end === end, "content-range mismatch"); this.resume = resume; return true; } @@ -11413,12 +11417,12 @@ var require_RetryHandler = __commonJS({ ); } const { start, size, end = size } = range; - assert( + assert2( start != null && Number.isFinite(start) && this.start !== start, "content-range mismatch" ); - assert(Number.isFinite(start)); - assert( + assert2(Number.isFinite(start)); + assert2( end != null && Number.isFinite(end) && this.end !== end, "invalid content-length" ); @@ -11429,8 +11433,8 @@ var require_RetryHandler = __commonJS({ const contentLength = headers["content-length"]; this.end = contentLength != null ? Number(contentLength) : null; } - assert(Number.isFinite(this.start)); - assert( + assert2(Number.isFinite(this.start)); + assert2( this.end == null || Number.isFinite(this.end), "invalid content-length" ); @@ -11571,9 +11575,9 @@ var require_headers = __commonJS({ isValidHeaderName, isValidHeaderValue } = require_util2(); - var util2 = require("util"); + var util = require("util"); var { webidl } = require_webidl(); - var assert = require("assert"); + var assert2 = require("assert"); var kHeadersMap = Symbol("headers map"); var kHeadersSortedMap = Symbol("headers map sorted"); function isHTTPWhiteSpaceCharCode(code) { @@ -11831,7 +11835,7 @@ var require_headers = __commonJS({ headers.push([name, cookies[j]]); } } else { - assert(value !== null); + assert2(value !== null); headers.push([name, value]); } } @@ -11924,7 +11928,7 @@ var require_headers = __commonJS({ value: "Headers", configurable: true }, - [util2.inspect.custom]: { + [util.inspect.custom]: { enumerable: false } }); @@ -11955,12 +11959,12 @@ var require_response = __commonJS({ "use strict"; var { Headers, HeadersList, fill } = require_headers(); var { extractBody, cloneBody, mixinBody } = require_body(); - var util2 = require_util(); - var { kEnumerableProperty } = util2; + var util = require_util(); + var { kEnumerableProperty } = util; var { isValidReasonPhrase, isCancelled, - isAborted: isAborted2, + isAborted, isBlobLike, serializeJavascriptValueToJSONString, isErrorLike, @@ -11977,7 +11981,7 @@ var require_response = __commonJS({ var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); var { kHeadersList, kConstruct } = require_symbols(); - var assert = require("assert"); + var assert2 = require("assert"); var { types } = require("util"); var ReadableStream = globalThis.ReadableStream || require("stream/web").ReadableStream; var textEncoder = new TextEncoder("utf-8"); @@ -12102,7 +12106,7 @@ var require_response = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Response); - return !!this[kState].body && util2.isDisturbed(this[kState].body.stream); + return !!this[kState].body && util.isDisturbed(this[kState].body.stream); } // Returns a clone of response. clone() { @@ -12193,7 +12197,7 @@ var require_response = __commonJS({ return p in state ? state[p] : target[p]; }, set(target, p, value) { - assert(!(p in state)); + assert2(!(p in state)); target[p] = value; return true; } @@ -12227,12 +12231,12 @@ var require_response = __commonJS({ body: null }); } else { - assert(false); + assert2(false); } } function makeAppropriateNetworkError(fetchParams, err = null) { - assert(isCancelled(fetchParams)); - return isAborted2(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); + assert2(isCancelled(fetchParams)); + return isAborted(fetchParams) ? makeNetworkError(Object.assign(new DOMException2("The operation was aborted.", "AbortError"), { cause: err })) : makeNetworkError(Object.assign(new DOMException2("Request was cancelled."), { cause: err })); } function initializeResponse(response, init, body) { if (init.status !== null && (init.status < 200 || init.status > 599)) { @@ -12284,7 +12288,7 @@ var require_response = __commonJS({ if (types.isArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) { return webidl.converters.BufferSource(V); } - if (util2.isFormDataLike(V)) { + if (util.isFormDataLike(V)) { return webidl.converters.FormData(V, { strict: false }); } if (V instanceof URLSearchParams) { @@ -12335,7 +12339,7 @@ var require_request2 = __commonJS({ var { extractBody, mixinBody, cloneBody } = require_body(); var { Headers, fill: fillHeaders, HeadersList } = require_headers(); var { FinalizationRegistry } = require_dispatcher_weakref()(); - var util2 = require_util(); + var util = require_util(); var { isValidHTTPToken, sameOrigin, @@ -12353,13 +12357,13 @@ var require_request2 = __commonJS({ requestCache, requestDuplex } = require_constants2(); - var { kEnumerableProperty } = util2; + var { kEnumerableProperty } = util; var { kHeaders, kSignal, kState, kGuard, kRealm } = require_symbols2(); var { webidl } = require_webidl(); var { getGlobalOrigin } = require_global(); var { URLSerializer } = require_dataURL(); var { kHeadersList, kConstruct } = require_symbols(); - var assert = require("assert"); + var assert2 = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; var kAbortController = Symbol("abortController"); @@ -12403,7 +12407,7 @@ var require_request2 = __commonJS({ request = makeRequest({ urlList: [parsedURL] }); fallbackMode = "cors"; } else { - assert(input instanceof _Request); + assert2(input instanceof _Request); request = input[kState]; signal = input[kSignal]; } @@ -12573,7 +12577,7 @@ var require_request2 = __commonJS({ } } catch { } - util2.addAbortListener(signal, abort); + util.addAbortListener(signal, abort); requestFinalizer.register(ac, { signal, abort }); } } @@ -12631,7 +12635,7 @@ var require_request2 = __commonJS({ } let finalBody = inputOrInitBody; if (initBody == null && inputBody != null) { - if (util2.isDisturbed(inputBody.stream) || inputBody.stream.locked) { + if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) { throw new TypeError( "Cannot construct a Request with a Request object that has already been used." ); @@ -12760,7 +12764,7 @@ var require_request2 = __commonJS({ } get bodyUsed() { webidl.brandCheck(this, _Request); - return !!this[kState].body && util2.isDisturbed(this[kState].body.stream); + return !!this[kState].body && util.isDisturbed(this[kState].body.stream); } get duplex() { webidl.brandCheck(this, _Request); @@ -12784,7 +12788,7 @@ var require_request2 = __commonJS({ if (this.signal.aborted) { ac.abort(this.signal.reason); } else { - util2.addAbortListener( + util.addAbortListener( this.signal, () => { ac.abort(this.signal.reason); @@ -13002,7 +13006,7 @@ var require_fetch = __commonJS({ isBlobLike, sameOrigin, isCancelled, - isAborted: isAborted2, + isAborted, isErrorLike, fullyReadBody, readableStreamClose, @@ -13012,7 +13016,7 @@ var require_fetch = __commonJS({ urlHasHttpsScheme } = require_util2(); var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); - var assert = require("assert"); + var assert2 = require("assert"); var { safelyExtractBody } = require_body(); var { redirectStatusSet, @@ -13092,7 +13096,7 @@ var require_fetch = __commonJS({ requestObject.signal, () => { locallyAborted = true; - assert(controller != null); + assert2(controller != null); controller.abort(requestObject.signal.reason); abortFetch(p, request, responseObject, requestObject.signal.reason); } @@ -13225,7 +13229,7 @@ var require_fetch = __commonJS({ taskDestination, crossOriginIsolatedCapability }; - assert(!request.body || request.body.stream); + assert2(!request.body || request.body.stream); if (request.window === "client") { request.window = request.client?.globalObject?.constructor?.name === "Window" ? request.client : "no-window"; } @@ -13318,7 +13322,7 @@ var require_fetch = __commonJS({ } else if (request.responseTainting === "opaque") { response = filterResponse(response, "opaque"); } else { - assert(false); + assert2(false); } } let internalResponse = response.status === 0 ? response : response.internalResponse; @@ -13510,7 +13514,7 @@ var require_fetch = __commonJS({ } else if (request.redirect === "follow") { response = await httpRedirectFetch(fetchParams, response); } else { - assert(false); + assert2(false); } } response.timingInfo = timingInfo; @@ -13563,7 +13567,7 @@ var require_fetch = __commonJS({ request.headersList.delete("host"); } if (request.body != null) { - assert(request.body.source != null); + assert2(request.body.source != null); request.body = safelyExtractBody(request.body.source)[0]; } const timingInfo = fetchParams.timingInfo; @@ -13696,7 +13700,7 @@ var require_fetch = __commonJS({ return response; } async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) { - assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); + assert2(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed); fetchParams.controller.connection = { abort: null, destroyed: false, @@ -13810,7 +13814,7 @@ var require_fetch = __commonJS({ let isFailure; try { const { done, value } = await fetchParams.controller.next(); - if (isAborted2(fetchParams)) { + if (isAborted(fetchParams)) { break; } bytes = done ? void 0 : value; @@ -13843,7 +13847,7 @@ var require_fetch = __commonJS({ } }; function onAborted(reason) { - if (isAborted2(fetchParams)) { + if (isAborted(fetchParams)) { response.aborted = true; if (isReadable(stream)) { fetchParams.controller.controller.error( @@ -14831,7 +14835,7 @@ var require_symbols4 = __commonJS({ var require_util5 = __commonJS({ "node_modules/.pnpm/undici@5.29.0/node_modules/undici/lib/cache/util.js"(exports2, module2) { "use strict"; - var assert = require("assert"); + var assert2 = require("assert"); var { URLSerializer } = require_dataURL(); var { isValidHeaderName } = require_util2(); function urlEquals(A, B, excludeFragment = false) { @@ -14840,7 +14844,7 @@ var require_util5 = __commonJS({ return serializedA === serializedB; } function fieldValues(header) { - assert(header !== null); + assert2(header !== null); const values = []; for (let value of header.split(",")) { value = value.trim(); @@ -14874,7 +14878,7 @@ var require_cache = __commonJS({ var { kState, kHeaders, kGuard, kRealm } = require_symbols2(); var { fetching } = require_fetch(); var { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require_util2(); - var assert = require("assert"); + var assert2 = require("assert"); var { getGlobalDispatcher } = require_global2(); var _relevantRequestResponseList, _Cache_instances, batchCacheOperations_fn, queryCache_fn, requestMatchesCachedItem_fn; var _Cache = class _Cache { @@ -15137,7 +15141,7 @@ var require_cache = __commonJS({ return false; } } else { - assert(typeof request === "string"); + assert2(typeof request === "string"); r = new Request(request)[kState]; } const operations = []; @@ -15249,7 +15253,7 @@ var require_cache = __commonJS({ } for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse); - assert(idx !== -1); + assert2(idx !== -1); cache.splice(idx, 1); } } else if (operation.type === "put") { @@ -15281,7 +15285,7 @@ var require_cache = __commonJS({ requestResponses = __privateMethod(this, _Cache_instances, queryCache_fn).call(this, operation.request); for (const requestResponse of requestResponses) { const idx = cache.indexOf(requestResponse); - assert(idx !== -1); + assert2(idx !== -1); cache.splice(idx, 1); } cache.push([operation.request, operation.response]); @@ -15564,9 +15568,9 @@ var require_util6 = __commonJS({ throw new Error("Invalid cookie domain"); } } - function toIMFDate(date) { - if (typeof date === "number") { - date = new Date(date); + function toIMFDate(date3) { + if (typeof date3 === "number") { + date3 = new Date(date3); } const days = [ "Sun", @@ -15591,13 +15595,13 @@ var require_util6 = __commonJS({ "Nov", "Dec" ]; - const dayName = days[date.getUTCDay()]; - const day = date.getUTCDate().toString().padStart(2, "0"); - const month = months[date.getUTCMonth()]; - const year = date.getUTCFullYear(); - const hour = date.getUTCHours().toString().padStart(2, "0"); - const minute = date.getUTCMinutes().toString().padStart(2, "0"); - const second = date.getUTCSeconds().toString().padStart(2, "0"); + const dayName = days[date3.getUTCDay()]; + const day = date3.getUTCDate().toString().padStart(2, "0"); + const month = months[date3.getUTCMonth()]; + const year = date3.getUTCFullYear(); + const hour = date3.getUTCHours().toString().padStart(2, "0"); + const minute = date3.getUTCMinutes().toString().padStart(2, "0"); + const second = date3.getUTCSeconds().toString().padStart(2, "0"); return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`; } function validateCookieMaxAge(maxAge) { @@ -15671,7 +15675,7 @@ var require_parse = __commonJS({ var { maxNameValuePairSize, maxAttributeValueSize } = require_constants4(); var { isCTLExcludingHtab } = require_util6(); var { collectASequenceOfCodePointsFast } = require_dataURL(); - var assert = require("assert"); + var assert2 = require("assert"); function parseSetCookie(header) { if (isCTLExcludingHtab(header)) { return null; @@ -15713,7 +15717,7 @@ var require_parse = __commonJS({ if (unparsedAttributes.length === 0) { return cookieAttributeList; } - assert(unparsedAttributes[0] === ";"); + assert2(unparsedAttributes[0] === ";"); unparsedAttributes = unparsedAttributes.slice(1); let cookieAv = ""; if (unparsedAttributes.includes(";")) { @@ -17206,7 +17210,7 @@ var require_undici = __commonJS({ var Pool = require_pool(); var BalancedPool = require_balanced_pool(); var Agent = require_agent(); - var util2 = require_util(); + var util = require_util(); var { InvalidArgumentError } = errors; var api = require_api(); var buildConnector = require_connect(); @@ -17260,12 +17264,12 @@ var require_undici = __commonJS({ if (!opts.path.startsWith("/")) { path3 = `/${path3}`; } - url = new URL(util2.parseOrigin(url).origin + path3); + url = new URL(util.parseOrigin(url).origin + path3); } else { if (!opts) { opts = typeof url === "object" ? url : {}; } - url = util2.parseURL(url); + url = util.parseURL(url); } const { agent, dispatcher = getGlobalDispatcher() } = opts; if (agent) { @@ -17281,7 +17285,7 @@ var require_undici = __commonJS({ } module2.exports.setGlobalDispatcher = setGlobalDispatcher; module2.exports.getGlobalDispatcher = getGlobalDispatcher; - if (util2.nodeMajor > 16 || util2.nodeMajor === 16 && util2.nodeMinor >= 8) { + if (util.nodeMajor > 16 || util.nodeMajor === 16 && util.nodeMinor >= 8) { let fetchImpl = null; module2.exports.fetch = async function fetch(resource) { if (!fetchImpl) { @@ -17309,7 +17313,7 @@ var require_undici = __commonJS({ const { kConstruct } = require_symbols4(); module2.exports.caches = new CacheStorage(kConstruct); } - if (util2.nodeMajor >= 16) { + if (util.nodeMajor >= 16) { const { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies(); module2.exports.deleteCookie = deleteCookie; module2.exports.getCookies = getCookies; @@ -17319,7 +17323,7 @@ var require_undici = __commonJS({ module2.exports.parseMIMEType = parseMIMEType; module2.exports.serializeAMimeType = serializeAMimeType; } - if (util2.nodeMajor >= 18 && hasCrypto) { + if (util.nodeMajor >= 18 && hasCrypto) { const { WebSocket } = require_websocket(); module2.exports.WebSocket = WebSocket; } @@ -17730,7 +17734,7 @@ var require_lib = __commonJS({ info2.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } let callbackCalled = false; - function handleResult2(err, res) { + function handleResult(err, res) { if (!callbackCalled) { callbackCalled = true; onResult(err, res); @@ -17738,7 +17742,7 @@ var require_lib = __commonJS({ } const req = info2.httpModule.request(info2.options, (msg) => { const res = new HttpClientResponse(msg); - handleResult2(void 0, res); + handleResult(void 0, res); }); let socket; req.on("socket", (sock) => { @@ -17748,10 +17752,10 @@ var require_lib = __commonJS({ if (socket) { socket.end(); } - handleResult2(new Error(`Request timeout: ${info2.options.path}`)); + handleResult(new Error(`Request timeout: ${info2.options.path}`)); }); req.on("error", function(err) { - handleResult2(err); + handleResult(err); }); if (data && typeof data === "string") { req.write(data, "utf8"); @@ -17812,12 +17816,12 @@ var require_lib = __commonJS({ } return lowercaseKeys(headers || {}); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default) { + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - return additionalHeaders[header] || clientHeader || _default; + return additionalHeaders[header] || clientHeader || _default2; } _getAgent(parsedUrl) { let agent; @@ -19577,7 +19581,7 @@ var require_platform = __commonJS({ var os_1 = __importDefault(require("os")); var exec2 = __importStar(require_exec()); var getWindowsInfo = () => __awaiter(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + const { stdout: version2 } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { @@ -19585,7 +19589,7 @@ var require_platform = __commonJS({ }); return { name: name.trim(), - version: version.trim() + version: version2.trim() }; }); var getMacOsInfo = () => __awaiter(void 0, void 0, void 0, function* () { @@ -19593,21 +19597,21 @@ var require_platform = __commonJS({ const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { silent: true }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; + const version2 = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; const name = (_d = (_c = stdout.match(/ProductName:\s*(.+)/)) === null || _c === void 0 ? void 0 : _c[1]) !== null && _d !== void 0 ? _d : ""; return { name, - version + version: version2 }; }); var getLinuxInfo = () => __awaiter(void 0, void 0, void 0, function* () { const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); - const [name, version] = stdout.trim().split("\n"); + const [name, version2] = stdout.trim().split("\n"); return { name, - version + version: version2 }; }); exports2.platform = os_1.default.platform(); @@ -20113,7 +20117,7 @@ var require_utils3 = __commonJS({ "node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/utils.js"(exports2) { "use strict"; exports2.__esModule = true; - exports2.extend = extend; + exports2.extend = extend2; exports2.indexOf = indexOf; exports2.escapeExpression = escapeExpression; exports2.isEmpty = isEmpty; @@ -20134,7 +20138,7 @@ var require_utils3 = __commonJS({ function escapeChar(chr) { return escape[chr]; } - function extend(obj) { + function extend2(obj) { for (var i = 1; i < arguments.length; i++) { for (var key in arguments[i]) { if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { @@ -20159,29 +20163,29 @@ var require_utils3 = __commonJS({ return value && typeof value === "object" ? toString.call(value) === "[object Array]" : false; }; exports2.isArray = isArray; - function indexOf(array, value) { - for (var i = 0, len = array.length; i < len; i++) { - if (array[i] === value) { + function indexOf(array2, value) { + for (var i = 0, len = array2.length; i < len; i++) { + if (array2[i] === value) { return i; } } return -1; } - function escapeExpression(string) { - if (typeof string !== "string") { - if (string && string.toHTML) { - return string.toHTML(); - } else if (string == null) { + function escapeExpression(string3) { + if (typeof string3 !== "string") { + if (string3 && string3.toHTML) { + return string3.toHTML(); + } else if (string3 == null) { return ""; - } else if (!string) { - return string + ""; + } else if (!string3) { + return string3 + ""; } - string = "" + string; + string3 = "" + string3; } - if (!possible.test(string)) { - return string; + if (!possible.test(string3)) { + return string3; } - return string.replace(badChars, escapeChar); + return string3.replace(badChars, escapeChar); } function isEmpty(value) { if (!value && value !== 0) { @@ -20193,7 +20197,7 @@ var require_utils3 = __commonJS({ } } function createFrame(object) { - var frame = extend({}, object); + var frame = extend2({}, object); frame._parent = object; return frame; } @@ -20765,7 +20769,7 @@ var require_base = __commonJS({ 8: ">= 4.3.0" }; exports2.REVISION_CHANGES = REVISION_CHANGES; - var objectType2 = "[object Object]"; + var objectType = "[object Object]"; function HandlebarsEnvironment(helpers, partials, decorators) { this.helpers = helpers || {}; this.partials = partials || {}; @@ -20778,7 +20782,7 @@ var require_base = __commonJS({ logger: _logger2["default"], log: _logger2["default"].log, registerHelper: function registerHelper(name, fn) { - if (_utils.toString.call(name) === objectType2) { + if (_utils.toString.call(name) === objectType) { if (fn) { throw new _exception2["default"]("Arg not supported with multiple helpers"); } @@ -20790,21 +20794,21 @@ var require_base = __commonJS({ unregisterHelper: function unregisterHelper(name) { delete this.helpers[name]; }, - registerPartial: function registerPartial(name, partial) { - if (_utils.toString.call(name) === objectType2) { + registerPartial: function registerPartial(name, partial2) { + if (_utils.toString.call(name) === objectType) { _utils.extend(this.partials, name); } else { - if (typeof partial === "undefined") { + if (typeof partial2 === "undefined") { throw new _exception2["default"]('Attempting to register a partial called "' + name + '" as undefined'); } - this.partials[name] = partial; + this.partials[name] = partial2; } }, unregisterPartial: function unregisterPartial(name) { delete this.partials[name]; }, registerDecorator: function registerDecorator(name, fn) { - if (_utils.toString.call(name) === objectType2) { + if (_utils.toString.call(name) === objectType) { if (fn) { throw new _exception2["default"]("Arg not supported with multiple decorators"); } @@ -20836,8 +20840,8 @@ var require_safe_string = __commonJS({ "node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(exports2, module2) { "use strict"; exports2.__esModule = true; - function SafeString(string) { - this.string = string; + function SafeString(string3) { + this.string = string3; } SafeString.prototype.toString = SafeString.prototype.toHTML = function() { return "" + this.string; @@ -20925,21 +20929,21 @@ var require_runtime = __commonJS({ templateSpec.main.decorator = templateSpec.main_d; env.VM.checkRevision(templateSpec.compiler); var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7; - function invokePartialWrapper(partial, context, options2) { + function invokePartialWrapper(partial2, context, options2) { if (options2.hash) { context = Utils.extend({}, context, options2.hash); if (options2.ids) { options2.ids[0] = true; } } - partial = env.VM.resolvePartial.call(this, partial, context, options2); + partial2 = env.VM.resolvePartial.call(this, partial2, context, options2); var extendedOptions = Utils.extend({}, options2, { hooks: this.hooks, protoAccessControl: this.protoAccessControl }); - var result = env.VM.invokePartial.call(this, partial, context, extendedOptions); + var result = env.VM.invokePartial.call(this, partial2, context, extendedOptions); if (result == null && env.compile) { - options2.partials[options2.name] = env.compile(partial, templateSpec.compilerOptions, env); + options2.partials[options2.name] = env.compile(partial2, templateSpec.compilerOptions, env); result = options2.partials[options2.name](context, extendedOptions); } if (result != null) { @@ -21099,20 +21103,20 @@ var require_runtime = __commonJS({ prog.blockParams = declaredBlockParams || 0; return prog; } - function resolvePartial(partial, context, options2) { - if (!partial) { + function resolvePartial(partial2, context, options2) { + if (!partial2) { if (options2.name === "@partial-block") { - partial = options2.data["partial-block"]; + partial2 = options2.data["partial-block"]; } else { - partial = options2.partials[options2.name]; + partial2 = options2.partials[options2.name]; } - } else if (!partial.call && !options2.name) { - options2.name = partial; - partial = options2.partials[partial]; + } else if (!partial2.call && !options2.name) { + options2.name = partial2; + partial2 = options2.partials[partial2]; } - return partial; + return partial2; } - function invokePartial(partial, context, options2) { + function invokePartial(partial2, context, options2) { var currentPartialBlock = options2.data && options2.data["partial-block"]; options2.partial = true; if (options2.ids) { @@ -21134,13 +21138,13 @@ var require_runtime = __commonJS({ } })(); } - if (partial === void 0 && partialBlock) { - partial = partialBlock; + if (partial2 === void 0 && partialBlock) { + partial2 = partialBlock; } - if (partial === void 0) { + if (partial2 === void 0) { throw new _exception2["default"]("The partial " + options2.name + " could not be found"); - } else if (partial instanceof Function) { - return partial(context, options2); + } else if (partial2 instanceof Function) { + return partial2(context, options2); } } function noop() { @@ -21550,7 +21554,7 @@ var require_parser = __commonJS({ parseError: function parseError(str, hash) { throw new Error(str); }, - parse: function parse2(input) { + parse: function parse3(input) { var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1; this.lexer.setInput(input); this.lexer.yy = this.yy; @@ -22033,11 +22037,11 @@ var require_visitor = __commonJS({ }, // Traverses a given array. If mutating, empty respnses will be removed // for child elements. - acceptArray: function acceptArray(array) { - for (var i = 0, l = array.length; i < l; i++) { - this.acceptKey(array, i); - if (!array[i]) { - array.splice(i, 1); + acceptArray: function acceptArray(array2) { + for (var i = 0, l = array2.length; i < l; i++) { + this.acceptKey(array2, i); + if (!array2[i]) { + array2.splice(i, 1); i--; l--; } @@ -22070,9 +22074,9 @@ var require_visitor = __commonJS({ BlockStatement: visitBlock, DecoratorBlock: visitBlock, PartialStatement: visitPartial, - PartialBlockStatement: function PartialBlockStatement(partial) { - visitPartial.call(this, partial); - this.acceptKey(partial, "program"); + PartialBlockStatement: function PartialBlockStatement(partial2) { + visitPartial.call(this, partial2); + this.acceptKey(partial2, "program"); }, ContentStatement: function ContentStatement() { }, @@ -22108,10 +22112,10 @@ var require_visitor = __commonJS({ this.acceptKey(block, "program"); this.acceptKey(block, "inverse"); } - function visitPartial(partial) { - this.acceptRequired(partial, "name"); - this.acceptArray(partial.params); - this.acceptKey(partial, "hash"); + function visitPartial(partial2) { + this.acceptRequired(partial2, "name"); + this.acceptArray(partial2.params); + this.acceptKey(partial2, "hash"); } exports2["default"] = Visitor; module2.exports = exports2["default"]; @@ -22463,7 +22467,7 @@ var require_base2 = __commonJS({ "use strict"; exports2.__esModule = true; exports2.parseWithoutProcessing = parseWithoutProcessing; - exports2.parse = parse2; + exports2.parse = parse3; function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; @@ -22502,7 +22506,7 @@ var require_base2 = __commonJS({ var ast = _parser2["default"].parse(input); return ast; } - function parse2(input, options2) { + function parse3(input, options2) { var ast = parseWithoutProcessing(input, options2); var strip = new _whitespaceControl2["default"](options2); return strip.accept(ast); @@ -22572,11 +22576,11 @@ var require_compiler = __commonJS({ return this.accept(program); }, compileProgram: function compileProgram(program) { - var childCompiler = new this.compiler(), result = childCompiler.compile(program, this.options), guid = this.guid++; + var childCompiler = new this.compiler(), result = childCompiler.compile(program, this.options), guid2 = this.guid++; this.usePartial = this.usePartial || result.usePartial; - this.children[guid] = result; + this.children[guid2] = result; this.useDepths = this.useDepths || result.useDepths; - return guid; + return guid2; }, accept: function accept(node) { if (!this[node.type]) { @@ -22627,15 +22631,15 @@ var require_compiler = __commonJS({ this.useDecorators = true; this.opcode("registerDecorator", params.length, path3.original); }, - PartialStatement: function PartialStatement(partial) { + PartialStatement: function PartialStatement(partial2) { this.usePartial = true; - var program = partial.program; + var program = partial2.program; if (program) { - program = this.compileProgram(partial.program); + program = this.compileProgram(partial2.program); } - var params = partial.params; + var params = partial2.params; if (params.length > 1) { - throw new _exception2["default"]("Unsupported number of partial arguments: " + params.length, partial); + throw new _exception2["default"]("Unsupported number of partial arguments: " + params.length, partial2); } else if (!params.length) { if (this.options.explicitPartialContext) { this.opcode("pushLiteral", "undefined"); @@ -22643,12 +22647,12 @@ var require_compiler = __commonJS({ params.push({ type: "PathExpression", parts: [], depth: 0 }); } } - var partialName = partial.name.original, isDynamic = partial.name.type === "SubExpression"; + var partialName = partial2.name.original, isDynamic = partial2.name.type === "SubExpression"; if (isDynamic) { - this.accept(partial.name); + this.accept(partial2.name); } - this.setupFullMustacheParams(partial, program, void 0, true); - var indent = partial.indent || ""; + this.setupFullMustacheParams(partial2, program, void 0, true); + var indent = partial2.indent || ""; if (this.options.preventIndent && indent) { this.opcode("appendContent", indent); indent = ""; @@ -22731,11 +22735,11 @@ var require_compiler = __commonJS({ this.opcode("lookupOnContext", path3.parts, path3.falsy, path3.strict, scoped); } }, - StringLiteral: function StringLiteral(string) { - this.opcode("pushString", string.value); + StringLiteral: function StringLiteral(string3) { + this.opcode("pushString", string3.value); }, - NumberLiteral: function NumberLiteral(number) { - this.opcode("pushLiteral", number.value); + NumberLiteral: function NumberLiteral(number2) { + this.opcode("pushLiteral", number2.value); }, BooleanLiteral: function BooleanLiteral(bool) { this.opcode("pushLiteral", bool.value); @@ -22918,14 +22922,14 @@ var require_compiler = __commonJS({ } function transformLiteralToPath(sexpr) { if (!sexpr.path.parts) { - var literal = sexpr.path; + var literal2 = sexpr.path; sexpr.path = { type: "PathExpression", data: false, depth: 0, - parts: [literal.original + ""], - original: literal.original + "", - loc: literal.loc + parts: [literal2.original + ""], + original: literal2.original + "", + loc: literal2.loc }; } } @@ -22937,11 +22941,11 @@ var require_base64 = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js"(exports2) { "use strict"; var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""); - exports2.encode = function(number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; + exports2.encode = function(number2) { + if (0 <= number2 && number2 < intToCharMap.length) { + return intToCharMap[number2]; } - throw new TypeError("Must be between 0 and 63: " + number); + throw new TypeError("Must be between 0 and 63: " + number2); }; exports2.decode = function(charCode) { var bigA = 65; @@ -22978,7 +22982,7 @@ var require_base64 = __commonJS({ var require_base64_vlq = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(exports2) { "use strict"; - var base64 = require_base64(); + var base642 = require_base64(); var VLQ_BASE_SHIFT = 5; var VLQ_BASE = 1 << VLQ_BASE_SHIFT; var VLQ_BASE_MASK = VLQ_BASE - 1; @@ -23001,7 +23005,7 @@ var require_base64_vlq = __commonJS({ if (vlq > 0) { digit |= VLQ_CONTINUATION_BIT; } - encoded += base64.encode(digit); + encoded += base642.encode(digit); } while (vlq > 0); return encoded; }; @@ -23014,7 +23018,7 @@ var require_base64_vlq = __commonJS({ if (aIndex >= strLen) { throw new Error("Expected more digits in base 64 VLQ value."); } - digit = base64.decode(aStr.charCodeAt(aIndex++)); + digit = base642.decode(aStr.charCodeAt(aIndex++)); if (digit === -1) { throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); } @@ -23335,7 +23339,7 @@ var require_util8 = __commonJS({ var require_array_set = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js"(exports2) { "use strict"; - var util2 = require_util8(); + var util = require_util8(); var has = Object.prototype.hasOwnProperty; var hasNativeMap = typeof Map !== "undefined"; function ArraySet() { @@ -23353,7 +23357,7 @@ var require_array_set = __commonJS({ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length; }; ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = hasNativeMap ? aStr : util2.toSetString(aStr); + var sStr = hasNativeMap ? aStr : util.toSetString(aStr); var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr); var idx = this._array.length; if (!isDuplicate || aAllowDuplicates) { @@ -23371,7 +23375,7 @@ var require_array_set = __commonJS({ if (hasNativeMap) { return this._set.has(aStr); } else { - var sStr = util2.toSetString(aStr); + var sStr = util.toSetString(aStr); return has.call(this._set, sStr); } }; @@ -23382,7 +23386,7 @@ var require_array_set = __commonJS({ return idx; } } else { - var sStr = util2.toSetString(aStr); + var sStr = util.toSetString(aStr); if (has.call(this._set, sStr)) { return this._set[sStr]; } @@ -23406,13 +23410,13 @@ var require_array_set = __commonJS({ var require_mapping_list = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js"(exports2) { "use strict"; - var util2 = require_util8(); + var util = require_util8(); function generatedPositionAfter(mappingA, mappingB) { var lineA = mappingA.generatedLine; var lineB = mappingB.generatedLine; var columnA = mappingA.generatedColumn; var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || util2.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; + return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; } function MappingList() { this._array = []; @@ -23433,7 +23437,7 @@ var require_mapping_list = __commonJS({ }; MappingList.prototype.toArray = function MappingList_toArray() { if (!this._sorted) { - this._array.sort(util2.compareByGeneratedPositionsInflated); + this._array.sort(util.compareByGeneratedPositionsInflated); this._sorted = true; } return this._array; @@ -23447,16 +23451,16 @@ var require_source_map_generator = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js"(exports2) { "use strict"; var base64VLQ = require_base64_vlq(); - var util2 = require_util8(); + var util = require_util8(); var ArraySet = require_array_set().ArraySet; var MappingList = require_mapping_list().MappingList; function SourceMapGenerator(aArgs) { if (!aArgs) { aArgs = {}; } - this._file = util2.getArg(aArgs, "file", null); - this._sourceRoot = util2.getArg(aArgs, "sourceRoot", null); - this._skipValidation = util2.getArg(aArgs, "skipValidation", false); + this._file = util.getArg(aArgs, "file", null); + this._sourceRoot = util.getArg(aArgs, "sourceRoot", null); + this._skipValidation = util.getArg(aArgs, "skipValidation", false); this._sources = new ArraySet(); this._names = new ArraySet(); this._mappings = new MappingList(); @@ -23479,7 +23483,7 @@ var require_source_map_generator = __commonJS({ if (mapping.source != null) { newMapping.source = mapping.source; if (sourceRoot != null) { - newMapping.source = util2.relative(sourceRoot, newMapping.source); + newMapping.source = util.relative(sourceRoot, newMapping.source); } newMapping.original = { line: mapping.originalLine, @@ -23494,7 +23498,7 @@ var require_source_map_generator = __commonJS({ aSourceMapConsumer.sources.forEach(function(sourceFile) { var sourceRelative = sourceFile; if (sourceRoot !== null) { - sourceRelative = util2.relative(sourceRoot, sourceFile); + sourceRelative = util.relative(sourceRoot, sourceFile); } if (!generator._sources.has(sourceRelative)) { generator._sources.add(sourceRelative); @@ -23507,10 +23511,10 @@ var require_source_map_generator = __commonJS({ return generator; }; SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) { - var generated = util2.getArg(aArgs, "generated"); - var original = util2.getArg(aArgs, "original", null); - var source = util2.getArg(aArgs, "source", null); - var name = util2.getArg(aArgs, "name", null); + var generated = util.getArg(aArgs, "generated"); + var original = util.getArg(aArgs, "original", null); + var source = util.getArg(aArgs, "source", null); + var name = util.getArg(aArgs, "name", null); if (!this._skipValidation) { this._validateMapping(generated, original, source, name); } @@ -23538,15 +23542,15 @@ var require_source_map_generator = __commonJS({ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { var source = aSourceFile; if (this._sourceRoot != null) { - source = util2.relative(this._sourceRoot, source); + source = util.relative(this._sourceRoot, source); } if (aSourceContent != null) { if (!this._sourcesContents) { this._sourcesContents = /* @__PURE__ */ Object.create(null); } - this._sourcesContents[util2.toSetString(source)] = aSourceContent; + this._sourcesContents[util.toSetString(source)] = aSourceContent; } else if (this._sourcesContents) { - delete this._sourcesContents[util2.toSetString(source)]; + delete this._sourcesContents[util.toSetString(source)]; if (Object.keys(this._sourcesContents).length === 0) { this._sourcesContents = null; } @@ -23564,7 +23568,7 @@ var require_source_map_generator = __commonJS({ } var sourceRoot = this._sourceRoot; if (sourceRoot != null) { - sourceFile = util2.relative(sourceRoot, sourceFile); + sourceFile = util.relative(sourceRoot, sourceFile); } var newSources = new ArraySet(); var newNames = new ArraySet(); @@ -23577,10 +23581,10 @@ var require_source_map_generator = __commonJS({ if (original.source != null) { mapping.source = original.source; if (aSourceMapPath != null) { - mapping.source = util2.join(aSourceMapPath, mapping.source); + mapping.source = util.join(aSourceMapPath, mapping.source); } if (sourceRoot != null) { - mapping.source = util2.relative(sourceRoot, mapping.source); + mapping.source = util.relative(sourceRoot, mapping.source); } mapping.originalLine = original.line; mapping.originalColumn = original.column; @@ -23604,10 +23608,10 @@ var require_source_map_generator = __commonJS({ var content = aSourceMapConsumer.sourceContentFor(sourceFile2); if (content != null) { if (aSourceMapPath != null) { - sourceFile2 = util2.join(aSourceMapPath, sourceFile2); + sourceFile2 = util.join(aSourceMapPath, sourceFile2); } if (sourceRoot != null) { - sourceFile2 = util2.relative(sourceRoot, sourceFile2); + sourceFile2 = util.relative(sourceRoot, sourceFile2); } this.setSourceContent(sourceFile2, content); } @@ -23656,7 +23660,7 @@ var require_source_map_generator = __commonJS({ } } else { if (i > 0) { - if (!util2.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { + if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { continue; } next += ","; @@ -23688,9 +23692,9 @@ var require_source_map_generator = __commonJS({ return null; } if (aSourceRoot != null) { - source = util2.relative(aSourceRoot, source); + source = util.relative(aSourceRoot, source); } - var key = util2.toSetString(source); + var key = util.toSetString(source); return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null; }, this); }; @@ -23816,7 +23820,7 @@ var require_quick_sort = __commonJS({ var require_source_map_consumer = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js"(exports2) { "use strict"; - var util2 = require_util8(); + var util = require_util8(); var binarySearch = require_binary_search(); var ArraySet = require_array_set().ArraySet; var base64VLQ = require_base64_vlq(); @@ -23824,7 +23828,7 @@ var require_source_map_consumer = __commonJS({ function SourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { - sourceMap = util2.parseSourceMapInput(aSourceMap); + sourceMap = util.parseSourceMapInput(aSourceMap); } return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL); } @@ -23882,7 +23886,7 @@ var require_source_map_consumer = __commonJS({ var sourceRoot = this.sourceRoot; mappings.map(function(mapping) { var source = mapping.source === null ? null : this._sources.at(mapping.source); - source = util2.computeSourceURL(sourceRoot, source, this._sourceMapURL); + source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL); return { source, generatedLine: mapping.generatedLine, @@ -23894,11 +23898,11 @@ var require_source_map_consumer = __commonJS({ }, this).forEach(aCallback, context); }; SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util2.getArg(aArgs, "line"); + var line = util.getArg(aArgs, "line"); var needle = { - source: util2.getArg(aArgs, "source"), + source: util.getArg(aArgs, "source"), originalLine: line, - originalColumn: util2.getArg(aArgs, "column", 0) + originalColumn: util.getArg(aArgs, "column", 0) }; needle.source = this._findSourceIndex(needle.source); if (needle.source < 0) { @@ -23910,7 +23914,7 @@ var require_source_map_consumer = __commonJS({ this._originalMappings, "originalLine", "originalColumn", - util2.compareByOriginalPositions, + util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND ); if (index >= 0) { @@ -23919,9 +23923,9 @@ var require_source_map_consumer = __commonJS({ var originalLine = mapping.originalLine; while (mapping && mapping.originalLine === originalLine) { mappings.push({ - line: util2.getArg(mapping, "generatedLine", null), - column: util2.getArg(mapping, "generatedColumn", null), - lastColumn: util2.getArg(mapping, "lastGeneratedColumn", null) + line: util.getArg(mapping, "generatedLine", null), + column: util.getArg(mapping, "generatedColumn", null), + lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) }); mapping = this._originalMappings[++index]; } @@ -23929,9 +23933,9 @@ var require_source_map_consumer = __commonJS({ var originalColumn = mapping.originalColumn; while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) { mappings.push({ - line: util2.getArg(mapping, "generatedLine", null), - column: util2.getArg(mapping, "generatedColumn", null), - lastColumn: util2.getArg(mapping, "lastGeneratedColumn", null) + line: util.getArg(mapping, "generatedLine", null), + column: util.getArg(mapping, "generatedColumn", null), + lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) }); mapping = this._originalMappings[++index]; } @@ -23943,28 +23947,28 @@ var require_source_map_consumer = __commonJS({ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { - sourceMap = util2.parseSourceMapInput(aSourceMap); - } - var version = util2.getArg(sourceMap, "version"); - var sources = util2.getArg(sourceMap, "sources"); - var names = util2.getArg(sourceMap, "names", []); - var sourceRoot = util2.getArg(sourceMap, "sourceRoot", null); - var sourcesContent = util2.getArg(sourceMap, "sourcesContent", null); - var mappings = util2.getArg(sourceMap, "mappings"); - var file = util2.getArg(sourceMap, "file", null); - if (version != this._version) { - throw new Error("Unsupported version: " + version); + sourceMap = util.parseSourceMapInput(aSourceMap); + } + var version2 = util.getArg(sourceMap, "version"); + var sources = util.getArg(sourceMap, "sources"); + var names = util.getArg(sourceMap, "names", []); + var sourceRoot = util.getArg(sourceMap, "sourceRoot", null); + var sourcesContent = util.getArg(sourceMap, "sourcesContent", null); + var mappings = util.getArg(sourceMap, "mappings"); + var file = util.getArg(sourceMap, "file", null); + if (version2 != this._version) { + throw new Error("Unsupported version: " + version2); } if (sourceRoot) { - sourceRoot = util2.normalize(sourceRoot); + sourceRoot = util.normalize(sourceRoot); } - sources = sources.map(String).map(util2.normalize).map(function(source) { - return sourceRoot && util2.isAbsolute(sourceRoot) && util2.isAbsolute(source) ? util2.relative(sourceRoot, source) : source; + sources = sources.map(String).map(util.normalize).map(function(source) { + return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source; }); this._names = ArraySet.fromArray(names.map(String), true); this._sources = ArraySet.fromArray(sources, true); this._absoluteSources = this._sources.toArray().map(function(s) { - return util2.computeSourceURL(sourceRoot, s, aSourceMapURL); + return util.computeSourceURL(sourceRoot, s, aSourceMapURL); }); this.sourceRoot = sourceRoot; this.sourcesContent = sourcesContent; @@ -23977,7 +23981,7 @@ var require_source_map_consumer = __commonJS({ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) { var relativeSource = aSource; if (this.sourceRoot != null) { - relativeSource = util2.relative(this.sourceRoot, relativeSource); + relativeSource = util.relative(this.sourceRoot, relativeSource); } if (this._sources.has(relativeSource)) { return this._sources.indexOf(relativeSource); @@ -24002,7 +24006,7 @@ var require_source_map_consumer = __commonJS({ smc.file = aSourceMap._file; smc._sourceMapURL = aSourceMapURL; smc._absoluteSources = smc._sources.toArray().map(function(s) { - return util2.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); + return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL); }); var generatedMappings = aSourceMap._mappings.toArray().slice(); var destGeneratedMappings = smc.__generatedMappings = []; @@ -24023,7 +24027,7 @@ var require_source_map_consumer = __commonJS({ } destGeneratedMappings.push(destMapping); } - quickSort(smc.__originalMappings, util2.compareByOriginalPositions); + quickSort(smc.__originalMappings, util.compareByOriginalPositions); return smc; }; BasicSourceMapConsumer.prototype._version = 3; @@ -24110,9 +24114,9 @@ var require_source_map_consumer = __commonJS({ } } } - quickSort(generatedMappings, util2.compareByGeneratedPositionsDeflated); + quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); this.__generatedMappings = generatedMappings; - quickSort(originalMappings, util2.compareByOriginalPositions); + quickSort(originalMappings, util.compareByOriginalPositions); this.__originalMappings = originalMappings; }; BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) { @@ -24139,33 +24143,33 @@ var require_source_map_consumer = __commonJS({ }; BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) { var needle = { - generatedLine: util2.getArg(aArgs, "line"), - generatedColumn: util2.getArg(aArgs, "column") + generatedLine: util.getArg(aArgs, "line"), + generatedColumn: util.getArg(aArgs, "column") }; var index = this._findMapping( needle, this._generatedMappings, "generatedLine", "generatedColumn", - util2.compareByGeneratedPositionsDeflated, - util2.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) + util.compareByGeneratedPositionsDeflated, + util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._generatedMappings[index]; if (mapping.generatedLine === needle.generatedLine) { - var source = util2.getArg(mapping, "source", null); + var source = util.getArg(mapping, "source", null); if (source !== null) { source = this._sources.at(source); - source = util2.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); + source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL); } - var name = util2.getArg(mapping, "name", null); + var name = util.getArg(mapping, "name", null); if (name !== null) { name = this._names.at(name); } return { source, - line: util2.getArg(mapping, "originalLine", null), - column: util2.getArg(mapping, "originalColumn", null), + line: util.getArg(mapping, "originalLine", null), + column: util.getArg(mapping, "originalColumn", null), name }; } @@ -24195,10 +24199,10 @@ var require_source_map_consumer = __commonJS({ } var relativeSource = aSource; if (this.sourceRoot != null) { - relativeSource = util2.relative(this.sourceRoot, relativeSource); + relativeSource = util.relative(this.sourceRoot, relativeSource); } var url; - if (this.sourceRoot != null && (url = util2.urlParse(this.sourceRoot))) { + if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) { var fileUriAbsPath = relativeSource.replace(/^file:\/\//, ""); if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) { return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]; @@ -24214,7 +24218,7 @@ var require_source_map_consumer = __commonJS({ } }; BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util2.getArg(aArgs, "source"); + var source = util.getArg(aArgs, "source"); source = this._findSourceIndex(source); if (source < 0) { return { @@ -24225,24 +24229,24 @@ var require_source_map_consumer = __commonJS({ } var needle = { source, - originalLine: util2.getArg(aArgs, "line"), - originalColumn: util2.getArg(aArgs, "column") + originalLine: util.getArg(aArgs, "line"), + originalColumn: util.getArg(aArgs, "column") }; var index = this._findMapping( needle, this._originalMappings, "originalLine", "originalColumn", - util2.compareByOriginalPositions, - util2.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) + util.compareByOriginalPositions, + util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND) ); if (index >= 0) { var mapping = this._originalMappings[index]; if (mapping.source === needle.source) { return { - line: util2.getArg(mapping, "generatedLine", null), - column: util2.getArg(mapping, "generatedColumn", null), - lastColumn: util2.getArg(mapping, "lastGeneratedColumn", null) + line: util.getArg(mapping, "generatedLine", null), + column: util.getArg(mapping, "generatedColumn", null), + lastColumn: util.getArg(mapping, "lastGeneratedColumn", null) }; } } @@ -24256,12 +24260,12 @@ var require_source_map_consumer = __commonJS({ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) { var sourceMap = aSourceMap; if (typeof aSourceMap === "string") { - sourceMap = util2.parseSourceMapInput(aSourceMap); + sourceMap = util.parseSourceMapInput(aSourceMap); } - var version = util2.getArg(sourceMap, "version"); - var sections = util2.getArg(sourceMap, "sections"); - if (version != this._version) { - throw new Error("Unsupported version: " + version); + var version2 = util.getArg(sourceMap, "version"); + var sections = util.getArg(sourceMap, "sections"); + if (version2 != this._version) { + throw new Error("Unsupported version: " + version2); } this._sources = new ArraySet(); this._names = new ArraySet(); @@ -24273,9 +24277,9 @@ var require_source_map_consumer = __commonJS({ if (s.url) { throw new Error("Support for url field in sections not implemented."); } - var offset = util2.getArg(s, "offset"); - var offsetLine = util2.getArg(offset, "line"); - var offsetColumn = util2.getArg(offset, "column"); + var offset = util.getArg(s, "offset"); + var offsetLine = util.getArg(offset, "line"); + var offsetColumn = util.getArg(offset, "column"); if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) { throw new Error("Section offsets must be ordered and non-overlapping."); } @@ -24287,7 +24291,7 @@ var require_source_map_consumer = __commonJS({ generatedLine: offsetLine + 1, generatedColumn: offsetColumn + 1 }, - consumer: new SourceMapConsumer(util2.getArg(s, "map"), aSourceMapURL) + consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL) }; }); } @@ -24307,8 +24311,8 @@ var require_source_map_consumer = __commonJS({ }); IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) { var needle = { - generatedLine: util2.getArg(aArgs, "line"), - generatedColumn: util2.getArg(aArgs, "column") + generatedLine: util.getArg(aArgs, "line"), + generatedColumn: util.getArg(aArgs, "column") }; var sectionIndex = binarySearch.search( needle, @@ -24358,7 +24362,7 @@ var require_source_map_consumer = __commonJS({ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { for (var i = 0; i < this._sections.length; i++) { var section = this._sections[i]; - if (section.consumer._findSourceIndex(util2.getArg(aArgs, "source")) === -1) { + if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) { continue; } var generatedPosition = section.consumer.generatedPositionFor(aArgs); @@ -24384,7 +24388,7 @@ var require_source_map_consumer = __commonJS({ for (var j = 0; j < sectionMappings.length; j++) { var mapping = sectionMappings[j]; var source = section.consumer._sources.at(mapping.source); - source = util2.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); + source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL); this._sources.add(source); source = this._sources.indexOf(source); var name = null; @@ -24407,8 +24411,8 @@ var require_source_map_consumer = __commonJS({ } } } - quickSort(this.__generatedMappings, util2.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util2.compareByOriginalPositions); + quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); + quickSort(this.__originalMappings, util.compareByOriginalPositions); }; exports2.IndexedSourceMapConsumer = IndexedSourceMapConsumer; } @@ -24419,7 +24423,7 @@ var require_source_node = __commonJS({ "node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js"(exports2) { "use strict"; var SourceMapGenerator = require_source_map_generator().SourceMapGenerator; - var util2 = require_util8(); + var util = require_util8(); var REGEX_NEWLINE = /(\r?\n)/; var NEWLINE_CODE = 10; var isSourceNode = "$$$isSourceNode$$$"; @@ -24485,7 +24489,7 @@ var require_source_node = __commonJS({ var content = aSourceMapConsumer.sourceContentFor(sourceFile); if (content != null) { if (aRelativePath != null) { - sourceFile = util2.join(aRelativePath, sourceFile); + sourceFile = util.join(aRelativePath, sourceFile); } node.setSourceContent(sourceFile, content); } @@ -24495,7 +24499,7 @@ var require_source_node = __commonJS({ if (mapping === null || mapping.source === void 0) { node.add(code); } else { - var source = aRelativePath ? util2.join(aRelativePath, mapping.source) : mapping.source; + var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source; node.add(new SourceNode( mapping.originalLine, mapping.originalColumn, @@ -24581,7 +24585,7 @@ var require_source_node = __commonJS({ return this; }; SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util2.toSetString(aSourceFile)] = aSourceContent; + this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; }; SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) { for (var i = 0, len = this.children.length; i < len; i++) { @@ -24591,7 +24595,7 @@ var require_source_node = __commonJS({ } var sources = Object.keys(this.sourceContents); for (var i = 0, len = sources.length; i < len; i++) { - aFn(util2.fromSetString(sources[i]), this.sourceContents[sources[i]]); + aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); } }; SourceNode.prototype.toString = function SourceNode_toString() { @@ -24759,7 +24763,7 @@ var require_code_gen = __commonJS({ push: function push(source, loc) { this.source.push(this.wrap(source, loc)); }, - merge: function merge() { + merge: function merge2() { var source = this.empty(); this.each(function(line) { source.add([" ", line, "\n"]); @@ -25248,14 +25252,14 @@ var require_javascript_compiler = __commonJS({ // This opcode is designed for use in string mode, which // provides the string value of a parameter along with its // depth rather than resolving it immediately. - pushStringParam: function pushStringParam(string, type) { + pushStringParam: function pushStringParam(string3, type) { this.pushContext(); this.pushString(type); if (type !== "SubExpression") { - if (typeof string === "string") { - this.pushString(string); + if (typeof string3 === "string") { + this.pushString(string3); } else { - this.pushStackLiteral(string); + this.pushStackLiteral(string3); } } }, @@ -25293,8 +25297,8 @@ var require_javascript_compiler = __commonJS({ // On stack, after: quotedString(string), ... // // Push a quoted version of `string` onto the stack - pushString: function pushString(string) { - this.pushStackLiteral(this.quotedString(string)); + pushString: function pushString(string3) { + this.pushStackLiteral(this.quotedString(string3)); }, // [pushLiteral] // @@ -25315,9 +25319,9 @@ var require_javascript_compiler = __commonJS({ // Push a program expression onto the stack. This takes // a compile-time guid and converts it into a runtime-accessible // expression. - pushProgram: function pushProgram(guid) { - if (guid != null) { - this.pushStackLiteral(this.programExpression(guid)); + pushProgram: function pushProgram(guid2) { + if (guid2 != null) { + this.pushStackLiteral(this.programExpression(guid2)); } else { this.pushStackLiteral(null); } @@ -25505,8 +25509,8 @@ var require_javascript_compiler = __commonJS({ } } }, - programExpression: function programExpression(guid) { - var child = this.environment.children[guid], programParams = [child.index, "data", child.blockParams]; + programExpression: function programExpression(guid2) { + var child = this.environment.children[guid2], programParams = [child.index, "data", child.blockParams]; if (this.useBlockParams || this.useDepths) { programParams.push("blockParams"); } @@ -25808,12 +25812,12 @@ var require_printer = __commonJS({ this.padding = 0; } PrintVisitor.prototype = new _visitor2["default"](); - PrintVisitor.prototype.pad = function(string) { + PrintVisitor.prototype.pad = function(string3) { var out = ""; for (var i = 0, l = this.padding; i < l; i++) { out += " "; } - out += string + "\n"; + out += string3 + "\n"; return out; }; PrintVisitor.prototype.Program = function(program) { @@ -25864,27 +25868,27 @@ var require_printer = __commonJS({ this.padding--; return out; }; - PrintVisitor.prototype.PartialStatement = function(partial) { - var content = "PARTIAL:" + partial.name.original; - if (partial.params[0]) { - content += " " + this.accept(partial.params[0]); + PrintVisitor.prototype.PartialStatement = function(partial2) { + var content = "PARTIAL:" + partial2.name.original; + if (partial2.params[0]) { + content += " " + this.accept(partial2.params[0]); } - if (partial.hash) { - content += " " + this.accept(partial.hash); + if (partial2.hash) { + content += " " + this.accept(partial2.hash); } return this.pad("{{> " + content + " }}"); }; - PrintVisitor.prototype.PartialBlockStatement = function(partial) { - var content = "PARTIAL BLOCK:" + partial.name.original; - if (partial.params[0]) { - content += " " + this.accept(partial.params[0]); + PrintVisitor.prototype.PartialBlockStatement = function(partial2) { + var content = "PARTIAL BLOCK:" + partial2.name.original; + if (partial2.params[0]) { + content += " " + this.accept(partial2.params[0]); } - if (partial.hash) { - content += " " + this.accept(partial.hash); + if (partial2.hash) { + content += " " + this.accept(partial2.hash); } content += " " + this.pad("PROGRAM:"); this.padding++; - content += this.accept(partial.program); + content += this.accept(partial2.program); this.padding--; return this.pad("{{> " + content + " }}"); }; @@ -25907,11 +25911,11 @@ var require_printer = __commonJS({ var path3 = id.parts.join("/"); return (id.data ? "@" : "") + "PATH:" + path3; }; - PrintVisitor.prototype.StringLiteral = function(string) { - return '"' + string.value + '"'; + PrintVisitor.prototype.StringLiteral = function(string3) { + return '"' + string3.value + '"'; }; - PrintVisitor.prototype.NumberLiteral = function(number) { - return "NUMBER{" + number.value + "}"; + PrintVisitor.prototype.NumberLiteral = function(number2) { + return "NUMBER{" + number2.value + "}"; }; PrintVisitor.prototype.BooleanLiteral = function(bool) { return "BOOLEAN{" + bool.value + "}"; @@ -25971,3877 +25975,2962 @@ var import_process = require("process"); var import_fs = require("fs"); var core2 = __toESM(require_core()); -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/helpers/util.js -var util; -(function(util2) { - util2.assertEqual = (_) => { - }; - function assertIs(_arg) { +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/core.js +var NEVER = Object.freeze({ + status: "aborted" +}); +// @__NO_SIDE_EFFECTS__ +function $constructor(name, initializer3, params) { + function init(inst, def) { + var _a; + Object.defineProperty(inst, "_zod", { + value: inst._zod ?? {}, + enumerable: false + }); + (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set()); + inst._zod.traits.add(name); + initializer3(inst, def); + for (const k in _.prototype) { + if (!(k in inst)) + Object.defineProperty(inst, k, { value: _.prototype[k].bind(inst) }); + } + inst._zod.constr = _; + inst._zod.def = def; } - util2.assertIs = assertIs; - function assertNever(_x) { - throw new Error(); + const Parent = params?.Parent ?? Object; + class Definition extends Parent { } - util2.assertNever = assertNever; - util2.arrayToEnum = (items) => { - const obj = {}; - for (const item of items) { - obj[item] = item; - } - return obj; - }; - util2.getValidEnumValues = (obj) => { - const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); - const filtered = {}; - for (const k of validKeys) { - filtered[k] = obj[k]; + Object.defineProperty(Definition, "name", { value: name }); + function _(def) { + var _a; + const inst = params?.Parent ? new Definition() : this; + init(inst, def); + (_a = inst._zod).deferred ?? (_a.deferred = []); + for (const fn of inst._zod.deferred) { + fn(); + } + return inst; + } + Object.defineProperty(_, "init", { value: init }); + Object.defineProperty(_, Symbol.hasInstance, { + value: (inst) => { + if (params?.Parent && inst instanceof params.Parent) + return true; + return inst?._zod?.traits?.has(name); } - return util2.objectValues(filtered); - }; - util2.objectValues = (obj) => { - return util2.objectKeys(obj).map(function(e) { - return obj[e]; - }); - }; - util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => { - const keys = []; - for (const key in object) { - if (Object.prototype.hasOwnProperty.call(object, key)) { - keys.push(key); + }); + Object.defineProperty(_, "name", { value: name }); + return _; +} +var $brand = Symbol("zod_brand"); +var $ZodAsyncError = class extends Error { + constructor() { + super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`); + } +}; +var globalConfig = {}; +function config(newConfig) { + if (newConfig) + Object.assign(globalConfig, newConfig); + return globalConfig; +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/util.js +var util_exports = {}; +__export(util_exports, { + BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES, + Class: () => Class, + NUMBER_FORMAT_RANGES: () => NUMBER_FORMAT_RANGES, + aborted: () => aborted, + allowsEval: () => allowsEval, + assert: () => assert, + assertEqual: () => assertEqual, + assertIs: () => assertIs, + assertNever: () => assertNever, + assertNotEqual: () => assertNotEqual, + assignProp: () => assignProp, + cached: () => cached, + captureStackTrace: () => captureStackTrace, + cleanEnum: () => cleanEnum, + cleanRegex: () => cleanRegex, + clone: () => clone, + cloneDef: () => cloneDef, + createTransparentProxy: () => createTransparentProxy, + defineLazy: () => defineLazy, + esc: () => esc, + escapeRegex: () => escapeRegex, + extend: () => extend, + finalizeIssue: () => finalizeIssue, + floatSafeRemainder: () => floatSafeRemainder, + getElementAtPath: () => getElementAtPath, + getEnumValues: () => getEnumValues, + getLengthableOrigin: () => getLengthableOrigin, + getParsedType: () => getParsedType, + getSizableOrigin: () => getSizableOrigin, + isObject: () => isObject, + isPlainObject: () => isPlainObject, + issue: () => issue, + joinValues: () => joinValues, + jsonStringifyReplacer: () => jsonStringifyReplacer, + merge: () => merge, + mergeDefs: () => mergeDefs, + normalizeParams: () => normalizeParams, + nullish: () => nullish, + numKeys: () => numKeys, + omit: () => omit, + optionalKeys: () => optionalKeys, + partial: () => partial, + pick: () => pick, + prefixIssues: () => prefixIssues, + primitiveTypes: () => primitiveTypes, + promiseAllObject: () => promiseAllObject, + propertyKeyTypes: () => propertyKeyTypes, + randomString: () => randomString, + required: () => required, + stringifyPrimitive: () => stringifyPrimitive, + unwrapMessage: () => unwrapMessage +}); +function assertEqual(val) { + return val; +} +function assertNotEqual(val) { + return val; +} +function assertIs(_arg) { +} +function assertNever(_x) { + throw new Error(); +} +function assert(_) { +} +function getEnumValues(entries) { + const numericValues = Object.values(entries).filter((v) => typeof v === "number"); + const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v); + return values; +} +function joinValues(array2, separator = "|") { + return array2.map((val) => stringifyPrimitive(val)).join(separator); +} +function jsonStringifyReplacer(_, value) { + if (typeof value === "bigint") + return value.toString(); + return value; +} +function cached(getter) { + const set = false; + return { + get value() { + if (!set) { + const value = getter(); + Object.defineProperty(this, "value", { value }); + return value; } + throw new Error("cached value already set"); } - return keys; }; - util2.find = (arr, checker) => { - for (const item of arr) { - if (checker(item)) - return item; +} +function nullish(input) { + return input === null || input === void 0; +} +function cleanRegex(source) { + const start = source.startsWith("^") ? 1 : 0; + const end = source.endsWith("$") ? source.length - 1 : source.length; + return source.slice(start, end); +} +function floatSafeRemainder(val, step) { + const valDecCount = (val.toString().split(".")[1] || "").length; + const stepString = step.toString(); + let stepDecCount = (stepString.split(".")[1] || "").length; + if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) { + const match = stepString.match(/\d?e-(\d?)/); + if (match?.[1]) { + stepDecCount = Number.parseInt(match[1]); } - return void 0; - }; - util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && Number.isFinite(val) && Math.floor(val) === val; - function joinValues(array, separator = " | ") { - return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator); } - util2.joinValues = joinValues; - util2.jsonStringifyReplacer = (_, value) => { - if (typeof value === "bigint") { - return value.toString(); + const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; + const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); + const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); + return valInt % stepInt / 10 ** decCount; +} +var EVALUATING = Symbol("evaluating"); +function defineLazy(object, key, getter) { + let value = void 0; + Object.defineProperty(object, key, { + get() { + if (value === EVALUATING) { + return void 0; + } + if (value === void 0) { + value = EVALUATING; + value = getter(); + } + return value; + }, + set(v) { + Object.defineProperty(object, key, { + value: v + // configurable: true, + }); + }, + configurable: true + }); +} +function assignProp(target, prop, value) { + Object.defineProperty(target, prop, { + value, + writable: true, + enumerable: true, + configurable: true + }); +} +function mergeDefs(...defs) { + const mergedDescriptors = {}; + for (const def of defs) { + const descriptors = Object.getOwnPropertyDescriptors(def); + Object.assign(mergedDescriptors, descriptors); + } + return Object.defineProperties({}, mergedDescriptors); +} +function cloneDef(schema) { + return mergeDefs(schema._zod.def); +} +function getElementAtPath(obj, path3) { + if (!path3) + return obj; + return path3.reduce((acc, key) => acc?.[key], obj); +} +function promiseAllObject(promisesObj) { + const keys = Object.keys(promisesObj); + const promises = keys.map((key) => promisesObj[key]); + return Promise.all(promises).then((results) => { + const resolvedObj = {}; + for (let i = 0; i < keys.length; i++) { + resolvedObj[keys[i]] = results[i]; + } + return resolvedObj; + }); +} +function randomString(length = 10) { + const chars = "abcdefghijklmnopqrstuvwxyz"; + let str = ""; + for (let i = 0; i < length; i++) { + str += chars[Math.floor(Math.random() * chars.length)]; + } + return str; +} +function esc(str) { + return JSON.stringify(str); +} +var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => { +}; +function isObject(data) { + return typeof data === "object" && data !== null && !Array.isArray(data); +} +var allowsEval = cached(() => { + if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) { + return false; + } + try { + const F = Function; + new F(""); + return true; + } catch (_) { + return false; + } +}); +function isPlainObject(o) { + if (isObject(o) === false) + return false; + const ctor = o.constructor; + if (ctor === void 0) + return true; + const prot = ctor.prototype; + if (isObject(prot) === false) + return false; + if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) { + return false; + } + return true; +} +function numKeys(data) { + let keyCount = 0; + for (const key in data) { + if (Object.prototype.hasOwnProperty.call(data, key)) { + keyCount++; } - return value; - }; -})(util || (util = {})); -var objectUtil; -(function(objectUtil2) { - objectUtil2.mergeShapes = (first, second) => { - return { - ...first, - ...second - // second overwrites first - }; - }; -})(objectUtil || (objectUtil = {})); -var ZodParsedType = util.arrayToEnum([ - "string", - "nan", - "number", - "integer", - "float", - "boolean", - "date", - "bigint", - "symbol", - "function", - "undefined", - "null", - "array", - "object", - "unknown", - "promise", - "void", - "never", - "map", - "set" -]); + } + return keyCount; +} var getParsedType = (data) => { const t = typeof data; switch (t) { case "undefined": - return ZodParsedType.undefined; + return "undefined"; case "string": - return ZodParsedType.string; + return "string"; case "number": - return Number.isNaN(data) ? ZodParsedType.nan : ZodParsedType.number; + return Number.isNaN(data) ? "nan" : "number"; case "boolean": - return ZodParsedType.boolean; + return "boolean"; case "function": - return ZodParsedType.function; + return "function"; case "bigint": - return ZodParsedType.bigint; + return "bigint"; case "symbol": - return ZodParsedType.symbol; + return "symbol"; case "object": if (Array.isArray(data)) { - return ZodParsedType.array; + return "array"; } if (data === null) { - return ZodParsedType.null; + return "null"; } if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { - return ZodParsedType.promise; + return "promise"; } if (typeof Map !== "undefined" && data instanceof Map) { - return ZodParsedType.map; + return "map"; } if (typeof Set !== "undefined" && data instanceof Set) { - return ZodParsedType.set; + return "set"; } if (typeof Date !== "undefined" && data instanceof Date) { - return ZodParsedType.date; + return "date"; + } + if (typeof File !== "undefined" && data instanceof File) { + return "file"; } - return ZodParsedType.object; + return "object"; default: - return ZodParsedType.unknown; + throw new Error(`Unknown data type: ${t}`); } }; - -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/ZodError.js -var ZodIssueCode = util.arrayToEnum([ - "invalid_type", - "invalid_literal", - "custom", - "invalid_union", - "invalid_union_discriminator", - "invalid_enum_value", - "unrecognized_keys", - "invalid_arguments", - "invalid_return_type", - "invalid_date", - "invalid_string", - "too_small", - "too_big", - "invalid_intersection_types", - "not_multiple_of", - "not_finite" -]); -var ZodError = class _ZodError extends Error { - get errors() { - return this.issues; - } - constructor(issues) { - super(); - this.issues = []; - this.addIssue = (sub) => { - this.issues = [...this.issues, sub]; - }; - this.addIssues = (subs = []) => { - this.issues = [...this.issues, ...subs]; - }; - const actualProto = new.target.prototype; - if (Object.setPrototypeOf) { - Object.setPrototypeOf(this, actualProto); - } else { - this.__proto__ = actualProto; - } - this.name = "ZodError"; - this.issues = issues; - } - format(_mapper) { - const mapper = _mapper || function(issue) { - return issue.message; - }; - const fieldErrors = { _errors: [] }; - const processError = (error2) => { - for (const issue of error2.issues) { - if (issue.code === "invalid_union") { - issue.unionErrors.map(processError); - } else if (issue.code === "invalid_return_type") { - processError(issue.returnTypeError); - } else if (issue.code === "invalid_arguments") { - processError(issue.argumentsError); - } else if (issue.path.length === 0) { - fieldErrors._errors.push(mapper(issue)); - } else { - let curr = fieldErrors; - let i = 0; - while (i < issue.path.length) { - const el = issue.path[i]; - const terminal = i === issue.path.length - 1; - if (!terminal) { - curr[el] = curr[el] || { _errors: [] }; - } else { - curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue)); - } - curr = curr[el]; - i++; - } - } - } - }; - processError(this); - return fieldErrors; - } - static assert(value) { - if (!(value instanceof _ZodError)) { - throw new Error(`Not a ZodError: ${value}`); - } - } - toString() { - return this.message; - } - get message() { - return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2); - } - get isEmpty() { - return this.issues.length === 0; - } - flatten(mapper = (issue) => issue.message) { - const fieldErrors = {}; - const formErrors = []; - for (const sub of this.issues) { - if (sub.path.length > 0) { - fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; - fieldErrors[sub.path[0]].push(mapper(sub)); - } else { - formErrors.push(mapper(sub)); - } +var propertyKeyTypes = /* @__PURE__ */ new Set(["string", "number", "symbol"]); +var primitiveTypes = /* @__PURE__ */ new Set(["string", "number", "bigint", "boolean", "symbol", "undefined"]); +function escapeRegex(str) { + return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); +} +function clone(inst, def, params) { + const cl = new inst._zod.constr(def ?? inst._zod.def); + if (!def || params?.parent) + cl._zod.parent = inst; + return cl; +} +function normalizeParams(_params) { + const params = _params; + if (!params) + return {}; + if (typeof params === "string") + return { error: () => params }; + if (params?.message !== void 0) { + if (params?.error !== void 0) + throw new Error("Cannot specify both `message` and `error` params"); + params.error = params.message; + } + delete params.message; + if (typeof params.error === "string") + return { ...params, error: () => params.error }; + return params; +} +function createTransparentProxy(getter) { + let target; + return new Proxy({}, { + get(_, prop, receiver) { + target ?? (target = getter()); + return Reflect.get(target, prop, receiver); + }, + set(_, prop, value, receiver) { + target ?? (target = getter()); + return Reflect.set(target, prop, value, receiver); + }, + has(_, prop) { + target ?? (target = getter()); + return Reflect.has(target, prop); + }, + deleteProperty(_, prop) { + target ?? (target = getter()); + return Reflect.deleteProperty(target, prop); + }, + ownKeys(_) { + target ?? (target = getter()); + return Reflect.ownKeys(target); + }, + getOwnPropertyDescriptor(_, prop) { + target ?? (target = getter()); + return Reflect.getOwnPropertyDescriptor(target, prop); + }, + defineProperty(_, prop, descriptor) { + target ?? (target = getter()); + return Reflect.defineProperty(target, prop, descriptor); } - return { formErrors, fieldErrors }; - } - get formErrors() { - return this.flatten(); - } + }); +} +function stringifyPrimitive(value) { + if (typeof value === "bigint") + return value.toString() + "n"; + if (typeof value === "string") + return `"${value}"`; + return `${value}`; +} +function optionalKeys(shape) { + return Object.keys(shape).filter((k) => { + return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional"; + }); +} +var NUMBER_FORMAT_RANGES = { + safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER], + int32: [-2147483648, 2147483647], + uint32: [0, 4294967295], + float32: [-34028234663852886e22, 34028234663852886e22], + float64: [-Number.MAX_VALUE, Number.MAX_VALUE] }; -ZodError.create = (issues) => { - const error2 = new ZodError(issues); - return error2; +var BIGINT_FORMAT_RANGES = { + int64: [/* @__PURE__ */ BigInt("-9223372036854775808"), /* @__PURE__ */ BigInt("9223372036854775807")], + uint64: [/* @__PURE__ */ BigInt(0), /* @__PURE__ */ BigInt("18446744073709551615")] }; - -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/locales/en.js -var errorMap = (issue, _ctx) => { - let message; - switch (issue.code) { - case ZodIssueCode.invalid_type: - if (issue.received === ZodParsedType.undefined) { - message = "Required"; +function pick(schema, mask) { + const currDef = schema._zod.def; + const def = mergeDefs(schema._zod.def, { + get shape() { + const newShape = {}; + for (const key in mask) { + if (!(key in currDef.shape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + newShape[key] = currDef.shape[key]; + } + assignProp(this, "shape", newShape); + return newShape; + }, + checks: [] + }); + return clone(schema, def); +} +function omit(schema, mask) { + const currDef = schema._zod.def; + const def = mergeDefs(schema._zod.def, { + get shape() { + const newShape = { ...schema._zod.def.shape }; + for (const key in mask) { + if (!(key in currDef.shape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + delete newShape[key]; + } + assignProp(this, "shape", newShape); + return newShape; + }, + checks: [] + }); + return clone(schema, def); +} +function extend(schema, shape) { + if (!isPlainObject(shape)) { + throw new Error("Invalid input to extend: expected a plain object"); + } + const def = mergeDefs(schema._zod.def, { + get shape() { + const _shape = { ...schema._zod.def.shape, ...shape }; + assignProp(this, "shape", _shape); + return _shape; + }, + checks: [] + }); + return clone(schema, def); +} +function merge(a, b) { + const def = mergeDefs(a._zod.def, { + get shape() { + const _shape = { ...a._zod.def.shape, ...b._zod.def.shape }; + assignProp(this, "shape", _shape); + return _shape; + }, + get catchall() { + return b._zod.def.catchall; + }, + checks: [] + // delete existing checks + }); + return clone(a, def); +} +function partial(Class2, schema, mask) { + const def = mergeDefs(schema._zod.def, { + get shape() { + const oldShape = schema._zod.def.shape; + const shape = { ...oldShape }; + if (mask) { + for (const key in mask) { + if (!(key in oldShape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + shape[key] = Class2 ? new Class2({ + type: "optional", + innerType: oldShape[key] + }) : oldShape[key]; + } } else { - message = `Expected ${issue.expected}, received ${issue.received}`; - } - break; - case ZodIssueCode.invalid_literal: - message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`; - break; - case ZodIssueCode.unrecognized_keys: - message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`; - break; - case ZodIssueCode.invalid_union: - message = `Invalid input`; - break; - case ZodIssueCode.invalid_union_discriminator: - message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`; - break; - case ZodIssueCode.invalid_enum_value: - message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`; - break; - case ZodIssueCode.invalid_arguments: - message = `Invalid function arguments`; - break; - case ZodIssueCode.invalid_return_type: - message = `Invalid function return type`; - break; - case ZodIssueCode.invalid_date: - message = `Invalid date`; - break; - case ZodIssueCode.invalid_string: - if (typeof issue.validation === "object") { - if ("includes" in issue.validation) { - message = `Invalid input: must include "${issue.validation.includes}"`; - if (typeof issue.validation.position === "number") { - message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; - } - } else if ("startsWith" in issue.validation) { - message = `Invalid input: must start with "${issue.validation.startsWith}"`; - } else if ("endsWith" in issue.validation) { - message = `Invalid input: must end with "${issue.validation.endsWith}"`; - } else { - util.assertNever(issue.validation); + for (const key in oldShape) { + shape[key] = Class2 ? new Class2({ + type: "optional", + innerType: oldShape[key] + }) : oldShape[key]; + } + } + assignProp(this, "shape", shape); + return shape; + }, + checks: [] + }); + return clone(schema, def); +} +function required(Class2, schema, mask) { + const def = mergeDefs(schema._zod.def, { + get shape() { + const oldShape = schema._zod.def.shape; + const shape = { ...oldShape }; + if (mask) { + for (const key in mask) { + if (!(key in shape)) { + throw new Error(`Unrecognized key: "${key}"`); + } + if (!mask[key]) + continue; + shape[key] = new Class2({ + type: "nonoptional", + innerType: oldShape[key] + }); } - } else if (issue.validation !== "regex") { - message = `Invalid ${issue.validation}`; } else { - message = "Invalid"; - } - break; - case ZodIssueCode.too_small: - if (issue.type === "array") - message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; - else if (issue.type === "string") - message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; - else if (issue.type === "number") - message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`; - else if (issue.type === "date") - message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode.too_big: - if (issue.type === "array") - message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; - else if (issue.type === "string") - message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; - else if (issue.type === "number") - message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; - else if (issue.type === "bigint") - message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; - else if (issue.type === "date") - message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode.custom: - message = `Invalid input`; - break; - case ZodIssueCode.invalid_intersection_types: - message = `Intersection results could not be merged`; - break; - case ZodIssueCode.not_multiple_of: - message = `Number must be a multiple of ${issue.multipleOf}`; - break; - case ZodIssueCode.not_finite: - message = "Number must be finite"; - break; - default: - message = _ctx.defaultError; - util.assertNever(issue); + for (const key in oldShape) { + shape[key] = new Class2({ + type: "nonoptional", + innerType: oldShape[key] + }); + } + } + assignProp(this, "shape", shape); + return shape; + }, + checks: [] + }); + return clone(schema, def); +} +function aborted(x, startIndex = 0) { + for (let i = startIndex; i < x.issues.length; i++) { + if (x.issues[i]?.continue !== true) { + return true; + } } - return { message }; -}; -var en_default = errorMap; - -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/errors.js -var overrideErrorMap = en_default; -function getErrorMap() { - return overrideErrorMap; + return false; } - -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/helpers/parseUtil.js -var makeIssue = (params) => { - const { data, path: path3, errorMaps, issueData } = params; - const fullPath = [...path3, ...issueData.path || []]; - const fullIssue = { - ...issueData, - path: fullPath - }; - if (issueData.message !== void 0) { +function prefixIssues(path3, issues) { + return issues.map((iss) => { + var _a; + (_a = iss).path ?? (_a.path = []); + iss.path.unshift(path3); + return iss; + }); +} +function unwrapMessage(message) { + return typeof message === "string" ? message : message?.message; +} +function finalizeIssue(iss, ctx, config2) { + const full = { ...iss, path: iss.path ?? [] }; + if (!iss.message) { + const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config2.customError?.(iss)) ?? unwrapMessage(config2.localeError?.(iss)) ?? "Invalid input"; + full.message = message; + } + delete full.inst; + delete full.continue; + if (!ctx?.reportInput) { + delete full.input; + } + return full; +} +function getSizableOrigin(input) { + if (input instanceof Set) + return "set"; + if (input instanceof Map) + return "map"; + if (input instanceof File) + return "file"; + return "unknown"; +} +function getLengthableOrigin(input) { + if (Array.isArray(input)) + return "array"; + if (typeof input === "string") + return "string"; + return "unknown"; +} +function issue(...args) { + const [iss, input, inst] = args; + if (typeof iss === "string") { return { - ...issueData, - path: fullPath, - message: issueData.message + message: iss, + code: "custom", + input, + inst }; } - let errorMessage = ""; - const maps = errorMaps.filter((m) => !!m).slice().reverse(); - for (const map of maps) { - errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message; + return { ...iss }; +} +function cleanEnum(obj) { + return Object.entries(obj).filter(([k, _]) => { + return Number.isNaN(Number.parseInt(k, 10)); + }).map((el) => el[1]); +} +var Class = class { + constructor(..._args) { } - return { - ...issueData, - path: fullPath, - message: errorMessage - }; }; -function addIssueToContext(ctx, issueData) { - const overrideMap = getErrorMap(); - const issue = makeIssue({ - issueData, - data: ctx.data, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - // contextual error map is first priority - ctx.schemaErrorMap, - // then schema-bound map if available - overrideMap, - // then global override map - overrideMap === en_default ? void 0 : en_default - // then global default map - ].filter((x) => !!x) + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/errors.js +var initializer = (inst, def) => { + inst.name = "$ZodError"; + Object.defineProperty(inst, "_zod", { + value: inst._zod, + enumerable: false }); - ctx.common.issues.push(issue); -} -var ParseStatus = class _ParseStatus { - constructor() { - this.value = "valid"; - } - dirty() { - if (this.value === "valid") - this.value = "dirty"; - } - abort() { - if (this.value !== "aborted") - this.value = "aborted"; - } - static mergeArray(status, results) { - const arrayValue = []; - for (const s of results) { - if (s.status === "aborted") - return INVALID; - if (s.status === "dirty") - status.dirty(); - arrayValue.push(s.value); - } - return { status: status.value, value: arrayValue }; - } - static async mergeObjectAsync(status, pairs) { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - syncPairs.push({ - key, - value - }); + Object.defineProperty(inst, "issues", { + value: def, + enumerable: false + }); + inst.message = JSON.stringify(def, jsonStringifyReplacer, 2); + Object.defineProperty(inst, "toString", { + value: () => inst.message, + enumerable: false + }); +}; +var $ZodError = $constructor("$ZodError", initializer); +var $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error }); +function flattenError(error2, mapper = (issue2) => issue2.message) { + const fieldErrors = {}; + const formErrors = []; + for (const sub of error2.issues) { + if (sub.path.length > 0) { + fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; + fieldErrors[sub.path[0]].push(mapper(sub)); + } else { + formErrors.push(mapper(sub)); } - return _ParseStatus.mergeObjectSync(status, syncPairs); } - static mergeObjectSync(status, pairs) { - const finalObject = {}; - for (const pair of pairs) { - const { key, value } = pair; - if (key.status === "aborted") - return INVALID; - if (value.status === "aborted") - return INVALID; - if (key.status === "dirty") - status.dirty(); - if (value.status === "dirty") - status.dirty(); - if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) { - finalObject[key.value] = value.value; + return { formErrors, fieldErrors }; +} +function formatError(error2, _mapper) { + const mapper = _mapper || function(issue2) { + return issue2.message; + }; + const fieldErrors = { _errors: [] }; + const processError = (error3) => { + for (const issue2 of error3.issues) { + if (issue2.code === "invalid_union" && issue2.errors.length) { + issue2.errors.map((issues) => processError({ issues })); + } else if (issue2.code === "invalid_key") { + processError({ issues: issue2.issues }); + } else if (issue2.code === "invalid_element") { + processError({ issues: issue2.issues }); + } else if (issue2.path.length === 0) { + fieldErrors._errors.push(mapper(issue2)); + } else { + let curr = fieldErrors; + let i = 0; + while (i < issue2.path.length) { + const el = issue2.path[i]; + const terminal = i === issue2.path.length - 1; + if (!terminal) { + curr[el] = curr[el] || { _errors: [] }; + } else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue2)); + } + curr = curr[el]; + i++; + } } } - return { status: status.value, value: finalObject }; - } + }; + processError(error2); + return fieldErrors; +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/parse.js +var _parse = (_Err) => (schema, value, _ctx, _params) => { + const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false }; + const result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) { + throw new $ZodAsyncError(); + } + if (result.issues.length) { + const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + captureStackTrace(e, _params?.callee); + throw e; + } + return result.value; }; -var INVALID = Object.freeze({ - status: "aborted" -}); -var DIRTY = (value) => ({ status: "dirty", value }); -var OK = (value) => ({ status: "valid", value }); -var isAborted = (x) => x.status === "aborted"; -var isDirty = (x) => x.status === "dirty"; -var isValid = (x) => x.status === "valid"; -var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise; +var _parseAsync = (_Err) => async (schema, value, _ctx, params) => { + const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; + let result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) + result = await result; + if (result.issues.length) { + const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))); + captureStackTrace(e, params?.callee); + throw e; + } + return result.value; +}; +var _safeParse = (_Err) => (schema, value, _ctx) => { + const ctx = _ctx ? { ..._ctx, async: false } : { async: false }; + const result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) { + throw new $ZodAsyncError(); + } + return result.issues.length ? { + success: false, + error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + } : { success: true, data: result.value }; +}; +var safeParse = /* @__PURE__ */ _safeParse($ZodRealError); +var _safeParseAsync = (_Err) => async (schema, value, _ctx) => { + const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true }; + let result = schema._zod.run({ value, issues: [] }, ctx); + if (result instanceof Promise) + result = await result; + return result.issues.length ? { + success: false, + error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + } : { success: true, data: result.value }; +}; +var safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError); -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/helpers/errorUtil.js -var errorUtil; -(function(errorUtil2) { - errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {}; - errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message; -})(errorUtil || (errorUtil = {})); +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/regexes.js +var cuid = /^[cC][^\s-]{8,}$/; +var cuid2 = /^[0-9a-z]+$/; +var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/; +var xid = /^[0-9a-vA-V]{20}$/; +var ksuid = /^[A-Za-z0-9]{27}$/; +var nanoid = /^[a-zA-Z0-9_-]{21}$/; +var duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/; +var 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})$/; +var uuid = (version2) => { + if (!version2) + return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/; + return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version2}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`); +}; +var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/; +var _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +function emoji() { + return new RegExp(_emoji, "u"); +} +var 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])$/; +var 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})$/; +var 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])$/; +var 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])$/; +var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/; +var base64url = /^[A-Za-z0-9_-]*$/; +var hostname = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/; +var e164 = /^\+(?:[0-9]){6,14}[0-9]$/; +var 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])))`; +var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`); +function timeSource(args) { + const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`; + const regex = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`; + return regex; +} +function time(args) { + return new RegExp(`^${timeSource(args)}$`); +} +function datetime(args) { + const time3 = timeSource({ precision: args.precision }); + const opts = ["Z"]; + if (args.local) + opts.push(""); + if (args.offset) + opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`); + const timeRegex = `${time3}(?:${opts.join("|")})`; + return new RegExp(`^${dateSource}T(?:${timeRegex})$`); +} +var string = (params) => { + const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`; + return new RegExp(`^${regex}$`); +}; +var boolean = /true|false/i; +var lowercase = /^[^A-Z]*$/; +var uppercase = /^[^a-z]*$/; -// node_modules/.pnpm/zod@3.25.67/node_modules/zod/dist/esm/v3/types.js -var ParseInputLazyPath = class { - constructor(parent, value, path3, key) { - this._cachedPath = []; - this.parent = parent; - this.data = value; - this._path = path3; - this._key = key; - } - get path() { - if (!this._cachedPath.length) { - if (Array.isArray(this._key)) { - this._cachedPath.push(...this._path, ...this._key); - } else { - this._cachedPath.push(...this._path, this._key); - } +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/checks.js +var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => { + var _a; + inst._zod ?? (inst._zod = {}); + inst._zod.def = def; + (_a = inst._zod).onattach ?? (_a.onattach = []); +}); +var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => { + var _a; + $ZodCheck.init(inst, def); + (_a = inst._zod.def).when ?? (_a.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== void 0; + }); + inst._zod.onattach.push((inst2) => { + const curr = inst2._zod.bag.maximum ?? Number.POSITIVE_INFINITY; + if (def.maximum < curr) + inst2._zod.bag.maximum = def.maximum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length <= def.maximum) + return; + const origin = getLengthableOrigin(input); + payload.issues.push({ + origin, + code: "too_big", + maximum: def.maximum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => { + var _a; + $ZodCheck.init(inst, def); + (_a = inst._zod.def).when ?? (_a.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== void 0; + }); + inst._zod.onattach.push((inst2) => { + const curr = inst2._zod.bag.minimum ?? Number.NEGATIVE_INFINITY; + if (def.minimum > curr) + inst2._zod.bag.minimum = def.minimum; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length >= def.minimum) + return; + const origin = getLengthableOrigin(input); + payload.issues.push({ + origin, + code: "too_small", + minimum: def.minimum, + inclusive: true, + input, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => { + var _a; + $ZodCheck.init(inst, def); + (_a = inst._zod.def).when ?? (_a.when = (payload) => { + const val = payload.value; + return !nullish(val) && val.length !== void 0; + }); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.minimum = def.length; + bag.maximum = def.length; + bag.length = def.length; + }); + inst._zod.check = (payload) => { + const input = payload.value; + const length = input.length; + if (length === def.length) + return; + const origin = getLengthableOrigin(input); + const tooBig = length > def.length; + payload.issues.push({ + origin, + ...tooBig ? { code: "too_big", maximum: def.length } : { code: "too_small", minimum: def.length }, + inclusive: true, + exact: true, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => { + var _a, _b; + $ZodCheck.init(inst, def); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.format = def.format; + if (def.pattern) { + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(def.pattern); } - return this._cachedPath; - } + }); + if (def.pattern) + (_a = inst._zod).check ?? (_a.check = (payload) => { + def.pattern.lastIndex = 0; + if (def.pattern.test(payload.value)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: def.format, + input: payload.value, + ...def.pattern ? { pattern: def.pattern.toString() } : {}, + inst, + continue: !def.abort + }); + }); + else + (_b = inst._zod).check ?? (_b.check = () => { + }); +}); +var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => { + $ZodCheckStringFormat.init(inst, def); + inst._zod.check = (payload) => { + def.pattern.lastIndex = 0; + if (def.pattern.test(payload.value)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "regex", + input: payload.value, + pattern: def.pattern.toString(), + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => { + def.pattern ?? (def.pattern = lowercase); + $ZodCheckStringFormat.init(inst, def); +}); +var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => { + def.pattern ?? (def.pattern = uppercase); + $ZodCheckStringFormat.init(inst, def); +}); +var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => { + $ZodCheck.init(inst, def); + const escapedRegex = escapeRegex(def.includes); + const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex); + def.pattern = pattern; + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.includes(def.includes, def.position)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "includes", + includes: def.includes, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => { + $ZodCheck.init(inst, def); + const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`); + def.pattern ?? (def.pattern = pattern); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.startsWith(def.prefix)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "starts_with", + prefix: def.prefix, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => { + $ZodCheck.init(inst, def); + const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`); + def.pattern ?? (def.pattern = pattern); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set()); + bag.patterns.add(pattern); + }); + inst._zod.check = (payload) => { + if (payload.value.endsWith(def.suffix)) + return; + payload.issues.push({ + origin: "string", + code: "invalid_format", + format: "ends_with", + suffix: def.suffix, + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => { + $ZodCheck.init(inst, def); + inst._zod.check = (payload) => { + payload.value = def.tx(payload.value); + }; +}); + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/versions.js +var version = { + major: 4, + minor: 0, + patch: 14 }; -var handleResult = (ctx, result) => { - if (isValid(result)) { - return { success: true, data: result.value }; + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/schemas.js +var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => { + var _a; + inst ?? (inst = {}); + inst._zod.def = def; + inst._zod.bag = inst._zod.bag || {}; + inst._zod.version = version; + const checks = [...inst._zod.def.checks ?? []]; + if (inst._zod.traits.has("$ZodCheck")) { + checks.unshift(inst); + } + for (const ch of checks) { + for (const fn of ch._zod.onattach) { + fn(inst); + } + } + if (checks.length === 0) { + (_a = inst._zod).deferred ?? (_a.deferred = []); + inst._zod.deferred?.push(() => { + inst._zod.run = inst._zod.parse; + }); } else { - if (!ctx.common.issues.length) { - throw new Error("Validation failed but no issues detected."); - } - return { - success: false, - get error() { - if (this._error) - return this._error; - const error2 = new ZodError(ctx.common.issues); - this._error = error2; - return this._error; + const runChecks = (payload, checks2, ctx) => { + let isAborted = aborted(payload); + let asyncResult; + for (const ch of checks2) { + if (ch._zod.def.when) { + const shouldRun = ch._zod.def.when(payload); + if (!shouldRun) + continue; + } else if (isAborted) { + continue; + } + const currLen = payload.issues.length; + const _ = ch._zod.check(payload); + if (_ instanceof Promise && ctx?.async === false) { + throw new $ZodAsyncError(); + } + if (asyncResult || _ instanceof Promise) { + asyncResult = (asyncResult ?? Promise.resolve()).then(async () => { + await _; + const nextLen = payload.issues.length; + if (nextLen === currLen) + return; + if (!isAborted) + isAborted = aborted(payload, currLen); + }); + } else { + const nextLen = payload.issues.length; + if (nextLen === currLen) + continue; + if (!isAborted) + isAborted = aborted(payload, currLen); + } + } + if (asyncResult) { + return asyncResult.then(() => { + return payload; + }); } + return payload; }; - } -}; -function processCreateParams(params) { - if (!params) - return {}; - const { errorMap: errorMap2, invalid_type_error, required_error, description } = params; - if (errorMap2 && (invalid_type_error || required_error)) { - throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); - } - if (errorMap2) - return { errorMap: errorMap2, description }; - const customMap = (iss, ctx) => { - const { message } = params; - if (iss.code === "invalid_enum_value") { - return { message: message ?? ctx.defaultError }; - } - if (typeof ctx.data === "undefined") { - return { message: message ?? required_error ?? ctx.defaultError }; - } - if (iss.code !== "invalid_type") - return { message: ctx.defaultError }; - return { message: message ?? invalid_type_error ?? ctx.defaultError }; - }; - return { errorMap: customMap, description }; -} -var ZodType = class { - get description() { - return this._def.description; - } - _getType(input) { - return getParsedType(input.data); - } - _getOrReturnCtx(input, ctx) { - return ctx || { - common: input.parent.common, - data: input.data, - parsedType: getParsedType(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent - }; - } - _processInputParams(input) { - return { - status: new ParseStatus(), - ctx: { - common: input.parent.common, - data: input.data, - parsedType: getParsedType(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent + inst._zod.run = (payload, ctx) => { + const result = inst._zod.parse(payload, ctx); + if (result instanceof Promise) { + if (ctx.async === false) + throw new $ZodAsyncError(); + return result.then((result2) => runChecks(result2, checks, ctx)); } + return runChecks(result, checks, ctx); }; } - _parseSync(input) { - const result = this._parse(input); - if (isAsync(result)) { - throw new Error("Synchronous parse encountered promise."); - } - return result; - } - _parseAsync(input) { - const result = this._parse(input); - return Promise.resolve(result); - } - parse(data, params) { - const result = this.safeParse(data, params); - if (result.success) - return result.data; - throw result.error; - } - safeParse(data, params) { - const ctx = { - common: { - issues: [], - async: params?.async ?? false, - contextualErrorMap: params?.errorMap - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - const result = this._parseSync({ data, path: ctx.path, parent: ctx }); - return handleResult(ctx, result); - } - "~validate"(data) { - const ctx = { - common: { - issues: [], - async: !!this["~standard"].async - }, - path: [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - if (!this["~standard"].async) { + inst["~standard"] = { + validate: (value) => { try { - const result = this._parseSync({ data, path: [], parent: ctx }); - return isValid(result) ? { - value: result.value - } : { - issues: ctx.common.issues - }; - } catch (err) { - if (err?.message?.toLowerCase()?.includes("encountered")) { - this["~standard"].async = true; - } - ctx.common = { - issues: [], - async: true - }; - } - } - return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? { - value: result.value - } : { - issues: ctx.common.issues + const r = safeParse(inst, value); + return r.success ? { value: r.data } : { issues: r.error?.issues }; + } catch (_) { + return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues }); + } + }, + vendor: "zod", + version: 1 + }; +}); +var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string(inst._zod.bag); + inst._zod.parse = (payload, _) => { + if (def.coerce) + try { + payload.value = String(payload.value); + } catch (_2) { + } + if (typeof payload.value === "string") + return payload; + payload.issues.push({ + expected: "string", + code: "invalid_type", + input: payload.value, + inst }); - } - async parseAsync(data, params) { - const result = await this.safeParseAsync(data, params); - if (result.success) - return result.data; - throw result.error; - } - async safeParseAsync(data, params) { - const ctx = { - common: { - issues: [], - contextualErrorMap: params?.errorMap, - async: true - }, - path: params?.path || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); - const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); - return handleResult(ctx, result); - } - refine(check, message) { - const getIssueProperties = (val) => { - if (typeof message === "string" || typeof message === "undefined") { - return { message }; - } else if (typeof message === "function") { - return message(val); - } else { - return message; - } - }; - return this._refinement((val, ctx) => { - const result = check(val); - const setError = () => ctx.addIssue({ - code: ZodIssueCode.custom, - ...getIssueProperties(val) - }); - if (typeof Promise !== "undefined" && result instanceof Promise) { - return result.then((data) => { - if (!data) { - setError(); - return false; - } else { - return true; - } - }); + return payload; + }; +}); +var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => { + $ZodCheckStringFormat.init(inst, def); + $ZodString.init(inst, def); +}); +var $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => { + def.pattern ?? (def.pattern = guid); + $ZodStringFormat.init(inst, def); +}); +var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => { + if (def.version) { + const versionMap = { + v1: 1, + v2: 2, + v3: 3, + v4: 4, + v5: 5, + v6: 6, + v7: 7, + v8: 8 + }; + const v = versionMap[def.version]; + if (v === void 0) + throw new Error(`Invalid UUID version: "${def.version}"`); + def.pattern ?? (def.pattern = uuid(v)); + } else + def.pattern ?? (def.pattern = uuid()); + $ZodStringFormat.init(inst, def); +}); +var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => { + def.pattern ?? (def.pattern = email); + $ZodStringFormat.init(inst, def); +}); +var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => { + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + try { + const trimmed = payload.value.trim(); + const url = new URL(trimmed); + if (def.hostname) { + def.hostname.lastIndex = 0; + if (!def.hostname.test(url.hostname)) { + payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid hostname", + pattern: hostname.source, + input: payload.value, + inst, + continue: !def.abort + }); + } } - if (!result) { - setError(); - return false; - } else { - return true; + if (def.protocol) { + def.protocol.lastIndex = 0; + if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) { + payload.issues.push({ + code: "invalid_format", + format: "url", + note: "Invalid protocol", + pattern: def.protocol.source, + input: payload.value, + inst, + continue: !def.abort + }); + } } - }); - } - refinement(check, refinementData) { - return this._refinement((val, ctx) => { - if (!check(val)) { - ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); - return false; + if (def.normalize) { + payload.value = url.href; } else { - return true; - } - }); - } - _refinement(refinement) { - return new ZodEffects({ - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { type: "refinement", refinement } - }); - } - superRefine(refinement) { - return this._refinement(refinement); - } - constructor(def) { - this.spa = this.safeParseAsync; - this._def = def; - this.parse = this.parse.bind(this); - this.safeParse = this.safeParse.bind(this); - this.parseAsync = this.parseAsync.bind(this); - this.safeParseAsync = this.safeParseAsync.bind(this); - this.spa = this.spa.bind(this); - this.refine = this.refine.bind(this); - this.refinement = this.refinement.bind(this); - this.superRefine = this.superRefine.bind(this); - this.optional = this.optional.bind(this); - this.nullable = this.nullable.bind(this); - this.nullish = this.nullish.bind(this); - this.array = this.array.bind(this); - this.promise = this.promise.bind(this); - this.or = this.or.bind(this); - this.and = this.and.bind(this); - this.transform = this.transform.bind(this); - this.brand = this.brand.bind(this); - this.default = this.default.bind(this); - this.catch = this.catch.bind(this); - this.describe = this.describe.bind(this); - this.pipe = this.pipe.bind(this); - this.readonly = this.readonly.bind(this); - this.isNullable = this.isNullable.bind(this); - this.isOptional = this.isOptional.bind(this); - this["~standard"] = { - version: 1, - vendor: "zod", - validate: (data) => this["~validate"](data) - }; - } - optional() { - return ZodOptional.create(this, this._def); - } - nullable() { - return ZodNullable.create(this, this._def); - } - nullish() { - return this.nullable().optional(); - } - array() { - return ZodArray.create(this); - } - promise() { - return ZodPromise.create(this, this._def); - } - or(option) { - return ZodUnion.create([this, option], this._def); - } - and(incoming) { - return ZodIntersection.create(this, incoming, this._def); - } - transform(transform) { - return new ZodEffects({ - ...processCreateParams(this._def), - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { type: "transform", transform } - }); - } - default(def) { - const defaultValueFunc = typeof def === "function" ? def : () => def; - return new ZodDefault({ - ...processCreateParams(this._def), - innerType: this, - defaultValue: defaultValueFunc, - typeName: ZodFirstPartyTypeKind.ZodDefault - }); - } - brand() { - return new ZodBranded({ - typeName: ZodFirstPartyTypeKind.ZodBranded, - type: this, - ...processCreateParams(this._def) - }); - } - catch(def) { - const catchValueFunc = typeof def === "function" ? def : () => def; - return new ZodCatch({ - ...processCreateParams(this._def), - innerType: this, - catchValue: catchValueFunc, - typeName: ZodFirstPartyTypeKind.ZodCatch - }); - } - describe(description) { - const This = this.constructor; - return new This({ - ...this._def, - description - }); - } - pipe(target) { - return ZodPipeline.create(this, target); - } - readonly() { - return ZodReadonly.create(this); - } - isOptional() { - return this.safeParse(void 0).success; - } - isNullable() { - return this.safeParse(null).success; - } -}; -var cuidRegex = /^c[^\s-]{8,}$/i; -var cuid2Regex = /^[0-9a-z]+$/; -var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i; -var 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; -var nanoidRegex = /^[a-z0-9_-]{21}$/i; -var jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/; -var 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)?)??$/; -var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; -var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; -var emojiRegex; -var 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])$/; -var 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])$/; -var 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]))$/; -var 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])$/; -var base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/; -var base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/; -var 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])))`; -var dateRegex = new RegExp(`^${dateRegexSource}$`); -function timeRegexSource(args) { - let secondsRegexSource = `[0-5]\\d`; - if (args.precision) { - secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`; - } else if (args.precision == null) { - secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`; - } - const secondsQuantifier = args.precision ? "+" : "?"; - return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`; -} -function timeRegex(args) { - return new RegExp(`^${timeRegexSource(args)}$`); -} -function datetimeRegex(args) { - let regex = `${dateRegexSource}T${timeRegexSource(args)}`; - const opts = []; - opts.push(args.local ? `Z?` : `Z`); - if (args.offset) - opts.push(`([+-]\\d{2}:?\\d{2})`); - regex = `${regex}(${opts.join("|")})`; - return new RegExp(`^${regex}$`); -} -function isValidIP(ip, version) { - if ((version === "v4" || !version) && ipv4Regex.test(ip)) { + payload.value = trimmed; + } + return; + } catch (_) { + payload.issues.push({ + code: "invalid_format", + format: "url", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => { + def.pattern ?? (def.pattern = emoji()); + $ZodStringFormat.init(inst, def); +}); +var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => { + def.pattern ?? (def.pattern = nanoid); + $ZodStringFormat.init(inst, def); +}); +var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => { + def.pattern ?? (def.pattern = cuid); + $ZodStringFormat.init(inst, def); +}); +var $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => { + def.pattern ?? (def.pattern = cuid2); + $ZodStringFormat.init(inst, def); +}); +var $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => { + def.pattern ?? (def.pattern = ulid); + $ZodStringFormat.init(inst, def); +}); +var $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => { + def.pattern ?? (def.pattern = xid); + $ZodStringFormat.init(inst, def); +}); +var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => { + def.pattern ?? (def.pattern = ksuid); + $ZodStringFormat.init(inst, def); +}); +var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => { + def.pattern ?? (def.pattern = datetime(def)); + $ZodStringFormat.init(inst, def); +}); +var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => { + def.pattern ?? (def.pattern = date); + $ZodStringFormat.init(inst, def); +}); +var $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => { + def.pattern ?? (def.pattern = time(def)); + $ZodStringFormat.init(inst, def); +}); +var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => { + def.pattern ?? (def.pattern = duration); + $ZodStringFormat.init(inst, def); +}); +var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => { + def.pattern ?? (def.pattern = ipv4); + $ZodStringFormat.init(inst, def); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.format = `ipv4`; + }); +}); +var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => { + def.pattern ?? (def.pattern = ipv6); + $ZodStringFormat.init(inst, def); + inst._zod.onattach.push((inst2) => { + const bag = inst2._zod.bag; + bag.format = `ipv6`; + }); + inst._zod.check = (payload) => { + try { + new URL(`http://[${payload.value}]`); + } catch { + payload.issues.push({ + code: "invalid_format", + format: "ipv6", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => { + def.pattern ?? (def.pattern = cidrv4); + $ZodStringFormat.init(inst, def); +}); +var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => { + def.pattern ?? (def.pattern = cidrv6); + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + const [address, prefix] = payload.value.split("/"); + try { + if (!prefix) + throw new Error(); + const prefixNum = Number(prefix); + if (`${prefixNum}` !== prefix) + throw new Error(); + if (prefixNum < 0 || prefixNum > 128) + throw new Error(); + new URL(`http://[${address}]`); + } catch { + payload.issues.push({ + code: "invalid_format", + format: "cidrv6", + input: payload.value, + inst, + continue: !def.abort + }); + } + }; +}); +function isValidBase64(data) { + if (data === "") return true; - } - if ((version === "v6" || !version) && ipv6Regex.test(ip)) { + if (data.length % 4 !== 0) + return false; + try { + atob(data); return true; + } catch { + return false; } - return false; } -function isValidJWT(jwt, alg) { - if (!jwtRegex.test(jwt)) +var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => { + def.pattern ?? (def.pattern = base64); + $ZodStringFormat.init(inst, def); + inst._zod.onattach.push((inst2) => { + inst2._zod.bag.contentEncoding = "base64"; + }); + inst._zod.check = (payload) => { + if (isValidBase64(payload.value)) + return; + payload.issues.push({ + code: "invalid_format", + format: "base64", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +function isValidBase64URL(data) { + if (!base64url.test(data)) return false; + const base642 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/"); + const padded = base642.padEnd(Math.ceil(base642.length / 4) * 4, "="); + return isValidBase64(padded); +} +var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => { + def.pattern ?? (def.pattern = base64url); + $ZodStringFormat.init(inst, def); + inst._zod.onattach.push((inst2) => { + inst2._zod.bag.contentEncoding = "base64url"; + }); + inst._zod.check = (payload) => { + if (isValidBase64URL(payload.value)) + return; + payload.issues.push({ + code: "invalid_format", + format: "base64url", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => { + def.pattern ?? (def.pattern = e164); + $ZodStringFormat.init(inst, def); +}); +function isValidJWT(token, algorithm = null) { try { - const [header] = jwt.split("."); - const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "="); - const decoded = JSON.parse(atob(base64)); - if (typeof decoded !== "object" || decoded === null) + const tokensParts = token.split("."); + if (tokensParts.length !== 3) + return false; + const [header] = tokensParts; + if (!header) return false; - if ("typ" in decoded && decoded?.typ !== "JWT") + const parsedHeader = JSON.parse(atob(header)); + if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false; - if (!decoded.alg) + if (!parsedHeader.alg) return false; - if (alg && decoded.alg !== alg) + if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false; return true; } catch { return false; } } -function isValidCidr(ip, version) { - if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) { - return true; - } - if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) { - return true; +var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => { + $ZodStringFormat.init(inst, def); + inst._zod.check = (payload) => { + if (isValidJWT(payload.value, def.alg)) + return; + payload.issues.push({ + code: "invalid_format", + format: "jwt", + input: payload.value, + inst, + continue: !def.abort + }); + }; +}); +var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.pattern = boolean; + inst._zod.parse = (payload, _ctx) => { + if (def.coerce) + try { + payload.value = Boolean(payload.value); + } catch (_) { + } + const input = payload.value; + if (typeof input === "boolean") + return payload; + payload.issues.push({ + expected: "boolean", + code: "invalid_type", + input, + inst + }); + return payload; + }; +}); +function handleArrayResult(result, final, index) { + if (result.issues.length) { + final.issues.push(...prefixIssues(index, result.issues)); } - return false; + final.value[index] = result.value; } -var ZodString = class _ZodString extends ZodType { - _parse(input) { - if (this._def.coerce) { - input.data = String(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.string) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.string, - received: ctx2.parsedType +var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!Array.isArray(input)) { + payload.issues.push({ + expected: "array", + code: "invalid_type", + input, + inst }); - return INVALID; - } - const status = new ParseStatus(); - let ctx = void 0; - for (const check of this._def.checks) { - if (check.kind === "min") { - if (input.data.length < check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "string", - inclusive: true, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (input.data.length > check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "string", - inclusive: true, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "length") { - const tooBig = input.data.length > check.value; - const tooSmall = input.data.length < check.value; - if (tooBig || tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - if (tooBig) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "string", - inclusive: true, - exact: true, - message: check.message - }); - } else if (tooSmall) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "string", - inclusive: true, - exact: true, - message: check.message - }); - } - status.dirty(); - } - } else if (check.kind === "email") { - if (!emailRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "email", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "emoji") { - if (!emojiRegex) { - emojiRegex = new RegExp(_emojiRegex, "u"); - } - if (!emojiRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "emoji", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "uuid") { - if (!uuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "uuid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "nanoid") { - if (!nanoidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "nanoid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cuid") { - if (!cuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cuid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cuid2") { - if (!cuid2Regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cuid2", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "ulid") { - if (!ulidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "ulid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "url") { - try { - new URL(input.data); - } catch { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "url", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "regex") { - check.regex.lastIndex = 0; - const testResult = check.regex.test(input.data); - if (!testResult) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "regex", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "trim") { - input.data = input.data.trim(); - } else if (check.kind === "includes") { - if (!input.data.includes(check.value, check.position)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { includes: check.value, position: check.position }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "toLowerCase") { - input.data = input.data.toLowerCase(); - } else if (check.kind === "toUpperCase") { - input.data = input.data.toUpperCase(); - } else if (check.kind === "startsWith") { - if (!input.data.startsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { startsWith: check.value }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "endsWith") { - if (!input.data.endsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { endsWith: check.value }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "datetime") { - const regex = datetimeRegex(check); - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "datetime", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "date") { - const regex = dateRegex; - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "date", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "time") { - const regex = timeRegex(check); - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "time", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "duration") { - if (!durationRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "duration", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "ip") { - if (!isValidIP(input.data, check.version)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "ip", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "jwt") { - if (!isValidJWT(input.data, check.alg)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "jwt", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cidr") { - if (!isValidCidr(input.data, check.version)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cidr", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "base64") { - if (!base64Regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "base64", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "base64url") { - if (!base64urlRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "base64url", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } + return payload; + } + payload.value = Array(input.length); + const proms = []; + for (let i = 0; i < input.length; i++) { + const item = input[i]; + const result = def.element._zod.run({ + value: item, + issues: [] + }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => handleArrayResult(result2, payload, i))); } else { - util.assertNever(check); + handleArrayResult(result, payload, i); } } - return { status: status.value, value: input.data }; - } - _regex(regex, validation, message) { - return this.refinement((data) => regex.test(data), { - validation, - code: ZodIssueCode.invalid_string, - ...errorUtil.errToObj(message) - }); - } - _addCheck(check) { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - email(message) { - return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) }); - } - url(message) { - return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) }); - } - emoji(message) { - return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) }); - } - uuid(message) { - return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) }); - } - nanoid(message) { - return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) }); - } - cuid(message) { - return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) }); - } - cuid2(message) { - return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) }); - } - ulid(message) { - return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) }); - } - base64(message) { - return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) }); - } - base64url(message) { - return this._addCheck({ - kind: "base64url", - ...errorUtil.errToObj(message) - }); - } - jwt(options2) { - return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options2) }); - } - ip(options2) { - return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options2) }); - } - cidr(options2) { - return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options2) }); - } - datetime(options2) { - if (typeof options2 === "string") { - return this._addCheck({ - kind: "datetime", - precision: null, - offset: false, - local: false, - message: options2 - }); + if (proms.length) { + return Promise.all(proms).then(() => payload); } - return this._addCheck({ - kind: "datetime", - precision: typeof options2?.precision === "undefined" ? null : options2?.precision, - offset: options2?.offset ?? false, - local: options2?.local ?? false, - ...errorUtil.errToObj(options2?.message) + return payload; + }; +}); +function handleUnionResults(results, final, inst, ctx) { + for (const result of results) { + if (result.issues.length === 0) { + final.value = result.value; + return final; + } + } + const nonaborted = results.filter((r) => !aborted(r)); + if (nonaborted.length === 1) { + final.value = nonaborted[0].value; + return nonaborted[0]; + } + final.issues.push({ + code: "invalid_union", + input: final.value, + inst, + errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config()))) + }); + return final; +} +var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0); + defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0); + defineLazy(inst._zod, "values", () => { + if (def.options.every((o) => o._zod.values)) { + return new Set(def.options.flatMap((option) => Array.from(option._zod.values))); + } + return void 0; + }); + defineLazy(inst._zod, "pattern", () => { + if (def.options.every((o) => o._zod.pattern)) { + const patterns = def.options.map((o) => o._zod.pattern); + return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`); + } + return void 0; + }); + const single = def.options.length === 1; + const first = def.options[0]._zod.run; + inst._zod.parse = (payload, ctx) => { + if (single) { + return first(payload, ctx); + } + let async = false; + const results = []; + for (const option of def.options) { + const result = option._zod.run({ + value: payload.value, + issues: [] + }, ctx); + if (result instanceof Promise) { + results.push(result); + async = true; + } else { + if (result.issues.length === 0) + return result; + results.push(result); + } + } + if (!async) + return handleUnionResults(results, payload, inst, ctx); + return Promise.all(results).then((results2) => { + return handleUnionResults(results2, payload, inst, ctx); }); - } - date(message) { - return this._addCheck({ kind: "date", message }); - } - time(options2) { - if (typeof options2 === "string") { - return this._addCheck({ - kind: "time", - precision: null, - message: options2 + }; +}); +var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + const left = def.left._zod.run({ value: input, issues: [] }, ctx); + const right = def.right._zod.run({ value: input, issues: [] }, ctx); + const async = left instanceof Promise || right instanceof Promise; + if (async) { + return Promise.all([left, right]).then(([left2, right2]) => { + return handleIntersectionResults(payload, left2, right2); }); } - return this._addCheck({ - kind: "time", - precision: typeof options2?.precision === "undefined" ? null : options2?.precision, - ...errorUtil.errToObj(options2?.message) - }); - } - duration(message) { - return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) }); - } - regex(regex, message) { - return this._addCheck({ - kind: "regex", - regex, - ...errorUtil.errToObj(message) - }); - } - includes(value, options2) { - return this._addCheck({ - kind: "includes", - value, - position: options2?.position, - ...errorUtil.errToObj(options2?.message) - }); - } - startsWith(value, message) { - return this._addCheck({ - kind: "startsWith", - value, - ...errorUtil.errToObj(message) - }); + return handleIntersectionResults(payload, left, right); + }; +}); +function mergeValues(a, b) { + if (a === b) { + return { valid: true, data: a }; } - endsWith(value, message) { - return this._addCheck({ - kind: "endsWith", - value, - ...errorUtil.errToObj(message) - }); + if (a instanceof Date && b instanceof Date && +a === +b) { + return { valid: true, data: a }; } - min(minLength, message) { - return this._addCheck({ - kind: "min", - value: minLength, - ...errorUtil.errToObj(message) - }); + if (isPlainObject(a) && isPlainObject(b)) { + const bKeys = Object.keys(b); + const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { ...a, ...b }; + for (const key of sharedKeys) { + const sharedValue = mergeValues(a[key], b[key]); + if (!sharedValue.valid) { + return { + valid: false, + mergeErrorPath: [key, ...sharedValue.mergeErrorPath] + }; + } + newObj[key] = sharedValue.data; + } + return { valid: true, data: newObj }; } - max(maxLength, message) { - return this._addCheck({ - kind: "max", - value: maxLength, - ...errorUtil.errToObj(message) - }); + if (Array.isArray(a) && Array.isArray(b)) { + if (a.length !== b.length) { + return { valid: false, mergeErrorPath: [] }; + } + const newArray = []; + for (let index = 0; index < a.length; index++) { + const itemA = a[index]; + const itemB = b[index]; + const sharedValue = mergeValues(itemA, itemB); + if (!sharedValue.valid) { + return { + valid: false, + mergeErrorPath: [index, ...sharedValue.mergeErrorPath] + }; + } + newArray.push(sharedValue.data); + } + return { valid: true, data: newArray }; } - length(len, message) { - return this._addCheck({ - kind: "length", - value: len, - ...errorUtil.errToObj(message) - }); + return { valid: false, mergeErrorPath: [] }; +} +function handleIntersectionResults(result, left, right) { + if (left.issues.length) { + result.issues.push(...left.issues); } - /** - * Equivalent to `.min(1)` - */ - nonempty(message) { - return this.min(1, errorUtil.errToObj(message)); + if (right.issues.length) { + result.issues.push(...right.issues); } - trim() { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "trim" }] - }); + if (aborted(result)) + return result; + const merged = mergeValues(left.value, right.value); + if (!merged.valid) { + throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`); } - toLowerCase() { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toLowerCase" }] - }); - } - toUpperCase() { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toUpperCase" }] - }); - } - get isDatetime() { - return !!this._def.checks.find((ch) => ch.kind === "datetime"); - } - get isDate() { - return !!this._def.checks.find((ch) => ch.kind === "date"); - } - get isTime() { - return !!this._def.checks.find((ch) => ch.kind === "time"); - } - get isDuration() { - return !!this._def.checks.find((ch) => ch.kind === "duration"); - } - get isEmail() { - return !!this._def.checks.find((ch) => ch.kind === "email"); - } - get isURL() { - return !!this._def.checks.find((ch) => ch.kind === "url"); - } - get isEmoji() { - return !!this._def.checks.find((ch) => ch.kind === "emoji"); - } - get isUUID() { - return !!this._def.checks.find((ch) => ch.kind === "uuid"); - } - get isNANOID() { - return !!this._def.checks.find((ch) => ch.kind === "nanoid"); - } - get isCUID() { - return !!this._def.checks.find((ch) => ch.kind === "cuid"); - } - get isCUID2() { - return !!this._def.checks.find((ch) => ch.kind === "cuid2"); - } - get isULID() { - return !!this._def.checks.find((ch) => ch.kind === "ulid"); - } - get isIP() { - return !!this._def.checks.find((ch) => ch.kind === "ip"); - } - get isCIDR() { - return !!this._def.checks.find((ch) => ch.kind === "cidr"); - } - get isBase64() { - return !!this._def.checks.find((ch) => ch.kind === "base64"); - } - get isBase64url() { - return !!this._def.checks.find((ch) => ch.kind === "base64url"); - } - get minLength() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } - } - return min; - } - get maxLength() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max; - } -}; -ZodString.create = (params) => { - return new ZodString({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodString, - coerce: params?.coerce ?? false, - ...processCreateParams(params) - }); -}; -function floatSafeRemainder(val, step) { - const valDecCount = (val.toString().split(".")[1] || "").length; - const stepDecCount = (step.toString().split(".")[1] || "").length; - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; - const valInt = Number.parseInt(val.toFixed(decCount).replace(".", "")); - const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", "")); - return valInt % stepInt / 10 ** decCount; + result.value = merged.data; + return result; } -var ZodNumber = class _ZodNumber extends ZodType { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - this.step = this.multipleOf; - } - _parse(input) { - if (this._def.coerce) { - input.data = Number(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.number) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.number, - received: ctx2.parsedType +var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, ctx) => { + const input = payload.value; + if (!isPlainObject(input)) { + payload.issues.push({ + expected: "record", + code: "invalid_type", + input, + inst }); - return INVALID; - } - let ctx = void 0; - const status = new ParseStatus(); - for (const check of this._def.checks) { - if (check.kind === "int") { - if (!util.isInteger(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: "integer", - received: "float", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "min") { - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "number", - inclusive: check.inclusive, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "number", - inclusive: check.inclusive, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "multipleOf") { - if (floatSafeRemainder(input.data, check.value) !== 0) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "finite") { - if (!Number.isFinite(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_finite, - message: check.message - }); - status.dirty(); + return payload; + } + const proms = []; + if (def.keyType._zod.values) { + const values = def.keyType._zod.values; + payload.value = {}; + for (const key of values) { + if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") { + const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => { + if (result2.issues.length) { + payload.issues.push(...prefixIssues(key, result2.issues)); + } + payload.value[key] = result2.value; + })); + } else { + if (result.issues.length) { + payload.issues.push(...prefixIssues(key, result.issues)); + } + payload.value[key] = result.value; + } } - } else { - util.assertNever(check); } - } - return { status: status.value, value: input.data }; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new _ZodNumber({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil.toString(message) + let unrecognized; + for (const key in input) { + if (!values.has(key)) { + unrecognized = unrecognized ?? []; + unrecognized.push(key); } - ] - }); - } - _addCheck(check) { - return new _ZodNumber({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - int(message) { - return this._addCheck({ - kind: "int", - message: errorUtil.toString(message) - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil.toString(message) - }); - } - finite(message) { - return this._addCheck({ - kind: "finite", - message: errorUtil.toString(message) - }); - } - safe(message) { - return this._addCheck({ - kind: "min", - inclusive: true, - value: Number.MIN_SAFE_INTEGER, - message: errorUtil.toString(message) - })._addCheck({ - kind: "max", - inclusive: true, - value: Number.MAX_SAFE_INTEGER, - message: errorUtil.toString(message) - }); - } - get minValue() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; } - } - return min; - } - get maxValue() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max; - } - get isInt() { - return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value)); - } - get isFinite() { - let max = null; - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") { - return true; - } else if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } else if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; + if (unrecognized && unrecognized.length > 0) { + payload.issues.push({ + code: "unrecognized_keys", + input, + inst, + keys: unrecognized + }); } - } - return Number.isFinite(min) && Number.isFinite(max); - } -}; -ZodNumber.create = (params) => { - return new ZodNumber({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodNumber, - coerce: params?.coerce || false, - ...processCreateParams(params) - }); -}; -var ZodBigInt = class _ZodBigInt extends ZodType { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - } - _parse(input) { - if (this._def.coerce) { - try { - input.data = BigInt(input.data); - } catch { - return this._getInvalidInput(input); - } - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.bigint) { - return this._getInvalidInput(input); - } - let ctx = void 0; - const status = new ParseStatus(); - for (const check of this._def.checks) { - if (check.kind === "min") { - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - type: "bigint", - minimum: check.value, - inclusive: check.inclusive, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - type: "bigint", - maximum: check.value, - inclusive: check.inclusive, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "multipleOf") { - if (input.data % check.value !== BigInt(0)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message + } else { + payload.value = {}; + for (const key of Reflect.ownKeys(input)) { + if (key === "__proto__") + continue; + const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx); + if (keyResult instanceof Promise) { + throw new Error("Async schemas not supported in object keys currently"); + } + if (keyResult.issues.length) { + payload.issues.push({ + code: "invalid_key", + origin: "record", + issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())), + input: key, + path: [key], + inst }); - status.dirty(); + payload.value[keyResult.value] = keyResult.value; + continue; + } + const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx); + if (result instanceof Promise) { + proms.push(result.then((result2) => { + if (result2.issues.length) { + payload.issues.push(...prefixIssues(key, result2.issues)); + } + payload.value[keyResult.value] = result2.value; + })); + } else { + if (result.issues.length) { + payload.issues.push(...prefixIssues(key, result.issues)); + } + payload.value[keyResult.value] = result.value; } - } else { - util.assertNever(check); } } - return { status: status.value, value: input.data }; - } - _getInvalidInput(input) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.bigint, - received: ctx.parsedType - }); - return INVALID; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new _ZodBigInt({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil.toString(message) - } - ] - }); - } - _addCheck(check) { - return new _ZodBigInt({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) + if (proms.length) { + return Promise.all(proms).then(() => payload); + } + return payload; + }; +}); +var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => { + $ZodType.init(inst, def); + const values = getEnumValues(def.entries); + const valuesSet = new Set(values); + inst._zod.values = valuesSet; + inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (valuesSet.has(input)) { + return payload; + } + payload.issues.push({ + code: "invalid_value", + values, + input, + inst }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil.toString(message) + return payload; + }; +}); +var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => { + $ZodType.init(inst, def); + if (def.values.length === 0) { + throw new Error("Cannot create literal schema with no valid values"); + } + inst._zod.values = new Set(def.values); + inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`); + inst._zod.parse = (payload, _ctx) => { + const input = payload.value; + if (inst._zod.values.has(input)) { + return payload; + } + payload.issues.push({ + code: "invalid_value", + values: def.values, + input, + inst }); - } - get minValue() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } + return payload; + }; +}); +var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + const _out = def.transform(payload.value, payload); + if (_ctx.async) { + const output = _out instanceof Promise ? _out : Promise.resolve(_out); + return output.then((output2) => { + payload.value = output2; + return payload; + }); } - return min; - } - get maxValue() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } + if (_out instanceof Promise) { + throw new $ZodAsyncError(); } - return max; + payload.value = _out; + return payload; + }; +}); +function handleOptionalResult(result, input) { + if (result.issues.length && input === void 0) { + return { issues: [], value: void 0 }; } -}; -ZodBigInt.create = (params) => { - return new ZodBigInt({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodBigInt, - coerce: params?.coerce ?? false, - ...processCreateParams(params) + return result; +} +var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + inst._zod.optout = "optional"; + defineLazy(inst._zod, "values", () => { + return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0; }); -}; -var ZodBoolean = class extends ZodType { - _parse(input) { - if (this._def.coerce) { - input.data = Boolean(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.boolean) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.boolean, - received: ctx.parsedType - }); - return INVALID; + defineLazy(inst._zod, "pattern", () => { + const pattern = def.innerType._zod.pattern; + return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0; + }); + inst._zod.parse = (payload, ctx) => { + if (def.innerType._zod.optin === "optional") { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) + return result.then((r) => handleOptionalResult(r, payload.value)); + return handleOptionalResult(result, payload.value); + } + if (payload.value === void 0) { + return payload; } - return OK(input.data); + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + defineLazy(inst._zod, "pattern", () => { + const pattern = def.innerType._zod.pattern; + return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0; + }); + defineLazy(inst._zod, "values", () => { + return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0; + }); + inst._zod.parse = (payload, ctx) => { + if (payload.value === null) + return payload; + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (payload.value === void 0) { + payload.value = def.defaultValue; + return payload; + } + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => handleDefaultResult(result2, def)); + } + return handleDefaultResult(result, def); + }; +}); +function handleDefaultResult(payload, def) { + if (payload.value === void 0) { + payload.value = def.defaultValue; } -}; -ZodBoolean.create = (params) => { - return new ZodBoolean({ - typeName: ZodFirstPartyTypeKind.ZodBoolean, - coerce: params?.coerce || false, - ...processCreateParams(params) + return payload; +} +var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => { + $ZodType.init(inst, def); + inst._zod.optin = "optional"; + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + if (payload.value === void 0) { + payload.value = def.defaultValue; + } + return def.innerType._zod.run(payload, ctx); + }; +}); +var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "values", () => { + const v = def.innerType._zod.values; + return v ? new Set([...v].filter((x) => x !== void 0)) : void 0; }); -}; -var ZodDate = class _ZodDate extends ZodType { - _parse(input) { - if (this._def.coerce) { - input.data = new Date(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.date) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.date, - received: ctx2.parsedType - }); - return INVALID; + inst._zod.parse = (payload, ctx) => { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => handleNonOptionalResult(result2, inst)); } - if (Number.isNaN(input.data.getTime())) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_date - }); - return INVALID; - } - const status = new ParseStatus(); - let ctx = void 0; - for (const check of this._def.checks) { - if (check.kind === "min") { - if (input.data.getTime() < check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - message: check.message, - inclusive: true, - exact: false, - minimum: check.value, - type: "date" - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (input.data.getTime() > check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - message: check.message, - inclusive: true, - exact: false, - maximum: check.value, - type: "date" + return handleNonOptionalResult(result, inst); + }; +}); +function handleNonOptionalResult(payload, inst) { + if (!payload.issues.length && payload.value === void 0) { + payload.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: payload.value, + inst + }); + } + return payload; +} +var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + inst._zod.parse = (payload, ctx) => { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then((result2) => { + payload.value = result2.value; + if (result2.issues.length) { + payload.value = def.catchValue({ + ...payload, + error: { + issues: result2.issues.map((iss) => finalizeIssue(iss, ctx, config())) + }, + input: payload.value }); - status.dirty(); + payload.issues = []; } - } else { - util.assertNever(check); - } + return payload; + }); } - return { - status: status.value, - value: new Date(input.data.getTime()) - }; - } - _addCheck(check) { - return new _ZodDate({ - ...this._def, - checks: [...this._def.checks, check] - }); + payload.value = result.value; + if (result.issues.length) { + payload.value = def.catchValue({ + ...payload, + error: { + issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) + }, + input: payload.value + }); + payload.issues = []; + } + return payload; + }; +}); +var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "values", () => def.in._zod.values); + defineLazy(inst._zod, "optin", () => def.in._zod.optin); + defineLazy(inst._zod, "optout", () => def.out._zod.optout); + defineLazy(inst._zod, "propValues", () => def.in._zod.propValues); + inst._zod.parse = (payload, ctx) => { + const left = def.in._zod.run(payload, ctx); + if (left instanceof Promise) { + return left.then((left2) => handlePipeResult(left2, def, ctx)); + } + return handlePipeResult(left, def, ctx); + }; +}); +function handlePipeResult(left, def, ctx) { + if (left.issues.length) { + return left; } - min(minDate, message) { - return this._addCheck({ - kind: "min", - value: minDate.getTime(), - message: errorUtil.toString(message) - }); + return def.out._zod.run({ value: left.value, issues: left.issues }, ctx); +} +var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => { + $ZodType.init(inst, def); + defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues); + defineLazy(inst._zod, "values", () => def.innerType._zod.values); + defineLazy(inst._zod, "optin", () => def.innerType._zod.optin); + defineLazy(inst._zod, "optout", () => def.innerType._zod.optout); + inst._zod.parse = (payload, ctx) => { + const result = def.innerType._zod.run(payload, ctx); + if (result instanceof Promise) { + return result.then(handleReadonlyResult); + } + return handleReadonlyResult(result); + }; +}); +function handleReadonlyResult(payload) { + payload.value = Object.freeze(payload.value); + return payload; +} +var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => { + $ZodCheck.init(inst, def); + $ZodType.init(inst, def); + inst._zod.parse = (payload, _) => { + return payload; + }; + inst._zod.check = (payload) => { + const input = payload.value; + const r = def.fn(input); + if (r instanceof Promise) { + return r.then((r2) => handleRefineResult(r2, payload, input, inst)); + } + handleRefineResult(r, payload, input, inst); + return; + }; +}); +function handleRefineResult(result, payload, input, inst) { + if (!result) { + const _iss = { + code: "custom", + input, + inst, + // incorporates params.error into issue reporting + path: [...inst._zod.def.path ?? []], + // incorporates params.error into issue reporting + continue: !inst._zod.def.abort + // params: inst._zod.def.params, + }; + if (inst._zod.def.params) + _iss.params = inst._zod.def.params; + payload.issues.push(issue(_iss)); } - max(maxDate, message) { - return this._addCheck({ - kind: "max", - value: maxDate.getTime(), - message: errorUtil.toString(message) - }); +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/registries.js +var $output = Symbol("ZodOutput"); +var $input = Symbol("ZodInput"); +var $ZodRegistry = class { + constructor() { + this._map = /* @__PURE__ */ new Map(); + this._idmap = /* @__PURE__ */ new Map(); } - get minDate() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; + add(schema, ..._meta) { + const meta = _meta[0]; + this._map.set(schema, meta); + if (meta && typeof meta === "object" && "id" in meta) { + if (this._idmap.has(meta.id)) { + throw new Error(`ID ${meta.id} already exists in the registry`); } + this._idmap.set(meta.id, schema); } - return min != null ? new Date(min) : null; + return this; } - get maxDate() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max != null ? new Date(max) : null; + clear() { + this._map = /* @__PURE__ */ new Map(); + this._idmap = /* @__PURE__ */ new Map(); + return this; } -}; -ZodDate.create = (params) => { - return new ZodDate({ - checks: [], - coerce: params?.coerce || false, - typeName: ZodFirstPartyTypeKind.ZodDate, - ...processCreateParams(params) - }); -}; -var ZodSymbol = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.symbol) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.symbol, - received: ctx.parsedType - }); - return INVALID; + remove(schema) { + const meta = this._map.get(schema); + if (meta && typeof meta === "object" && "id" in meta) { + this._idmap.delete(meta.id); } - return OK(input.data); + this._map.delete(schema); + return this; } -}; -ZodSymbol.create = (params) => { - return new ZodSymbol({ - typeName: ZodFirstPartyTypeKind.ZodSymbol, - ...processCreateParams(params) - }); -}; -var ZodUndefined = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.undefined, - received: ctx.parsedType - }); - return INVALID; + get(schema) { + const p = schema._zod.parent; + if (p) { + const pm = { ...this.get(p) ?? {} }; + delete pm.id; + const f = { ...pm, ...this._map.get(schema) }; + return Object.keys(f).length ? f : void 0; } - return OK(input.data); + return this._map.get(schema); } -}; -ZodUndefined.create = (params) => { - return new ZodUndefined({ - typeName: ZodFirstPartyTypeKind.ZodUndefined, - ...processCreateParams(params) - }); -}; -var ZodNull = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.null) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.null, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); + has(schema) { + return this._map.has(schema); } }; -ZodNull.create = (params) => { - return new ZodNull({ - typeName: ZodFirstPartyTypeKind.ZodNull, - ...processCreateParams(params) +function registry() { + return new $ZodRegistry(); +} +var globalRegistry = /* @__PURE__ */ registry(); + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/core/api.js +function _string(Class2, params) { + return new Class2({ + type: "string", + ...normalizeParams(params) }); -}; -var ZodAny = class extends ZodType { - constructor() { - super(...arguments); - this._any = true; - } - _parse(input) { - return OK(input.data); - } -}; -ZodAny.create = (params) => { - return new ZodAny({ - typeName: ZodFirstPartyTypeKind.ZodAny, - ...processCreateParams(params) +} +function _email(Class2, params) { + return new Class2({ + type: "string", + format: "email", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var ZodUnknown = class extends ZodType { - constructor() { - super(...arguments); - this._unknown = true; - } - _parse(input) { - return OK(input.data); - } -}; -ZodUnknown.create = (params) => { - return new ZodUnknown({ - typeName: ZodFirstPartyTypeKind.ZodUnknown, - ...processCreateParams(params) +} +function _guid(Class2, params) { + return new Class2({ + type: "string", + format: "guid", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var ZodNever = class extends ZodType { - _parse(input) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.never, - received: ctx.parsedType - }); - return INVALID; - } -}; -ZodNever.create = (params) => { - return new ZodNever({ - typeName: ZodFirstPartyTypeKind.ZodNever, - ...processCreateParams(params) +} +function _uuid(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var ZodVoid = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.void, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodVoid.create = (params) => { - return new ZodVoid({ - typeName: ZodFirstPartyTypeKind.ZodVoid, - ...processCreateParams(params) +} +function _uuidv4(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v4", + ...normalizeParams(params) }); -}; -var ZodArray = class _ZodArray extends ZodType { - _parse(input) { - const { ctx, status } = this._processInputParams(input); - const def = this._def; - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }); - return INVALID; - } - if (def.exactLength !== null) { - const tooBig = ctx.data.length > def.exactLength.value; - const tooSmall = ctx.data.length < def.exactLength.value; - if (tooBig || tooSmall) { - addIssueToContext(ctx, { - code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, - minimum: tooSmall ? def.exactLength.value : void 0, - maximum: tooBig ? def.exactLength.value : void 0, - type: "array", - inclusive: true, - exact: true, - message: def.exactLength.message - }); - status.dirty(); - } - } - if (def.minLength !== null) { - if (ctx.data.length < def.minLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.minLength.message - }); - status.dirty(); - } - } - if (def.maxLength !== null) { - if (ctx.data.length > def.maxLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.maxLength.message - }); - status.dirty(); - } - } - if (ctx.common.async) { - return Promise.all([...ctx.data].map((item, i) => { - return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); - })).then((result2) => { - return ParseStatus.mergeArray(status, result2); - }); - } - const result = [...ctx.data].map((item, i) => { - return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); - }); - return ParseStatus.mergeArray(status, result); - } - get element() { - return this._def.type; - } - min(minLength, message) { - return new _ZodArray({ - ...this._def, - minLength: { value: minLength, message: errorUtil.toString(message) } - }); - } - max(maxLength, message) { - return new _ZodArray({ - ...this._def, - maxLength: { value: maxLength, message: errorUtil.toString(message) } - }); - } - length(len, message) { - return new _ZodArray({ - ...this._def, - exactLength: { value: len, message: errorUtil.toString(message) } - }); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodArray.create = (schema, params) => { - return new ZodArray({ - type: schema, - minLength: null, - maxLength: null, - exactLength: null, - typeName: ZodFirstPartyTypeKind.ZodArray, - ...processCreateParams(params) +} +function _uuidv6(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v6", + ...normalizeParams(params) }); -}; -function deepPartialify(schema) { - if (schema instanceof ZodObject) { - const newShape = {}; - for (const key in schema.shape) { - const fieldSchema = schema.shape[key]; - newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); - } - return new ZodObject({ - ...schema._def, - shape: () => newShape - }); - } else if (schema instanceof ZodArray) { - return new ZodArray({ - ...schema._def, - type: deepPartialify(schema.element) - }); - } else if (schema instanceof ZodOptional) { - return ZodOptional.create(deepPartialify(schema.unwrap())); - } else if (schema instanceof ZodNullable) { - return ZodNullable.create(deepPartialify(schema.unwrap())); - } else if (schema instanceof ZodTuple) { - return ZodTuple.create(schema.items.map((item) => deepPartialify(item))); - } else { - return schema; - } } -var ZodObject = class _ZodObject extends ZodType { - constructor() { - super(...arguments); - this._cached = null; - this.nonstrict = this.passthrough; - this.augment = this.extend; - } - _getCached() { - if (this._cached !== null) - return this._cached; - const shape = this._def.shape(); - const keys = util.objectKeys(shape); - this._cached = { shape, keys }; - return this._cached; - } - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.object) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx2.parsedType - }); - return INVALID; - } - const { status, ctx } = this._processInputParams(input); - const { shape, keys: shapeKeys } = this._getCached(); - const extraKeys = []; - if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) { - for (const key in ctx.data) { - if (!shapeKeys.includes(key)) { - extraKeys.push(key); - } - } - } - const pairs = []; - for (const key of shapeKeys) { - const keyValidator = shape[key]; - const value = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (this._def.catchall instanceof ZodNever) { - const unknownKeys = this._def.unknownKeys; - if (unknownKeys === "passthrough") { - for (const key of extraKeys) { - pairs.push({ - key: { status: "valid", value: key }, - value: { status: "valid", value: ctx.data[key] } - }); - } - } else if (unknownKeys === "strict") { - if (extraKeys.length > 0) { - addIssueToContext(ctx, { - code: ZodIssueCode.unrecognized_keys, - keys: extraKeys - }); - status.dirty(); - } - } else if (unknownKeys === "strip") { - } else { - throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); - } - } else { - const catchall = this._def.catchall; - for (const key of extraKeys) { - const value = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: catchall._parse( - new ParseInputLazyPath(ctx, value, ctx.path, key) - //, ctx.child(key), value, getParsedType(value) - ), - alwaysSet: key in ctx.data - }); - } - } - if (ctx.common.async) { - return Promise.resolve().then(async () => { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - syncPairs.push({ - key, - value, - alwaysSet: pair.alwaysSet - }); - } - return syncPairs; - }).then((syncPairs) => { - return ParseStatus.mergeObjectSync(status, syncPairs); - }); - } else { - return ParseStatus.mergeObjectSync(status, pairs); - } - } - get shape() { - return this._def.shape(); - } - strict(message) { - errorUtil.errToObj; - return new _ZodObject({ - ...this._def, - unknownKeys: "strict", - ...message !== void 0 ? { - errorMap: (issue, ctx) => { - const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError; - if (issue.code === "unrecognized_keys") - return { - message: errorUtil.errToObj(message).message ?? defaultError - }; - return { - message: defaultError - }; - } - } : {} - }); - } - strip() { - return new _ZodObject({ - ...this._def, - unknownKeys: "strip" - }); - } - passthrough() { - return new _ZodObject({ - ...this._def, - unknownKeys: "passthrough" - }); - } - // const AugmentFactory = - // (def: Def) => - // ( - // augmentation: Augmentation - // ): ZodObject< - // extendShape, Augmentation>, - // Def["unknownKeys"], - // Def["catchall"] - // > => { - // return new ZodObject({ - // ...def, - // shape: () => ({ - // ...def.shape(), - // ...augmentation, - // }), - // }) as any; - // }; - extend(augmentation) { - return new _ZodObject({ - ...this._def, - shape: () => ({ - ...this._def.shape(), - ...augmentation - }) - }); - } - /** - * Prior to zod@1.0.12 there was a bug in the - * inferred type of merged objects. Please - * upgrade if you are experiencing issues. - */ - merge(merging) { - const merged = new _ZodObject({ - unknownKeys: merging._def.unknownKeys, - catchall: merging._def.catchall, - shape: () => ({ - ...this._def.shape(), - ...merging._def.shape() - }), - typeName: ZodFirstPartyTypeKind.ZodObject - }); - return merged; - } - // merge< - // Incoming extends AnyZodObject, - // Augmentation extends Incoming["shape"], - // NewOutput extends { - // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation - // ? Augmentation[k]["_output"] - // : k extends keyof Output - // ? Output[k] - // : never; - // }, - // NewInput extends { - // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation - // ? Augmentation[k]["_input"] - // : k extends keyof Input - // ? Input[k] - // : never; - // } - // >( - // merging: Incoming - // ): ZodObject< - // extendShape>, - // Incoming["_def"]["unknownKeys"], - // Incoming["_def"]["catchall"], - // NewOutput, - // NewInput - // > { - // const merged: any = new ZodObject({ - // unknownKeys: merging._def.unknownKeys, - // catchall: merging._def.catchall, - // shape: () => - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), - // typeName: ZodFirstPartyTypeKind.ZodObject, - // }) as any; - // return merged; - // } - setKey(key, schema) { - return this.augment({ [key]: schema }); - } - // merge( - // merging: Incoming - // ): //ZodObject = (merging) => { - // ZodObject< - // extendShape>, - // Incoming["_def"]["unknownKeys"], - // Incoming["_def"]["catchall"] - // > { - // // const mergedShape = objectUtil.mergeShapes( - // // this._def.shape(), - // // merging._def.shape() - // // ); - // const merged: any = new ZodObject({ - // unknownKeys: merging._def.unknownKeys, - // catchall: merging._def.catchall, - // shape: () => - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), - // typeName: ZodFirstPartyTypeKind.ZodObject, - // }) as any; - // return merged; - // } - catchall(index) { - return new _ZodObject({ - ...this._def, - catchall: index - }); - } - pick(mask) { - const shape = {}; - for (const key of util.objectKeys(mask)) { - if (mask[key] && this.shape[key]) { - shape[key] = this.shape[key]; - } - } - return new _ZodObject({ - ...this._def, - shape: () => shape - }); - } - omit(mask) { - const shape = {}; - for (const key of util.objectKeys(this.shape)) { - if (!mask[key]) { - shape[key] = this.shape[key]; - } - } - return new _ZodObject({ - ...this._def, - shape: () => shape - }); - } - /** - * @deprecated - */ - deepPartial() { - return deepPartialify(this); - } - partial(mask) { - const newShape = {}; - for (const key of util.objectKeys(this.shape)) { - const fieldSchema = this.shape[key]; - if (mask && !mask[key]) { - newShape[key] = fieldSchema; - } else { - newShape[key] = fieldSchema.optional(); - } - } - return new _ZodObject({ - ...this._def, - shape: () => newShape - }); - } - required(mask) { - const newShape = {}; - for (const key of util.objectKeys(this.shape)) { - if (mask && !mask[key]) { - newShape[key] = this.shape[key]; - } else { - const fieldSchema = this.shape[key]; - let newField = fieldSchema; - while (newField instanceof ZodOptional) { - newField = newField._def.innerType; - } - newShape[key] = newField; - } - } - return new _ZodObject({ - ...this._def, - shape: () => newShape - }); - } - keyof() { - return createZodEnum(util.objectKeys(this.shape)); - } -}; -ZodObject.create = (shape, params) => { - return new ZodObject({ - shape: () => shape, - unknownKeys: "strip", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) +function _uuidv7(Class2, params) { + return new Class2({ + type: "string", + format: "uuid", + check: "string_format", + abort: false, + version: "v7", + ...normalizeParams(params) }); -}; -ZodObject.strictCreate = (shape, params) => { - return new ZodObject({ - shape: () => shape, - unknownKeys: "strict", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) +} +function _url(Class2, params) { + return new Class2({ + type: "string", + format: "url", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -ZodObject.lazycreate = (shape, params) => { - return new ZodObject({ - shape, - unknownKeys: "strip", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) +} +function _emoji2(Class2, params) { + return new Class2({ + type: "string", + format: "emoji", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var ZodUnion = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const options2 = this._def.options; - function handleResults(results) { - for (const result of results) { - if (result.result.status === "valid") { - return result.result; - } - } - for (const result of results) { - if (result.result.status === "dirty") { - ctx.common.issues.push(...result.ctx.common.issues); - return result.result; - } - } - const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues)); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }); - return INVALID; - } - if (ctx.common.async) { - return Promise.all(options2.map(async (option) => { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - return { - result: await option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }), - ctx: childCtx - }; - })).then(handleResults); - } else { - let dirty = void 0; - const issues = []; - for (const option of options2) { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - const result = option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }); - if (result.status === "valid") { - return result; - } else if (result.status === "dirty" && !dirty) { - dirty = { result, ctx: childCtx }; - } - if (childCtx.common.issues.length) { - issues.push(childCtx.common.issues); - } - } - if (dirty) { - ctx.common.issues.push(...dirty.ctx.common.issues); - return dirty.result; - } - const unionErrors = issues.map((issues2) => new ZodError(issues2)); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }); - return INVALID; - } - } - get options() { - return this._def.options; - } -}; -ZodUnion.create = (types, params) => { - return new ZodUnion({ - options: types, - typeName: ZodFirstPartyTypeKind.ZodUnion, - ...processCreateParams(params) +} +function _nanoid(Class2, params) { + return new Class2({ + type: "string", + format: "nanoid", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var getDiscriminator = (type) => { - if (type instanceof ZodLazy) { - return getDiscriminator(type.schema); - } else if (type instanceof ZodEffects) { - return getDiscriminator(type.innerType()); - } else if (type instanceof ZodLiteral) { - return [type.value]; - } else if (type instanceof ZodEnum) { - return type.options; - } else if (type instanceof ZodNativeEnum) { - return util.objectValues(type.enum); - } else if (type instanceof ZodDefault) { - return getDiscriminator(type._def.innerType); - } else if (type instanceof ZodUndefined) { - return [void 0]; - } else if (type instanceof ZodNull) { - return [null]; - } else if (type instanceof ZodOptional) { - return [void 0, ...getDiscriminator(type.unwrap())]; - } else if (type instanceof ZodNullable) { - return [null, ...getDiscriminator(type.unwrap())]; - } else if (type instanceof ZodBranded) { - return getDiscriminator(type.unwrap()); - } else if (type instanceof ZodReadonly) { - return getDiscriminator(type.unwrap()); - } else if (type instanceof ZodCatch) { - return getDiscriminator(type._def.innerType); - } else { - return []; - } -}; -var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }); - return INVALID; - } - const discriminator = this.discriminator; - const discriminatorValue = ctx.data[discriminator]; - const option = this.optionsMap.get(discriminatorValue); - if (!option) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union_discriminator, - options: Array.from(this.optionsMap.keys()), - path: [discriminator] - }); - return INVALID; - } - if (ctx.common.async) { - return option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } else { - return option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } - } - get discriminator() { - return this._def.discriminator; - } - get options() { - return this._def.options; - } - get optionsMap() { - return this._def.optionsMap; - } - /** - * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. - * However, it only allows a union of objects, all of which need to share a discriminator property. This property must - * have a different value for each object in the union. - * @param discriminator the name of the discriminator property - * @param types an array of object schemas - * @param params - */ - static create(discriminator, options2, params) { - const optionsMap = /* @__PURE__ */ new Map(); - for (const type of options2) { - const discriminatorValues = getDiscriminator(type.shape[discriminator]); - if (!discriminatorValues.length) { - throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); - } - for (const value of discriminatorValues) { - if (optionsMap.has(value)) { - throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); - } - optionsMap.set(value, type); - } - } - return new _ZodDiscriminatedUnion({ - typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, - discriminator, - options: options2, - optionsMap, - ...processCreateParams(params) - }); - } -}; -function mergeValues(a, b) { - const aType = getParsedType(a); - const bType = getParsedType(b); - if (a === b) { - return { valid: true, data: a }; - } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { - const bKeys = util.objectKeys(b); - const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1); - const newObj = { ...a, ...b }; - for (const key of sharedKeys) { - const sharedValue = mergeValues(a[key], b[key]); - if (!sharedValue.valid) { - return { valid: false }; - } - newObj[key] = sharedValue.data; - } - return { valid: true, data: newObj }; - } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { - if (a.length !== b.length) { - return { valid: false }; - } - const newArray = []; - for (let index = 0; index < a.length; index++) { - const itemA = a[index]; - const itemB = b[index]; - const sharedValue = mergeValues(itemA, itemB); - if (!sharedValue.valid) { - return { valid: false }; - } - newArray.push(sharedValue.data); - } - return { valid: true, data: newArray }; - } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) { - return { valid: true, data: a }; - } else { - return { valid: false }; - } } -var ZodIntersection = class extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const handleParsed = (parsedLeft, parsedRight) => { - if (isAborted(parsedLeft) || isAborted(parsedRight)) { - return INVALID; - } - const merged = mergeValues(parsedLeft.value, parsedRight.value); - if (!merged.valid) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_intersection_types - }); - return INVALID; - } - if (isDirty(parsedLeft) || isDirty(parsedRight)) { - status.dirty(); - } - return { status: status.value, value: merged.data }; - }; - if (ctx.common.async) { - return Promise.all([ - this._def.left._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), - this._def.right._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }) - ]).then(([left, right]) => handleParsed(left, right)); - } else { - return handleParsed(this._def.left._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), this._def.right._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - })); - } - } -}; -ZodIntersection.create = (left, right, params) => { - return new ZodIntersection({ - left, - right, - typeName: ZodFirstPartyTypeKind.ZodIntersection, - ...processCreateParams(params) +function _cuid(Class2, params) { + return new Class2({ + type: "string", + format: "cuid", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var ZodTuple = class _ZodTuple extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }); - return INVALID; - } - if (ctx.data.length < this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - return INVALID; - } - const rest = this._def.rest; - if (!rest && ctx.data.length > this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - status.dirty(); - } - const items = [...ctx.data].map((item, itemIndex) => { - const schema = this._def.items[itemIndex] || this._def.rest; - if (!schema) - return null; - return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); - }).filter((x) => !!x); - if (ctx.common.async) { - return Promise.all(items).then((results) => { - return ParseStatus.mergeArray(status, results); - }); - } else { - return ParseStatus.mergeArray(status, items); - } - } - get items() { - return this._def.items; - } - rest(rest) { - return new _ZodTuple({ - ...this._def, - rest - }); - } -}; -ZodTuple.create = (schemas, params) => { - if (!Array.isArray(schemas)) { - throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); - } - return new ZodTuple({ - items: schemas, - typeName: ZodFirstPartyTypeKind.ZodTuple, - rest: null, - ...processCreateParams(params) +} +function _cuid2(Class2, params) { + return new Class2({ + type: "string", + format: "cuid2", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var ZodRecord = class _ZodRecord extends ZodType { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }); - return INVALID; - } - const pairs = []; - const keyType = this._def.keyType; - const valueType = this._def.valueType; - for (const key in ctx.data) { - pairs.push({ - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), - value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (ctx.common.async) { - return ParseStatus.mergeObjectAsync(status, pairs); - } else { - return ParseStatus.mergeObjectSync(status, pairs); - } - } - get element() { - return this._def.valueType; - } - static create(first, second, third) { - if (second instanceof ZodType) { - return new _ZodRecord({ - keyType: first, - valueType: second, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(third) - }); - } - return new _ZodRecord({ - keyType: ZodString.create(), - valueType: first, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(second) - }); - } -}; -var ZodMap = class extends ZodType { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.map) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.map, - received: ctx.parsedType - }); - return INVALID; - } - const keyType = this._def.keyType; - const valueType = this._def.valueType; - const pairs = [...ctx.data.entries()].map(([key, value], index) => { - return { - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])), - value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])) - }; - }); - if (ctx.common.async) { - const finalMap = /* @__PURE__ */ new Map(); - return Promise.resolve().then(async () => { - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - if (key.status === "aborted" || value.status === "aborted") { - return INVALID; - } - if (key.status === "dirty" || value.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value.value); - } - return { status: status.value, value: finalMap }; - }); - } else { - const finalMap = /* @__PURE__ */ new Map(); - for (const pair of pairs) { - const key = pair.key; - const value = pair.value; - if (key.status === "aborted" || value.status === "aborted") { - return INVALID; - } - if (key.status === "dirty" || value.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value.value); - } - return { status: status.value, value: finalMap }; - } - } -}; -ZodMap.create = (keyType, valueType, params) => { - return new ZodMap({ - valueType, - keyType, - typeName: ZodFirstPartyTypeKind.ZodMap, - ...processCreateParams(params) +} +function _ulid(Class2, params) { + return new Class2({ + type: "string", + format: "ulid", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var ZodSet = class _ZodSet extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.set) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.set, - received: ctx.parsedType - }); - return INVALID; - } - const def = this._def; - if (def.minSize !== null) { - if (ctx.data.size < def.minSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.minSize.message - }); - status.dirty(); - } - } - if (def.maxSize !== null) { - if (ctx.data.size > def.maxSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.maxSize.message - }); - status.dirty(); - } - } - const valueType = this._def.valueType; - function finalizeSet(elements2) { - const parsedSet = /* @__PURE__ */ new Set(); - for (const element of elements2) { - if (element.status === "aborted") - return INVALID; - if (element.status === "dirty") - status.dirty(); - parsedSet.add(element.value); - } - return { status: status.value, value: parsedSet }; - } - const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); - if (ctx.common.async) { - return Promise.all(elements).then((elements2) => finalizeSet(elements2)); - } else { - return finalizeSet(elements); - } - } - min(minSize, message) { - return new _ZodSet({ - ...this._def, - minSize: { value: minSize, message: errorUtil.toString(message) } - }); - } - max(maxSize, message) { - return new _ZodSet({ - ...this._def, - maxSize: { value: maxSize, message: errorUtil.toString(message) } - }); - } - size(size, message) { - return this.min(size, message).max(size, message); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodSet.create = (valueType, params) => { - return new ZodSet({ - valueType, - minSize: null, - maxSize: null, - typeName: ZodFirstPartyTypeKind.ZodSet, - ...processCreateParams(params) +} +function _xid(Class2, params) { + return new Class2({ + type: "string", + format: "xid", + check: "string_format", + abort: false, + ...normalizeParams(params) }); -}; -var ZodFunction = class _ZodFunction extends ZodType { - constructor() { - super(...arguments); - this.validate = this.implement; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.function) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.function, - received: ctx.parsedType - }); - return INVALID; - } - function makeArgsIssue(args, error2) { - return makeIssue({ - data: args, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x), - issueData: { - code: ZodIssueCode.invalid_arguments, - argumentsError: error2 - } - }); - } - function makeReturnsIssue(returns, error2) { - return makeIssue({ - data: returns, - path: ctx.path, - errorMaps: [ctx.common.contextualErrorMap, ctx.schemaErrorMap, getErrorMap(), en_default].filter((x) => !!x), - issueData: { - code: ZodIssueCode.invalid_return_type, - returnTypeError: error2 - } - }); - } - const params = { errorMap: ctx.common.contextualErrorMap }; - const fn = ctx.data; - if (this._def.returns instanceof ZodPromise) { - const me = this; - return OK(async function(...args) { - const error2 = new ZodError([]); - const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => { - error2.addIssue(makeArgsIssue(args, e)); - throw error2; - }); - const result = await Reflect.apply(fn, this, parsedArgs); - const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => { - error2.addIssue(makeReturnsIssue(result, e)); - throw error2; - }); - return parsedReturns; - }); - } else { - const me = this; - return OK(function(...args) { - const parsedArgs = me._def.args.safeParse(args, params); - if (!parsedArgs.success) { - throw new ZodError([makeArgsIssue(args, parsedArgs.error)]); - } - const result = Reflect.apply(fn, this, parsedArgs.data); - const parsedReturns = me._def.returns.safeParse(result, params); - if (!parsedReturns.success) { - throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]); - } - return parsedReturns.data; - }); - } - } - parameters() { - return this._def.args; - } - returnType() { - return this._def.returns; - } - args(...items) { - return new _ZodFunction({ - ...this._def, - args: ZodTuple.create(items).rest(ZodUnknown.create()) - }); - } - returns(returnType) { - return new _ZodFunction({ - ...this._def, - returns: returnType - }); - } - implement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - strictImplement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - static create(args, returns, params) { - return new _ZodFunction({ - args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()), - returns: returns || ZodUnknown.create(), - typeName: ZodFirstPartyTypeKind.ZodFunction, - ...processCreateParams(params) - }); - } -}; -var ZodLazy = class extends ZodType { - get schema() { - return this._def.getter(); - } - _parse(input) { - const { ctx } = this._processInputParams(input); - const lazySchema = this._def.getter(); - return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); - } -}; -ZodLazy.create = (getter, params) => { - return new ZodLazy({ - getter, - typeName: ZodFirstPartyTypeKind.ZodLazy, - ...processCreateParams(params) +} +function _ksuid(Class2, params) { + return new Class2({ + type: "string", + format: "ksuid", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ipv4(Class2, params) { + return new Class2({ + type: "string", + format: "ipv4", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _ipv6(Class2, params) { + return new Class2({ + type: "string", + format: "ipv6", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cidrv4(Class2, params) { + return new Class2({ + type: "string", + format: "cidrv4", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _cidrv6(Class2, params) { + return new Class2({ + type: "string", + format: "cidrv6", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _base64(Class2, params) { + return new Class2({ + type: "string", + format: "base64", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _base64url(Class2, params) { + return new Class2({ + type: "string", + format: "base64url", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _e164(Class2, params) { + return new Class2({ + type: "string", + format: "e164", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _jwt(Class2, params) { + return new Class2({ + type: "string", + format: "jwt", + check: "string_format", + abort: false, + ...normalizeParams(params) + }); +} +function _isoDateTime(Class2, params) { + return new Class2({ + type: "string", + format: "datetime", + check: "string_format", + offset: false, + local: false, + precision: null, + ...normalizeParams(params) + }); +} +function _isoDate(Class2, params) { + return new Class2({ + type: "string", + format: "date", + check: "string_format", + ...normalizeParams(params) + }); +} +function _isoTime(Class2, params) { + return new Class2({ + type: "string", + format: "time", + check: "string_format", + precision: null, + ...normalizeParams(params) + }); +} +function _isoDuration(Class2, params) { + return new Class2({ + type: "string", + format: "duration", + check: "string_format", + ...normalizeParams(params) + }); +} +function _boolean(Class2, params) { + return new Class2({ + type: "boolean", + ...normalizeParams(params) + }); +} +function _maxLength(maximum, params) { + const ch = new $ZodCheckMaxLength({ + check: "max_length", + ...normalizeParams(params), + maximum + }); + return ch; +} +function _minLength(minimum, params) { + return new $ZodCheckMinLength({ + check: "min_length", + ...normalizeParams(params), + minimum + }); +} +function _length(length, params) { + return new $ZodCheckLengthEquals({ + check: "length_equals", + ...normalizeParams(params), + length + }); +} +function _regex(pattern, params) { + return new $ZodCheckRegex({ + check: "string_format", + format: "regex", + ...normalizeParams(params), + pattern + }); +} +function _lowercase(params) { + return new $ZodCheckLowerCase({ + check: "string_format", + format: "lowercase", + ...normalizeParams(params) + }); +} +function _uppercase(params) { + return new $ZodCheckUpperCase({ + check: "string_format", + format: "uppercase", + ...normalizeParams(params) }); -}; -var ZodLiteral = class extends ZodType { - _parse(input) { - if (input.data !== this._def.value) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_literal, - expected: this._def.value - }); - return INVALID; - } - return { status: "valid", value: input.data }; - } - get value() { - return this._def.value; - } -}; -ZodLiteral.create = (value, params) => { - return new ZodLiteral({ - value, - typeName: ZodFirstPartyTypeKind.ZodLiteral, - ...processCreateParams(params) +} +function _includes(includes, params) { + return new $ZodCheckIncludes({ + check: "string_format", + format: "includes", + ...normalizeParams(params), + includes }); -}; -function createZodEnum(values, params) { - return new ZodEnum({ - values, - typeName: ZodFirstPartyTypeKind.ZodEnum, - ...processCreateParams(params) +} +function _startsWith(prefix, params) { + return new $ZodCheckStartsWith({ + check: "string_format", + format: "starts_with", + ...normalizeParams(params), + prefix }); } -var ZodEnum = class _ZodEnum extends ZodType { - _parse(input) { - if (typeof input.data !== "string") { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }); - return INVALID; - } - if (!this._cache) { - this._cache = new Set(this._def.values); - } - if (!this._cache.has(input.data)) { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }); - return INVALID; - } - return OK(input.data); - } - get options() { - return this._def.values; - } - get enum() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - get Values() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - get Enum() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - extract(values, newDef = this._def) { - return _ZodEnum.create(values, { - ...this._def, - ...newDef - }); - } - exclude(values, newDef = this._def) { - return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), { - ...this._def, - ...newDef - }); - } -}; -ZodEnum.create = createZodEnum; -var ZodNativeEnum = class extends ZodType { - _parse(input) { - const nativeEnumValues = util.getValidEnumValues(this._def.values); - const ctx = this._getOrReturnCtx(input); - if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) { - const expectedValues = util.objectValues(nativeEnumValues); - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }); - return INVALID; - } - if (!this._cache) { - this._cache = new Set(util.getValidEnumValues(this._def.values)); - } - if (!this._cache.has(input.data)) { - const expectedValues = util.objectValues(nativeEnumValues); - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }); - return INVALID; - } - return OK(input.data); - } - get enum() { - return this._def.values; - } -}; -ZodNativeEnum.create = (values, params) => { - return new ZodNativeEnum({ - values, - typeName: ZodFirstPartyTypeKind.ZodNativeEnum, - ...processCreateParams(params) +function _endsWith(suffix, params) { + return new $ZodCheckEndsWith({ + check: "string_format", + format: "ends_with", + ...normalizeParams(params), + suffix }); -}; -var ZodPromise = class extends ZodType { - unwrap() { - return this._def.type; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.promise, - received: ctx.parsedType - }); - return INVALID; - } - const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); - return OK(promisified.then((data) => { - return this._def.type.parseAsync(data, { - path: ctx.path, - errorMap: ctx.common.contextualErrorMap - }); - })); - } -}; -ZodPromise.create = (schema, params) => { - return new ZodPromise({ - type: schema, - typeName: ZodFirstPartyTypeKind.ZodPromise, - ...processCreateParams(params) +} +function _overwrite(tx) { + return new $ZodCheckOverwrite({ + check: "overwrite", + tx }); -}; -var ZodEffects = class extends ZodType { - innerType() { - return this._def.schema; - } - sourceType() { - return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const effect = this._def.effect || null; - const checkCtx = { - addIssue: (arg) => { - addIssueToContext(ctx, arg); - if (arg.fatal) { - status.abort(); - } else { - status.dirty(); - } - }, - get path() { - return ctx.path; - } - }; - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); - if (effect.type === "preprocess") { - const processed = effect.transform(ctx.data, checkCtx); - if (ctx.common.async) { - return Promise.resolve(processed).then(async (processed2) => { - if (status.value === "aborted") - return INVALID; - const result = await this._def.schema._parseAsync({ - data: processed2, - path: ctx.path, - parent: ctx - }); - if (result.status === "aborted") - return INVALID; - if (result.status === "dirty") - return DIRTY(result.value); - if (status.value === "dirty") - return DIRTY(result.value); - return result; - }); +} +function _normalize(form) { + return _overwrite((input) => input.normalize(form)); +} +function _trim() { + return _overwrite((input) => input.trim()); +} +function _toLowerCase() { + return _overwrite((input) => input.toLowerCase()); +} +function _toUpperCase() { + return _overwrite((input) => input.toUpperCase()); +} +function _array(Class2, element, params) { + return new Class2({ + type: "array", + element, + // get element() { + // return element; + // }, + ...normalizeParams(params) + }); +} +function _refine(Class2, fn, _params) { + const schema = new Class2({ + type: "custom", + check: "custom", + fn, + ...normalizeParams(_params) + }); + return schema; +} +function _superRefine(fn) { + const ch = _check((payload) => { + payload.addIssue = (issue2) => { + if (typeof issue2 === "string") { + payload.issues.push(issue(issue2, payload.value, ch._zod.def)); } else { - if (status.value === "aborted") - return INVALID; - const result = this._def.schema._parseSync({ - data: processed, - path: ctx.path, - parent: ctx - }); - if (result.status === "aborted") - return INVALID; - if (result.status === "dirty") - return DIRTY(result.value); - if (status.value === "dirty") - return DIRTY(result.value); - return result; + const _issue = issue2; + if (_issue.fatal) + _issue.continue = false; + _issue.code ?? (_issue.code = "custom"); + _issue.input ?? (_issue.input = payload.value); + _issue.inst ?? (_issue.inst = ch); + _issue.continue ?? (_issue.continue = !ch._zod.def.abort); + payload.issues.push(issue(_issue)); } + }; + return fn(payload.value, payload); + }); + return ch; +} +function _check(fn, params) { + const ch = new $ZodCheck({ + check: "custom", + ...normalizeParams(params) + }); + ch._zod.check = fn; + return ch; +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/classic/iso.js +var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => { + $ZodISODateTime.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function datetime2(params) { + return _isoDateTime(ZodISODateTime, params); +} +var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => { + $ZodISODate.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function date2(params) { + return _isoDate(ZodISODate, params); +} +var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => { + $ZodISOTime.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function time2(params) { + return _isoTime(ZodISOTime, params); +} +var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => { + $ZodISODuration.init(inst, def); + ZodStringFormat.init(inst, def); +}); +function duration2(params) { + return _isoDuration(ZodISODuration, params); +} + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/classic/errors.js +var initializer2 = (inst, issues) => { + $ZodError.init(inst, issues); + inst.name = "ZodError"; + Object.defineProperties(inst, { + format: { + value: (mapper) => formatError(inst, mapper) + // enumerable: false, + }, + flatten: { + value: (mapper) => flattenError(inst, mapper) + // enumerable: false, + }, + addIssue: { + value: (issue2) => { + inst.issues.push(issue2); + inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); + } + // enumerable: false, + }, + addIssues: { + value: (issues2) => { + inst.issues.push(...issues2); + inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2); + } + // enumerable: false, + }, + isEmpty: { + get() { + return inst.issues.length === 0; + } + // enumerable: false, } - if (effect.type === "refinement") { - const executeRefinement = (acc) => { - const result = effect.refinement(acc, checkCtx); - if (ctx.common.async) { - return Promise.resolve(result); - } - if (result instanceof Promise) { - throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); - } - return acc; - }; - if (ctx.common.async === false) { - const inner = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inner.status === "aborted") - return INVALID; - if (inner.status === "dirty") - status.dirty(); - executeRefinement(inner.value); - return { status: status.value, value: inner.value }; - } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => { - if (inner.status === "aborted") - return INVALID; - if (inner.status === "dirty") - status.dirty(); - return executeRefinement(inner.value).then(() => { - return { status: status.value, value: inner.value }; - }); - }); + }); +}; +var ZodError = $constructor("ZodError", initializer2); +var ZodRealError = $constructor("ZodError", initializer2, { + Parent: Error +}); + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/classic/parse.js +var parse = /* @__PURE__ */ _parse(ZodRealError); +var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError); +var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError); +var safeParseAsync2 = /* @__PURE__ */ _safeParseAsync(ZodRealError); + +// node_modules/.pnpm/zod@4.0.14/node_modules/zod/v4/classic/schemas.js +var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => { + $ZodType.init(inst, def); + inst.def = def; + Object.defineProperty(inst, "_def", { value: def }); + inst.check = (...checks) => { + return inst.clone( + { + ...def, + checks: [ + ...def.checks ?? [], + ...checks.map((ch) => typeof ch === "function" ? { _zod: { check: ch, def: { check: "custom" }, onattach: [] } } : ch) + ] } + // { parent: true } + ); + }; + inst.clone = (def2, params) => clone(inst, def2, params); + inst.brand = () => inst; + inst.register = (reg, meta) => { + reg.add(inst, meta); + return inst; + }; + inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse }); + inst.safeParse = (data, params) => safeParse2(inst, data, params); + inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync }); + inst.safeParseAsync = async (data, params) => safeParseAsync2(inst, data, params); + inst.spa = inst.safeParseAsync; + inst.refine = (check, params) => inst.check(refine(check, params)); + inst.superRefine = (refinement) => inst.check(superRefine(refinement)); + inst.overwrite = (fn) => inst.check(_overwrite(fn)); + inst.optional = () => optional(inst); + inst.nullable = () => nullable(inst); + inst.nullish = () => optional(nullable(inst)); + inst.nonoptional = (params) => nonoptional(inst, params); + inst.array = () => array(inst); + inst.or = (arg) => union([inst, arg]); + inst.and = (arg) => intersection(inst, arg); + inst.transform = (tx) => pipe(inst, transform(tx)); + inst.default = (def2) => _default(inst, def2); + inst.prefault = (def2) => prefault(inst, def2); + inst.catch = (params) => _catch(inst, params); + inst.pipe = (target) => pipe(inst, target); + inst.readonly = () => readonly(inst); + inst.describe = (description) => { + const cl = inst.clone(); + globalRegistry.add(cl, { description }); + return cl; + }; + Object.defineProperty(inst, "description", { + get() { + return globalRegistry.get(inst)?.description; + }, + configurable: true + }); + inst.meta = (...args) => { + if (args.length === 0) { + return globalRegistry.get(inst); } - if (effect.type === "transform") { - if (ctx.common.async === false) { - const base = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (!isValid(base)) - return INVALID; - const result = effect.transform(base.value, checkCtx); - if (result instanceof Promise) { - throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); - } - return { status: status.value, value: result }; - } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => { - if (!isValid(base)) - return INVALID; - return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ - status: status.value, - value: result - })); - }); + const cl = inst.clone(); + globalRegistry.add(cl, args[0]); + return cl; + }; + inst.isOptional = () => inst.safeParse(void 0).success; + inst.isNullable = () => inst.safeParse(null).success; + return inst; +}); +var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => { + $ZodString.init(inst, def); + ZodType.init(inst, def); + const bag = inst._zod.bag; + inst.format = bag.format ?? null; + inst.minLength = bag.minimum ?? null; + inst.maxLength = bag.maximum ?? null; + inst.regex = (...args) => inst.check(_regex(...args)); + inst.includes = (...args) => inst.check(_includes(...args)); + inst.startsWith = (...args) => inst.check(_startsWith(...args)); + inst.endsWith = (...args) => inst.check(_endsWith(...args)); + inst.min = (...args) => inst.check(_minLength(...args)); + inst.max = (...args) => inst.check(_maxLength(...args)); + inst.length = (...args) => inst.check(_length(...args)); + inst.nonempty = (...args) => inst.check(_minLength(1, ...args)); + inst.lowercase = (params) => inst.check(_lowercase(params)); + inst.uppercase = (params) => inst.check(_uppercase(params)); + inst.trim = () => inst.check(_trim()); + inst.normalize = (...args) => inst.check(_normalize(...args)); + inst.toLowerCase = () => inst.check(_toLowerCase()); + inst.toUpperCase = () => inst.check(_toUpperCase()); +}); +var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => { + $ZodString.init(inst, def); + _ZodString.init(inst, def); + inst.email = (params) => inst.check(_email(ZodEmail, params)); + inst.url = (params) => inst.check(_url(ZodURL, params)); + inst.jwt = (params) => inst.check(_jwt(ZodJWT, params)); + inst.emoji = (params) => inst.check(_emoji2(ZodEmoji, params)); + inst.guid = (params) => inst.check(_guid(ZodGUID, params)); + inst.uuid = (params) => inst.check(_uuid(ZodUUID, params)); + inst.uuidv4 = (params) => inst.check(_uuidv4(ZodUUID, params)); + inst.uuidv6 = (params) => inst.check(_uuidv6(ZodUUID, params)); + inst.uuidv7 = (params) => inst.check(_uuidv7(ZodUUID, params)); + inst.nanoid = (params) => inst.check(_nanoid(ZodNanoID, params)); + inst.guid = (params) => inst.check(_guid(ZodGUID, params)); + inst.cuid = (params) => inst.check(_cuid(ZodCUID, params)); + inst.cuid2 = (params) => inst.check(_cuid2(ZodCUID2, params)); + inst.ulid = (params) => inst.check(_ulid(ZodULID, params)); + inst.base64 = (params) => inst.check(_base64(ZodBase64, params)); + inst.base64url = (params) => inst.check(_base64url(ZodBase64URL, params)); + inst.xid = (params) => inst.check(_xid(ZodXID, params)); + inst.ksuid = (params) => inst.check(_ksuid(ZodKSUID, params)); + inst.ipv4 = (params) => inst.check(_ipv4(ZodIPv4, params)); + inst.ipv6 = (params) => inst.check(_ipv6(ZodIPv6, params)); + inst.cidrv4 = (params) => inst.check(_cidrv4(ZodCIDRv4, params)); + inst.cidrv6 = (params) => inst.check(_cidrv6(ZodCIDRv6, params)); + inst.e164 = (params) => inst.check(_e164(ZodE164, params)); + inst.datetime = (params) => inst.check(datetime2(params)); + inst.date = (params) => inst.check(date2(params)); + inst.time = (params) => inst.check(time2(params)); + inst.duration = (params) => inst.check(duration2(params)); +}); +function string2(params) { + return _string(ZodString, params); +} +var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => { + $ZodStringFormat.init(inst, def); + _ZodString.init(inst, def); +}); +var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => { + $ZodEmail.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => { + $ZodGUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => { + $ZodUUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => { + $ZodURL.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => { + $ZodEmoji.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => { + $ZodNanoID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => { + $ZodCUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => { + $ZodCUID2.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => { + $ZodULID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => { + $ZodXID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => { + $ZodKSUID.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => { + $ZodIPv4.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => { + $ZodIPv6.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => { + $ZodCIDRv4.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => { + $ZodCIDRv6.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => { + $ZodBase64.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => { + $ZodBase64URL.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => { + $ZodE164.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => { + $ZodJWT.init(inst, def); + ZodStringFormat.init(inst, def); +}); +var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => { + $ZodBoolean.init(inst, def); + ZodType.init(inst, def); +}); +function boolean2(params) { + return _boolean(ZodBoolean, params); +} +var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => { + $ZodArray.init(inst, def); + ZodType.init(inst, def); + inst.element = def.element; + inst.min = (minLength, params) => inst.check(_minLength(minLength, params)); + inst.nonempty = (params) => inst.check(_minLength(1, params)); + inst.max = (maxLength, params) => inst.check(_maxLength(maxLength, params)); + inst.length = (len, params) => inst.check(_length(len, params)); + inst.unwrap = () => inst.element; +}); +function array(element, params) { + return _array(ZodArray, element, params); +} +var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => { + $ZodUnion.init(inst, def); + ZodType.init(inst, def); + inst.options = def.options; +}); +function union(options2, params) { + return new ZodUnion({ + type: "union", + options: options2, + ...util_exports.normalizeParams(params) + }); +} +var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => { + $ZodIntersection.init(inst, def); + ZodType.init(inst, def); +}); +function intersection(left, right) { + return new ZodIntersection({ + type: "intersection", + left, + right + }); +} +var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => { + $ZodRecord.init(inst, def); + ZodType.init(inst, def); + inst.keyType = def.keyType; + inst.valueType = def.valueType; +}); +function record(keyType, valueType, params) { + return new ZodRecord({ + type: "record", + keyType, + valueType, + ...util_exports.normalizeParams(params) + }); +} +var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => { + $ZodEnum.init(inst, def); + ZodType.init(inst, def); + inst.enum = def.entries; + inst.options = Object.values(def.entries); + const keys = new Set(Object.keys(def.entries)); + inst.extract = (values, params) => { + const newEntries = {}; + for (const value of values) { + if (keys.has(value)) { + newEntries[value] = def.entries[value]; + } else + throw new Error(`Key ${value} not found in enum`); + } + return new ZodEnum({ + ...def, + checks: [], + ...util_exports.normalizeParams(params), + entries: newEntries + }); + }; + inst.exclude = (values, params) => { + const newEntries = { ...def.entries }; + for (const value of values) { + if (keys.has(value)) { + delete newEntries[value]; + } else + throw new Error(`Key ${value} not found in enum`); + } + return new ZodEnum({ + ...def, + checks: [], + ...util_exports.normalizeParams(params), + entries: newEntries + }); + }; +}); +function _enum(values, params) { + const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values; + return new ZodEnum({ + type: "enum", + entries, + ...util_exports.normalizeParams(params) + }); +} +var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => { + $ZodLiteral.init(inst, def); + ZodType.init(inst, def); + inst.values = new Set(def.values); + Object.defineProperty(inst, "value", { + get() { + if (def.values.length > 1) { + throw new Error("This schema contains multiple valid literal values. Use `.values` instead."); } + return def.values[0]; } - util.assertNever(effect); - } -}; -ZodEffects.create = (schema, effect, params) => { - return new ZodEffects({ - schema, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect, - ...processCreateParams(params) }); -}; -ZodEffects.createWithPreprocess = (preprocess, schema, params) => { - return new ZodEffects({ - schema, - effect: { type: "preprocess", transform: preprocess }, - typeName: ZodFirstPartyTypeKind.ZodEffects, - ...processCreateParams(params) +}); +function literal(value, params) { + return new ZodLiteral({ + type: "literal", + values: Array.isArray(value) ? value : [value], + ...util_exports.normalizeParams(params) }); -}; -var ZodOptional = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType === ZodParsedType.undefined) { - return OK(void 0); +} +var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => { + $ZodTransform.init(inst, def); + ZodType.init(inst, def); + inst._zod.parse = (payload, _ctx) => { + payload.addIssue = (issue2) => { + if (typeof issue2 === "string") { + payload.issues.push(util_exports.issue(issue2, payload.value, def)); + } else { + const _issue = issue2; + if (_issue.fatal) + _issue.continue = false; + _issue.code ?? (_issue.code = "custom"); + _issue.input ?? (_issue.input = payload.value); + _issue.inst ?? (_issue.inst = inst); + payload.issues.push(util_exports.issue(_issue)); + } + }; + const output = def.transform(payload.value, payload); + if (output instanceof Promise) { + return output.then((output2) => { + payload.value = output2; + return payload; + }); } - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodOptional.create = (type, params) => { + payload.value = output; + return payload; + }; +}); +function transform(fn) { + return new ZodTransform({ + type: "transform", + transform: fn + }); +} +var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => { + $ZodOptional.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function optional(innerType) { return new ZodOptional({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodOptional, - ...processCreateParams(params) + type: "optional", + innerType }); -}; -var ZodNullable = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType === ZodParsedType.null) { - return OK(null); - } - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodNullable.create = (type, params) => { +} +var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => { + $ZodNullable.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function nullable(innerType) { return new ZodNullable({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodNullable, - ...processCreateParams(params) + type: "nullable", + innerType }); -}; -var ZodDefault = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - let data = ctx.data; - if (ctx.parsedType === ZodParsedType.undefined) { - data = this._def.defaultValue(); - } - return this._def.innerType._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - removeDefault() { - return this._def.innerType; - } -}; -ZodDefault.create = (type, params) => { +} +var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => { + $ZodDefault.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; + inst.removeDefault = inst.unwrap; +}); +function _default(innerType, defaultValue) { return new ZodDefault({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodDefault, - defaultValue: typeof params.default === "function" ? params.default : () => params.default, - ...processCreateParams(params) + type: "default", + innerType, + get defaultValue() { + return typeof defaultValue === "function" ? defaultValue() : defaultValue; + } }); -}; -var ZodCatch = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const newCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - } - }; - const result = this._def.innerType._parse({ - data: newCtx.data, - path: newCtx.path, - parent: { - ...newCtx - } - }); - if (isAsync(result)) { - return result.then((result2) => { - return { - status: "valid", - value: result2.status === "valid" ? result2.value : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - }); - } else { - return { - status: "valid", - value: result.status === "valid" ? result.value : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues); - }, - input: newCtx.data - }) - }; +} +var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => { + $ZodPrefault.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function prefault(innerType, defaultValue) { + return new ZodPrefault({ + type: "prefault", + innerType, + get defaultValue() { + return typeof defaultValue === "function" ? defaultValue() : defaultValue; } - } - removeCatch() { - return this._def.innerType; - } -}; -ZodCatch.create = (type, params) => { + }); +} +var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => { + $ZodNonOptional.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function nonoptional(innerType, params) { + return new ZodNonOptional({ + type: "nonoptional", + innerType, + ...util_exports.normalizeParams(params) + }); +} +var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => { + $ZodCatch.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; + inst.removeCatch = inst.unwrap; +}); +function _catch(innerType, catchValue) { return new ZodCatch({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodCatch, - catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, - ...processCreateParams(params) + type: "catch", + innerType, + catchValue: typeof catchValue === "function" ? catchValue : () => catchValue }); -}; -var ZodNaN = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.nan) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.nan, - received: ctx.parsedType - }); - return INVALID; - } - return { status: "valid", value: input.data }; - } -}; -ZodNaN.create = (params) => { - return new ZodNaN({ - typeName: ZodFirstPartyTypeKind.ZodNaN, - ...processCreateParams(params) +} +var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => { + $ZodPipe.init(inst, def); + ZodType.init(inst, def); + inst.in = def.in; + inst.out = def.out; +}); +function pipe(in_, out) { + return new ZodPipe({ + type: "pipe", + in: in_, + out + // ...util.normalizeParams(params), }); -}; -var BRAND = Symbol("zod_brand"); -var ZodBranded = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const data = ctx.data; - return this._def.type._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - unwrap() { - return this._def.type; - } -}; -var ZodPipeline = class _ZodPipeline extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.common.async) { - const handleAsync = async () => { - const inResult = await this._def.in._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID; - if (inResult.status === "dirty") { - status.dirty(); - return DIRTY(inResult.value); - } else { - return this._def.out._parseAsync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - }; - return handleAsync(); - } else { - const inResult = this._def.in._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID; - if (inResult.status === "dirty") { - status.dirty(); - return { - status: "dirty", - value: inResult.value - }; - } else { - return this._def.out._parseSync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - } - } - static create(a, b) { - return new _ZodPipeline({ - in: a, - out: b, - typeName: ZodFirstPartyTypeKind.ZodPipeline - }); - } -}; -var ZodReadonly = class extends ZodType { - _parse(input) { - const result = this._def.innerType._parse(input); - const freeze = (data) => { - if (isValid(data)) { - data.value = Object.freeze(data.value); - } - return data; - }; - return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result); - } - unwrap() { - return this._def.innerType; - } -}; -ZodReadonly.create = (type, params) => { +} +var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => { + $ZodReadonly.init(inst, def); + ZodType.init(inst, def); + inst.unwrap = () => inst._zod.def.innerType; +}); +function readonly(innerType) { return new ZodReadonly({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodReadonly, - ...processCreateParams(params) + type: "readonly", + innerType }); -}; -var late = { - object: ZodObject.lazycreate -}; -var ZodFirstPartyTypeKind; -(function(ZodFirstPartyTypeKind2) { - ZodFirstPartyTypeKind2["ZodString"] = "ZodString"; - ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber"; - ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN"; - ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt"; - ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean"; - ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate"; - ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol"; - ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined"; - ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull"; - ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny"; - ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown"; - ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever"; - ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid"; - ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray"; - ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject"; - ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion"; - ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; - ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection"; - ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple"; - ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord"; - ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap"; - ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet"; - ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction"; - ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy"; - ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral"; - ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum"; - ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects"; - ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum"; - ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional"; - ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable"; - ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault"; - ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch"; - ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise"; - ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded"; - ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline"; - ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly"; -})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); -var stringType = ZodString.create; -var numberType = ZodNumber.create; -var nanType = ZodNaN.create; -var bigIntType = ZodBigInt.create; -var booleanType = ZodBoolean.create; -var dateType = ZodDate.create; -var symbolType = ZodSymbol.create; -var undefinedType = ZodUndefined.create; -var nullType = ZodNull.create; -var anyType = ZodAny.create; -var unknownType = ZodUnknown.create; -var neverType = ZodNever.create; -var voidType = ZodVoid.create; -var arrayType = ZodArray.create; -var objectType = ZodObject.create; -var strictObjectType = ZodObject.strictCreate; -var unionType = ZodUnion.create; -var discriminatedUnionType = ZodDiscriminatedUnion.create; -var intersectionType = ZodIntersection.create; -var tupleType = ZodTuple.create; -var recordType = ZodRecord.create; -var mapType = ZodMap.create; -var setType = ZodSet.create; -var functionType = ZodFunction.create; -var lazyType = ZodLazy.create; -var literalType = ZodLiteral.create; -var enumType = ZodEnum.create; -var nativeEnumType = ZodNativeEnum.create; -var promiseType = ZodPromise.create; -var effectsType = ZodEffects.create; -var optionalType = ZodOptional.create; -var nullableType = ZodNullable.create; -var preprocessType = ZodEffects.createWithPreprocess; -var pipelineType = ZodPipeline.create; +} +var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => { + $ZodCustom.init(inst, def); + ZodType.init(inst, def); +}); +function refine(fn, _params = {}) { + return _refine(ZodCustom, fn, _params); +} +function superRefine(fn) { + return _superRefine(fn); +} // node_modules/.pnpm/untildify@5.0.0/node_modules/untildify/index.js var import_node_os = __toESM(require("os"), 1); @@ -29853,13 +28942,13 @@ function untildify(pathWithTilde) { return homeDirectory ? pathWithTilde.replace(/^~(?=$|\/|\\)/, homeDirectory) : pathWithTilde; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/error.js -function getLineColFromPtr(string, ptr) { - let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g); +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/error.js +function getLineColFromPtr(string3, ptr) { + let lines = string3.slice(0, ptr).split(/\r\n|\n|\r/g); return [lines.length, lines.pop().length + 1]; } -function makeCodeBlock(string, line, column) { - let lines = string.split(/\r\n|\n|\r/g); +function makeCodeBlock(string3, line, column) { + let lines = string3.split(/\r\n|\n|\r/g); let codeblock = ""; let numberLen = (Math.log10(line + 1) | 0) + 1; for (let i = line - 1; i <= line + 1; i++) { @@ -29893,7 +28982,7 @@ ${codeblock}`, options2); } }; -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/util.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/util.js function indexOfNewline(str, start = 0, end = str.length) { let idx = str.indexOf("\n", start); if (str[idx - 1] === "\r") @@ -29961,36 +29050,36 @@ function getStringEnd(str, seek) { return seek; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/date.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/date.js var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i; var _hasDate, _hasTime, _offset; var _TomlDate = class _TomlDate extends Date { - constructor(date) { + constructor(date3) { let hasDate = true; let hasTime = true; let offset = "Z"; - if (typeof date === "string") { - let match = date.match(DATE_TIME_RE); + if (typeof date3 === "string") { + let match = date3.match(DATE_TIME_RE); if (match) { if (!match[1]) { hasDate = false; - date = `0000-01-01T${date}`; + date3 = `0000-01-01T${date3}`; } hasTime = !!match[2]; - hasTime && date[10] === " " && (date = date.replace(" ", "T")); + hasTime && date3[10] === " " && (date3 = date3.replace(" ", "T")); if (match[2] && +match[2] > 23) { - date = ""; + date3 = ""; } else { offset = match[3] || null; - date = date.toUpperCase(); + date3 = date3.toUpperCase(); if (!offset && hasTime) - date += "Z"; + date3 += "Z"; } } else { - date = ""; + date3 = ""; } } - super(date); + super(date3); __privateAdd(this, _hasDate, false); __privateAdd(this, _hasTime, false); __privateAdd(this, _offset, null); @@ -30031,26 +29120,26 @@ var _TomlDate = class _TomlDate extends Date { return offsetDate.toISOString().slice(0, -1) + __privateGet(this, _offset); } static wrapAsOffsetDateTime(jsDate, offset = "Z") { - let date = new _TomlDate(jsDate); - __privateSet(date, _offset, offset); - return date; + let date3 = new _TomlDate(jsDate); + __privateSet(date3, _offset, offset); + return date3; } static wrapAsLocalDateTime(jsDate) { - let date = new _TomlDate(jsDate); - __privateSet(date, _offset, null); - return date; + let date3 = new _TomlDate(jsDate); + __privateSet(date3, _offset, null); + return date3; } static wrapAsLocalDate(jsDate) { - let date = new _TomlDate(jsDate); - __privateSet(date, _hasTime, false); - __privateSet(date, _offset, null); - return date; + let date3 = new _TomlDate(jsDate); + __privateSet(date3, _hasTime, false); + __privateSet(date3, _offset, null); + return date3; } static wrapAsLocalTime(jsDate) { - let date = new _TomlDate(jsDate); - __privateSet(date, _hasDate, false); - __privateSet(date, _offset, null); - return date; + let date3 = new _TomlDate(jsDate); + __privateSet(date3, _hasDate, false); + __privateSet(date3, _offset, null); + return date3; } }; _hasDate = new WeakMap(); @@ -30058,7 +29147,7 @@ _hasTime = new WeakMap(); _offset = new WeakMap(); var TomlDate = _TomlDate; -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/primitive.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/primitive.js var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; var LEADING_ZERO = /^[+-]?0[0-9_]/; @@ -30181,22 +29270,22 @@ function parseValue(value, toml, ptr, integersAsBigInt) { ptr }); } - if (isInt || integersAsBigInt) + if (isInt || integersAsBigInt === true) numeric = BigInt(value); } return numeric; } - const date = new TomlDate(value); - if (!date.isValid()) { + const date3 = new TomlDate(value); + if (!date3.isValid()) { throw new TomlError("invalid value", { toml, ptr }); } - return date; + return date3; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/extract.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/extract.js function sliceAndTrimEndOf(str, startPtr, endPtr, allowNewLines) { let value = str.slice(startPtr, endPtr); let commentIdx = value.indexOf("#"); @@ -30272,7 +29361,7 @@ function extractValue(str, ptr, end, depth, integersAsBigInt) { ]; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/struct.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/struct.js var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; function parseKey(str, ptr, end = "=") { let dot = ptr - 1; @@ -30428,7 +29517,7 @@ function parseArray(str, ptr, depth, integersAsBigInt) { return [res, ptr]; } -// node_modules/.pnpm/smol-toml@1.4.0/node_modules/smol-toml/dist/parse.js +// node_modules/.pnpm/smol-toml@1.4.1/node_modules/smol-toml/dist/parse.js function peekTable(key, table, meta, type) { let t = table; let m = meta; @@ -30488,7 +29577,7 @@ function peekTable(key, table, meta, type) { } return [k, t, state.c]; } -function parse(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { +function parse2(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { let res = {}; let meta = {}; let tbl = res; @@ -30569,7 +29658,7 @@ https://github.com/prefix-dev/pixi/releases/download/{{version}}/{{pixiFile}} // src/options.ts var pixiPath = "pixi.toml"; var pyprojectPath = "pyproject.toml"; -var logLevelSchema = enumType(["q", "default", "v", "vv", "vvv"]); +var logLevelSchema = _enum(["q", "default", "v", "vv", "vvv"]); var PATHS = { pixiBin: import_path.default.join(import_os.default.homedir(), ".pixi", "bin", `pixi${import_os.default.platform() === "win32" ? ".exe" : ""}`) }; @@ -30718,7 +29807,7 @@ var inferOptions = (inputs) => { } else if ((0, import_fs.existsSync)(pyprojectPath)) { try { const fileContent = (0, import_fs.readFileSync)(pyprojectPath, "utf-8"); - const parsedContent = parse(fileContent); + const parsedContent = parse2(fileContent); if (parsedContent.tool && typeof parsedContent.tool === "object" && "pixi" in parsedContent.tool) { core2.debug(`The tool.pixi table found, using ${pyprojectPath} as manifest file.`); manifestPath = pyprojectPath; @@ -30790,35 +29879,35 @@ var getOptions = () => { const inputs = { pixiVersion: parseOrUndefined( "pixi-version", - unionType([literalType("latest"), stringType().regex(/^v\d+\.\d+\.\d+$/)]), + union([literal("latest"), string2().regex(/^v\d+\.\d+\.\d+$/)]), "pixi-version must either be `latest` or a version string matching `vX.Y.Z`." ), - pixiUrl: parseOrUndefined("pixi-url", stringType()), - pixiUrlHeaders: parseOrUndefinedJSON("pixi-url-headers", recordType(stringType(), stringType())), + pixiUrl: parseOrUndefined("pixi-url", string2()), + pixiUrlHeaders: parseOrUndefinedJSON("pixi-url-headers", record(string2(), string2())), logLevel: parseOrUndefined( "log-level", logLevelSchema, "log-level must be one of `q`, `default`, `v`, `vv`, `vvv`." ), - manifestPath: parseOrUndefined("manifest-path", stringType()), - runInstall: parseOrUndefinedJSON("run-install", booleanType()), - environments: parseOrUndefinedList("environments", stringType()), - activateEnvironment: parseOrUndefined("activate-environment", stringType()), - locked: parseOrUndefinedJSON("locked", booleanType()), - frozen: parseOrUndefinedJSON("frozen", booleanType()), - cache: parseOrUndefinedJSON("cache", booleanType()), - cacheKey: parseOrUndefined("cache-key", stringType()), - cacheWrite: parseOrUndefinedJSON("cache-write", booleanType()), - pixiBinPath: parseOrUndefined("pixi-bin-path", stringType()), - authHost: parseOrUndefined("auth-host", stringType()), - authToken: parseOrUndefined("auth-token", stringType()), - authUsername: parseOrUndefined("auth-username", stringType()), - authPassword: parseOrUndefined("auth-password", stringType()), - authCondaToken: parseOrUndefined("auth-conda-token", stringType()), - authS3AccessKeyId: parseOrUndefined("auth-s3-access-key-id", stringType()), - authS3SecretAccessKey: parseOrUndefined("auth-s3-secret-access-key", stringType()), - authS3SessionToken: parseOrUndefined("auth-s3-session-token", stringType()), - postCleanup: parseOrUndefinedJSON("post-cleanup", booleanType()) + manifestPath: parseOrUndefined("manifest-path", string2()), + runInstall: parseOrUndefinedJSON("run-install", boolean2()), + environments: parseOrUndefinedList("environments", string2()), + activateEnvironment: parseOrUndefined("activate-environment", string2()), + locked: parseOrUndefinedJSON("locked", boolean2()), + frozen: parseOrUndefinedJSON("frozen", boolean2()), + cache: parseOrUndefinedJSON("cache", boolean2()), + cacheKey: parseOrUndefined("cache-key", string2()), + cacheWrite: parseOrUndefinedJSON("cache-write", boolean2()), + pixiBinPath: parseOrUndefined("pixi-bin-path", string2()), + authHost: parseOrUndefined("auth-host", string2()), + authToken: parseOrUndefined("auth-token", string2()), + authUsername: parseOrUndefined("auth-username", string2()), + authPassword: parseOrUndefined("auth-password", string2()), + authCondaToken: parseOrUndefined("auth-conda-token", string2()), + authS3AccessKeyId: parseOrUndefined("auth-s3-access-key-id", string2()), + authS3SecretAccessKey: parseOrUndefined("auth-s3-secret-access-key", string2()), + authS3SessionToken: parseOrUndefined("auth-s3-session-token", string2()), + postCleanup: parseOrUndefinedJSON("post-cleanup", boolean2()) }; core2.debug(`Inputs: ${JSON.stringify(inputs)}`); validateInputs(inputs); diff --git a/package.json b/package.json index 8013ba0..56dc7b3 100644 --- a/package.json +++ b/package.json @@ -28,19 +28,19 @@ "@actions/io": "^1.1.3", "@actions/tool-cache": "^2.0.2", "handlebars": "^4.7.8", - "smol-toml": "^1.4.0", + "smol-toml": "^1.4.1", "untildify": "^5.0.0", "which": "^5.0.0", - "zod": "^3.25.67" + "zod": "^4.0.14" }, "devDependencies": { - "@eslint/js": "^9.30.0", - "@types/node": "^24.0.8", + "@eslint/js": "^9.32.0", + "@types/node": "^24.1.0", "@types/which": "^3.0.4", - "eslint": "^9.30.0", + "eslint": "^9.32.0", "prettier": "^3.6.2", "tsup": "^8.4.0", - "typescript": "^5.8.2", - "typescript-eslint": "^8.35.1" + "typescript": "^5.9.2", + "typescript-eslint": "^8.38.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8a7d124..60afe06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,8 +27,8 @@ importers: specifier: ^4.7.8 version: 4.7.8 smol-toml: - specifier: ^1.4.0 - version: 1.4.0 + specifier: ^1.4.1 + version: 1.4.1 untildify: specifier: ^5.0.0 version: 5.0.0 @@ -36,33 +36,33 @@ importers: specifier: ^5.0.0 version: 5.0.0 zod: - specifier: ^3.25.67 - version: 3.25.67 + specifier: ^4.0.14 + version: 4.0.14 devDependencies: '@eslint/js': - specifier: ^9.30.0 - version: 9.30.0 + specifier: ^9.32.0 + version: 9.32.0 '@types/node': - specifier: ^24.0.8 - version: 24.0.8 + specifier: ^24.1.0 + version: 24.1.0 '@types/which': specifier: ^3.0.4 version: 3.0.4 eslint: - specifier: ^9.30.0 - version: 9.30.0 + specifier: ^9.32.0 + version: 9.32.0 prettier: specifier: ^3.6.2 version: 3.6.2 tsup: specifier: ^8.4.0 - version: 8.5.0(typescript@5.8.3) + version: 8.5.0(typescript@5.9.2) typescript: - specifier: ^5.8.2 - version: 5.8.3 + specifier: ^5.9.2 + version: 5.9.2 typescript-eslint: - specifier: ^8.35.1 - version: 8.35.1(eslint@9.30.0)(typescript@5.8.3) + specifier: ^8.38.0 + version: 8.38.0(eslint@9.32.0)(typescript@5.9.2) packages: @@ -310,10 +310,6 @@ packages: resolution: {integrity: sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.14.0': - resolution: {integrity: sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.15.1': resolution: {integrity: sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -322,16 +318,16 @@ packages: resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.30.0': - resolution: {integrity: sha512-Wzw3wQwPvc9sHM+NjakWTcPx11mbZyiYHuwWa/QfZ7cIRX7WK54PSk7bdyXDaoaopUcMatv1zaQvOAAO8hCdww==} + '@eslint/js@9.32.0': + resolution: {integrity: sha512-BBpRFZK3eX6uMLKz8WxFOBIFFcGFJ/g8XuwjTHCqHROSIsopI+ddn/d5Cfh36+7+e5edVS8dbSHnBNhrLEX0zg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.6': resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.3.3': - resolution: {integrity: sha512-1+WqvgNMhmlAambTvT3KPtCl/Ibr68VldY2XY40SL1CE0ZXiakFR/cbTspaF5HsnpDMvcYYoJHfl4980NBjGag==} + '@eslint/plugin-kit@0.3.4': + resolution: {integrity: sha512-Ul5l+lHEcw3L5+k8POx6r74mxEYKG5kOb6Xpy2gCRW6zweT6TEhAf8vhxGgjhqrd/VO/Dirhsb+1hNpD1ue9hw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@fastify/busboy@2.1.1': @@ -517,69 +513,69 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/node@24.0.8': - resolution: {integrity: sha512-WytNrFSgWO/esSH9NbpWUfTMGQwCGIKfCmNlmFDNiI5gGhgMmEA+V1AEvKLeBNvvtBnailJtkrEa2OIISwrVAA==} + '@types/node@24.1.0': + resolution: {integrity: sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==} '@types/which@3.0.4': resolution: {integrity: sha512-liyfuo/106JdlgSchJzXEQCVArk0CvevqPote8F8HgWgJ3dRCcTHgJIsLDuee0kxk/mhbInzIZk3QWSZJ8R+2w==} - '@typescript-eslint/eslint-plugin@8.35.1': - resolution: {integrity: sha512-9XNTlo7P7RJxbVeICaIIIEipqxLKguyh+3UbXuT2XQuFp6d8VOeDEGuz5IiX0dgZo8CiI6aOFLg4e8cF71SFVg==} + '@typescript-eslint/eslint-plugin@8.38.0': + resolution: {integrity: sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.35.1 + '@typescript-eslint/parser': ^8.38.0 eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/parser@8.35.1': - resolution: {integrity: sha512-3MyiDfrfLeK06bi/g9DqJxP5pV74LNv4rFTyvGDmT3x2p1yp1lOd+qYZfiRPIOf/oON+WRZR5wxxuF85qOar+w==} + '@typescript-eslint/parser@8.38.0': + resolution: {integrity: sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/project-service@8.35.1': - resolution: {integrity: sha512-VYxn/5LOpVxADAuP3NrnxxHYfzVtQzLKeldIhDhzC8UHaiQvYlXvKuVho1qLduFbJjjy5U5bkGwa3rUGUb1Q6Q==} + '@typescript-eslint/project-service@8.38.0': + resolution: {integrity: sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/scope-manager@8.35.1': - resolution: {integrity: sha512-s/Bpd4i7ht2934nG+UoSPlYXd08KYz3bmjLEb7Ye1UVob0d1ENiT3lY8bsCmik4RqfSbPw9xJJHbugpPpP5JUg==} + '@typescript-eslint/scope-manager@8.38.0': + resolution: {integrity: sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/tsconfig-utils@8.35.1': - resolution: {integrity: sha512-K5/U9VmT9dTHoNowWZpz+/TObS3xqC5h0xAIjXPw+MNcKV9qg6eSatEnmeAwkjHijhACH0/N7bkhKvbt1+DXWQ==} + '@typescript-eslint/tsconfig-utils@8.38.0': + resolution: {integrity: sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/type-utils@8.35.1': - resolution: {integrity: sha512-HOrUBlfVRz5W2LIKpXzZoy6VTZzMu2n8q9C2V/cFngIC5U1nStJgv0tMV4sZPzdf4wQm9/ToWUFPMN9Vq9VJQQ==} + '@typescript-eslint/type-utils@8.38.0': + resolution: {integrity: sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/types@8.35.1': - resolution: {integrity: sha512-q/O04vVnKHfrrhNAscndAn1tuQhIkwqnaW+eu5waD5IPts2eX1dgJxgqcPx5BX109/qAz7IG6VrEPTOYKCNfRQ==} + '@typescript-eslint/types@8.38.0': + resolution: {integrity: sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.35.1': - resolution: {integrity: sha512-Vvpuvj4tBxIka7cPs6Y1uvM7gJgdF5Uu9F+mBJBPY4MhvjrjWGK4H0lVgLJd/8PWZ23FTqsaJaLEkBCFUk8Y9g==} + '@typescript-eslint/typescript-estree@8.38.0': + resolution: {integrity: sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/utils@8.35.1': - resolution: {integrity: sha512-lhnwatFmOFcazAsUm3ZnZFpXSxiwoa1Lj50HphnDe1Et01NF4+hrdXONSUHIcbVu2eFb1bAf+5yjXkGVkXBKAQ==} + '@typescript-eslint/utils@8.38.0': + resolution: {integrity: sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 typescript: '>=4.8.4 <5.9.0' - '@typescript-eslint/visitor-keys@8.35.1': - resolution: {integrity: sha512-VRwixir4zBWCSTP/ljEo091lbpypz57PoeAQ9imjG+vbeof9LplljsL1mos4ccG6H9IjfrVGM359RozUnuFhpw==} + '@typescript-eslint/visitor-keys@8.38.0': + resolution: {integrity: sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} abort-controller@3.0.0: @@ -771,8 +767,8 @@ packages: resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.30.0: - resolution: {integrity: sha512-iN/SiPxmQu6EVkf+m1qpBxzUhE12YqFLOSySuOyVLJLEF9nzTf+h/1AJYc1JWzCnktggeNrjvQGLngDzXirU6g==} + eslint@9.32.0: + resolution: {integrity: sha512-LSehfdpgMeWcTZkWZVIJl+tkZ2nuSkyyB9C27MZqFWXuph7DvaowgcTvKqxvpLW1JZIk8PN7hFY3Rj9LQ7m7lg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -1227,8 +1223,8 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - smol-toml@1.4.0: - resolution: {integrity: sha512-IMxaDA/58wBvkvX77ykQ6e9r6fjs8xbxpz8bMCyVQ/fEFWbA5uJrnaVwDuhLrrANGdd7apRyTPDBvI893Bxu9g==} + smol-toml@1.4.1: + resolution: {integrity: sha512-CxdwHXyYTONGHThDbq5XdwbFsuY4wlClRGejfE2NtwUtiHYsP1QtNsHb/hnj31jKYSchztJsaA8pSQoVzkfCFg==} engines: {node: '>= 18'} source-map@0.6.1: @@ -1238,6 +1234,7 @@ packages: source-map@0.8.0-beta.0: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} + deprecated: The work that was done in this beta branch won't be included in future versions string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -1341,8 +1338,8 @@ packages: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} - typescript-eslint@8.35.1: - resolution: {integrity: sha512-xslJjFzhOmHYQzSB/QTeASAHbjmxOGEP6Coh93TXmUBFQoJ1VU35UHIDmG06Jd6taf3wqqC1ntBnCMeymy5Ovw==} + typescript-eslint@8.38.0: + resolution: {integrity: sha512-FsZlrYK6bPDGoLeZRuvx2v6qrM03I0U0SnfCLPs/XCCPCFD80xU9Pg09H/K+XFa68uJuZo7l/Xhs+eDRg2l3hg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -1353,8 +1350,8 @@ packages: engines: {node: '>=4.2.0'} hasBin: true - typescript@5.8.3: - resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==} + typescript@5.9.2: + resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} engines: {node: '>=14.17'} hasBin: true @@ -1433,8 +1430,8 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - zod@3.25.67: - resolution: {integrity: sha512-idA2YXwpCdqUSKRCACDE6ItZD9TZzy3OZMtpfLoh6oPR47lipysRrJfjzMqFxQ3uJuUPyUeWe1r9vLH33xO/Qw==} + zod@4.0.14: + resolution: {integrity: sha512-nGFJTnJN6cM2v9kXL+SOBq3AtjQby3Mv5ySGFof5UGRHrRioSJ5iG680cYNjE/yWk671nROcpPj4hAS8nyLhSw==} snapshots: @@ -1665,9 +1662,9 @@ snapshots: '@esbuild/win32-x64@0.25.0': optional: true - '@eslint-community/eslint-utils@4.7.0(eslint@9.30.0)': + '@eslint-community/eslint-utils@4.7.0(eslint@9.32.0)': dependencies: - eslint: 9.30.0 + eslint: 9.32.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.1': {} @@ -1682,10 +1679,6 @@ snapshots: '@eslint/config-helpers@0.3.0': {} - '@eslint/core@0.14.0': - dependencies: - '@types/json-schema': 7.0.15 - '@eslint/core@0.15.1': dependencies: '@types/json-schema': 7.0.15 @@ -1704,11 +1697,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.30.0': {} + '@eslint/js@9.32.0': {} '@eslint/object-schema@2.1.6': {} - '@eslint/plugin-kit@0.3.3': + '@eslint/plugin-kit@0.3.4': dependencies: '@eslint/core': 0.15.1 levn: 0.4.1 @@ -1853,102 +1846,103 @@ snapshots: '@types/json-schema@7.0.15': {} - '@types/node@24.0.8': + '@types/node@24.1.0': dependencies: undici-types: 7.8.0 '@types/which@3.0.4': {} - '@typescript-eslint/eslint-plugin@8.35.1(@typescript-eslint/parser@8.35.1(eslint@9.30.0)(typescript@5.8.3))(eslint@9.30.0)(typescript@5.8.3)': + '@typescript-eslint/eslint-plugin@8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.32.0)(typescript@5.9.2))(eslint@9.32.0)(typescript@5.9.2)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.35.1(eslint@9.30.0)(typescript@5.8.3) - '@typescript-eslint/scope-manager': 8.35.1 - '@typescript-eslint/type-utils': 8.35.1(eslint@9.30.0)(typescript@5.8.3) - '@typescript-eslint/utils': 8.35.1(eslint@9.30.0)(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.35.1 - eslint: 9.30.0 + '@typescript-eslint/parser': 8.38.0(eslint@9.32.0)(typescript@5.9.2) + '@typescript-eslint/scope-manager': 8.38.0 + '@typescript-eslint/type-utils': 8.38.0(eslint@9.32.0)(typescript@5.9.2) + '@typescript-eslint/utils': 8.38.0(eslint@9.32.0)(typescript@5.9.2) + '@typescript-eslint/visitor-keys': 8.38.0 + eslint: 9.32.0 graphemer: 1.4.0 ignore: 7.0.5 natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.35.1(eslint@9.30.0)(typescript@5.8.3)': + '@typescript-eslint/parser@8.38.0(eslint@9.32.0)(typescript@5.9.2)': dependencies: - '@typescript-eslint/scope-manager': 8.35.1 - '@typescript-eslint/types': 8.35.1 - '@typescript-eslint/typescript-estree': 8.35.1(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.35.1 + '@typescript-eslint/scope-manager': 8.38.0 + '@typescript-eslint/types': 8.38.0 + '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.9.2) + '@typescript-eslint/visitor-keys': 8.38.0 debug: 4.4.1 - eslint: 9.30.0 - typescript: 5.8.3 + eslint: 9.32.0 + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.35.1(typescript@5.8.3)': + '@typescript-eslint/project-service@8.38.0(typescript@5.9.2)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.35.1(typescript@5.8.3) - '@typescript-eslint/types': 8.35.1 + '@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.9.2) + '@typescript-eslint/types': 8.38.0 debug: 4.4.1 - typescript: 5.8.3 + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.35.1': + '@typescript-eslint/scope-manager@8.38.0': dependencies: - '@typescript-eslint/types': 8.35.1 - '@typescript-eslint/visitor-keys': 8.35.1 + '@typescript-eslint/types': 8.38.0 + '@typescript-eslint/visitor-keys': 8.38.0 - '@typescript-eslint/tsconfig-utils@8.35.1(typescript@5.8.3)': + '@typescript-eslint/tsconfig-utils@8.38.0(typescript@5.9.2)': dependencies: - typescript: 5.8.3 + typescript: 5.9.2 - '@typescript-eslint/type-utils@8.35.1(eslint@9.30.0)(typescript@5.8.3)': + '@typescript-eslint/type-utils@8.38.0(eslint@9.32.0)(typescript@5.9.2)': dependencies: - '@typescript-eslint/typescript-estree': 8.35.1(typescript@5.8.3) - '@typescript-eslint/utils': 8.35.1(eslint@9.30.0)(typescript@5.8.3) + '@typescript-eslint/types': 8.38.0 + '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.9.2) + '@typescript-eslint/utils': 8.38.0(eslint@9.32.0)(typescript@5.9.2) debug: 4.4.1 - eslint: 9.30.0 - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + eslint: 9.32.0 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.35.1': {} + '@typescript-eslint/types@8.38.0': {} - '@typescript-eslint/typescript-estree@8.35.1(typescript@5.8.3)': + '@typescript-eslint/typescript-estree@8.38.0(typescript@5.9.2)': dependencies: - '@typescript-eslint/project-service': 8.35.1(typescript@5.8.3) - '@typescript-eslint/tsconfig-utils': 8.35.1(typescript@5.8.3) - '@typescript-eslint/types': 8.35.1 - '@typescript-eslint/visitor-keys': 8.35.1 + '@typescript-eslint/project-service': 8.38.0(typescript@5.9.2) + '@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.9.2) + '@typescript-eslint/types': 8.38.0 + '@typescript-eslint/visitor-keys': 8.38.0 debug: 4.4.1 fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.7.2 - ts-api-utils: 2.1.0(typescript@5.8.3) - typescript: 5.8.3 + ts-api-utils: 2.1.0(typescript@5.9.2) + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.35.1(eslint@9.30.0)(typescript@5.8.3)': + '@typescript-eslint/utils@8.38.0(eslint@9.32.0)(typescript@5.9.2)': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.30.0) - '@typescript-eslint/scope-manager': 8.35.1 - '@typescript-eslint/types': 8.35.1 - '@typescript-eslint/typescript-estree': 8.35.1(typescript@5.8.3) - eslint: 9.30.0 - typescript: 5.8.3 + '@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0) + '@typescript-eslint/scope-manager': 8.38.0 + '@typescript-eslint/types': 8.38.0 + '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.9.2) + eslint: 9.32.0 + typescript: 5.9.2 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.35.1': + '@typescript-eslint/visitor-keys@8.38.0': dependencies: - '@typescript-eslint/types': 8.35.1 + '@typescript-eslint/types': 8.38.0 eslint-visitor-keys: 4.2.1 abort-controller@3.0.0: @@ -2126,16 +2120,16 @@ snapshots: eslint-visitor-keys@4.2.1: {} - eslint@9.30.0: + eslint@9.32.0: dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.30.0) + '@eslint-community/eslint-utils': 4.7.0(eslint@9.32.0) '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.21.0 '@eslint/config-helpers': 0.3.0 - '@eslint/core': 0.14.0 + '@eslint/core': 0.15.1 '@eslint/eslintrc': 3.3.1 - '@eslint/js': 9.30.0 - '@eslint/plugin-kit': 0.3.3 + '@eslint/js': 9.32.0 + '@eslint/plugin-kit': 0.3.4 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 @@ -2571,7 +2565,7 @@ snapshots: signal-exit@4.1.0: {} - smol-toml@1.4.0: {} + smol-toml@1.4.1: {} source-map@0.6.1: {} @@ -2644,9 +2638,9 @@ snapshots: tree-kill@1.2.2: {} - ts-api-utils@2.1.0(typescript@5.8.3): + ts-api-utils@2.1.0(typescript@5.9.2): dependencies: - typescript: 5.8.3 + typescript: 5.9.2 ts-interface-checker@0.1.13: {} @@ -2654,7 +2648,7 @@ snapshots: tslib@2.8.1: {} - tsup@8.5.0(typescript@5.8.3): + tsup@8.5.0(typescript@5.9.2): dependencies: bundle-require: 5.1.0(esbuild@0.25.0) cac: 6.7.14 @@ -2674,7 +2668,7 @@ snapshots: tinyglobby: 0.2.12 tree-kill: 1.2.2 optionalDependencies: - typescript: 5.8.3 + typescript: 5.9.2 transitivePeerDependencies: - jiti - supports-color @@ -2687,19 +2681,20 @@ snapshots: dependencies: prelude-ls: 1.2.1 - typescript-eslint@8.35.1(eslint@9.30.0)(typescript@5.8.3): + typescript-eslint@8.38.0(eslint@9.32.0)(typescript@5.9.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.35.1(@typescript-eslint/parser@8.35.1(eslint@9.30.0)(typescript@5.8.3))(eslint@9.30.0)(typescript@5.8.3) - '@typescript-eslint/parser': 8.35.1(eslint@9.30.0)(typescript@5.8.3) - '@typescript-eslint/utils': 8.35.1(eslint@9.30.0)(typescript@5.8.3) - eslint: 9.30.0 - typescript: 5.8.3 + '@typescript-eslint/eslint-plugin': 8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.32.0)(typescript@5.9.2))(eslint@9.32.0)(typescript@5.9.2) + '@typescript-eslint/parser': 8.38.0(eslint@9.32.0)(typescript@5.9.2) + '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.9.2) + '@typescript-eslint/utils': 8.38.0(eslint@9.32.0)(typescript@5.9.2) + eslint: 9.32.0 + typescript: 5.9.2 transitivePeerDependencies: - supports-color typescript@3.9.10: {} - typescript@5.8.3: {} + typescript@5.9.2: {} ufo@1.6.1: {} @@ -2768,4 +2763,4 @@ snapshots: yocto-queue@0.1.0: {} - zod@3.25.67: {} + zod@4.0.14: {} diff --git a/src/options.ts b/src/options.ts index 0222b02..699d5aa 100644 --- a/src/options.ts +++ b/src/options.ts @@ -113,7 +113,7 @@ const inputOrEnvironmentVariable = (key: string): string | undefined => { return undefined } -const parseOrUndefined = (key: string, schema: z.ZodSchema, errorMessage?: string): T | undefined => { +const parseOrUndefined = (key: string, schema: z.ZodType, errorMessage?: string): T | undefined => { const input = inputOrEnvironmentVariable(key) if (input === undefined) { return undefined @@ -128,7 +128,7 @@ const parseOrUndefined = (key: string, schema: z.ZodSchema, errorMessage?: return maybeResult.data } -const parseOrUndefinedJSON = (key: string, schema: z.ZodSchema): T | undefined => { +const parseOrUndefinedJSON = (key: string, schema: z.ZodType): T | undefined => { const input = inputOrEnvironmentVariable(key) if (input === undefined) { return undefined @@ -136,7 +136,7 @@ const parseOrUndefinedJSON = (key: string, schema: z.ZodSchema): T | undef return schema.parse(JSON.parse(input)) } -const parseOrUndefinedList = (key: string, schema: z.ZodSchema): T[] | undefined => { +const parseOrUndefinedList = (key: string, schema: z.ZodType): T[] | undefined => { const input = inputOrEnvironmentVariable(key) if (input === undefined) { return undefined