@cloudflare/vitest-pool-workers 0.13.5 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pool/index.mjs +9649 -66
- package/dist/pool/index.mjs.map +1 -1
- package/dist/worker/index.mjs +1 -1
- package/dist/worker/index.mjs.map +1 -1
- package/dist/worker/lib/cloudflare/test-internal.mjs +11 -0
- package/dist/worker/lib/cloudflare/test-internal.mjs.map +1 -1
- package/package.json +6 -6
- package/types/cloudflare-test.d.ts +33 -0
package/dist/pool/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["index","value","from","to","parseOptions","MAX_LENGTH","MAX_SAFE_INTEGER","MAX_SAFE_COMPONENT_LENGTH","MAX_SAFE_BUILD_LENGTH","debug","debug","re","src","t","MAX_LENGTH","compareIdentifiers","debug","re","parseOptions","SemVer","t","SemVer","compare","compare","eq","compare","neq","compare","gt","compare","gte","compare","lt","lte","cmp","Comparator","parseOptions","re","t","SemVer","Range","debug","Range","z","#compatibilityDate","#compatibilityFlags","#optionsPath","#relativeProjectPath","#relativeWranglerConfigPath","#flagExists","#buildErrorMessageBase","#buildConfigPath","exportMap: ExportMap","fs","ids: string[]","debuglog: util.DebugLoggerFunction","log","__filename","__dirname","platformPath","require","parentPaths: string[]","cache","e: unknown","exports","exhaustive: never","result: Record<string, unknown>","errorRef: ZodErrorRef","log","name: string","formatted: string","options: PoolOptions","poolOptions:\n\t\t\t| WorkersPoolOptions\n\t\t\t| ((\n\t\t\t\t\tctx: WorkerPoolOptionsContext\n\t\t\t ) => Promise<WorkersPoolOptions> | WorkersPoolOptions)","resolvedPoolOptions: WorkersPoolOptions","toSend: WorkerRequest","main: string | undefined","fs","devalue.stringify","devalue.parse","workerName: string | undefined","selfWorkerExports: string[]","workers: ProjectWorkers","worker: unknown","SHARED_MINIFLARE_OPTIONS: SharedOptions","getPort","inspectorPort: number | undefined"],"sources":["../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/utils.js","../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/base64.js","../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/constants.js","../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/parse.js","../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/stringify.js","../../../../node_modules/.pnpm/get-port@7.1.0/node_modules/get-port/index.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js","../../src/pool/compatibility-flag-assertions.ts","../../src/pool/guess-exports.ts","../../src/pool/helpers.ts","../../src/pool/loopback.ts","../../src/shared/builtin-modules.ts","../../src/pool/module-fallback.ts","../../src/pool/config.ts","../../src/pool/pages.ts","../../src/pool/cloudflare-pool-worker.ts","../../src/pool/pool.ts","../../src/pool/plugin.ts","../../src/pool/d1.ts","../../src/pool/index.ts"],"sourcesContent":["/** @type {Record<string, string>} */\nexport const escaped = {\n\t'<': '\\\\u003C',\n\t'\\\\': '\\\\\\\\',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t',\n\t'\\u2028': '\\\\u2028',\n\t'\\u2029': '\\\\u2029'\n};\n\nexport class DevalueError extends Error {\n\t/**\n\t * @param {string} message\n\t * @param {string[]} keys\n\t * @param {any} [value] - The value that failed to be serialized\n\t * @param {any} [root] - The root value being serialized\n\t */\n\tconstructor(message, keys, value, root) {\n\t\tsuper(message);\n\t\tthis.name = 'DevalueError';\n\t\tthis.path = keys.join('');\n\t\tthis.value = value;\n\t\tthis.root = root;\n\t}\n}\n\n/** @param {any} thing */\nexport function is_primitive(thing) {\n\treturn Object(thing) !== thing;\n}\n\nconst object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(\n\tObject.prototype\n)\n\t.sort()\n\t.join('\\0');\n\n/** @param {any} thing */\nexport function is_plain_object(thing) {\n\tconst proto = Object.getPrototypeOf(thing);\n\n\treturn (\n\t\tproto === Object.prototype ||\n\t\tproto === null ||\n\t\tObject.getPrototypeOf(proto) === null ||\n\t\tObject.getOwnPropertyNames(proto).sort().join('\\0') === object_proto_names\n\t);\n}\n\n/** @param {any} thing */\nexport function get_type(thing) {\n\treturn Object.prototype.toString.call(thing).slice(8, -1);\n}\n\n/** @param {string} char */\nfunction get_escaped_char(char) {\n\tswitch (char) {\n\t\tcase '\"':\n\t\t\treturn '\\\\\"';\n\t\tcase '<':\n\t\t\treturn '\\\\u003C';\n\t\tcase '\\\\':\n\t\t\treturn '\\\\\\\\';\n\t\tcase '\\n':\n\t\t\treturn '\\\\n';\n\t\tcase '\\r':\n\t\t\treturn '\\\\r';\n\t\tcase '\\t':\n\t\t\treturn '\\\\t';\n\t\tcase '\\b':\n\t\t\treturn '\\\\b';\n\t\tcase '\\f':\n\t\t\treturn '\\\\f';\n\t\tcase '\\u2028':\n\t\t\treturn '\\\\u2028';\n\t\tcase '\\u2029':\n\t\t\treturn '\\\\u2029';\n\t\tdefault:\n\t\t\treturn char < ' '\n\t\t\t\t? `\\\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`\n\t\t\t\t: '';\n\t}\n}\n\n/** @param {string} str */\nexport function stringify_string(str) {\n\tlet result = '';\n\tlet last_pos = 0;\n\tconst len = str.length;\n\n\tfor (let i = 0; i < len; i += 1) {\n\t\tconst char = str[i];\n\t\tconst replacement = get_escaped_char(char);\n\t\tif (replacement) {\n\t\t\tresult += str.slice(last_pos, i) + replacement;\n\t\t\tlast_pos = i + 1;\n\t\t}\n\t}\n\n\treturn `\"${last_pos === 0 ? str : result + str.slice(last_pos)}\"`;\n}\n\n/** @param {Record<string | symbol, any>} object */\nexport function enumerable_symbols(object) {\n\treturn Object.getOwnPropertySymbols(object).filter(\n\t\t(symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable\n\t);\n}\n\nconst is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/** @param {string} key */\nexport function stringify_key(key) {\n\treturn is_identifier.test(key) ? '.' + key : '[' + JSON.stringify(key) + ']';\n}\n\n/** @param {string} s */\nfunction is_valid_array_index(s) {\n\tif (s.length === 0) return false;\n\tif (s.length > 1 && s.charCodeAt(0) === 48) return false; // leading zero\n\tfor (let i = 0; i < s.length; i++) {\n\t\tconst c = s.charCodeAt(i);\n\t\tif (c < 48 || c > 57) return false;\n\t}\n\t// by this point we know it's a string of digits, but it has to be within the range of valid array indices\n\tconst n = +s;\n\tif (n >= 2 ** 32 - 1) return false;\n\tif (n < 0) return false;\n\treturn true;\n}\n\n/**\n * Finds the populated indices of an array.\n * @param {unknown[]} array\n */\nexport function valid_array_indices(array) {\n\tconst keys = Object.keys(array);\n\tfor (var i = keys.length - 1; i >= 0; i--) {\n\t\tif (is_valid_array_index(keys[i])) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tkeys.length = i + 1;\n\treturn keys;\n}\n","/**\n * Base64 Encodes an arraybuffer\n * @param {ArrayBuffer} arraybuffer\n * @returns {string}\n */\nexport function encode64(arraybuffer) {\n const dv = new DataView(arraybuffer);\n let binaryString = \"\";\n\n for (let i = 0; i < arraybuffer.byteLength; i++) {\n binaryString += String.fromCharCode(dv.getUint8(i));\n }\n\n return binaryToAscii(binaryString);\n}\n\n/**\n * Decodes a base64 string into an arraybuffer\n * @param {string} string\n * @returns {ArrayBuffer}\n */\nexport function decode64(string) {\n const binaryString = asciiToBinary(string);\n const arraybuffer = new ArrayBuffer(binaryString.length);\n const dv = new DataView(arraybuffer);\n\n for (let i = 0; i < arraybuffer.byteLength; i++) {\n dv.setUint8(i, binaryString.charCodeAt(i));\n }\n\n return arraybuffer;\n}\n\nconst KEY_STRING =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n/**\n * Substitute for atob since it's deprecated in node.\n * Does not do any input validation.\n *\n * @see https://github.com/jsdom/abab/blob/master/lib/atob.js\n *\n * @param {string} data\n * @returns {string}\n */\nfunction asciiToBinary(data) {\n if (data.length % 4 === 0) {\n data = data.replace(/==?$/, \"\");\n }\n\n let output = \"\";\n let buffer = 0;\n let accumulatedBits = 0;\n\n for (let i = 0; i < data.length; i++) {\n buffer <<= 6;\n buffer |= KEY_STRING.indexOf(data[i]);\n accumulatedBits += 6;\n if (accumulatedBits === 24) {\n output += String.fromCharCode((buffer & 0xff0000) >> 16);\n output += String.fromCharCode((buffer & 0xff00) >> 8);\n output += String.fromCharCode(buffer & 0xff);\n buffer = accumulatedBits = 0;\n }\n }\n if (accumulatedBits === 12) {\n buffer >>= 4;\n output += String.fromCharCode(buffer);\n } else if (accumulatedBits === 18) {\n buffer >>= 2;\n output += String.fromCharCode((buffer & 0xff00) >> 8);\n output += String.fromCharCode(buffer & 0xff);\n }\n return output;\n}\n\n/**\n * Substitute for btoa since it's deprecated in node.\n * Does not do any input validation.\n *\n * @see https://github.com/jsdom/abab/blob/master/lib/btoa.js\n *\n * @param {string} str\n * @returns {string}\n */\nfunction binaryToAscii(str) {\n let out = \"\";\n for (let i = 0; i < str.length; i += 3) {\n /** @type {[number, number, number, number]} */\n const groupsOfSix = [undefined, undefined, undefined, undefined];\n groupsOfSix[0] = str.charCodeAt(i) >> 2;\n groupsOfSix[1] = (str.charCodeAt(i) & 0x03) << 4;\n if (str.length > i + 1) {\n groupsOfSix[1] |= str.charCodeAt(i + 1) >> 4;\n groupsOfSix[2] = (str.charCodeAt(i + 1) & 0x0f) << 2;\n }\n if (str.length > i + 2) {\n groupsOfSix[2] |= str.charCodeAt(i + 2) >> 6;\n groupsOfSix[3] = str.charCodeAt(i + 2) & 0x3f;\n }\n for (let j = 0; j < groupsOfSix.length; j++) {\n if (typeof groupsOfSix[j] === \"undefined\") {\n out += \"=\";\n } else {\n out += KEY_STRING[groupsOfSix[j]];\n }\n }\n }\n return out;\n}\n","export const UNDEFINED = -1;\nexport const HOLE = -2;\nexport const NAN = -3;\nexport const POSITIVE_INFINITY = -4;\nexport const NEGATIVE_INFINITY = -5;\nexport const NEGATIVE_ZERO = -6;\nexport const SPARSE = -7;\n","import { decode64 } from './base64.js';\nimport {\n\tHOLE,\n\tNAN,\n\tNEGATIVE_INFINITY,\n\tNEGATIVE_ZERO,\n\tPOSITIVE_INFINITY,\n\tSPARSE,\n\tUNDEFINED\n} from './constants.js';\n\n/**\n * Revive a value serialized with `devalue.stringify`\n * @param {string} serialized\n * @param {Record<string, (value: any) => any>} [revivers]\n */\nexport function parse(serialized, revivers) {\n\treturn unflatten(JSON.parse(serialized), revivers);\n}\n\n/**\n * Revive a value flattened with `devalue.stringify`\n * @param {number | any[]} parsed\n * @param {Record<string, (value: any) => any>} [revivers]\n */\nexport function unflatten(parsed, revivers) {\n\tif (typeof parsed === 'number') return hydrate(parsed, true);\n\n\tif (!Array.isArray(parsed) || parsed.length === 0) {\n\t\tthrow new Error('Invalid input');\n\t}\n\n\tconst values = /** @type {any[]} */ (parsed);\n\n\tconst hydrated = Array(values.length);\n\n\t/**\n\t * A set of values currently being hydrated with custom revivers,\n\t * used to detect invalid cyclical dependencies\n\t * @type {Set<number> | null}\n\t */\n\tlet hydrating = null;\n\n\t/**\n\t * @param {number} index\n\t * @returns {any}\n\t */\n\tfunction hydrate(index, standalone = false) {\n\t\tif (index === UNDEFINED) return undefined;\n\t\tif (index === NAN) return NaN;\n\t\tif (index === POSITIVE_INFINITY) return Infinity;\n\t\tif (index === NEGATIVE_INFINITY) return -Infinity;\n\t\tif (index === NEGATIVE_ZERO) return -0;\n\n\t\tif (standalone || typeof index !== 'number') {\n\t\t\tthrow new Error(`Invalid input`);\n\t\t}\n\n\t\tif (index in hydrated) return hydrated[index];\n\n\t\tconst value = values[index];\n\n\t\tif (!value || typeof value !== 'object') {\n\t\t\thydrated[index] = value;\n\t\t} else if (Array.isArray(value)) {\n\t\t\tif (typeof value[0] === 'string') {\n\t\t\t\tconst type = value[0];\n\n\t\t\t\tconst reviver =\n\t\t\t\t\trevivers && Object.hasOwn(revivers, type)\n\t\t\t\t\t\t? revivers[type]\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\tif (reviver) {\n\t\t\t\t\tlet i = value[1];\n\t\t\t\t\tif (typeof i !== 'number') {\n\t\t\t\t\t\t// if it's not a number, it was serialized by a builtin reviver\n\t\t\t\t\t\t// so we need to munge it into the format expected by a custom reviver\n\t\t\t\t\t\ti = values.push(value[1]) - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\thydrating ??= new Set();\n\n\t\t\t\t\tif (hydrating.has(i)) {\n\t\t\t\t\t\tthrow new Error('Invalid circular reference');\n\t\t\t\t\t}\n\n\t\t\t\t\thydrating.add(i);\n\t\t\t\t\thydrated[index] = reviver(hydrate(i));\n\t\t\t\t\thydrating.delete(i);\n\n\t\t\t\t\treturn hydrated[index];\n\t\t\t\t}\n\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'Date':\n\t\t\t\t\t\thydrated[index] = new Date(value[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Set':\n\t\t\t\t\t\tconst set = new Set();\n\t\t\t\t\t\thydrated[index] = set;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 1) {\n\t\t\t\t\t\t\tset.add(hydrate(value[i]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Map':\n\t\t\t\t\t\tconst map = new Map();\n\t\t\t\t\t\thydrated[index] = map;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 2) {\n\t\t\t\t\t\t\tmap.set(hydrate(value[i]), hydrate(value[i + 1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'RegExp':\n\t\t\t\t\t\thydrated[index] = new RegExp(value[1], value[2]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Object':\n\t\t\t\t\t\thydrated[index] = Object(value[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'BigInt':\n\t\t\t\t\t\thydrated[index] = BigInt(value[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'null':\n\t\t\t\t\t\tconst obj = Object.create(null);\n\t\t\t\t\t\thydrated[index] = obj;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 2) {\n\t\t\t\t\t\t\tobj[value[i]] = hydrate(value[i + 1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Int8Array':\n\t\t\t\t\tcase 'Uint8Array':\n\t\t\t\t\tcase 'Uint8ClampedArray':\n\t\t\t\t\tcase 'Int16Array':\n\t\t\t\t\tcase 'Uint16Array':\n\t\t\t\t\tcase 'Int32Array':\n\t\t\t\t\tcase 'Uint32Array':\n\t\t\t\t\tcase 'Float32Array':\n\t\t\t\t\tcase 'Float64Array':\n\t\t\t\t\tcase 'BigInt64Array':\n\t\t\t\t\tcase 'BigUint64Array': {\n\t\t\t\t\t\tif (values[value[1]][0] !== 'ArrayBuffer') {\n\t\t\t\t\t\t\t// without this, if we receive malformed input we could\n\t\t\t\t\t\t\t// end up trying to hydrate in a circle or allocate\n\t\t\t\t\t\t\t// huge amounts of memory when we call `new TypedArrayConstructor(buffer)`\n\t\t\t\t\t\t\tthrow new Error('Invalid data');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst TypedArrayConstructor = globalThis[type];\n\t\t\t\t\t\tconst buffer = hydrate(value[1]);\n\t\t\t\t\t\tconst typedArray = new TypedArrayConstructor(buffer);\n\n\t\t\t\t\t\thydrated[index] =\n\t\t\t\t\t\t\tvalue[2] !== undefined\n\t\t\t\t\t\t\t\t? typedArray.subarray(value[2], value[3])\n\t\t\t\t\t\t\t\t: typedArray;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'ArrayBuffer': {\n\t\t\t\t\t\tconst base64 = value[1];\n\t\t\t\t\t\tif (typeof base64 !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('Invalid ArrayBuffer encoding');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst arraybuffer = decode64(base64);\n\t\t\t\t\t\thydrated[index] = arraybuffer;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'Temporal.Duration':\n\t\t\t\t\tcase 'Temporal.Instant':\n\t\t\t\t\tcase 'Temporal.PlainDate':\n\t\t\t\t\tcase 'Temporal.PlainTime':\n\t\t\t\t\tcase 'Temporal.PlainDateTime':\n\t\t\t\t\tcase 'Temporal.PlainMonthDay':\n\t\t\t\t\tcase 'Temporal.PlainYearMonth':\n\t\t\t\t\tcase 'Temporal.ZonedDateTime': {\n\t\t\t\t\t\tconst temporalName = type.slice(9);\n\t\t\t\t\t\t// @ts-expect-error TS doesn't know about Temporal yet\n\t\t\t\t\t\thydrated[index] = Temporal[temporalName].from(value[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'URL': {\n\t\t\t\t\t\tconst url = new URL(value[1]);\n\t\t\t\t\t\thydrated[index] = url;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'URLSearchParams': {\n\t\t\t\t\t\tconst url = new URLSearchParams(value[1]);\n\t\t\t\t\t\thydrated[index] = url;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error(`Unknown type ${type}`);\n\t\t\t\t}\n\t\t\t} else if (value[0] === SPARSE) {\n\t\t\t\t// Sparse array encoding: [SPARSE, length, idx, val, idx, val, ...]\n\t\t\t\tconst len = value[1];\n\n\t\t\t\tconst array = new Array(len);\n\t\t\t\thydrated[index] = array;\n\n\t\t\t\tfor (let i = 2; i < value.length; i += 2) {\n\t\t\t\t\tconst idx = value[i];\n\t\t\t\t\tarray[idx] = hydrate(value[i + 1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst array = new Array(value.length);\n\t\t\t\thydrated[index] = array;\n\n\t\t\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\t\t\tconst n = value[i];\n\t\t\t\t\tif (n === HOLE) continue;\n\n\t\t\t\t\tarray[i] = hydrate(n);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t/** @type {Record<string, any>} */\n\t\t\tconst object = {};\n\t\t\thydrated[index] = object;\n\n\t\t\tfor (const key of Object.keys(value)) {\n\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\tthrow new Error('Cannot parse an object with a `__proto__` property');\n\t\t\t\t}\n\n\t\t\t\tconst n = value[key];\n\t\t\t\tobject[key] = hydrate(n);\n\t\t\t}\n\t\t}\n\n\t\treturn hydrated[index];\n\t}\n\n\treturn hydrate(0);\n}\n","import {\n\tDevalueError,\n\tenumerable_symbols,\n\tget_type,\n\tis_plain_object,\n\tis_primitive,\n\tstringify_key,\n\tstringify_string,\n\tvalid_array_indices\n} from './utils.js';\nimport {\n\tHOLE,\n\tNAN,\n\tNEGATIVE_INFINITY,\n\tNEGATIVE_ZERO,\n\tPOSITIVE_INFINITY,\n\tSPARSE,\n\tUNDEFINED\n} from './constants.js';\nimport { encode64 } from './base64.js';\n\n/**\n * Turn a value into a JSON string that can be parsed with `devalue.parse`\n * @param {any} value\n * @param {Record<string, (value: any) => any>} [reducers]\n */\nexport function stringify(value, reducers) {\n\t/** @type {any[]} */\n\tconst stringified = [];\n\n\t/** @type {Map<any, number>} */\n\tconst indexes = new Map();\n\n\t/** @type {Array<{ key: string, fn: (value: any) => any }>} */\n\tconst custom = [];\n\tif (reducers) {\n\t\tfor (const key of Object.getOwnPropertyNames(reducers)) {\n\t\t\tcustom.push({ key, fn: reducers[key] });\n\t\t}\n\t}\n\n\t/** @type {string[]} */\n\tconst keys = [];\n\n\tlet p = 0;\n\n\t/** @param {any} thing */\n\tfunction flatten(thing) {\n\t\tif (thing === undefined) return UNDEFINED;\n\t\tif (Number.isNaN(thing)) return NAN;\n\t\tif (thing === Infinity) return POSITIVE_INFINITY;\n\t\tif (thing === -Infinity) return NEGATIVE_INFINITY;\n\t\tif (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO;\n\n\t\tif (indexes.has(thing)) return indexes.get(thing);\n\n\t\tconst index = p++;\n\t\tindexes.set(thing, index);\n\n\t\tfor (const { key, fn } of custom) {\n\t\t\tconst value = fn(thing);\n\t\t\tif (value) {\n\t\t\t\tstringified[index] = `[\"${key}\",${flatten(value)}]`;\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\tif (typeof thing === 'function') {\n\t\t\tthrow new DevalueError(`Cannot stringify a function`, keys, thing, value);\n\t\t}\n\n\t\tlet str = '';\n\n\t\tif (is_primitive(thing)) {\n\t\t\tstr = stringify_primitive(thing);\n\t\t} else {\n\t\t\tconst type = get_type(thing);\n\n\t\t\tswitch (type) {\n\t\t\t\tcase 'Number':\n\t\t\t\tcase 'String':\n\t\t\t\tcase 'Boolean':\n\t\t\t\t\tstr = `[\"Object\",${stringify_primitive(thing)}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'BigInt':\n\t\t\t\t\tstr = `[\"BigInt\",${thing}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Date':\n\t\t\t\t\tconst valid = !isNaN(thing.getDate());\n\t\t\t\t\tstr = `[\"Date\",\"${valid ? thing.toISOString() : ''}\"]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'URL':\n\t\t\t\t\tstr = `[\"URL\",${stringify_string(thing.toString())}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'URLSearchParams':\n\t\t\t\t\tstr = `[\"URLSearchParams\",${stringify_string(thing.toString())}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'RegExp':\n\t\t\t\t\tconst { source, flags } = thing;\n\t\t\t\t\tstr = flags\n\t\t\t\t\t\t? `[\"RegExp\",${stringify_string(source)},\"${flags}\"]`\n\t\t\t\t\t\t: `[\"RegExp\",${stringify_string(source)}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Array': {\n\t\t\t\t\t// For dense arrays (no holes), we iterate normally.\n\t\t\t\t\t// When we encounter the first hole, we call Object.keys\n\t\t\t\t\t// to determine the sparseness, then decide between:\n\t\t\t\t\t// - HOLE encoding: [-2, val, -2, ...] (default)\n\t\t\t\t\t// - Sparse encoding: [-7, length, idx, val, ...] (for very sparse arrays)\n\t\t\t\t\t// Only the sparse path avoids iterating every slot, which\n\t\t\t\t\t// is what protects against the DoS of e.g. `arr[1000000] = 1`.\n\t\t\t\t\tlet mostly_dense = false;\n\n\t\t\t\t\tstr = '[';\n\n\t\t\t\t\tfor (let i = 0; i < thing.length; i += 1) {\n\t\t\t\t\t\tif (i > 0) str += ',';\n\n\t\t\t\t\t\tif (Object.hasOwn(thing, i)) {\n\t\t\t\t\t\t\tkeys.push(`[${i}]`);\n\t\t\t\t\t\t\tstr += flatten(thing[i]);\n\t\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t\t} else if (mostly_dense) {\n\t\t\t\t\t\t\t// Use dense encoding. The heuristic guarantees the\n\t\t\t\t\t\t\t// array is only mildly sparse, so iterating over every\n\t\t\t\t\t\t\t// slot is fine.\n\t\t\t\t\t\t\tstr += HOLE;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Decide between HOLE encoding and sparse encoding.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// HOLE encoding: each hole is serialized as the HOLE\n\t\t\t\t\t\t\t// sentinel (-2). For example, [, \"a\", ,] becomes\n\t\t\t\t\t\t\t// [-2, 0, -2]. Each hole costs 3 chars (\"-2\" + comma).\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Sparse encoding: lists only populated indices.\n\t\t\t\t\t\t\t// For example, [, \"a\", ,] becomes [-7, 3, 1, 0] — the\n\t\t\t\t\t\t\t// -7 sentinel, the array length (3), then index-value\n\t\t\t\t\t\t\t// pairs. This avoids paying per-hole, but each element\n\t\t\t\t\t\t\t// costs extra chars to write its index.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// The values are the same size either way, so the\n\t\t\t\t\t\t\t// choice comes down to structural overhead:\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// HOLE overhead:\n\t\t\t\t\t\t\t// 3 chars per hole (\"-2\" + comma)\n\t\t\t\t\t\t\t// = (L - P) * 3\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Sparse overhead:\n\t\t\t\t\t\t\t// \"-7,\" — 3 chars (sparse sentinel + comma)\n\t\t\t\t\t\t\t// + length + \",\" — (d + 1) chars (array length + comma)\n\t\t\t\t\t\t\t// + per element: index + \",\" — (d + 1) chars\n\t\t\t\t\t\t\t// = (4 + d) + P * (d + 1)\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// where L is the array length, P is the number of\n\t\t\t\t\t\t\t// populated elements, and d is the number of digits\n\t\t\t\t\t\t\t// in L (an upper bound on the digits in any index).\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Sparse encoding is cheaper when:\n\t\t\t\t\t\t\t// (4 + d) + P * (d + 1) < (L - P) * 3\n\t\t\t\t\t\t\tconst populated_keys = valid_array_indices(/** @type {any[]} */ (thing));\n\t\t\t\t\t\t\tconst population = populated_keys.length;\n\t\t\t\t\t\t\tconst d = String(thing.length).length;\n\n\t\t\t\t\t\t\tconst hole_cost = (thing.length - population) * 3;\n\t\t\t\t\t\t\tconst sparse_cost = 4 + d + population * (d + 1);\n\n\t\t\t\t\t\t\tif (hole_cost > sparse_cost) {\n\t\t\t\t\t\t\t\tstr = '[' + SPARSE + ',' + thing.length;\n\t\t\t\t\t\t\t\tfor (let j = 0; j < populated_keys.length; j++) {\n\t\t\t\t\t\t\t\t\tconst key = populated_keys[j];\n\t\t\t\t\t\t\t\t\tkeys.push(`[${key}]`);\n\t\t\t\t\t\t\t\t\tstr += ',' + key + ',' + flatten(thing[key]);\n\t\t\t\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmostly_dense = true;\n\t\t\t\t\t\t\t\tstr += HOLE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstr += ']';\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'Set':\n\t\t\t\t\tstr = '[\"Set\"';\n\n\t\t\t\t\tfor (const value of thing) {\n\t\t\t\t\t\tstr += `,${flatten(value)}`;\n\t\t\t\t\t}\n\n\t\t\t\t\tstr += ']';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Map':\n\t\t\t\t\tstr = '[\"Map\"';\n\n\t\t\t\t\tfor (const [key, value] of thing) {\n\t\t\t\t\t\tkeys.push(\n\t\t\t\t\t\t\t`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tstr += `,${flatten(key)},${flatten(value)}`;\n\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t}\n\n\t\t\t\t\tstr += ']';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Int8Array':\n\t\t\t\tcase 'Uint8Array':\n\t\t\t\tcase 'Uint8ClampedArray':\n\t\t\t\tcase 'Int16Array':\n\t\t\t\tcase 'Uint16Array':\n\t\t\t\tcase 'Int32Array':\n\t\t\t\tcase 'Uint32Array':\n\t\t\t\tcase 'Float32Array':\n\t\t\t\tcase 'Float64Array':\n\t\t\t\tcase 'BigInt64Array':\n\t\t\t\tcase 'BigUint64Array': {\n\t\t\t\t\t/** @type {import(\"./types.js\").TypedArray} */\n\t\t\t\t\tconst typedArray = thing;\n\t\t\t\t\tstr = '[\"' + type + '\",' + flatten(typedArray.buffer);\n\n\t\t\t\t\tconst a = thing.byteOffset;\n\t\t\t\t\tconst b = a + thing.byteLength;\n\n\t\t\t\t\t// handle subarrays\n\t\t\t\t\tif (a > 0 || b !== typedArray.buffer.byteLength) {\n\t\t\t\t\t\tconst m = +/(\\d+)/.exec(type)[1] / 8;\n\t\t\t\t\t\tstr += `,${a / m},${b / m}`;\n\t\t\t\t\t}\n\n\t\t\t\t\tstr += ']';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'ArrayBuffer': {\n\t\t\t\t\t/** @type {ArrayBuffer} */\n\t\t\t\t\tconst arraybuffer = thing;\n\t\t\t\t\tconst base64 = encode64(arraybuffer);\n\n\t\t\t\t\tstr = `[\"ArrayBuffer\",\"${base64}\"]`;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'Temporal.Duration':\n\t\t\t\tcase 'Temporal.Instant':\n\t\t\t\tcase 'Temporal.PlainDate':\n\t\t\t\tcase 'Temporal.PlainTime':\n\t\t\t\tcase 'Temporal.PlainDateTime':\n\t\t\t\tcase 'Temporal.PlainMonthDay':\n\t\t\t\tcase 'Temporal.PlainYearMonth':\n\t\t\t\tcase 'Temporal.ZonedDateTime':\n\t\t\t\t\tstr = `[\"${type}\",${stringify_string(thing.toString())}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tif (!is_plain_object(thing)) {\n\t\t\t\t\t\tthrow new DevalueError(\n\t\t\t\t\t\t\t`Cannot stringify arbitrary non-POJOs`,\n\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\tthing,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (enumerable_symbols(thing).length > 0) {\n\t\t\t\t\t\tthrow new DevalueError(\n\t\t\t\t\t\t\t`Cannot stringify POJOs with symbolic keys`,\n\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\tthing,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Object.getPrototypeOf(thing) === null) {\n\t\t\t\t\t\tstr = '[\"null\"';\n\t\t\t\t\t\tfor (const key of Object.keys(thing)) {\n\t\t\t\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\t\t\t\tthrow new DevalueError(\n\t\t\t\t\t\t\t\t\t`Cannot stringify objects with __proto__ keys`,\n\t\t\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\t\t\tthing,\n\t\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tkeys.push(stringify_key(key));\n\t\t\t\t\t\t\tstr += `,${stringify_string(key)},${flatten(thing[key])}`;\n\t\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstr += ']';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstr = '{';\n\t\t\t\t\t\tlet started = false;\n\t\t\t\t\t\tfor (const key of Object.keys(thing)) {\n\t\t\t\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\t\t\t\tthrow new DevalueError(\n\t\t\t\t\t\t\t\t\t`Cannot stringify objects with __proto__ keys`,\n\t\t\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\t\t\tthing,\n\t\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (started) str += ',';\n\t\t\t\t\t\t\tstarted = true;\n\t\t\t\t\t\t\tkeys.push(stringify_key(key));\n\t\t\t\t\t\t\tstr += `${stringify_string(key)}:${flatten(thing[key])}`;\n\t\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstr += '}';\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstringified[index] = str;\n\t\treturn index;\n\t}\n\n\tconst index = flatten(value);\n\n\t// special case — value is represented as a negative index\n\tif (index < 0) return `${index}`;\n\n\treturn `[${stringified.join(',')}]`;\n}\n\n/**\n * @param {any} thing\n * @returns {string}\n */\nfunction stringify_primitive(thing) {\n\tconst type = typeof thing;\n\tif (type === 'string') return stringify_string(thing);\n\tif (thing instanceof String) return stringify_string(thing.toString());\n\tif (thing === void 0) return UNDEFINED.toString();\n\tif (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString();\n\tif (type === 'bigint') return `[\"BigInt\",\"${thing}\"]`;\n\treturn String(thing);\n}\n","import net from 'node:net';\nimport os from 'node:os';\n\nclass Locked extends Error {\n\tconstructor(port) {\n\t\tsuper(`${port} is locked`);\n\t}\n}\n\nconst lockedPorts = {\n\told: new Set(),\n\tyoung: new Set(),\n};\n\n// On this interval, the old locked ports are discarded,\n// the young locked ports are moved to old locked ports,\n// and a new young set for locked ports are created.\nconst releaseOldLockedPortsIntervalMs = 1000 * 15;\n\nconst minPort = 1024;\nconst maxPort = 65_535;\n\n// Lazily create timeout on first use\nlet timeout;\n\nconst getLocalHosts = () => {\n\tconst interfaces = os.networkInterfaces();\n\n\t// Add undefined value for createServer function to use default host,\n\t// and default IPv4 host in case createServer defaults to IPv6.\n\tconst results = new Set([undefined, '0.0.0.0']);\n\n\tfor (const _interface of Object.values(interfaces)) {\n\t\tfor (const config of _interface) {\n\t\t\tresults.add(config.address);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nconst checkAvailablePort = options =>\n\tnew Promise((resolve, reject) => {\n\t\tconst server = net.createServer();\n\t\tserver.unref();\n\t\tserver.on('error', reject);\n\n\t\tserver.listen(options, () => {\n\t\t\tconst {port} = server.address();\n\t\t\tserver.close(() => {\n\t\t\t\tresolve(port);\n\t\t\t});\n\t\t});\n\t});\n\nconst getAvailablePort = async (options, hosts) => {\n\tif (options.host || options.port === 0) {\n\t\treturn checkAvailablePort(options);\n\t}\n\n\tfor (const host of hosts) {\n\t\ttry {\n\t\t\tawait checkAvailablePort({port: options.port, host}); // eslint-disable-line no-await-in-loop\n\t\t} catch (error) {\n\t\t\tif (!['EADDRNOTAVAIL', 'EINVAL'].includes(error.code)) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn options.port;\n};\n\nconst portCheckSequence = function * (ports) {\n\tif (ports) {\n\t\tyield * ports;\n\t}\n\n\tyield 0; // Fall back to 0 if anything else failed\n};\n\nexport default async function getPorts(options) {\n\tlet ports;\n\tlet exclude = new Set();\n\n\tif (options) {\n\t\tif (options.port) {\n\t\t\tports = typeof options.port === 'number' ? [options.port] : options.port;\n\t\t}\n\n\t\tif (options.exclude) {\n\t\t\tconst excludeIterable = options.exclude;\n\n\t\t\tif (typeof excludeIterable[Symbol.iterator] !== 'function') {\n\t\t\t\tthrow new TypeError('The `exclude` option must be an iterable.');\n\t\t\t}\n\n\t\t\tfor (const element of excludeIterable) {\n\t\t\t\tif (typeof element !== 'number') {\n\t\t\t\t\tthrow new TypeError('Each item in the `exclude` option must be a number corresponding to the port you want excluded.');\n\t\t\t\t}\n\n\t\t\t\tif (!Number.isSafeInteger(element)) {\n\t\t\t\t\tthrow new TypeError(`Number ${element} in the exclude option is not a safe integer and can't be used`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texclude = new Set(excludeIterable);\n\t\t}\n\t}\n\n\tif (timeout === undefined) {\n\t\ttimeout = setTimeout(() => {\n\t\t\ttimeout = undefined;\n\n\t\t\tlockedPorts.old = lockedPorts.young;\n\t\t\tlockedPorts.young = new Set();\n\t\t}, releaseOldLockedPortsIntervalMs);\n\n\t\t// Does not exist in some environments (Electron, Jest jsdom env, browser, etc).\n\t\tif (timeout.unref) {\n\t\t\ttimeout.unref();\n\t\t}\n\t}\n\n\tconst hosts = getLocalHosts();\n\n\tfor (const port of portCheckSequence(ports)) {\n\t\ttry {\n\t\t\tif (exclude.has(port)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet availablePort = await getAvailablePort({...options, port}, hosts); // eslint-disable-line no-await-in-loop\n\t\t\twhile (lockedPorts.old.has(availablePort) || lockedPorts.young.has(availablePort)) {\n\t\t\t\tif (port !== 0) {\n\t\t\t\t\tthrow new Locked(port);\n\t\t\t\t}\n\n\t\t\t\tavailablePort = await getAvailablePort({...options, port}, hosts); // eslint-disable-line no-await-in-loop\n\t\t\t}\n\n\t\t\tlockedPorts.young.add(availablePort);\n\n\t\t\treturn availablePort;\n\t\t} catch (error) {\n\t\t\tif (!['EADDRINUSE', 'EACCES'].includes(error.code) && !(error instanceof Locked)) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow new Error('No available ports found');\n}\n\nexport function portNumbers(from, to) {\n\tif (!Number.isInteger(from) || !Number.isInteger(to)) {\n\t\tthrow new TypeError('`from` and `to` must be integer numbers');\n\t}\n\n\tif (from < minPort || from > maxPort) {\n\t\tthrow new RangeError(`'from' must be between ${minPort} and ${maxPort}`);\n\t}\n\n\tif (to < minPort || to > maxPort) {\n\t\tthrow new RangeError(`'to' must be between ${minPort} and ${maxPort}`);\n\t}\n\n\tif (from > to) {\n\t\tthrow new RangeError('`to` must be greater than or equal to `from`');\n\t}\n\n\tconst generator = function * (from, to) {\n\t\tfor (let port = from; port <= to; port++) {\n\t\t\tyield port;\n\t\t}\n\t};\n\n\treturn generator(from, to);\n}\n\nexport function clearLockedPorts() {\n\tlockedPorts.old.clear();\n\tlockedPorts.young.clear();\n}\n","class LRUCache {\n constructor () {\n this.max = 1000\n this.map = new Map()\n }\n\n get (key) {\n const value = this.map.get(key)\n if (value === undefined) {\n return undefined\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key)\n this.map.set(key, value)\n return value\n }\n }\n\n delete (key) {\n return this.map.delete(key)\n }\n\n set (key, value) {\n const deleted = this.delete(key)\n\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value\n this.delete(firstKey)\n }\n\n this.map.set(key, value)\n }\n\n return this\n }\n}\n\nmodule.exports = LRUCache\n","// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst safeSrc = exports.safeSrc = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n safeSrc[index] = safe\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, safeSrc: src, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n if (release.startsWith('pre')) {\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n // Avoid an invalid semver results\n if (identifier) {\n const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`)\n const match = `-${identifier}`.match(r)\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`)\n }\n }\n }\n\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n case 'release':\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`)\n }\n this.prerelease.length = 0\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","const SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","/**\n * The `CompatibilityFlagAssertions` class provides methods to validate compatibility flags and dates\n * within a project's configuration. It ensures that specific flags are either present\n * or absent and that compatibility dates meet the required criteria.\n */\nexport class CompatibilityFlagAssertions {\n\t#compatibilityDate?: string;\n\t#compatibilityFlags: string[];\n\t#optionsPath: string;\n\t#relativeProjectPath: string;\n\t#relativeWranglerConfigPath?: string;\n\n\tconstructor(options: CommonOptions) {\n\t\tthis.#compatibilityDate = options.compatibilityDate;\n\t\tthis.#compatibilityFlags = options.compatibilityFlags;\n\t\tthis.#optionsPath = options.optionsPath;\n\t\tthis.#relativeProjectPath = options.relativeProjectPath;\n\t\tthis.#relativeWranglerConfigPath = options.relativeWranglerConfigPath;\n\t}\n\n\t/**\n\t * Checks if a specific flag is present in the compatibilityFlags array.\n\t */\n\t#flagExists(flag: string): boolean {\n\t\treturn this.#compatibilityFlags.includes(flag);\n\t}\n\n\t/**\n\t * Constructs the base of the error message.\n\t *\n\t * @example\n\t * In project /path/to/project\n\t *\n\t * @example\n\t * In project /path/to/project's configuration file wrangler.toml\n\t */\n\t#buildErrorMessageBase(): string {\n\t\tlet message = `In project ${this.#relativeProjectPath}`;\n\t\tif (this.#relativeWranglerConfigPath) {\n\t\t\tmessage += `'s configuration file ${this.#relativeWranglerConfigPath}`;\n\t\t}\n\t\treturn message;\n\t}\n\n\t/**\n\t * Constructs the configuration path part of the error message.\n\t */\n\t#buildConfigPath(setting: string): string {\n\t\tif (this.#relativeWranglerConfigPath) {\n\t\t\treturn `\\`${setting}\\``;\n\t\t}\n\n\t\tconst camelCaseSetting = setting.replace(/_(\\w)/g, (_, letter) =>\n\t\t\tletter.toUpperCase()\n\t\t);\n\n\t\treturn `\\`${this.#optionsPath}.${camelCaseSetting}\\``;\n\t}\n\n\tisEnabled(\n\t\tenableFlag: string,\n\t\tdisableFlag: string,\n\t\tdefaultOnDate?: string\n\t): boolean {\n\t\tif (this.#flagExists(disableFlag)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (\n\t\t\tthis.#flagExists(enableFlag) ||\n\t\t\tisDateSufficient(this.#compatibilityDate, defaultOnDate)\n\t\t);\n\t}\n\n\t/**\n\t * Ensures that a specific enable flag is present or that the compatibility date meets the required date.\n\t */\n\tassertIsEnabled({\n\t\tenableFlag,\n\t\tdisableFlag,\n\t\tdefaultOnDate,\n\t}: {\n\t\tenableFlag: string;\n\t\tdisableFlag: string;\n\t\tdefaultOnDate?: string;\n\t}): AssertionResult {\n\t\t// If it's disabled by this flag, we can return early.\n\t\tif (this.#flagExists(disableFlag)) {\n\t\t\tconst errorMessage = `${this.#buildErrorMessageBase()}, ${this.#buildConfigPath(\n\t\t\t\t\"compatibility_flags\"\n\t\t\t)} must not contain \"${disableFlag}\".\\nThis flag is incompatible with \\`@cloudflare/vitest-pool-workers\\`.`;\n\t\t\treturn { isValid: false, errorMessage };\n\t\t}\n\n\t\tconst enableFlagPresent = this.#flagExists(enableFlag);\n\t\tconst dateSufficient = isDateSufficient(\n\t\t\tthis.#compatibilityDate,\n\t\t\tdefaultOnDate\n\t\t);\n\n\t\tif (!enableFlagPresent && !dateSufficient) {\n\t\t\tlet errorMessage = `${this.#buildErrorMessageBase()}, ${this.#buildConfigPath(\n\t\t\t\t\"compatibility_flags\"\n\t\t\t)} must contain \"${enableFlag}\"`;\n\n\t\t\tif (defaultOnDate) {\n\t\t\t\terrorMessage += `, or ${this.#buildConfigPath(\n\t\t\t\t\t\"compatibility_date\"\n\t\t\t\t)} must be >= \"${defaultOnDate}\".`;\n\t\t\t}\n\n\t\t\terrorMessage += `\\nThis flag is required to use \\`@cloudflare/vitest-pool-workers\\`.`;\n\n\t\t\treturn { isValid: false, errorMessage };\n\t\t}\n\n\t\treturn { isValid: true };\n\t}\n\n\t/**\n\t * Ensures that a any one of a given set of flags is present in the compatibility_flags array.\n\t */\n\tassertAtLeastOneFlagExists(flags: string[]): AssertionResult {\n\t\tif (flags.length === 0 || flags.some((flag) => this.#flagExists(flag))) {\n\t\t\treturn { isValid: true };\n\t\t}\n\n\t\tconst errorMessage = `${this.#buildErrorMessageBase()}, ${this.#buildConfigPath(\n\t\t\t\"compatibility_flags\"\n\t\t)} must contain one of ${flags.map((flag) => `\"${flag}\"`).join(\"/\")}.\\nEither one of these flags is required to use \\`@cloudflare/vitest-pool-workers\\`.`;\n\n\t\treturn { isValid: false, errorMessage };\n\t}\n}\n\n/**\n * Common options used across all assertion methods.\n */\ninterface CommonOptions {\n\tcompatibilityDate?: string;\n\tcompatibilityFlags: string[];\n\toptionsPath: string;\n\trelativeProjectPath: string;\n\trelativeWranglerConfigPath?: string;\n}\n\n/**\n * Result of an assertion method.\n */\ninterface AssertionResult {\n\tisValid: boolean;\n\terrorMessage?: string;\n}\n\n/**\n * Parses a date string into a Date object.\n */\nfunction parseDate(dateStr: string): Date {\n\tconst date = new Date(dateStr);\n\tif (isNaN(date.getTime())) {\n\t\tthrow new Error(`Invalid date format: \"${dateStr}\"`);\n\t}\n\treturn date;\n}\n\n/**\n * Checks if the compatibility date meets or exceeds the required date.\n */\nfunction isDateSufficient(\n\tcompatibilityDate?: string,\n\tdefaultOnDate?: string\n): boolean {\n\tif (!compatibilityDate || !defaultOnDate) {\n\t\treturn false;\n\t}\n\tconst compDate = parseDate(compatibilityDate);\n\tconst reqDate = parseDate(defaultOnDate);\n\treturn compDate >= reqDate;\n}\n","import path from \"node:path\";\nimport { build } from \"esbuild\";\n\nexport type ExportMap = Map<\n\tstring,\n\t\"WorkerEntrypoint\" | \"DurableObject\" | \"WorkflowEntrypoint\" | null\n>;\n\n/**\n * Guesses the exports of the main Worker.\n *\n * We do this by running a lightweight esbuild of the main script, and looking at the meta-file generated by esbuild.\n *\n * - This doesn't support Python Workers, but then neither does Vitest.\n * - Workers that need to be built with Vite plugins (e.g. containing wildcard re-exported virtual imports)\n * may not work with esbuild and so we won't be able to find the exports. But in these cases, the user can\n * always manually specify the exports in the Wrangler config via Service bindings, Workflows, or Durable Object migrations.\n *\n * @param entryFile The entry file of the Worker.\n * @param additionalExports Additional exports to include in the export map.\n *\n * @returns A map of export names to their types (WorkerEntrypoint, DurableObject, WorkflowEntrypoint), or null if unknown.\n */\nexport async function guessWorkerExports(\n\tentryFile: string | undefined,\n\tadditionalExports: {\n\t\t[exportName: string]:\n\t\t\t| \"WorkerEntrypoint\"\n\t\t\t| \"DurableObject\"\n\t\t\t| \"WorkflowEntrypoint\";\n\t} = {}\n): Promise<ExportMap> {\n\tconst exportMap: ExportMap = new Map(Object.entries(additionalExports));\n\tif (entryFile === undefined) {\n\t\treturn exportMap;\n\t}\n\n\tif (path.extname(entryFile) == \".py\") {\n\t\t// We don't support Python Workers here.\n\t\treturn exportMap;\n\t}\n\n\tconst result = await build({\n\t\ttarget: \"es2024\",\n\t\tloader: { \".js\": \"jsx\", \".mjs\": \"jsx\", \".cjs\": \"jsx\" },\n\t\tentryPoints: [path.resolve(entryFile)],\n\t\tmetafile: true,\n\t\tbundle: false,\n\t\twrite: false,\n\t\tlogLevel: \"silent\",\n\t});\n\n\tconst entryPoints = Object.values(result.metafile.outputs).filter(\n\t\t(output) => output.entryPoint !== undefined\n\t);\n\tif (entryPoints.length === 0) {\n\t\tthrow new Error(\n\t\t\t`Cannot find entry-point \"${entryFile}\" in generated bundle.`\n\t\t);\n\t}\n\tif (entryPoints.length > 1) {\n\t\tthrow new Error(\n\t\t\t\"More than one entry-point found for generated bundle.\\n\" +\n\t\t\t\tentryPoints.map((output) => ` - ${output.entryPoint}`).join(\"\\n\")\n\t\t);\n\t}\n\n\tfor (const exportName of entryPoints[0].exports) {\n\t\t// For now we have no way to guess the type..\n\t\tif (!exportMap.has(exportName)) {\n\t\t\texportMap.set(exportName, null);\n\t\t}\n\t}\n\n\treturn exportMap;\n}\n","import path from \"node:path\";\nimport type { TestProject } from \"vitest/node\";\n\n// User worker names must not start with this\nexport const WORKER_NAME_PREFIX = \"vitest-pool-workers-\";\n\nexport function isFileNotFoundError(e: unknown): boolean {\n\treturn (\n\t\ttypeof e === \"object\" && e !== null && \"code\" in e && e.code === \"ENOENT\"\n\t);\n}\n\nexport function getProjectPath(project: TestProject): string {\n\treturn project.config.root;\n}\n\nexport function getRelativeProjectPath(project: TestProject): string {\n\tconst projectPath = getProjectPath(project);\n\treturn path.relative(\"\", projectPath);\n}\n\nexport function getRelativeProjectConfigPath(project: TestProject): string {\n\treturn project.config.config\n\t\t? path.relative(\"\", project.config.config)\n\t\t: getRelativeProjectPath(project);\n}\n","import assert from \"node:assert\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { Response } from \"miniflare\";\nimport { isFileNotFoundError } from \"./helpers\";\nimport type { Awaitable, Miniflare, Request } from \"miniflare\";\n\n// Based on https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/snapshot/src/env/node.ts\nasync function handleSnapshotRequest(\n\trequest: Request,\n\turl: URL\n): Promise<Response> {\n\tconst filePath = url.searchParams.get(\"path\");\n\tif (filePath === null) {\n\t\treturn new Response(null, { status: 400 });\n\t}\n\n\tif (request.method === \"POST\" /* prepareDirectory */) {\n\t\tawait fs.mkdir(filePath, { recursive: true });\n\t\treturn new Response(null, { status: 204 });\n\t}\n\n\tif (request.method === \"PUT\" /* saveSnapshotFile */) {\n\t\tconst snapshot = await request.arrayBuffer();\n\t\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\t\tawait fs.writeFile(filePath, new Uint8Array(snapshot));\n\t\treturn new Response(null, { status: 204 });\n\t}\n\n\tif (request.method === \"GET\" /* readSnapshotFile */) {\n\t\ttry {\n\t\t\treturn new Response(await fs.readFile(filePath));\n\t\t} catch (e) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\treturn new Response(null, { status: 404 });\n\t\t}\n\t}\n\n\tif (request.method === \"DELETE\" /* removeSnapshotFile */) {\n\t\ttry {\n\t\t\tawait fs.unlink(filePath);\n\t\t} catch (e) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t\treturn new Response(null, { status: 204 });\n\t}\n\n\treturn new Response(null, { status: 405 });\n}\n\nexport async function listDurableObjectIds(\n\trequest: Request,\n\tmf: Miniflare,\n\turl: URL\n): Promise<Response> {\n\tif (request.method !== \"GET\") {\n\t\treturn new Response(null, { status: 405 });\n\t}\n\tconst persistPaths = mf.unsafeGetPersistPaths();\n\tconst durableObjectPersistPath = persistPaths.get(\"do\");\n\tassert(\n\t\tdurableObjectPersistPath !== undefined,\n\t\t\"Expected Durable Object persist path\"\n\t);\n\n\tconst uniqueKey = url.searchParams.get(\"unique_key\");\n\tif (uniqueKey === null) {\n\t\treturn new Response(null, { status: 400 });\n\t}\n\tconst namespacePath = path.join(durableObjectPersistPath, uniqueKey);\n\n\tconst ids: string[] = [];\n\ttry {\n\t\tconst names = await fs.readdir(namespacePath);\n\t\tfor (const name of names) {\n\t\t\tif (name.endsWith(\".sqlite\")) {\n\t\t\t\tids.push(name.substring(0, name.length - 7 /* \".sqlite\".length */));\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tif (!isFileNotFoundError(e)) {\n\t\t\tthrow e;\n\t\t}\n\t}\n\treturn Response.json(ids);\n}\n\nexport function handleLoopbackRequest(\n\trequest: Request,\n\tmf: Miniflare\n): Awaitable<Response> {\n\tconst url = new URL(request.url);\n\tif (url.pathname === \"/snapshot\") {\n\t\treturn handleSnapshotRequest(request, url);\n\t}\n\tif (url.pathname === \"/durable-objects\") {\n\t\treturn listDurableObjectIds(request, mf, url);\n\t}\n\treturn new Response(null, { status: 404 });\n}\n","// Node.js built-in modules provided by `workerd`\nexport const workerdBuiltinModules = new Set([\n\t...VITEST_POOL_WORKERS_DEFINE_BUILTIN_MODULES,\n\t\"__STATIC_CONTENT_MANIFEST\",\n]);\n","import assert from \"node:assert\";\nimport fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport platformPath from \"node:path\";\nimport posixPath from \"node:path/posix\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport util from \"node:util\";\nimport * as cjsModuleLexer from \"cjs-module-lexer\";\nimport { ModuleRuleTypeSchema, Response } from \"miniflare\";\nimport { workerdBuiltinModules } from \"../shared/builtin-modules\";\nimport { isFileNotFoundError } from \"./helpers\";\nimport type { ModuleRuleType, Request, Worker_Module } from \"miniflare\";\nimport type { Vite } from \"vitest/node\";\n\nlet debuglog: util.DebugLoggerFunction = util.debuglog(\n\t\"vitest-pool-workers:module-fallback\",\n\t(log) => (debuglog = log)\n);\n\nconst isWindows = process.platform === \"win32\";\n\n// Ensures `filePath` uses forward-slashes. Note this doesn't prepend a\n// forward-slash in front of Windows paths, so they can still be passed to Node\n// `fs` functions.\nexport function ensurePosixLikePath(filePath: string) {\n\treturn isWindows ? filePath.replaceAll(\"\\\\\", \"/\") : filePath;\n}\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = platformPath.dirname(__filename);\nconst require = createRequire(__filename);\n\nconst distPath = ensurePosixLikePath(platformPath.resolve(__dirname, \"..\"));\nconst libPath = posixPath.join(distPath, \"worker\", \"lib\");\nconst emptyLibPath = posixPath.join(libPath, \"cloudflare/empty-internal.cjs\");\n\n// File path suffix to disable CJS to ESM-with-named-exports shimming\nconst disableCjsEsmShimSuffix = \"?mf_vitest_no_cjs_esm_shim\";\nfunction trimSuffix(suffix: string, value: string) {\n\tassert(value.endsWith(suffix));\n\treturn value.substring(0, value.length - suffix.length);\n}\n\n/**\n * When pre-bundling is enabled, Vite will add a hash to the end of the file path\n * e.g. `/node_modules/.vite/deps/my-dep.js?v=f3sf2ebd`\n *\n * @see https://vite.dev/guide/features.html#npm-dependency-resolving-and-pre-bundling\n * @see https://github.com/cloudflare/workers-sdk/pull/5673\n */\nconst versionHashRegExp = /\\?v=[0-9a-f]+$/;\n\nfunction trimViteVersionHash(filePath: string) {\n\treturn filePath.replace(versionHashRegExp, \"\");\n}\n\n// RegExp for path suffix to force loading module as specific type.\n// (e.g. `/path/to/module.wasm?mf_vitest_force=CompiledWasm`)\n// This suffix will be added by the pool when fetching a module that matches a\n// module rule. In this case, the module will be marked as external with this\n// suffix, causing the fallback service to return a module with the correct\n// type. Note we can't easily implement rules with a Vite plugin, as they:\n// - Depend on `miniflare`/`wrangler` configuration, and we can't modify the\n// Vite config in the pool\n// - Would require use of an `UnsafeEval` binding to build `WebAssembly.Module`s\nconst forceModuleTypeRegexp = new RegExp(\n\t`\\\\?mf_vitest_force=(${ModuleRuleTypeSchema.options.join(\"|\")})$`\n);\n\nfunction isFile(filePath: string): boolean {\n\treturn fs.statSync(filePath, { throwIfNoEntry: false })?.isFile() ?? false;\n}\n\nfunction isDirectory(filePath: string): boolean {\n\treturn (\n\t\tfs.statSync(filePath, { throwIfNoEntry: false })?.isDirectory() ?? false\n\t);\n}\n\nfunction getParentPaths(filePath: string): string[] {\n\tconst parentPaths: string[] = [];\n\n\twhile (true) {\n\t\tconst parentPath = posixPath.dirname(filePath);\n\t\tif (parentPath === filePath) {\n\t\t\treturn parentPaths;\n\t\t}\n\t\tparentPaths.push(parentPath);\n\t\tfilePath = parentPath;\n\t}\n}\n\nconst dirPathTypeModuleCache = new Map<string, boolean>();\nfunction isWithinTypeModuleContext(filePath: string): boolean {\n\tconst parentPaths = getParentPaths(filePath);\n\n\tfor (const parentPath of parentPaths) {\n\t\tconst cache = dirPathTypeModuleCache.get(parentPath);\n\t\tif (cache !== undefined) {\n\t\t\treturn cache;\n\t\t}\n\t}\n\n\tfor (const parentPath of parentPaths) {\n\t\ttry {\n\t\t\tconst pkgPath = posixPath.join(parentPath, \"package.json\");\n\t\t\tconst pkgJson = fs.readFileSync(pkgPath, \"utf8\");\n\t\t\tconst pkg = JSON.parse(pkgJson);\n\t\t\tconst maybeModulePath = pkg.module\n\t\t\t\t? posixPath.join(parentPath, pkg.module)\n\t\t\t\t: \"\";\n\t\t\tconst cache = pkg.type === \"module\" || maybeModulePath === filePath;\n\t\t\tdirPathTypeModuleCache.set(parentPath, cache);\n\t\t\treturn cache;\n\t\t} catch (e: unknown) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\nawait cjsModuleLexer.init();\n/**\n * Gets \"named\" exports from a CommonJS module. Normally, CommonJS modules can\n * only be default-imported, but Node performs additional static analysis to\n * allow named-imports too (https://nodejs.org/api/esm.html#interoperability-with-commonjs).\n * This function returns the named-exports we should add to our ESM-CJS shim,\n * using the same package as Node.\n */\nasync function getCjsNamedExports(\n\tvite: Vite.ViteDevServer,\n\tfilePath: string,\n\tcontents: string,\n\tseen = new Set()\n): Promise<Set<string>> {\n\tconst { exports, reexports } = cjsModuleLexer.parse(contents);\n\tconst result = new Set(exports);\n\tfor (const reexport of reexports) {\n\t\tconst resolved = await viteResolve(\n\t\t\tvite,\n\t\t\treexport,\n\t\t\tfilePath,\n\t\t\t/* isRequire */ true\n\t\t);\n\t\tif (seen.has(resolved)) {\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\tconst resolvedContents = fs.readFileSync(resolved, \"utf8\");\n\t\t\tseen.add(resolved);\n\t\t\tconst resolvedNames = await getCjsNamedExports(\n\t\t\t\tvite,\n\t\t\t\tresolved,\n\t\t\t\tresolvedContents,\n\t\t\t\tseen\n\t\t\t);\n\t\t\tfor (const name of resolvedNames) {\n\t\t\t\tresult.add(name);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n\tresult.delete(\"default\");\n\tresult.delete(\"__esModule\");\n\treturn result;\n}\n\nfunction withSourceUrl(contents: string, url: string | URL): string {\n\t// If we've already got a `//# sourceURL` comment, return `script` as is\n\t// (searching from the end as that's where we'd expect it)\n\tif (contents.lastIndexOf(\"//# sourceURL=\") !== -1) {\n\t\treturn contents;\n\t}\n\t// Make sure `//# sourceURL` comment is on its own line\n\tconst sourceURL = `\\n//# sourceURL=${url.toString()}\\n`;\n\treturn contents + sourceURL;\n}\n\nfunction withImportMetaUrl(contents: string, url: string | URL): string {\n\t// TODO(soon): this isn't perfect, ideally need `workerd` support\n\treturn contents.replaceAll(\"import.meta.url\", JSON.stringify(url.toString()));\n}\n\n// Extensions that Node's `require()` probes automatically but `workerd` won't.\n// ESM `import` requires explicit extensions; Vite's resolver handles those.\nconst requireExtensions = [\".js\", \".mjs\", \".cjs\", \".json\"];\nfunction maybeGetTargetFilePath(\n\ttarget: string,\n\tisRequire: boolean\n): string | undefined {\n\t// Can't use `fs.existsSync()` here as `target` could be a directory\n\t// (e.g. `node:fs` and `node:fs/promises`)\n\tif (isFile(target)) {\n\t\treturn target;\n\t}\n\tif (isRequire) {\n\t\tfor (const extension of requireExtensions) {\n\t\t\tconst targetWithExtension = target + extension;\n\t\t\tif (fs.existsSync(targetWithExtension)) {\n\t\t\t\treturn targetWithExtension;\n\t\t\t}\n\t\t}\n\t}\n\tif (target.endsWith(disableCjsEsmShimSuffix)) {\n\t\treturn target;\n\t}\n\tif (isDirectory(target)) {\n\t\treturn maybeGetTargetFilePath(target + \"/index\", isRequire);\n\t}\n}\n\n/**\n * `target` is the path to the \"file\" `workerd` is trying to load,\n * `referrer` is the path to the file that imported/required the `target`,\n * `referrerDir` is the dirname of `referrer`\n *\n * For example, if the `referrer` is \"/a/b/c/index.mjs\":\n *\n * | Import Statement | `target` | Return |\n * |-----------------------------|--------------------|--------------------|\n * | import \"./dep.mjs\" | /a/b/c/dep.mjs | dep.mjs |\n * | import \"../dep.mjs\" | /a/b/dep.mjs | ../dep.mjs |\n * | import \"pkg\" | /a/b/c/pkg | pkg |\n * | import \"@org/pkg\" | /a/b/c/@org/pkg | @org/pkg |\n * | import \"node:assert\" | node:assert | node:assert |\n * | import \"cloudflare:sockets\" | cloudflare:sockets | cloudflare:sockets |\n * | import \"workerd:rtti\" | workerd:rtti | workerd:rtti |\n * | import \"random:pkg\" | /a/b/c/random:pkg | random:pkg |\n *\n * Note that we return `dep.mjs` for `import \"./dep.mjs\"`. This would fail\n * ES module resolution, so must be handled by `maybeGetTargetFilePath()`.\n */\nfunction getApproximateSpecifier(target: string, referrerDir: string): string {\n\tif (/^(node|cloudflare|workerd):/.test(target)) {\n\t\treturn target;\n\t}\n\treturn posixPath.relative(referrerDir, target);\n}\n\nasync function viteResolve(\n\tvite: Vite.ViteDevServer,\n\tspecifier: string,\n\treferrer: string,\n\tisRequire: boolean\n): Promise<string> {\n\tconst resolved = await vite.pluginContainer.resolveId(specifier, referrer, {\n\t\tssr: true,\n\t\t// https://github.com/vitejs/vite/blob/v5.1.4/packages/vite/src/node/plugins/resolve.ts#L178-L179\n\t\tcustom: { \"node-resolve\": { isRequire } },\n\t});\n\tif (resolved === null) {\n\t\t// Vite's resolution algorithm doesn't apply Node resolution to specifiers\n\t\t// starting with a dot. Unfortunately, the `@prisma/client` package includes\n\t\t// `require(\".prisma/client/wasm\")` which needs to resolve to something in\n\t\t// `node_modules/.prisma/client`. Since Prisma officially supports Workers,\n\t\t// it's quite likely users will want to use it with the Vitest pool. To fix\n\t\t// this, we fall back to Node's resolution algorithm in this case.\n\t\tif (isRequire && specifier[0] === \".\") {\n\t\t\treturn require.resolve(specifier, { paths: [referrer] });\n\t\t}\n\t\tthrow new Error(\"Not found\");\n\t}\n\t// Handle case where `package.json` `browser` field stubs out built-in with an\n\t// empty module (e.g. `{ \"browser\": { \"fs\": false } }`).\n\tif (resolved.id === \"__vite-browser-external\") {\n\t\treturn emptyLibPath;\n\t}\n\tif (resolved.external) {\n\t\t// Handle case where `node:*` built-in resolved from import map\n\t\t// (e.g. https://github.com/sindresorhus/p-limit/blob/f53bdb5f464ae112b2859e834fdebedc0745199b/package.json#L20)\n\t\tlet { id } = resolved;\n\t\tif (workerdBuiltinModules.has(id)) {\n\t\t\treturn `/${id}`;\n\t\t}\n\t\tif (id.startsWith(\"node:\")) {\n\t\t\tthrow new Error(\"Not found\");\n\t\t}\n\n\t\tid = `node:${id}`;\n\t\tif (workerdBuiltinModules.has(id)) {\n\t\t\treturn `/${id}`;\n\t\t}\n\n\t\t// If we get this far, we have something that:\n\t\t// - looks like a built-in node module but wasn't imported with a `node:` prefix\n\t\t// - and isn't provided by workerd natively\n\t\t// In that case, _try_ and load the identifier with a `node:` prefix.\n\t\t// This will potentially load one of the Node.js polyfills provided by `vitest-pool-workers`\n\t\t// Note: User imports should never get here! This is only meant to cater for Vitest internals\n\t\t// (Specifically, the \"tinyrainbow\" module imports `node:tty` as `tty`)\n\t\treturn id;\n\t}\n\n\treturn trimViteVersionHash(resolved.id);\n}\n\ntype ResolveMethod = \"import\" | \"require\";\nasync function resolve(\n\tvite: Vite.ViteDevServer,\n\tmethod: ResolveMethod,\n\ttarget: string,\n\tspecifier: string,\n\treferrer: string\n): Promise<string /* filePath */> {\n\tconst referrerDir = posixPath.dirname(referrer);\n\n\tconst isRequire = method === \"require\";\n\tlet filePath = maybeGetTargetFilePath(target, isRequire);\n\tif (filePath !== undefined) {\n\t\treturn filePath;\n\t}\n\n\t// `workerd` will always try to resolve modules relative to the referencing\n\t// dir first. Built-in `node:*`/`cloudflare:*` imports only exist at the root.\n\t// We need to ensure we only load a single copy of these modules, therefore,\n\t// we return a redirect to the root here. Note `workerd` will automatically\n\t// look in the root if we return 404 from the fallback service when\n\t// *import*ing `node:*`/`cloudflare:*` modules, but not when *require()*ing\n\t// them. For the sake of consistency (and a nice return type on this function)\n\t// we return a redirect for `import`s too.\n\tif (referrerDir !== \"/\" && workerdBuiltinModules.has(specifier)) {\n\t\treturn `/${specifier}`;\n\t}\n\n\tconst specifierLibPath = posixPath.join(\n\t\tlibPath,\n\t\tspecifier.replaceAll(\":\", \"/\")\n\t);\n\t// Always probe extensions for pool-internal lib modules\n\tfilePath = maybeGetTargetFilePath(specifierLibPath, /* isRequire */ true);\n\tif (filePath !== undefined) {\n\t\treturn filePath;\n\t}\n\n\treturn viteResolve(vite, specifier, referrer, method === \"require\");\n}\n\nfunction buildRedirectResponse(filePath: string) {\n\t// `workerd` expects an absolute POSIX-style path (starting with a slash) for\n\t// redirects. `filePath` is a platform absolute path with forward slashes.\n\t// On Windows, this won't start with a `/`, so we add one to produce paths\n\t// like `/C:/a/b/c`.\n\tif (isWindows && filePath[0] !== \"/\") {\n\t\tfilePath = `/${filePath}`;\n\t}\n\treturn new Response(null, { status: 301, headers: { Location: filePath } });\n}\n\n// `Omit<Worker_Module, \"name\">` gives type `{}` which isn't very helpful, so\n// we have to do something like this instead.\ntype DistributeWorkerModuleForContents<T> = T extends unknown\n\t? { [P in Exclude<keyof T, \"name\">]: NonNullable<T[P]> }\n\t: never;\ntype ModuleContents = DistributeWorkerModuleForContents<Worker_Module>;\n\n// Refer to docs on `forceModuleTypeRegexp` for more details\nfunction maybeGetForceTypeModuleContents(\n\tfilePath: string\n): ModuleContents | undefined {\n\tconst match = forceModuleTypeRegexp.exec(filePath);\n\tif (match === null) {\n\t\treturn;\n\t}\n\n\tfilePath = trimSuffix(match[0], filePath);\n\tconst type = match[1] as ModuleRuleType;\n\tconst contents = fs.readFileSync(filePath);\n\tswitch (type) {\n\t\tcase \"ESModule\":\n\t\t\treturn { esModule: contents.toString() };\n\t\tcase \"CommonJS\":\n\t\t\treturn { commonJsModule: contents.toString() };\n\t\tcase \"Text\":\n\t\t\treturn { text: contents.toString() };\n\t\tcase \"Data\":\n\t\t\treturn { data: contents };\n\t\tcase \"CompiledWasm\":\n\t\t\treturn { wasm: contents };\n\t\tcase \"PythonModule\":\n\t\t\treturn { pythonModule: contents.toString() };\n\t\tcase \"PythonRequirement\":\n\t\t\treturn { pythonRequirement: contents.toString() };\n\t\tdefault: {\n\t\t\t// `type` should've been validated against `ModuleRuleType`\n\t\t\tconst exhaustive: never = type;\n\t\t\tassert.fail(`Unreachable: ${exhaustive} modules are unsupported`);\n\t\t}\n\t}\n}\nfunction buildModuleResponse(target: string, contents: ModuleContents) {\n\tlet name = target;\n\tif (!isWindows) {\n\t\tname = posixPath.relative(\"/\", target);\n\t}\n\tassert(name[0] !== \"/\");\n\tconst result: Record<string, unknown> = { name };\n\tfor (const key in contents) {\n\t\tconst value = (contents as Record<string, unknown>)[key];\n\t\t// Cap'n Proto expects byte arrays for `:Data` typed fields from JSON\n\t\tresult[key] = value instanceof Uint8Array ? Array.from(value) : value;\n\t}\n\treturn Response.json(result);\n}\n\nasync function load(\n\tvite: Vite.ViteDevServer,\n\tlogBase: string,\n\tmethod: ResolveMethod,\n\ttarget: string,\n\tspecifier: string,\n\tfilePath: string\n): Promise<Response> {\n\tif (target !== filePath) {\n\t\t// We might `import` and `require` the same CommonJS package. In this case,\n\t\t// we want to respond with an ES module shim for the `import`, and the\n\t\t// module as is otherwise. If we're `require()`ing a package, make sure we\n\t\t// redirect to the module disabling the ES module shim.\n\t\tif (method === \"require\" && !specifier.startsWith(\"node:\")) {\n\t\t\tfilePath += disableCjsEsmShimSuffix;\n\t\t}\n\t\tdebuglog(logBase, \"redirect:\", filePath);\n\t\treturn buildRedirectResponse(filePath);\n\t}\n\n\t// If this is a WebAssembly module, force load it as one. This ensures we\n\t// support `.wasm` files inside `node_modules` (e.g. Prisma's client).\n\t// It seems unlikely a package would want to do anything else with a `.wasm`\n\t// file. Note if a module rule was applied to `.wasm` files, this path will\n\t// have a `?mf_vitest_force` suffix already, so this line won't do anything.\n\tif (filePath.endsWith(\".wasm\")) {\n\t\tfilePath += `?mf_vitest_force=CompiledWasm`;\n\t}\n\n\t// If we're importing with a forced module type, load the file as that type\n\tconst maybeContents = maybeGetForceTypeModuleContents(filePath);\n\tif (maybeContents !== undefined) {\n\t\tdebuglog(logBase, \"forced:\", filePath);\n\t\treturn buildModuleResponse(target, maybeContents);\n\t}\n\n\t// If we're importing from a shim module, don't shim again\n\tconst disableCjsEsmShim = filePath.endsWith(disableCjsEsmShimSuffix);\n\tif (disableCjsEsmShim) {\n\t\tfilePath = trimSuffix(disableCjsEsmShimSuffix, filePath);\n\t}\n\n\tconst isEsm =\n\t\tfilePath.endsWith(\".mjs\") ||\n\t\t(filePath.endsWith(\".js\") && isWithinTypeModuleContext(filePath));\n\n\t// JSON modules: CommonJS `require(\"./data.json\")` is common in many widely\n\t// used packages (e.g. mime-types). If we return raw JSON as a `commonJsModule`,\n\t// `workerd` will try to parse it as JavaScript and fail with\n\t// `SyntaxError: Unexpected token ':'`.\n\tif (filePath.endsWith(\".json\")) {\n\t\tconst json = fs.readFileSync(filePath, \"utf8\");\n\t\tdebuglog(logBase, \"json:\", filePath);\n\t\treturn buildModuleResponse(target, { json });\n\t}\n\n\tlet contents = fs.readFileSync(filePath, \"utf8\");\n\tconst targetUrl = pathToFileURL(target);\n\tcontents = withSourceUrl(contents, targetUrl);\n\n\tif (isEsm) {\n\t\t// Respond with ES module\n\t\tcontents = withImportMetaUrl(contents, targetUrl);\n\t\tdebuglog(logBase, \"esm:\", filePath);\n\t\treturn buildModuleResponse(target, { esModule: contents });\n\t}\n\n\t// Respond with CommonJS module\n\n\t// If we're `import`ing a CommonJS module, or we're `require`ing a `node:*`\n\t// module from a CommonJS, return an ES module shim. Note\n\t// CommonJS can `require` ES modules, using the default export.\n\tconst insertCjsEsmShim = method === \"import\" || specifier.startsWith(\"node:\");\n\tif (insertCjsEsmShim && !disableCjsEsmShim) {\n\t\tconst fileName = posixPath.basename(filePath);\n\t\tconst disableShimSpecifier = `./${fileName}${disableCjsEsmShimSuffix}`;\n\t\tconst quotedDisableShimSpecifier = JSON.stringify(disableShimSpecifier);\n\t\tlet esModule = `import mod from ${quotedDisableShimSpecifier}; export default mod;`;\n\t\tfor (const name of await getCjsNamedExports(vite, filePath, contents)) {\n\t\t\tesModule += ` export const ${name} = mod.${name};`;\n\t\t}\n\t\tdebuglog(logBase, \"cjs-esm-shim:\", filePath);\n\t\treturn buildModuleResponse(target, { esModule });\n\t}\n\n\t// Otherwise, if we're `require`ing a non-`node:*` module, just return a\n\t// CommonJS\n\tdebuglog(logBase, \"cjs:\", filePath);\n\treturn buildModuleResponse(target, { commonJsModule: contents });\n}\n\nexport async function handleModuleFallbackRequest(\n\tvite: Vite.ViteDevServer,\n\trequest: Request\n): Promise<Response> {\n\tconst method = request.headers.get(\"X-Resolve-Method\");\n\tassert(method === \"import\" || method === \"require\");\n\tconst url = new URL(request.url);\n\tlet target = url.searchParams.get(\"specifier\");\n\tlet referrer = url.searchParams.get(\"referrer\");\n\tassert(target !== null, \"Expected specifier search param\");\n\tassert(referrer !== null, \"Expected referrer search param\");\n\tconst referrerDir = posixPath.dirname(referrer);\n\tlet specifier = getApproximateSpecifier(target, referrerDir);\n\n\t// Convert specifiers like `file:/a/index.mjs` to `/a/index.mjs`. `workerd`\n\t// currently passes `import(\"file:///a/index.mjs\")` through like this.\n\t// TODO(soon): remove this code once the new modules refactor lands\n\tif (specifier.startsWith(\"file:\")) {\n\t\tspecifier = fileURLToPath(specifier);\n\t}\n\n\tif (isWindows) {\n\t\t// Convert paths like `/C:/a/index.mjs` to `C:/a/index.mjs` so they can be\n\t\t// passed to Node `fs` functions.\n\t\tif (target[0] === \"/\") {\n\t\t\ttarget = target.substring(1);\n\t\t}\n\t\tif (referrer[0] === \"/\") {\n\t\t\treferrer = referrer.substring(1);\n\t\t}\n\t}\n\n\tconst quotedTarget = JSON.stringify(target);\n\tconst logBase = `${method}(${quotedTarget}) relative to ${referrer}:`;\n\n\ttry {\n\t\tconst filePath = await resolve(vite, method, target, specifier, referrer);\n\n\t\treturn await load(vite, logBase, method, target, specifier, filePath);\n\t} catch (e) {\n\t\tdebuglog(logBase, \"error:\", e);\n\t\tconsole.error(\n\t\t\t`[vitest-pool-workers] Failed to ${method} ${JSON.stringify(target)} from ${JSON.stringify(referrer)}.`,\n\t\t\t\"To resolve this, try bundling the relevant dependency with Vite.\",\n\t\t\t\"For more details, refer to https://developers.cloudflare.com/workers/testing/vitest-integration/known-issues/#module-resolution\"\n\t\t);\n\t}\n\n\treturn new Response(null, { status: 404 });\n}\n","import path from \"node:path\";\nimport {\n\tformatZodError,\n\tgetRootPath,\n\tLog,\n\tLogLevel,\n\tmergeWorkerOptions,\n\tparseWithRootPath,\n\tPLUGINS,\n} from \"miniflare\";\nimport { z } from \"zod\";\nimport {\n\tgetProjectPath,\n\tgetRelativeProjectConfigPath,\n\tgetRelativeProjectPath,\n} from \"./helpers\";\nimport type { ModuleRule, WorkerOptions } from \"miniflare\";\nimport type { TestProject } from \"vitest/node\";\nimport type { Binding, RemoteProxySession } from \"wrangler\";\nimport type { ParseParams, ZodError } from \"zod\";\n\nexport interface WorkersConfigPluginAPI {\n\tsetMain(newMain?: string): void;\n}\n\nconst PLUGIN_VALUES = Object.values(PLUGINS);\n\nconst WorkersPoolOptionsSchema = z.object({\n\t/**\n\t * Entrypoint to Worker run in the same isolate/context as tests. This is\n\t * required to use `import { exports } from \"cloudflare:workers\"`, or Durable\n\t * Objects without an explicit `scriptName`. Note this goes through Vite\n\t * transforms and can be a TypeScript file. Note also\n\t * `import module from \"<path-to-main>\"` inside tests gives exactly the same\n\t * `module` instance as is used internally for the `SELF` and Durable Object\n\t * bindings.\n\t */\n\tmain: z.ostring(),\n\t/**\n\t * Enables remote bindings to access remote resources configured\n\t * with `remote: true` in the wrangler configuration file.\n\t */\n\tremoteBindings: z.boolean().default(true),\n\t/**\n\t * Additional exports.\n\t * A map of module exports to be made available on the `ctx.exports`\n\t * that cannot be automatically inferred by analyzing the Worker source code.\n\t *\n\t * This is useful for exports that are re-exported implicitly, for example\n\t * through wildcard (`export * from \"...\"`) re-exports from virtual modules.\n\t */\n\tadditionalExports: z\n\t\t.record(\n\t\t\tz.string(),\n\t\t\tz.union([\n\t\t\t\tz.literal(\"WorkerEntrypoint\"),\n\t\t\t\tz.literal(\"DurableObject\"),\n\t\t\t\tz.literal(\"WorkflowEntrypoint\"),\n\t\t\t])\n\t\t)\n\t\t.default({}),\n\tminiflare: z\n\t\t.object({\n\t\t\tworkers: z.array(z.object({}).passthrough()).optional(),\n\t\t})\n\t\t.passthrough()\n\t\t.optional(),\n\twrangler: z\n\t\t.object({ configPath: z.ostring(), environment: z.ostring() })\n\t\t.optional(),\n});\n\nexport type SourcelessWorkerOptions = Omit<\n\tWorkerOptions,\n\t\"script\" | \"scriptPath\" | \"modules\" | \"modulesRoot\"\n> & {\n\t// `modulesRules` is not included in all members of the `SourceOptions` type\n\t// from which `WorkerOptions` is derived. Therefore, we manually include it.\n\tmodulesRules?: ModuleRule[];\n};\n\nexport type WorkersPoolOptions = z.input<typeof WorkersPoolOptionsSchema> & {\n\tminiflare?: SourcelessWorkerOptions & {\n\t\tworkers?: WorkerOptions[];\n\t};\n};\n\nexport type WorkersPoolOptionsWithDefines = WorkersPoolOptions & {\n\tdefines?: Record<string, string>;\n};\n\ntype PathParseParams = Pick<ParseParams, \"path\">;\n\nfunction isZodErrorLike(value: unknown): value is ZodError {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"issues\" in value &&\n\t\tArray.isArray(value.issues)\n\t);\n}\n\ntype ZodErrorRef = { value?: ZodError };\nfunction coalesceZodErrors(ref: ZodErrorRef, thrown: unknown) {\n\tif (!isZodErrorLike(thrown)) {\n\t\tthrow thrown;\n\t}\n\tif (ref.value === undefined) {\n\t\tref.value = thrown;\n\t} else {\n\t\tref.value.issues.push(...thrown.issues);\n\t}\n}\n\nfunction parseWorkerOptions(\n\trootPath: string,\n\tvalue: Record<string, unknown>,\n\twithoutScript: boolean,\n\topts: PathParseParams\n): WorkerOptions {\n\t// If this worker shouldn't have a configurable script, remove all script data\n\t// and replace it with an empty `script` that will pass validation\n\tif (withoutScript) {\n\t\tvalue[\"script\"] = \"\";\n\t\tdelete value[\"scriptPath\"];\n\t\tdelete value[\"modules\"];\n\t\tdelete value[\"modulesRoot\"];\n\t}\n\n\tconst result = {} as WorkerOptions;\n\tconst errorRef: ZodErrorRef = {};\n\tfor (const plugin of PLUGIN_VALUES) {\n\t\ttry {\n\t\t\t// This `parse()` may throw a different `ZodError` than what we `import`\n\t\t\tconst parsed = parseWithRootPath(rootPath, plugin.options, value, opts);\n\t\t\tObject.assign(result, parsed);\n\t\t} catch (e) {\n\t\t\tcoalesceZodErrors(errorRef, e);\n\t\t}\n\t}\n\tif (errorRef.value !== undefined) {\n\t\tthrow errorRef.value;\n\t}\n\n\t// Remove the placeholder script added if any\n\tif (withoutScript) {\n\t\tdelete value[\"script\"];\n\t}\n\treturn result;\n}\n\nconst log = new Log(LogLevel.WARN, { prefix: \"vpw\" });\n\nfunction filterTails(\n\ttails: WorkerOptions[\"tails\"],\n\tuserWorkers?: { name?: string }[]\n) {\n\t// Only connect the tail consumers that represent Workers that are defined in the Vitest config. Warn that a tail will be omitted otherwise\n\t// This _differs from service bindings_ because tail consumers are \"optional\" in a sense, and shouldn't affect the runtime behaviour of a Worker\n\treturn tails?.filter((tailService) => {\n\t\tlet name: string;\n\t\tif (typeof tailService === \"string\") {\n\t\t\tname = tailService;\n\t\t} else if (\n\t\t\ttypeof tailService === \"object\" &&\n\t\t\t\"name\" in tailService &&\n\t\t\ttypeof tailService.name === \"string\"\n\t\t) {\n\t\t\tname = tailService.name;\n\t\t} else {\n\t\t\t// Don't interfere with network-based tail connections (e.g. via the dev registry), or kCurrentWorker\n\t\t\treturn true;\n\t\t}\n\t\tconst found = userWorkers?.some((w) => w.name === name);\n\n\t\tif (!found) {\n\t\t\tlog.warn(\n\t\t\t\t`Tail consumer \"${name}\" was not found in your config. Make sure you add it if you'd like to simulate receiving tail events locally.`\n\t\t\t);\n\t\t}\n\n\t\treturn found;\n\t});\n}\n\n/** Map that maps worker configPaths to their existing remote proxy session data (if any) */\nexport const remoteProxySessionsDataMap = new Map<\n\tstring,\n\t{\n\t\tsession: RemoteProxySession;\n\t\tremoteBindings: Record<string, Binding>;\n\t} | null\n>();\n\nasync function parseCustomPoolOptions(\n\trootPath: string,\n\tvalue: unknown\n): Promise<WorkersPoolOptionsWithDefines> {\n\t// Try to parse pool specific options\n\tconst options = WorkersPoolOptionsSchema.parse(\n\t\tvalue\n\t) as WorkersPoolOptionsWithDefines;\n\toptions.miniflare ??= {};\n\n\t// Try to parse runner worker options, coalescing all errors\n\tconst errorRef: ZodErrorRef = {};\n\tconst workers = options.miniflare?.workers;\n\tconst rootPathOption = getRootPath(options.miniflare);\n\trootPath = path.resolve(rootPath, rootPathOption);\n\ttry {\n\t\toptions.miniflare = parseWorkerOptions(\n\t\t\trootPath,\n\t\t\toptions.miniflare,\n\t\t\t/* withoutScript */ true, // (script provided by runner)\n\t\t\t{ path: [\"miniflare\"] }\n\t\t);\n\t} catch (e) {\n\t\tcoalesceZodErrors(errorRef, e);\n\t}\n\n\toptions.miniflare.workers = [];\n\t// Try to parse auxiliary worker options\n\tif (workers !== undefined) {\n\t\toptions.miniflare.workers = workers.map((worker, i) => {\n\t\t\ttry {\n\t\t\t\tconst workerRootPathOption = getRootPath(worker);\n\t\t\t\tconst workerRootPath = path.resolve(rootPath, workerRootPathOption);\n\t\t\t\treturn parseWorkerOptions(\n\t\t\t\t\tworkerRootPath,\n\t\t\t\t\tworker,\n\t\t\t\t\t/* withoutScript */ false,\n\t\t\t\t\t{\n\t\t\t\t\t\tpath: [\"miniflare\", \"workers\", i],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\tcoalesceZodErrors(errorRef, e);\n\t\t\t\treturn { script: \"\" }; // (ignored as we'll be throwing)\n\t\t\t}\n\t\t});\n\t}\n\n\tif (errorRef.value !== undefined) {\n\t\tthrow errorRef.value;\n\t}\n\n\t// Try to parse Wrangler config if any\n\tif (options.wrangler?.configPath !== undefined) {\n\t\tconst configPath = path.resolve(rootPath, options.wrangler.configPath);\n\t\t// Make sure future accesses to `configPath` see a fully-resolved path\n\t\t// (e.g. for getting accurate relative paths in error messages)\n\t\toptions.wrangler.configPath = configPath;\n\n\t\t// Lazily import `wrangler` if and when we need it\n\t\tconst wrangler = await import(\"wrangler\");\n\n\t\tconst preExistingRemoteProxySessionData = options.wrangler?.configPath\n\t\t\t? remoteProxySessionsDataMap.get(options.wrangler.configPath)\n\t\t\t: undefined;\n\n\t\tconst remoteProxySessionData = options.remoteBindings\n\t\t\t? await wrangler.maybeStartOrUpdateRemoteProxySession(\n\t\t\t\t\t{\n\t\t\t\t\t\tpath: options.wrangler.configPath,\n\t\t\t\t\t\tenvironment: options.wrangler.environment,\n\t\t\t\t\t},\n\t\t\t\t\tpreExistingRemoteProxySessionData ?? null\n\t\t\t\t)\n\t\t\t: null;\n\n\t\tif (options.wrangler?.configPath && remoteProxySessionData) {\n\t\t\tremoteProxySessionsDataMap.set(\n\t\t\t\toptions.wrangler.configPath,\n\t\t\t\tremoteProxySessionData\n\t\t\t);\n\t\t}\n\n\t\tconst { workerOptions, externalWorkers, define, main } =\n\t\t\twrangler.unstable_getMiniflareWorkerOptions(\n\t\t\t\tconfigPath,\n\t\t\t\toptions.wrangler.environment,\n\t\t\t\t{\n\t\t\t\t\toverrides: {\n\t\t\t\t\t\tassets: options.miniflare.assets,\n\t\t\t\t\t\t// doesn't work with containers yet so let's just disable it\n\t\t\t\t\t\tenableContainers: false,\n\t\t\t\t\t},\n\t\t\t\t\tremoteProxyConnectionString:\n\t\t\t\t\t\tremoteProxySessionData?.session?.remoteProxyConnectionString,\n\t\t\t\t}\n\t\t\t);\n\n\t\t// If `main` wasn't explicitly configured, fall back to Wrangler config's\n\t\toptions.main ??= main;\n\n\t\toptions.miniflare.workers = [\n\t\t\t...options.miniflare.workers,\n\t\t\t...externalWorkers,\n\t\t];\n\n\t\t// Merge generated Miniflare options from Wrangler with specified overrides\n\t\toptions.miniflare = mergeWorkerOptions(\n\t\t\tworkerOptions,\n\t\t\toptions.miniflare as SourcelessWorkerOptions\n\t\t);\n\n\t\toptions.miniflare = {\n\t\t\t...options.miniflare,\n\t\t\ttails: filterTails(workerOptions.tails, options.miniflare.workers),\n\t\t};\n\n\t\t// Record any Wrangler `define`s\n\t\toptions.defines = define;\n\t}\n\n\t// Some assets plumbing that should be hidden from the end user\n\tif (options.miniflare?.assets) {\n\t\t// (Used to set the SELF binding to point to the router worker instead)\n\t\toptions.miniflare.hasAssetsAndIsVitest = true;\n\t\toptions.miniflare.assets.routerConfig ??= {};\n\t\toptions.miniflare.assets.routerConfig.has_user_worker = Boolean(\n\t\t\toptions.main\n\t\t);\n\t}\n\n\treturn options;\n}\n\nexport async function parseProjectOptions(\n\tproject: TestProject,\n\tpoolOptions: unknown\n): Promise<WorkersPoolOptionsWithDefines> {\n\t// Make sure the user hasn't specified a custom environment. This was how\n\t// users enabled Miniflare 2's Vitest environment, so it's likely users will\n\t// hit this case.\n\tconst environment = project.config.environment;\n\tif (environment !== undefined && environment !== \"node\") {\n\t\tconst quotedEnvironment = JSON.stringify(environment);\n\n\t\tlet migrationGuide = \".\";\n\t\tif (environment === \"miniflare\") {\n\t\t\tmigrationGuide =\n\t\t\t\t\", and refer to the migration guide if upgrading from `vitest-environment-miniflare`:\\nhttps://developers.cloudflare.com/workers/testing/vitest-integration/get-started/migrate-from-miniflare-2/\";\n\t\t}\n\n\t\tconst relativePath = getRelativeProjectPath(project);\n\t\tconst message = [\n\t\t\t`Unexpected custom \\`environment\\` ${quotedEnvironment} in project ${relativePath}.`,\n\t\t\t\"The Workers pool always runs your tests inside of an environment providing Workers runtime APIs.\",\n\t\t\t`Please remove the \\`environment\\` configuration${migrationGuide}`,\n\t\t].join(\"\\n\");\n\t\tthrow new TypeError(message);\n\t}\n\n\tconst projectPath = getProjectPath(project);\n\n\ttry {\n\t\treturn await parseCustomPoolOptions(projectPath, poolOptions);\n\t} catch (e) {\n\t\tif (!isZodErrorLike(e)) {\n\t\t\tthrow e;\n\t\t}\n\t\tlet formatted: string;\n\t\ttry {\n\t\t\tformatted = formatZodError(e, poolOptions);\n\t\t} catch {\n\t\t\tthrow e;\n\t\t}\n\t\tconst relativePath = getRelativeProjectConfigPath(project);\n\t\tthrow new TypeError(\n\t\t\t`Unexpected options in project ${relativePath}:\\n${formatted}`\n\t\t);\n\t}\n}\n","import type { Request, Response } from \"miniflare\";\nimport type { Unstable_ASSETSBindingsOptions } from \"wrangler\";\n\n// Track all AbortControllers created by buildPagesASSETSBinding so they can\n// be cleaned up when the last pool worker stops. This is necessary because\n// vitest evaluates all project configs at startup (to discover the workspace),\n// even for projects that won't run — so the watchers are created before any\n// pool worker exists, and the creating project's pool worker may never start.\nconst registeredControllers = new Set<AbortController>();\n\n// Reference count of active pool workers. Watchers are only closed when the\n// last worker stops, so that early-finishing workers don't kill watchers that\n// later workers (or other projects in the workspace) still need.\nlet activeWorkers = 0;\n\nexport function poolWorkerStarted(): void {\n\tactiveWorkers++;\n}\n\nexport function poolWorkerStopped(): void {\n\tactiveWorkers--;\n\tif (activeWorkers <= 0) {\n\t\tactiveWorkers = 0;\n\t\tfor (const ac of registeredControllers) {\n\t\t\tac.abort();\n\t\t}\n\t\tregisteredControllers.clear();\n\t}\n}\n\nexport async function buildPagesASSETSBinding(\n\tassetsPath: string\n): Promise<(request: Request) => Promise<Response>> {\n\t// noinspection SuspiciousTypeOfGuard\n\tif (typeof assetsPath !== \"string\") {\n\t\tthrow new TypeError(\n\t\t\t\"Failed to execute 'buildPagesASSETSBinding': parameter 1 is not of type 'string'.\"\n\t\t);\n\t}\n\n\tconst { unstable_generateASSETSBinding } = await import(\"wrangler\"); // (lazy)\n\n\t// Create the AbortController after the import succeeds so we don't leak\n\t// a registered controller if the import throws.\n\tconst ac = new AbortController();\n\tregisteredControllers.add(ac);\n\n\tconst log = {\n\t\t...console,\n\t\tdebugWithSanitization: console.debug,\n\t\tloggerLevel: \"info\",\n\t\tcolumns: process.stdout.columns,\n\t} as unknown as Unstable_ASSETSBindingsOptions[\"log\"];\n\treturn unstable_generateASSETSBinding({\n\t\tlog,\n\t\tdirectory: assetsPath,\n\t\tsignal: ac.signal,\n\t});\n}\n","import assert from \"node:assert\";\nimport path from \"node:path\";\nimport { compileModuleRules, testRegExps } from \"miniflare\";\nimport { type ProvidedContext } from \"vitest\";\nimport { workerdBuiltinModules } from \"../shared/builtin-modules\";\nimport { parseProjectOptions, remoteProxySessionsDataMap } from \"./config\";\nimport { poolWorkerStarted, poolWorkerStopped } from \"./pages\";\nimport { type WorkerPoolOptionsContext } from \"./plugin\";\nimport {\n\tassertCompatibleVitestVersion,\n\tconnectToMiniflareSocket,\n\tgetDurableObjectDesignators,\n\tgetProjectMiniflare,\n\tgetRunnerName,\n\tmaybeGetResolvedMainPath,\n\tstructuredSerializableParse,\n\tstructuredSerializableStringify,\n} from \".\";\nimport type {\n\tWorkersConfigPluginAPI,\n\tWorkersPoolOptions,\n\tWorkersPoolOptionsWithDefines,\n} from \"./config\";\nimport type {\n\tMiniflare,\n\tMessageEvent as MiniflareMessageEvent,\n\tWebSocket,\n} from \"miniflare\";\nimport type {\n\tPoolOptions,\n\tPoolWorker,\n\tWorkerRequest,\n\tWorkerResponse,\n} from \"vitest/node\";\n\nexport class CloudflarePoolWorker implements PoolWorker {\n\tname = \"cloudflare-pool\";\n\tprivate mf: Miniflare | undefined;\n\tprivate socket: WebSocket | undefined;\n\tprivate parsedPoolOptions: WorkersPoolOptionsWithDefines | undefined;\n\tprivate main: string | undefined;\n\t// Store wrapped listeners so off() can remove them correctly.\n\t// Vitest registers at most one listener per event type.\n\tprivate messageListener?: (event: MiniflareMessageEvent) => void;\n\tprivate errorListener?: (event: Event) => void;\n\tprivate closeListener?: () => void;\n\n\tconstructor(\n\t\tprivate options: PoolOptions,\n\t\tprivate poolOptions:\n\t\t\t| WorkersPoolOptions\n\t\t\t| ((\n\t\t\t\t\tctx: WorkerPoolOptionsContext\n\t\t\t ) => Promise<WorkersPoolOptions> | WorkersPoolOptions)\n\t) {\n\t\tassertCompatibleVitestVersion(options.project.vitest);\n\t}\n\n\tasync start(): Promise<void> {\n\t\tpoolWorkerStarted();\n\n\t\tlet resolvedPoolOptions: WorkersPoolOptions;\n\t\tif (typeof this.poolOptions === \"function\") {\n\t\t\t// https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/vitest/src/integrations/inject.ts\n\t\t\tconst inject = <K extends keyof ProvidedContext>(\n\t\t\t\tkey: K\n\t\t\t): ProvidedContext[K] => {\n\t\t\t\treturn this.options.project.getProvidedContext()[key];\n\t\t\t};\n\t\t\tresolvedPoolOptions = await this.poolOptions({ inject });\n\t\t} else {\n\t\t\tresolvedPoolOptions = this.poolOptions;\n\t\t}\n\n\t\tthis.parsedPoolOptions = await parseProjectOptions(\n\t\t\tthis.options.project,\n\t\t\tresolvedPoolOptions\n\t\t);\n\t\tthis.main = maybeGetResolvedMainPath(\n\t\t\tthis.options.project,\n\t\t\tthis.parsedPoolOptions\n\t\t);\n\n\t\t// Find the vitest-pool-workers plugin and give it the path to the main file.\n\t\t// This allows that plugin to inject a virtual dependency on main so that vitest\n\t\t// will automatically re-run tests when that gets updated, avoiding the user having\n\t\t// to manually add such an import in their tests.\n\t\tconst configPlugin = this.options.project.vite.config.plugins.find(\n\t\t\t({ name }) => name === \"@cloudflare/vitest-pool-workers\"\n\t\t);\n\t\tif (configPlugin !== undefined) {\n\t\t\tconst api = configPlugin.api as WorkersConfigPluginAPI;\n\t\t\tapi.setMain(this.main);\n\t\t}\n\n\t\tthis.mf = await getProjectMiniflare(\n\t\t\tthis.options.project.vitest,\n\t\t\tthis.options.project,\n\t\t\tthis.parsedPoolOptions,\n\t\t\tthis.main\n\t\t);\n\n\t\tthis.socket = await connectToMiniflareSocket(\n\t\t\tthis.mf,\n\t\t\tgetRunnerName(this.options.project)\n\t\t);\n\t}\n\n\tasync stop(): Promise<void> {\n\t\tthis.socket?.close();\n\t\tthis.socket = undefined;\n\t\tawait this.mf?.dispose();\n\t\tthis.mf = undefined;\n\n\t\tif (this.parsedPoolOptions?.wrangler?.configPath) {\n\t\t\tawait remoteProxySessionsDataMap\n\t\t\t\t.get(this.parsedPoolOptions?.wrangler?.configPath)\n\t\t\t\t?.session?.dispose?.();\n\t\t}\n\n\t\t// Decrement the active worker count. When the last worker stops, this\n\t\t// closes file watchers created by buildPagesASSETSBinding() during config\n\t\t// evaluation — they're registered globally because vitest evaluates all\n\t\t// project configs at startup, even for projects that won't run.\n\t\tpoolWorkerStopped();\n\t}\n\n\tsend(message: WorkerRequest): void {\n\t\t// Vitest will always call `start()` before calling `send()`\n\t\tassert(this.socket, \"Message sent to Worker before initialisation\");\n\t\tassert(\n\t\t\tthis.parsedPoolOptions,\n\t\t\t\"Message sent to Worker before initialisation\"\n\t\t);\n\n\t\t// Avoid mutating Vitest's message objects — shallow-copy the parts we modify\n\t\tlet toSend: WorkerRequest = message;\n\t\tif (message.type === \"start\") {\n\t\t\t// Users can write `vitest --inspect` to start an inspector connection for their tests\n\t\t\t// We intercept that option and use it to enable inspection of the Workers running in workerd\n\t\t\t// We need to stop it passing through into Vitest's in-Worker code, or Vitest will try and import\n\t\t\t// and run `inspector.open()` from `node:inspector`\n\t\t\ttoSend = {\n\t\t\t\t...message,\n\t\t\t\tcontext: {\n\t\t\t\t\t...message.context,\n\t\t\t\t\tconfig: {\n\t\t\t\t\t\t...message.context.config,\n\t\t\t\t\t\tinspector: {\n\t\t\t\t\t\t\t...message.context.config.inspector,\n\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (message.type === \"run\") {\n\t\t\t// For some reason providing this using the Vitest `project.provide` API\n\t\t\t// doesn't work in Vitest Projects, and so we just provide the context directly\n\t\t\ttoSend = {\n\t\t\t\t...message,\n\t\t\t\tcontext: {\n\t\t\t\t\t...message.context,\n\t\t\t\t\tprovidedContext: {\n\t\t\t\t\t\t...message.context.providedContext,\n\t\t\t\t\t\tcloudflarePoolOptions: JSON.stringify({\n\t\t\t\t\t\t\t// Include resolved `main` if defined\n\t\t\t\t\t\t\tmain: this.main,\n\t\t\t\t\t\t\t// Include designators of all Durable Object namespaces bound in the\n\t\t\t\t\t\t\t// runner worker. We'll use this to list IDs in a namespace. We'll\n\t\t\t\t\t\t\t// also use this to check Durable Object test runner helpers are\n\t\t\t\t\t\t\t// only used with classes defined in the current worker, as these\n\t\t\t\t\t\t\t// helpers rely on wrapping the object.\n\t\t\t\t\t\t\tdurableObjectBindingDesignators: [\n\t\t\t\t\t\t\t\t...getDurableObjectDesignators(\n\t\t\t\t\t\t\t\t\tthis.parsedPoolOptions\n\t\t\t\t\t\t\t\t).entries(),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tselfName: getRunnerName(this.options.project),\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\tthis.socket.send(structuredSerializableStringify(toSend));\n\t}\n\n\ton(\n\t\tevent: string,\n\t\tcallback:\n\t\t\t| ((maybeError: unknown) => void)\n\t\t\t| (() => void)\n\t\t\t| ((response: WorkerResponse) => void)\n\t): void {\n\t\t// Vitest will always call `start()` before calling `on()`\n\t\tassert(this.socket, \"Message received from Worker before initialisation\");\n\t\tassert(\n\t\t\tthis.parsedPoolOptions,\n\t\t\t\"Message received from Worker before initialisation\"\n\t\t);\n\n\t\tconst rules = this.parsedPoolOptions.miniflare?.modulesRules;\n\t\tconst compiledRules = compileModuleRules(rules ?? []);\n\n\t\tif (event === \"message\") {\n\t\t\tconst messageWrapper = (m: { data: string | ArrayBuffer }) => {\n\t\t\t\tconst d = structuredSerializableParse(\n\t\t\t\t\tm.data as string\n\t\t\t\t) as WorkerResponse;\n\n\t\t\t\t// This is a birpc serialised message before it's been parsed, which is why the properties are so unintelligible\n\t\t\t\t// We're looking for a `fetch()` RPC call: https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/vitest/src/types/rpc.ts#L8\n\t\t\t\tif (\n\t\t\t\t\td &&\n\t\t\t\t\ttypeof d === \"object\" &&\n\t\t\t\t\t\"m\" in d &&\n\t\t\t\t\t\"a\" in d &&\n\t\t\t\t\t\"i\" in d &&\n\t\t\t\t\tArray.isArray(d.a) &&\n\t\t\t\t\td.m === \"fetch\"\n\t\t\t\t) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.socket,\n\t\t\t\t\t\t\"Message received from Worker before initialisation\"\n\t\t\t\t\t);\n\t\t\t\t\tconst specifier = d.a[0];\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// `cloudflare:test` imports are handled by the `@cloudflare/vitest-pool-workers` plugin, and so should be ignored here\n\t\t\t\t\t\tspecifier !== \"cloudflare:test\" &&\n\t\t\t\t\t\t(/^(cloudflare|workerd):/.test(specifier) ||\n\t\t\t\t\t\t\tworkerdBuiltinModules.has(specifier))\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn this.socket.send(\n\t\t\t\t\t\t\t// Tell Vitest to treat this module as \"external\" and load it using a workerd module import\n\t\t\t\t\t\t\tstructuredSerializableStringify({\n\t\t\t\t\t\t\t\tt: \"s\",\n\t\t\t\t\t\t\t\ti: d.i,\n\t\t\t\t\t\t\t\tr: { externalize: specifier },\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst maybeRule = compiledRules.find((rule) =>\n\t\t\t\t\t\ttestRegExps(rule.include, specifier)\n\t\t\t\t\t);\n\t\t\t\t\t// Skip if specifier already has query params (e.g. `?raw`), letting Vite handle it.\n\t\t\t\t\tif (maybeRule !== undefined && !specifier.includes(\"?\")) {\n\t\t\t\t\t\tconst externalize =\n\t\t\t\t\t\t\tpath.join(this.options.project.config.root, specifier) +\n\t\t\t\t\t\t\t`?mf_vitest_force=${maybeRule.type}`;\n\n\t\t\t\t\t\treturn this.socket.send(\n\t\t\t\t\t\t\tstructuredSerializableStringify({\n\t\t\t\t\t\t\t\tt: \"s\",\n\t\t\t\t\t\t\t\ti: d.i,\n\t\t\t\t\t\t\t\tr: { externalize },\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t(callback as (response: WorkerResponse) => void)(d);\n\t\t\t};\n\t\t\tthis.messageListener = messageWrapper as (\n\t\t\t\tevent: MiniflareMessageEvent\n\t\t\t) => void;\n\t\t\tthis.socket.addEventListener(\"message\", this.messageListener);\n\t\t} else if (event === \"error\") {\n\t\t\tthis.errorListener = (e: Event) => {\n\t\t\t\t(callback as (maybeError: unknown) => void)(\"error\" in e ? e.error : e);\n\t\t\t};\n\t\t\tthis.socket.addEventListener(\"error\", this.errorListener);\n\t\t} else if (event === \"exit\") {\n\t\t\tthis.closeListener = callback as () => void;\n\t\t\tthis.socket.addEventListener(\"close\", this.closeListener);\n\t\t}\n\t}\n\n\toff(event: string, _callback: (_arg: unknown) => void): void {\n\t\tif (event === \"message\" && this.messageListener) {\n\t\t\tthis.socket?.removeEventListener(\"message\", this.messageListener);\n\t\t\tthis.messageListener = undefined;\n\t\t} else if (event === \"error\" && this.errorListener) {\n\t\t\tthis.socket?.removeEventListener(\"error\", this.errorListener);\n\t\t\tthis.errorListener = undefined;\n\t\t} else if (event === \"exit\" && this.closeListener) {\n\t\t\tthis.socket?.removeEventListener(\"close\", this.closeListener);\n\t\t\tthis.closeListener = undefined;\n\t\t}\n\t}\n\n\t// Vitest does not have a corresponding `serialize()` option, so we can't actually use this for serialisation\n\t// Instead, we serialize/deserialize in the `send()` and `on()` methods.\n\tdeserialize(data: unknown) {\n\t\treturn data;\n\t}\n}\n","import { CloudflarePoolWorker } from \"./cloudflare-pool-worker\";\nimport type { WorkersPoolOptions } from \"./config\";\nimport type { WorkerPoolOptionsContext } from \"./plugin\";\nimport type { PoolRunnerInitializer } from \"vitest/node\";\n\nexport function cloudflarePool(\n\tpoolOptions:\n\t\t| WorkersPoolOptions\n\t\t| ((\n\t\t\t\tctx: WorkerPoolOptionsContext\n\t\t ) => Promise<WorkersPoolOptions> | WorkersPoolOptions)\n): PoolRunnerInitializer {\n\treturn {\n\t\tname: \"cloudflare-pool\",\n\t\tcreatePoolWorker: (options) =>\n\t\t\tnew CloudflarePoolWorker(options, poolOptions),\n\t};\n}\n","import crypto from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { cloudflarePool } from \"./pool\";\nimport type { WorkersPoolOptions } from \"./config\";\nimport type { inject } from \"vitest\";\nimport type { Vite, VitestPluginContext } from \"vitest/node\";\n\nconst cloudflareTestPath = path.resolve(\n\timport.meta.dirname,\n\t\"../worker/lib/cloudflare/test.mjs\"\n);\n\nexport interface WorkerPoolOptionsContext {\n\t// For accessing values from `globalSetup()` (e.g. ports servers started on)\n\t// in Miniflare options (e.g. bindings, upstream, hyperdrives, ...)\n\tinject: typeof inject;\n}\n\nfunction ensureArrayIncludes<T>(array: T[], items: T[]) {\n\tfor (const item of items) {\n\t\tif (!array.includes(item)) {\n\t\t\tarray.push(item);\n\t\t}\n\t}\n}\n\nfunction ensureArrayExcludes<T>(array: T[], items: T[]) {\n\tfor (let i = 0; i < array.length; i++) {\n\t\tif (items.includes(array[i])) {\n\t\t\tarray.splice(i, 1);\n\t\t\ti--;\n\t\t}\n\t}\n}\n\nconst requiredConditions = [\"workerd\", \"worker\", \"module\", \"browser\"];\nconst requiredMainFields = [\"browser\", \"module\", \"jsnext:main\", \"jsnext\"];\n\nexport function cloudflareTest(\n\toptions:\n\t\t| WorkersPoolOptions\n\t\t| ((\n\t\t\t\tctx: WorkerPoolOptionsContext\n\t\t ) => Promise<WorkersPoolOptions> | WorkersPoolOptions)\n): Vite.Plugin {\n\t// Use a unique ID for each `cloudflare:test` module so updates in one `main`\n\t// don't trigger re-runs in all other projects, just the one that changed.\n\tconst uuid = crypto.randomUUID();\n\tlet main: string | undefined;\n\treturn {\n\t\tname: \"@cloudflare/vitest-pool-workers\",\n\t\tapi: {\n\t\t\tsetMain(newMain: string) {\n\t\t\t\tmain = newMain;\n\t\t\t},\n\t\t},\n\t\tconfigureVitest(context: VitestPluginContext) {\n\t\t\tcontext.project.config.poolRunner = cloudflarePool(options);\n\t\t\tcontext.project.config.pool = \"cloudflare-pool\";\n\t\t\tcontext.project.config.snapshotEnvironment = \"cloudflare:snapshot\";\n\t\t},\n\t\t// Run after `vitest:project` plugin:\n\t\t// https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/vitest/src/node/plugins/workspace.ts#L122\n\t\tconfig(config) {\n\t\t\tconfig.resolve ??= {};\n\t\t\tconfig.resolve.conditions ??= [];\n\t\t\tconfig.resolve.mainFields ??= [];\n\t\t\tconfig.ssr ??= {};\n\n\t\t\tconfig.test ??= {};\n\t\t\tconfig.test.server ??= {};\n\t\t\tconfig.test.server.deps ??= {};\n\t\t\t// See https://vitest.dev/config/server.html#inline\n\t\t\t// Without this Vitest delegates to native import() for external deps in node_modules\n\t\t\tconfig.test.server.deps.inline = true;\n\n\t\t\t// Remove \"node\" condition added by the `vitest:project` plugin. We're\n\t\t\t// running tests inside `workerd`, not Node.js, so \"node\" isn't needed.\n\t\t\tensureArrayExcludes(config.resolve.conditions, [\"node\"]);\n\n\t\t\t// Use the same resolve conditions as `wrangler`, minus \"import\" as this\n\t\t\t// breaks Vite's `require()` resolve\n\t\t\tensureArrayIncludes(config.resolve.conditions, requiredConditions);\n\n\t\t\t// Vitest sets this to an empty array if unset, so restore Vite defaults:\n\t\t\t// https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/vitest/src/node/plugins/utils.ts#L121\n\t\t\tensureArrayIncludes(config.resolve.mainFields, requiredMainFields);\n\n\t\t\t// Apply `package.json` `browser` field remapping in SSR mode:\n\t\t\t// https://github.com/vitejs/vite/blob/v5.1.4/packages/vite/src/node/plugins/resolve.ts#L175\n\t\t\tconfig.ssr.target = \"webworker\";\n\t\t},\n\t\tresolveId(id) {\n\t\t\tif (id === \"cloudflare:test\") {\n\t\t\t\treturn `\\0cloudflare:test-${uuid}`;\n\t\t\t}\n\t\t},\n\t\tasync load(id) {\n\t\t\tif (id === `\\0cloudflare:test-${uuid}`) {\n\t\t\t\tlet contents = await fs.readFile(cloudflareTestPath, \"utf8\");\n\n\t\t\t\tif (main !== undefined) {\n\t\t\t\t\t// Inject a side-effect only import of the main entry-point into the test so that Vitest\n\t\t\t\t\t// knows to re-run tests when the Worker is modified.\n\t\t\t\t\tcontents += `import ${JSON.stringify(main)};`;\n\t\t\t\t}\n\t\t\t\treturn contents;\n\t\t\t}\n\t\t\tif (id.endsWith(\"msw/lib/node/index.mjs\")) {\n\t\t\t\t// HACK: This is a temporary solution while MSW works on some changes to better support the Workers\n\t\t\t\t// environment. In the meantime, this replaces the `msw/node` entrypoint with the `msw/native`\n\t\t\t\t// entrypoint (which is designed for React Native and does work in Workers). Users can't use\n\t\t\t\t// `msw/native` themselves directly as the export conditions are not compatible with the Vitest Pool\n\t\t\t\t// export conditions.\n\t\t\t\t//\n\t\t\t\t// This is tracked by https://github.com/mswjs/msw/issues/2637\n\t\t\t\treturn `export * from \"../native/index.mjs\"`;\n\t\t\t}\n\t\t},\n\t};\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { D1Migration } from \"../shared/d1\";\n\n/**\n * Reads all migrations in `migrationsPath`, ordered by migration number.\n * Each migration will have its contents split into an array of SQL queries.\n */\nexport async function readD1Migrations(\n\tmigrationsPath: string\n): Promise<D1Migration[]> {\n\t// noinspection SuspiciousTypeOfGuard\n\tif (typeof migrationsPath !== \"string\") {\n\t\tthrow new TypeError(\n\t\t\t\"Failed to execute 'readD1Migrations': parameter 1 is not of type 'string'.\"\n\t\t);\n\t}\n\n\tconst { unstable_splitSqlQuery } = await import(\"wrangler\"); // (lazy)\n\tconst names = fs\n\t\t.readdirSync(migrationsPath)\n\t\t.filter((name) => name.endsWith(\".sql\"));\n\tnames.sort((a, b) => {\n\t\tconst aNumber = parseInt(a.split(\"_\")[0]);\n\t\tconst bNumber = parseInt(b.split(\"_\")[0]);\n\t\treturn aNumber - bNumber;\n\t});\n\treturn names.map((name) => {\n\t\tconst migrationPath = path.join(migrationsPath, name);\n\t\tconst migration = fs.readFileSync(migrationPath, \"utf8\");\n\t\tconst queries = unstable_splitSqlQuery(migration);\n\t\treturn { name, queries };\n\t});\n}\n\nexport type { D1Migration };\n","import assert from \"node:assert\";\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport * as devalue from \"devalue\";\nimport getPort, { portNumbers } from \"get-port\";\nimport {\n\tgetNodeCompat,\n\tkCurrentWorker,\n\tkUnsafeEphemeralUniqueKey,\n\tLog,\n\tLogLevel,\n\tmaybeApply,\n\tMiniflare,\n\tstructuredSerializableReducers,\n\tstructuredSerializableRevivers,\n\tsupportedCompatibilityDate,\n} from \"miniflare\";\nimport semverSatisfies from \"semver/functions/satisfies.js\";\nimport { experimental_readRawConfig } from \"wrangler\";\nimport { CompatibilityFlagAssertions } from \"./compatibility-flag-assertions\";\nimport { guessWorkerExports } from \"./guess-exports\";\nimport {\n\tgetProjectPath,\n\tgetRelativeProjectPath,\n\tisFileNotFoundError,\n\tWORKER_NAME_PREFIX,\n} from \"./helpers\";\nimport { handleLoopbackRequest } from \"./loopback\";\nimport { handleModuleFallbackRequest } from \"./module-fallback\";\nimport type {\n\tSourcelessWorkerOptions,\n\tWorkersPoolOptions,\n\tWorkersPoolOptionsWithDefines,\n} from \"./config\";\nimport type { MiniflareOptions, SharedOptions, WorkerOptions } from \"miniflare\";\nimport type { Readable } from \"node:stream\";\nimport type { TestProject, Vitest } from \"vitest/node\";\n\nexport function structuredSerializableStringify(value: unknown): string {\n\t// Vitest v2+ sends a sourcemap to its runner, which we can't serialise currently.\n\t// Stripping it doesn't seem to cause any problems, and error stack traces etc.\n\t// still seem to work.\n\t// TODO: Figure out how to serialise SourceMap instances\n\tif (\n\t\tvalue &&\n\t\ttypeof value === \"object\" &&\n\t\t\"r\" in value &&\n\t\tvalue.r &&\n\t\ttypeof value.r === \"object\" &&\n\t\t\"map\" in value.r &&\n\t\tvalue.r.map\n\t) {\n\t\t// Shallow-copy to avoid mutating the caller's object\n\t\tvalue = { ...value, r: { ...value.r, map: undefined } };\n\t}\n\treturn devalue.stringify(value, structuredSerializableReducers);\n}\n\nexport function structuredSerializableParse(value: string): unknown {\n\treturn devalue.parse(value, structuredSerializableRevivers);\n}\n\n// Log for informational pool messages\nconst log = new Log(LogLevel.VERBOSE, { prefix: \"vpw\" });\n// Log for Miniflare instances, used for user code warnings/errors\nconst mfLog = new Log(LogLevel.WARN);\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\nconst DIST_PATH = path.resolve(__dirname, \"..\");\nconst POOL_WORKER_PATH = path.join(DIST_PATH, \"worker/index.mjs\");\n\nconst symbolizerWarning =\n\t\"warning: Not symbolizing stack traces because $LLVM_SYMBOLIZER is not set.\";\nconst ignoreMessages = [\n\t// Not user actionable\n\t// TODO(someday): this is normal operation and really shouldn't error\n\t\"disconnected: operation canceled\",\n\t\"disconnected: worker_do_not_log; Request failed due to internal error\",\n\t\"disconnected: WebSocket was aborted\",\n];\nfunction trimSymbolizerWarning(chunk: string): string {\n\treturn chunk.includes(symbolizerWarning)\n\t\t? chunk.substring(chunk.indexOf(\"\\n\") + 1)\n\t\t: chunk;\n}\nfunction handleRuntimeStdio(stdout: Readable, stderr: Readable): void {\n\tstdout.on(\"data\", (chunk: Buffer) => {\n\t\tprocess.stdout.write(chunk);\n\t});\n\tstderr.on(\"data\", (chunk: Buffer) => {\n\t\tconst str = trimSymbolizerWarning(chunk.toString());\n\t\tif (ignoreMessages.some((message) => str.includes(message))) {\n\t\t\treturn;\n\t\t}\n\t\tprocess.stderr.write(str);\n\t});\n}\n\nexport function getRunnerName(project: TestProject, testFile?: string) {\n\tconst name = `${WORKER_NAME_PREFIX}runner-${project.name.replace(/[^a-z0-9-]/gi, \"_\")}`;\n\tif (testFile === undefined) {\n\t\treturn name;\n\t}\n\tconst testFileHash = crypto.createHash(\"sha1\").update(testFile).digest(\"hex\");\n\ttestFile = testFile.replace(/[^a-z0-9-]/gi, \"_\");\n\treturn `${name}-${testFileHash}-${testFile}`;\n}\n\nfunction isDurableObjectDesignatorToSelf(\n\tvalue: unknown\n): value is string | { className: string } {\n\t// Either this is a simple `string` designator to the current worker...\n\tif (typeof value === \"string\") {\n\t\treturn true;\n\t}\n\t// ...or it's an object designator without a `scriptName`. We're assuming the\n\t// user isn't able to guess the current worker name, so if a `scriptName` is\n\t// set, the designator is definitely for another worker.\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"className\" in value &&\n\t\ttypeof value.className === \"string\" &&\n\t\t(!(\"scriptName\" in value) || value.scriptName === undefined)\n\t);\n}\n\nfunction isWorkflowDesignatorToSelf(\n\tvalue: unknown,\n\tcurrentScriptName: string | undefined\n): value is { className: string } {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"className\" in value &&\n\t\ttypeof value.className === \"string\" &&\n\t\t(!(\"scriptName\" in value) ||\n\t\t\tvalue.scriptName === undefined ||\n\t\t\tvalue.scriptName === currentScriptName)\n\t);\n}\n\ninterface DurableObjectDesignator {\n\tclassName: string;\n\tscriptName?: string;\n\tunsafeUniqueKey?: string;\n}\n/**\n * Returns a map of Durable Objects bindings' bound names to the designators of\n * the objects they point to.\n */\nexport function getDurableObjectDesignators(\n\toptions: WorkersPoolOptions\n): Map<string /* bound name */, DurableObjectDesignator> {\n\tconst result = new Map<string, DurableObjectDesignator>();\n\tconst durableObjects = options.miniflare?.durableObjects ?? {};\n\tfor (const [key, designator] of Object.entries(durableObjects)) {\n\t\tif (typeof designator === \"string\") {\n\t\t\tresult.set(key, { className: designator });\n\t\t} else if (typeof designator.unsafeUniqueKey !== \"symbol\") {\n\t\t\tresult.set(key, {\n\t\t\t\tclassName: designator.className,\n\t\t\t\tscriptName: designator.scriptName,\n\t\t\t\tunsafeUniqueKey: designator.unsafeUniqueKey,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const unboundDurableObject of options.miniflare\n\t\t?.additionalUnboundDurableObjects ?? []) {\n\t\tif (typeof unboundDurableObject.unsafeUniqueKey !== \"symbol\") {\n\t\t\tresult.set(unboundDurableObject.className, {\n\t\t\t\tclassName: unboundDurableObject.className,\n\t\t\t\tscriptName: unboundDurableObject.scriptName,\n\t\t\t\tunsafeUniqueKey: unboundDurableObject.unsafeUniqueKey,\n\t\t\t});\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Gets a set of Durable Object class names for the SELF Worker.\n *\n * This is calculated from the Durable Object bindings that point to SELF as well as the\n * unbound Durable Objects that only have migrations defined.\n */\nfunction getDurableObjectClasses(worker: SourcelessWorkerOptions): Set<string> {\n\t// TODO(someday): may need to extend this to take into account other workers\n\t// if doing multi-worker tests across workspace projects\n\t// TODO(someday): may want to validate class names are valid identifiers?\n\tconst result = new Set<string>();\n\n\t// Get all the Durable Object class names from bindings to the SELF Worker.\n\tfor (const designator of Object.values(worker.durableObjects ?? {})) {\n\t\tif (isDurableObjectDesignatorToSelf(designator)) {\n\t\t\tresult.add(\n\t\t\t\ttypeof designator === \"string\" ? designator : designator.className\n\t\t\t);\n\t\t}\n\t}\n\n\t// And all the Durable Object class names that may not have bindings but have migrations.\n\tfor (const designator of worker.additionalUnboundDurableObjects ?? []) {\n\t\tresult.add(designator.className);\n\t}\n\n\treturn result;\n}\n\nfunction getWranglerWorkerName(\n\trelativeWranglerConfigPath?: string\n): string | undefined {\n\tif (!relativeWranglerConfigPath) {\n\t\treturn undefined;\n\t}\n\tconst wranglerConfigObject = experimental_readRawConfig({\n\t\tconfig: relativeWranglerConfigPath,\n\t});\n\treturn wranglerConfigObject.rawConfig.name;\n}\n\n/**\n * Gets a set of class names for Workflows defined in the SELF Worker.\n */\nfunction getWorkflowClasses(\n\tworker: SourcelessWorkerOptions,\n\trelativeWranglerConfigPath: string | undefined\n): Set<string> {\n\t// TODO(someday): may need to extend this to take into account other workers\n\t// if doing multi-worker tests across workspace projects\n\t// TODO(someday): may want to validate class names are valid identifiers?\n\tconst result = new Set<string>();\n\tif (worker.workflows === undefined) {\n\t\treturn result;\n\t}\n\tfor (const key of Object.keys(worker.workflows)) {\n\t\tconst designator = worker.workflows[key];\n\n\t\tlet workerName: string | undefined;\n\t\t// If the designator's scriptName matches its own Worker name,\n\t\t// use that as the worker name, otherwise use the vitest worker's name\n\t\tconst wranglerWorkerName = getWranglerWorkerName(\n\t\t\trelativeWranglerConfigPath\n\t\t);\n\t\tif (wranglerWorkerName && designator.scriptName === wranglerWorkerName) {\n\t\t\tworkerName = wranglerWorkerName;\n\t\t} else {\n\t\t\tworkerName = worker.name;\n\t\t}\n\n\t\t// `designator` hasn't been validated at this point\n\t\tif (isWorkflowDesignatorToSelf(designator, workerName)) {\n\t\t\tresult.add(designator.className);\n\t\t\t// Shallow clone to avoid mutating config\n\t\t\tworker.workflows[key] = { ...designator };\n\t\t}\n\t}\n\treturn result;\n}\n\ntype ProjectWorkers = [\n\trunnerWorker: WorkerOptions,\n\t...auxiliaryWorkers: WorkerOptions[],\n];\n\nconst SELF_SERVICE_BINDING = \"__VITEST_POOL_WORKERS_SELF_SERVICE\";\nconst LOOPBACK_SERVICE_BINDING = \"__VITEST_POOL_WORKERS_LOOPBACK_SERVICE\";\nconst RUNNER_OBJECT_BINDING = \"__VITEST_POOL_WORKERS_RUNNER_OBJECT\";\n\nasync function buildProjectWorkerOptions(\n\tproject: TestProject,\n\tcustomOptions: WorkersPoolOptionsWithDefines,\n\tmain: string | undefined\n): Promise<ProjectWorkers> {\n\tconst relativeWranglerConfigPath = maybeApply(\n\t\t(v) => path.relative(\"\", v),\n\t\tcustomOptions.wrangler?.configPath\n\t);\n\tconst runnerWorker = customOptions.miniflare ?? {};\n\n\trunnerWorker.name = getRunnerName(project);\n\n\t// Make sure the worker has the `nodejs_compat` and `export_commonjs_default`\n\t// compatibility flags enabled. Vitest makes heavy use of Node APIs, and many\n\t// of the libraries it depends on expect `require()` to return\n\t// `module.exports` directly, rather than `{ default: module.exports }`.\n\trunnerWorker.compatibilityFlags ??= [];\n\n\t// By default, workerd tracks which request context a promise was created in\n\t// and rejects promises that resolve in a different request context. This is a\n\t// safety feature for production Workers to prevent data leaking between\n\t// requests. However, vitest-pool-workers runs all test files within the same\n\t// Durable Object, so promise resolution regularly crosses request boundaries\n\t// (e.g. a setup promise created for one test file resolving during another).\n\t// Without this flag, those promises get rejected and tests break.\n\trunnerWorker.compatibilityFlags.push(\n\t\t\"no_handle_cross_request_promise_resolution\"\n\t);\n\n\tif (runnerWorker.compatibilityDate === undefined) {\n\t\t// No compatibility date was provided, so infer the latest supported date\n\t\trunnerWorker.compatibilityDate ??= supportedCompatibilityDate;\n\t\tlog.info(\n\t\t\t`No compatibility date was provided for project ${getRelativeProjectPath(project)}, defaulting to latest supported date ${runnerWorker.compatibilityDate}.`\n\t\t);\n\t}\n\n\tconst flagAssertions = new CompatibilityFlagAssertions({\n\t\tcompatibilityDate: runnerWorker.compatibilityDate,\n\t\tcompatibilityFlags: runnerWorker.compatibilityFlags,\n\t\toptionsPath: `miniflare`,\n\t\trelativeProjectPath: getRelativeProjectPath(project),\n\t\trelativeWranglerConfigPath,\n\t});\n\n\tconst assertions = [\n\t\t() =>\n\t\t\tflagAssertions.assertIsEnabled({\n\t\t\t\tenableFlag: \"export_commonjs_default\",\n\t\t\t\tdisableFlag: \"export_commonjs_namespace\",\n\t\t\t\tdefaultOnDate: \"2022-10-31\",\n\t\t\t}),\n\t];\n\n\tfor (const assertion of assertions) {\n\t\tconst result = assertion();\n\t\tif (!result.isValid) {\n\t\t\tthrow new Error(result.errorMessage);\n\t\t}\n\t}\n\n\tconst { hasNoNodejsCompatV2Flag, mode } = getNodeCompat(\n\t\trunnerWorker.compatibilityDate,\n\t\trunnerWorker.compatibilityFlags\n\t);\n\n\t// Force nodejs_compat_v2 flag, even if it is disabled by the user, since we require this native stuff for Vitest to work properly\n\tif (mode !== \"v2\") {\n\t\tif (hasNoNodejsCompatV2Flag) {\n\t\t\trunnerWorker.compatibilityFlags.splice(\n\t\t\t\trunnerWorker.compatibilityFlags.indexOf(\"no_nodejs_compat_v2\"),\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\t\trunnerWorker.compatibilityFlags.push(\"nodejs_compat_v2\");\n\t}\n\n\t// Required for `workerd:unsafe` module. We don't require this flag to be set\n\t// as it's experimental, so couldn't be deployed by users.\n\tif (!runnerWorker.compatibilityFlags.includes(\"unsafe_module\")) {\n\t\trunnerWorker.compatibilityFlags.push(\"unsafe_module\");\n\t}\n\n\t// The following nodejs compat flags enable features required for Vitest to work properly\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_tty_module\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_fs_module\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_http_modules\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_perf_hooks_module\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_v8_module\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_process_v2\");\n\n\t// Make sure we define an unsafe eval binding and enable the fallback service\n\trunnerWorker.unsafeEvalBinding = \"__VITEST_POOL_WORKERS_UNSAFE_EVAL\";\n\trunnerWorker.unsafeUseModuleFallbackService = true;\n\n\t// Make sure we define our self/loopback service bindings for helpers\n\trunnerWorker.serviceBindings ??= {};\n\trunnerWorker.serviceBindings[SELF_SERVICE_BINDING] = kCurrentWorker;\n\trunnerWorker.serviceBindings[LOOPBACK_SERVICE_BINDING] =\n\t\thandleLoopbackRequest;\n\n\t// Build wrappers for entrypoints and Durable Objects defined in this worker\n\trunnerWorker.durableObjects ??= {};\n\tconst durableObjectClassNames = getDurableObjectClasses(runnerWorker);\n\n\tconst workflowClassNames = getWorkflowClasses(\n\t\trunnerWorker,\n\t\trelativeWranglerConfigPath\n\t);\n\n\tconst selfWorkerExports: string[] = [];\n\tif (\n\t\tflagAssertions.isEnabled(\n\t\t\t\"enable_ctx_exports\",\n\t\t\t\"disable_ctx_exports\",\n\t\t\t\"2025-11-17\"\n\t\t)\n\t) {\n\t\ttry {\n\t\t\tconst guessedExports = await guessWorkerExports(\n\t\t\t\tmain,\n\t\t\t\tcustomOptions.additionalExports\n\t\t\t);\n\t\t\tfor (const [exportName, exportType] of guessedExports) {\n\t\t\t\tswitch (exportType) {\n\t\t\t\t\tcase \"DurableObject\":\n\t\t\t\t\t\tdurableObjectClassNames.add(exportName);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"WorkflowEntrypoint\":\n\t\t\t\t\t\tworkflowClassNames.add(exportName);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"WorkerEntrypoint\":\n\t\t\t\t\tcase null:\n\t\t\t\t\t\tselfWorkerExports.push(exportName);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconst message = `Failed to statically analyze the exports of the main Worker entry-point \"${customOptions.main}\"\\nMore details: ${e}`;\n\t\t\tfor (const line of message.split(\"\\n\")) {\n\t\t\t\tlog.warn(line);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst workerEntrypointExports = selfWorkerExports.filter(\n\t\t(name) =>\n\t\t\tname !== \"default\" &&\n\t\t\tname !== \"__esModule\" &&\n\t\t\t!durableObjectClassNames.has(name) &&\n\t\t\t!workflowClassNames.has(name)\n\t);\n\n\tconst wrappers = [\n\t\t'import { createWorkerEntrypointWrapper, createDurableObjectWrapper, createWorkflowEntrypointWrapper } from \"cloudflare:test-internal\";',\n\t];\n\n\tfor (const entrypointName of workerEntrypointExports.sort()) {\n\t\tconst quotedEntrypointName = JSON.stringify(entrypointName);\n\t\tconst wrapper = `export const ${entrypointName} = createWorkerEntrypointWrapper(${quotedEntrypointName});`;\n\t\twrappers.push(wrapper);\n\t}\n\tfor (const className of Array.from(durableObjectClassNames).sort()) {\n\t\tconst quotedClassName = JSON.stringify(className);\n\t\tconst wrapper = `export const ${className} = createDurableObjectWrapper(${quotedClassName});`;\n\t\twrappers.push(wrapper);\n\t}\n\n\tfor (const className of Array.from(workflowClassNames).sort()) {\n\t\tconst quotedClassName = JSON.stringify(className);\n\t\tconst wrapper = `export const ${className} = createWorkflowEntrypointWrapper(${quotedClassName});`;\n\t\twrappers.push(wrapper);\n\t}\n\n\t// Make sure we define the `__VITEST_POOL_WORKERS_RUNNER_DURABLE_OBJECT__` Durable Object,\n\t// which is the singleton host for running tests. It's ephemeral (in-memory)\n\t// because the runner doesn't need persistent state, and all disk-backed DOs\n\t// hit a workerd bug on Windows where SQLite paths use Unix-style forward\n\t// slashes (cloudflare/workerd#6110).\n\trunnerWorker.durableObjects[RUNNER_OBJECT_BINDING] = {\n\t\tclassName: \"__VITEST_POOL_WORKERS_RUNNER_DURABLE_OBJECT__\",\n\t\tunsafePreventEviction: true,\n\t\tunsafeUniqueKey: kUnsafeEphemeralUniqueKey,\n\t};\n\n\t// Vite has its own define mechanism, but we can't control it from custom\n\t// pools. Our defines come from `wrangler.toml` files which are only parsed\n\t// with the rest of the pool configuration. Instead, we implement our own\n\t// define script similar to Vite's. When defines change, Miniflare will be\n\t// restarted as the input options will be different.\n\tconst defines = `export default {\n\t\t${Object.entries(customOptions.defines ?? {})\n\t\t\t.map(([key, value]) => `${JSON.stringify(key)}: ${value}`)\n\t\t\t.join(\",\\n\")}\n\t};\n\t`;\n\n\t// Make sure we define the runner script, including object wrappers & defines\n\tif (\"script\" in runnerWorker) {\n\t\tdelete runnerWorker.script;\n\t}\n\tif (\"scriptPath\" in runnerWorker) {\n\t\tdelete runnerWorker.scriptPath;\n\t}\n\n\t// We want module names to be their absolute path without the leading\tslash\n\t// (i.e. the modules root should be the root directory). On Windows, we'd\n\t// like paths to include the drive letter (i.e. `/C:/a/b/c/index.mjs`).\n\t// Internally, Miniflare uses `path.relative(modulesRoot, path)` to compute\n\t// module names. Setting `modulesRoot` to a drive letter and prepending this\n\t// to paths ensures correct names. This requires us to specify `contents`\n\t// with module definitions though, as the new paths don't exist.\n\t// TODO: add source URL comments to injected modules for better stack traces\n\tconst modulesRoot = process.platform === \"win32\" ? \"Z:\\\\\" : \"/\";\n\trunnerWorker.modulesRoot = modulesRoot;\n\n\trunnerWorker.modules = [\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"index.mjs\"),\n\t\t\tcontents: fs.readFileSync(POOL_WORKER_PATH),\n\t\t},\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"__VITEST_POOL_WORKERS_USER_OBJECT\"),\n\t\t\tcontents: wrappers.join(\"\\n\"),\n\t\t},\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"__VITEST_POOL_WORKERS_DEFINES\"),\n\t\t\tcontents: defines,\n\t\t},\n\t\t// The native workerd provided nodejs modules don't always support everything Vitest needs.\n\t\t// As a short-term fix, inject polyfills into the worker bundle that override the native modules.\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"node:console\"),\n\t\t\tcontents: fs.readFileSync(\n\t\t\t\tpath.join(DIST_PATH, `worker/node/console.mjs`)\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"node:vm\"),\n\t\t\tcontents: fs.readFileSync(path.join(DIST_PATH, `worker/node/vm.mjs`)),\n\t\t},\n\t];\n\n\t// Build array of workers contributed by the workspace\n\tconst workers: ProjectWorkers = [runnerWorker as WorkerOptions];\n\tif (runnerWorker.workers !== undefined) {\n\t\t// Try to add workers defined by the user\n\t\tfor (let i = 0; i < runnerWorker.workers.length; i++) {\n\t\t\tconst worker: unknown = runnerWorker.workers[i];\n\t\t\t// Make sure the worker has a non-empty name...\n\t\t\tif (\n\t\t\t\ttypeof worker !== \"object\" ||\n\t\t\t\tworker === null ||\n\t\t\t\t!(\"name\" in worker) ||\n\t\t\t\ttypeof worker.name !== \"string\" ||\n\t\t\t\tworker.name === \"\"\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`In project ${getRelativeProjectPath(project)}, \\`miniflare.workers[${i}].name\\` must be non-empty`\n\t\t\t\t);\n\t\t\t}\n\t\t\t// ...that doesn't start with our reserved prefix\n\t\t\tif (worker.name.startsWith(WORKER_NAME_PREFIX)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`In project ${getRelativeProjectPath(project)}, \\`miniflare.workers[${i}].name\\` must not start with \"${WORKER_NAME_PREFIX}\", got ${worker.name}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Miniflare will validate these options\n\t\t\tworkers.push(worker as WorkerOptions);\n\t\t}\n\t\tdelete runnerWorker.workers;\n\t}\n\n\treturn workers;\n}\n\nconst SHARED_MINIFLARE_OPTIONS: SharedOptions = {\n\tlog: mfLog,\n\tverbose: true,\n\thandleRuntimeStdio,\n\tunsafeStickyBlobs: true,\n} satisfies Partial<MiniflareOptions>;\n\nconst DEFAULT_INSPECTOR_PORT = 9229;\n\nfunction getFirstAvailablePort(start: number): Promise<number> {\n\treturn getPort({ port: portNumbers(start, 65535) });\n}\n\ntype ModuleFallbackService = NonNullable<\n\tMiniflareOptions[\"unsafeModuleFallbackService\"]\n>;\n// Reuse the same bound module fallback service when constructing Miniflare\n// options, so deep equality checks succeed\nconst moduleFallbackServices = new WeakMap<Vitest, ModuleFallbackService>();\nfunction getModuleFallbackService(ctx: Vitest): ModuleFallbackService {\n\tlet service = moduleFallbackServices.get(ctx);\n\tif (service !== undefined) {\n\t\treturn service;\n\t}\n\tservice = handleModuleFallbackRequest.bind(undefined, ctx.vite);\n\tmoduleFallbackServices.set(ctx, service);\n\treturn service;\n}\n\n/**\n * Builds options for the Miniflare instance running tests for the given Vitest\n * project.\n */\nasync function buildProjectMiniflareOptions(\n\tctx: Vitest,\n\tproject: TestProject,\n\tcustomOptions: WorkersPoolOptions,\n\tmain: string | undefined\n): Promise<MiniflareOptions> {\n\tconst moduleFallbackService = getModuleFallbackService(ctx);\n\tconst [runnerWorker, ...auxiliaryWorkers] = await buildProjectWorkerOptions(\n\t\tproject,\n\t\tcustomOptions,\n\t\tmain\n\t);\n\n\tassert(runnerWorker.name !== undefined);\n\tassert(runnerWorker.name.startsWith(WORKER_NAME_PREFIX));\n\n\tlet inspectorPort: number | undefined;\n\tif (ctx.config.inspector.enabled) {\n\t\tconst userSpecifiedPort = ctx.config.inspector.port;\n\t\tif (userSpecifiedPort !== undefined) {\n\t\t\tconst availablePort = await getFirstAvailablePort(userSpecifiedPort);\n\t\t\tif (availablePort !== userSpecifiedPort) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Inspector port ${userSpecifiedPort} is not available. ` +\n\t\t\t\t\t\t`Either free up the port or remove the inspector port configuration to use an automatically assigned port.`\n\t\t\t\t);\n\t\t\t}\n\t\t\tinspectorPort = userSpecifiedPort;\n\t\t} else {\n\t\t\tinspectorPort = await getFirstAvailablePort(DEFAULT_INSPECTOR_PORT);\n\t\t\tif (inspectorPort !== DEFAULT_INSPECTOR_PORT) {\n\t\t\t\tlog.warn(\n\t\t\t\t\t`Default inspector port ${DEFAULT_INSPECTOR_PORT} not available, using ${inspectorPort} instead.`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\t...SHARED_MINIFLARE_OPTIONS,\n\t\tinspectorPort,\n\t\tunsafeModuleFallbackService: moduleFallbackService,\n\t\tworkers: [runnerWorker, ...auxiliaryWorkers],\n\t};\n}\nexport async function getProjectMiniflare(\n\tctx: Vitest,\n\tproject: TestProject,\n\tpoolOptions: WorkersPoolOptionsWithDefines,\n\tmain: string | undefined\n): Promise<Miniflare> {\n\tconst mfOptions = await buildProjectMiniflareOptions(\n\t\tctx,\n\t\tproject,\n\t\tpoolOptions,\n\t\tmain\n\t);\n\tlog.info(\n\t\t`Starting runtime for ${getRelativeProjectPath(project)}` +\n\t\t\t`${mfOptions.inspectorPort !== undefined ? ` with inspector on port ${mfOptions.inspectorPort}` : \"\"}` +\n\t\t\t`...`\n\t);\n\tconst mf = new Miniflare(mfOptions);\n\tawait mf.ready;\n\treturn mf;\n}\n\nexport function maybeGetResolvedMainPath(\n\tproject: TestProject,\n\toptions: WorkersPoolOptionsWithDefines\n): string | undefined {\n\tconst projectPath = getProjectPath(project);\n\tconst main = options.main;\n\tif (main === undefined) {\n\t\treturn;\n\t}\n\tif (typeof projectPath === \"string\") {\n\t\treturn path.resolve(projectPath, main);\n\t} else {\n\t\treturn path.resolve(main);\n\t}\n}\n\nexport async function connectToMiniflareSocket(\n\tmf: Miniflare,\n\tworkerName: string\n) {\n\tconst ns = await mf.getDurableObjectNamespace(\n\t\tRUNNER_OBJECT_BINDING,\n\t\tworkerName\n\t);\n\n\t// @ts-expect-error `ColoLocalActorNamespace`s are not included in types\n\tconst stub = ns.get(\"singleton\");\n\n\tconst res = await stub.fetch(\"http://placeholder\", {\n\t\theaders: {\n\t\t\tUpgrade: \"websocket\",\n\t\t\t\"MF-Vitest-Worker-Data\": structuredSerializableStringify({\n\t\t\t\tcwd: process.cwd(),\n\t\t\t}),\n\t\t},\n\t});\n\n\tconst webSocket = res.webSocket;\n\tif (webSocket === null) {\n\t\tconst body = await res.text().catch(() => \"\");\n\t\tthrow new Error(\n\t\t\t`Failed to establish WebSocket to runner (status ${res.status}): ${body}`\n\t\t);\n\t}\n\n\twebSocket.accept();\n\n\treturn webSocket;\n}\n\ninterface PackageJson {\n\tversion?: string;\n\tpeerDependencies?: Record<string, string | undefined>;\n}\nfunction getPackageJson(dirPath: string): PackageJson | undefined {\n\twhile (true) {\n\t\tconst pkgJsonPath = path.join(dirPath, \"package.json\");\n\t\ttry {\n\t\t\tconst contents = fs.readFileSync(pkgJsonPath, \"utf8\");\n\t\t\treturn JSON.parse(contents);\n\t\t} catch (e) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t\tconst nextDirPath = path.dirname(dirPath);\n\t\t// `path.dirname()` of the root directory is the root directory\n\t\tif (nextDirPath === dirPath) {\n\t\t\treturn;\n\t\t}\n\t\tdirPath = nextDirPath;\n\t}\n}\n\nexport function assertCompatibleVitestVersion(ctx: Vitest) {\n\t// Some package managers don't enforce `peerDependencies` requirements,\n\t// so add a runtime sanity check to ensure things don't break in strange ways.\n\tconst poolPkgJson = getPackageJson(__dirname);\n\tconst vitestPkgJson = getPackageJson(ctx.distPath);\n\tassert(\n\t\tpoolPkgJson !== undefined,\n\t\t\"Expected to find `package.json` for `@cloudflare/vitest-pool-workers`\"\n\t);\n\tassert(\n\t\tvitestPkgJson !== undefined,\n\t\t\"Expected to find `package.json` for `vitest`\"\n\t);\n\n\tconst expectedVitestVersion = poolPkgJson.peerDependencies?.vitest;\n\tconst actualVitestVersion = vitestPkgJson.version;\n\tassert(\n\t\texpectedVitestVersion !== undefined,\n\t\t\"Expected to find `@cloudflare/vitest-pool-workers`'s `vitest` version constraint\"\n\t);\n\tassert(\n\t\tactualVitestVersion !== undefined,\n\t\t\"Expected to find `vitest`'s version\"\n\t);\n\n\t// Hard error on Vitest v3, which definitely won't work\n\tif (semverSatisfies(actualVitestVersion, \"3.x\")) {\n\t\tconst message = `You're running \\`vitest@${actualVitestVersion}\\`, but this version of \\`@cloudflare/vitest-pool-workers\\` only supports \\`vitest ${expectedVitestVersion}\\`.`;\n\t\tthrow new Error(message);\n\t}\n\n\tif (!semverSatisfies(actualVitestVersion, expectedVitestVersion)) {\n\t\tconst message = [\n\t\t\t`You're running \\`vitest@${actualVitestVersion}\\`, but this version of \\`@cloudflare/vitest-pool-workers\\` only officially supports \\`vitest ${expectedVitestVersion}\\`.`,\n\t\t\t\"`@cloudflare/vitest-pool-workers` currently depends on internal Vitest APIs that are not protected by semantic-versioning guarantees.\",\n\t\t\t`Your tests may work without issue, but we can not guarantee compatibility outside of the above version range.`,\n\t\t].join(\"\\n\");\n\t\tlog.warn(message);\n\t}\n}\n\n/**\n * Ensures that the specified compatibility feature is enabled for Vitest to work.\n * @param compatibilityFlags The list of current compatibility flags.\n * @param feature The name of the feature to enable.\n */\nfunction ensureFeature(compatibilityFlags: string[], feature: string) {\n\tconst flagToEnable = `enable_${feature}`;\n\tconst flagToDisable = `disable_${feature}`;\n\tif (!compatibilityFlags.includes(flagToEnable)) {\n\t\tlog.debug(\n\t\t\t`Adding \\`${flagToEnable}\\` compatibility flag during tests as this feature is needed to support the Vitest runner.`\n\t\t);\n\t\tcompatibilityFlags.push(flagToEnable);\n\t}\n\tif (compatibilityFlags.includes(flagToDisable)) {\n\t\tlog.info(\n\t\t\t`Removing \\`${flagToDisable}\\` compatibility flag during tests as that feature is needed to support the Vitest runner.`\n\t\t);\n\t\tcompatibilityFlags.splice(compatibilityFlags.indexOf(flagToDisable), 1);\n\t}\n}\n\nexport { cloudflarePool } from \"./pool\";\nexport { cloudflareTest } from \"./plugin\";\nexport * from \"./d1\";\nexport * from \"./pages\";\n"],"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M,cAAc,eAAe,UAAU;CAC7C,MAAM,gBAAgB,eAAe,IAAI,SAAS;AAClD,QACC,gBAAgB,QAChB,wEACA;AACD,QACC,kBAAkB,QAClB,+CACA;CAED,MAAM,wBAAwB,YAAY,kBAAkB;CAC5D,MAAM,sBAAsB,cAAc;AAC1C,QACC,0BAA0B,QAC1B,mFACA;AACD,QACC,wBAAwB,QACxB,sCACA;AAGD,mCAAoB,qBAAqB,MAAM,EAAE;EAChD,MAAM,UAAU,2BAA2B,oBAAoB,qFAAqF,sBAAsB;AAC1K,QAAM,IAAI,MAAM,QAAQ;;AAGzB,KAAI,+BAAiB,qBAAqB,sBAAsB,EAAE;EACjE,MAAM,UAAU;GACf,2BAA2B,oBAAoB,gGAAgG,sBAAsB;GACrK;GACA;GACA,CAAC,KAAK,KAAK;AACZ,MAAI,KAAK,QAAQ;;;;;;;;AASnB,SAAS,cAAc,oBAA8B,SAAiB;CACrE,MAAM,eAAe,UAAU;CAC/B,MAAM,gBAAgB,WAAW;AACjC,KAAI,CAAC,mBAAmB,SAAS,aAAa,EAAE;AAC/C,MAAI,MACH,YAAY,aAAa,4FACzB;AACD,qBAAmB,KAAK,aAAa;;AAEtC,KAAI,mBAAmB,SAAS,cAAc,EAAE;AAC/C,MAAI,KACH,cAAc,cAAc,4FAC5B;AACD,qBAAmB,OAAO,mBAAmB,QAAQ,cAAc,EAAE,EAAE"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["all","t","parse","#hasDate","#hasTime","#offset","numeric","t","stringify","#status","#reportable","readFileSync$1","readFileSync","isDirectory","cache","exports","util","z","path3","isDirectory","build","custom","index","value","from","to","parseOptions","MAX_LENGTH","MAX_SAFE_INTEGER","MAX_SAFE_COMPONENT_LENGTH","MAX_SAFE_BUILD_LENGTH","debug","debug","re","src","t","MAX_LENGTH","compareIdentifiers","debug","re","parseOptions","SemVer","t","SemVer","compare","compare","eq","compare","neq","compare","gt","compare","gte","compare","lt","lte","cmp","Comparator","parseOptions","re","t","SemVer","Range","debug","Range","z","#compatibilityDate","#compatibilityFlags","#optionsPath","#relativeProjectPath","#relativeWranglerConfigPath","#flagExists","#buildErrorMessageBase","#buildConfigPath","exportMap: ExportMap","fs","ids: string[]","debuglog: util.DebugLoggerFunction","log","__filename","__dirname","platformPath","require","parentPaths: string[]","cache","e: unknown","exports","resolve","exhaustive: never","result: Record<string, unknown>","errorRef: ZodErrorRef","log","name: string","formatted: string","options: PoolOptions","poolOptions:\n\t\t\t| WorkersPoolOptions\n\t\t\t| ((\n\t\t\t\t\tctx: WorkerPoolOptionsContext\n\t\t\t ) => Promise<WorkersPoolOptions> | WorkersPoolOptions)","resolvedPoolOptions: WorkersPoolOptions","toSend: WorkerRequest","main: string | undefined","fs","devalue.stringify","devalue.parse","workerName: string | undefined","selfWorkerExports: string[]","workers: ProjectWorkers","worker: unknown","SHARED_MINIFLARE_OPTIONS: SharedOptions","getPort","inspectorPort: number | undefined"],"sources":["../../../workers-utils/dist/chunk-OZQVB3L3.mjs","../../../workers-utils/dist/chunk-DCOBXSFB.mjs","../../../workers-utils/dist/chunk-LX2YG63L.mjs","../../../workers-utils/dist/chunk-O4YGOZSW.mjs","../../../workers-utils/dist/chunk-A4F3D336.mjs","../../../workers-utils/dist/index.mjs","../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/utils.js","../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/base64.js","../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/constants.js","../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/parse.js","../../../../node_modules/.pnpm/devalue@5.6.3/node_modules/devalue/src/stringify.js","../../../../node_modules/.pnpm/get-port@7.1.0/node_modules/get-port/index.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/lrucache.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/parse-options.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/constants.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/debug.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/re.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/internal/identifiers.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/semver.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/compare.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/eq.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/neq.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gt.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/gte.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lt.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/lte.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/cmp.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/comparator.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/classes/range.js","../../../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/satisfies.js","../../src/pool/compatibility-flag-assertions.ts","../../src/pool/guess-exports.ts","../../src/pool/helpers.ts","../../src/pool/loopback.ts","../../src/shared/builtin-modules.ts","../../src/pool/module-fallback.ts","../../src/pool/config.ts","../../src/pool/pages.ts","../../src/pool/cloudflare-pool-worker.ts","../../src/pool/pool.ts","../../src/pool/plugin.ts","../../src/pool/d1.ts","../../src/pool/index.ts"],"sourcesContent":["// src/constants.ts\nvar INHERIT_SYMBOL = Symbol.for(\"inherit_binding\");\nvar SERVICE_TAG_PREFIX = \"cf:service=\";\nvar ENVIRONMENT_TAG_PREFIX = \"cf:environment=\";\nvar PATH_TO_DEPLOY_CONFIG = \".wrangler/deploy/config.json\";\nvar JSON_CONFIG_FORMATS = [\"json\", \"jsonc\"];\n\nexport { ENVIRONMENT_TAG_PREFIX, INHERIT_SYMBOL, JSON_CONFIG_FORMATS, PATH_TO_DEPLOY_CONFIG, SERVICE_TAG_PREFIX };\n","var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n if (typeof require !== \"undefined\") return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\nexport { __commonJS, __export, __name, __reExport, __require, __toESM };\n","import { ENVIRONMENT_TAG_PREFIX, SERVICE_TAG_PREFIX } from './chunk-OZQVB3L3.mjs';\nimport { __name } from './chunk-DCOBXSFB.mjs';\nimport assert from 'node:assert';\n\nfunction isCompatDate(str) {\n return /^\\d{4}-\\d{2}-\\d{2}$/.test(str);\n}\n__name(isCompatDate, \"isCompatDate\");\nfunction formatCompatibilityDate(date) {\n const compatDate = date.toISOString().slice(0, 10);\n assert(isCompatDate(compatDate));\n return compatDate;\n}\n__name(formatCompatibilityDate, \"formatCompatibilityDate\");\nfunction getTodaysCompatDate() {\n return formatCompatibilityDate(/* @__PURE__ */ new Date());\n}\n__name(getTodaysCompatDate, \"getTodaysCompatDate\");\n\n// src/assert-never.ts\nfunction assertNever(_value) {\n}\n__name(assertNever, \"assertNever\");\n\n// src/map-worker-metadata-bindings.ts\nfunction mapWorkerMetadataBindings(bindings) {\n return bindings.filter((binding) => binding.type !== \"secret_text\").reduce((configObj, binding) => {\n switch (binding.type) {\n case \"plain_text\":\n {\n configObj.vars = {\n ...configObj.vars ?? {},\n [binding.name]: binding.text\n };\n }\n break;\n case \"json\":\n {\n configObj.vars = {\n ...configObj.vars ?? {},\n name: binding.name,\n json: binding.json\n };\n }\n break;\n case \"kv_namespace\":\n {\n configObj.kv_namespaces = [\n ...configObj.kv_namespaces ?? [],\n { id: binding.namespace_id, binding: binding.name }\n ];\n }\n break;\n case \"durable_object_namespace\":\n {\n configObj.durable_objects = {\n bindings: [\n ...configObj.durable_objects?.bindings ?? [],\n {\n name: binding.name,\n class_name: binding.class_name,\n script_name: binding.script_name,\n environment: binding.environment\n }\n ]\n };\n }\n break;\n case \"d1\":\n {\n configObj.d1_databases = [\n ...configObj.d1_databases ?? [],\n {\n binding: binding.name,\n database_id: binding.id\n }\n ];\n }\n break;\n case \"browser\":\n {\n configObj.browser = {\n binding: binding.name\n };\n }\n break;\n case \"ai\":\n {\n configObj.ai = {\n binding: binding.name\n };\n }\n break;\n case \"images\":\n {\n configObj.images = {\n binding: binding.name\n };\n }\n break;\n case \"stream\":\n {\n configObj.stream = {\n binding: binding.name\n };\n }\n break;\n case \"media\":\n {\n configObj.media = {\n binding: binding.name\n };\n }\n break;\n case \"r2_bucket\":\n {\n configObj.r2_buckets = [\n ...configObj.r2_buckets ?? [],\n {\n binding: binding.name,\n bucket_name: binding.bucket_name,\n jurisdiction: binding.jurisdiction\n }\n ];\n }\n break;\n case \"secrets_store_secret\":\n {\n configObj.secrets_store_secrets = [\n ...configObj.secrets_store_secrets ?? [],\n {\n binding: binding.name,\n store_id: binding.store_id,\n secret_name: binding.secret_name\n }\n ];\n }\n break;\n case \"unsafe_hello_world\": {\n configObj.unsafe_hello_world = [\n ...configObj.unsafe_hello_world ?? [],\n {\n binding: binding.name,\n enable_timer: binding.enable_timer\n }\n ];\n break;\n }\n case \"service\":\n {\n configObj.services = [\n ...configObj.services ?? [],\n {\n binding: binding.name,\n service: binding.service,\n environment: binding.environment,\n entrypoint: binding.entrypoint\n }\n ];\n }\n break;\n case \"analytics_engine\":\n {\n configObj.analytics_engine_datasets = [\n ...configObj.analytics_engine_datasets ?? [],\n { binding: binding.name, dataset: binding.dataset }\n ];\n }\n break;\n case \"dispatch_namespace\":\n {\n configObj.dispatch_namespaces = [\n ...configObj.dispatch_namespaces ?? [],\n {\n binding: binding.name,\n namespace: binding.namespace,\n ...binding.outbound && {\n outbound: {\n service: binding.outbound.worker.service,\n environment: binding.outbound.worker.environment,\n parameters: binding.outbound.params?.map((p) => p.name) ?? []\n }\n }\n }\n ];\n }\n break;\n case \"logfwdr\":\n {\n configObj.logfwdr = {\n bindings: [\n ...configObj.logfwdr?.bindings ?? [],\n { name: binding.name, destination: binding.destination }\n ]\n };\n }\n break;\n case \"wasm_module\":\n {\n configObj.wasm_modules = {\n ...configObj.wasm_modules ?? {},\n [binding.name]: binding.part\n };\n }\n break;\n case \"text_blob\":\n {\n configObj.text_blobs = {\n ...configObj.text_blobs ?? {},\n [binding.name]: binding.part\n };\n }\n break;\n case \"data_blob\":\n {\n configObj.data_blobs = {\n ...configObj.data_blobs ?? {},\n [binding.name]: binding.part\n };\n }\n break;\n case \"secret_text\":\n break;\n case \"version_metadata\": {\n {\n configObj.version_metadata = {\n binding: binding.name\n };\n }\n break;\n }\n case \"send_email\": {\n configObj.send_email = [\n ...configObj.send_email ?? [],\n {\n name: binding.name,\n destination_address: binding.destination_address,\n allowed_destination_addresses: binding.allowed_destination_addresses,\n allowed_sender_addresses: binding.allowed_sender_addresses\n }\n ];\n break;\n }\n case \"queue\":\n configObj.queues ??= { producers: [] };\n configObj.queues.producers = [\n ...configObj.queues.producers ?? [],\n {\n binding: binding.name,\n queue: binding.queue_name,\n delivery_delay: binding.delivery_delay\n }\n ];\n break;\n case \"vectorize\":\n configObj.vectorize = [\n ...configObj.vectorize ?? [],\n {\n binding: binding.name,\n index_name: binding.index_name\n }\n ];\n break;\n case \"ai_search_namespace\":\n configObj.ai_search_namespaces = [\n ...configObj.ai_search_namespaces ?? [],\n {\n binding: binding.name,\n namespace: binding.namespace\n }\n ];\n break;\n case \"ai_search\":\n configObj.ai_search = [\n ...configObj.ai_search ?? [],\n {\n binding: binding.name,\n instance_name: binding.instance_name\n }\n ];\n break;\n case \"hyperdrive\":\n configObj.hyperdrive = [\n ...configObj.hyperdrive ?? [],\n {\n binding: binding.name,\n id: binding.id\n }\n ];\n break;\n case \"mtls_certificate\":\n configObj.mtls_certificates = [\n ...configObj.mtls_certificates ?? [],\n {\n binding: binding.name,\n certificate_id: binding.certificate_id\n }\n ];\n break;\n case \"pipelines\":\n configObj.pipelines = [\n ...configObj.pipelines ?? [],\n {\n binding: binding.name,\n pipeline: binding.pipeline\n }\n ];\n break;\n case \"assets\":\n configObj.assets = {\n binding: binding.name\n // Note: we currently don't get all the assets information from the\n // API, so here we are only able to set the name of the binding\n // hopefully in the future we can properly fully support the binding\n };\n break;\n case \"inherit\":\n configObj.unsafe = {\n bindings: [...configObj.unsafe?.bindings ?? [], binding],\n metadata: configObj.unsafe?.metadata ?? void 0\n };\n break;\n case \"workflow\":\n {\n configObj.workflows = [\n ...configObj.workflows ?? [],\n {\n binding: binding.name,\n name: binding.workflow_name,\n class_name: binding.class_name,\n script_name: binding.script_name\n }\n ];\n }\n break;\n case \"worker_loader\":\n {\n configObj.worker_loaders = [\n ...configObj.worker_loaders ?? [],\n {\n binding: binding.name\n }\n ];\n }\n break;\n case \"ratelimit\":\n {\n configObj.ratelimits = [\n ...configObj.ratelimits ?? [],\n {\n name: binding.name,\n namespace_id: binding.namespace_id,\n simple: {\n limit: binding.simple.limit,\n period: binding.simple.period\n }\n }\n ];\n }\n break;\n case \"vpc_service\":\n {\n configObj.vpc_services = [\n ...configObj.vpc_services ?? [],\n {\n binding: binding.name,\n service_id: binding.service_id\n }\n ];\n }\n break;\n case \"vpc_network\":\n {\n if (binding.tunnel_id !== void 0) {\n configObj.vpc_networks = [\n ...configObj.vpc_networks ?? [],\n { binding: binding.name, tunnel_id: binding.tunnel_id }\n ];\n } else if (binding.network_id !== void 0) {\n configObj.vpc_networks = [\n ...configObj.vpc_networks ?? [],\n { binding: binding.name, network_id: binding.network_id }\n ];\n }\n }\n break;\n default: {\n configObj.unsafe = {\n bindings: [...configObj.unsafe?.bindings ?? [], binding],\n metadata: configObj.unsafe?.metadata ?? void 0\n };\n }\n }\n return configObj;\n }, {});\n}\n__name(mapWorkerMetadataBindings, \"mapWorkerMetadataBindings\");\n\n// src/construct-wrangler-config.ts\nfunction convertWorkerToWranglerConfig(config) {\n const mappedBindings = mapWorkerMetadataBindings(config.bindings);\n const durableObjectClassNames = config.bindings.filter(\n (binding) => binding.type === \"durable_object_namespace\" && binding.script_name === config.name\n ).map(\n (durableObject) => durableObject.class_name\n );\n const allRoutes = [\n ...config.routes.map((r) => ({\n pattern: r.pattern,\n zone_name: r.zone_name\n })),\n ...config.domains.map((c) => ({\n pattern: c.hostname,\n zone_name: c.zone_name,\n custom_domain: true\n }))\n ];\n return {\n name: config.name,\n main: config.entrypoint,\n workers_dev: config.subdomain.enabled,\n preview_urls: config.subdomain.previews_enabled,\n compatibility_date: config.compatibility_date ?? getTodaysCompatDate(),\n compatibility_flags: config.compatibility_flags,\n ...allRoutes.length ? { routes: allRoutes } : {},\n placement: config.placement?.mode === \"smart\" ? { mode: \"smart\" } : void 0,\n limits: config.limits,\n ...durableObjectClassNames.length && config.migration_tag ? {\n migrations: [\n {\n tag: config.migration_tag,\n new_classes: durableObjectClassNames\n }\n ]\n } : {},\n ...config.schedules.length ? {\n triggers: {\n crons: config.schedules.map((scheduled) => scheduled.cron)\n }\n } : {},\n tail_consumers: config.tail_consumers ?? void 0,\n observability: config.observability,\n ...mappedBindings\n };\n}\n__name(convertWorkerToWranglerConfig, \"convertWorkerToWranglerConfig\");\nfunction constructWranglerConfig(workerOrWorkers) {\n let workers;\n if (Array.isArray(workerOrWorkers)) {\n workers = workerOrWorkers;\n } else {\n workers = [workerOrWorkers];\n }\n const topLevelEnv = workers.find(\n (w) => !w.tags?.some((t) => t.startsWith(ENVIRONMENT_TAG_PREFIX))\n );\n const workerName = topLevelEnv?.name ?? workers[0].name;\n const entrypoint = topLevelEnv?.entrypoint ?? workers[0].entrypoint;\n let combinedConfig;\n if (topLevelEnv) {\n combinedConfig = convertWorkerToWranglerConfig(topLevelEnv);\n } else {\n combinedConfig = {\n name: workerName,\n main: entrypoint\n };\n }\n for (const env of workers) {\n const serviceTag = env.tags?.find(\n (t) => t === `${SERVICE_TAG_PREFIX}${workerName}`\n );\n const envTag = env.tags?.find((t) => t.startsWith(ENVIRONMENT_TAG_PREFIX));\n if (serviceTag !== `${SERVICE_TAG_PREFIX}${workerName}` || envTag === void 0) {\n continue;\n }\n const [_, envName] = envTag.split(\"=\");\n combinedConfig.env ??= {};\n combinedConfig.env[envName] = convertWorkerToWranglerConfig(env);\n }\n return combinedConfig;\n}\n__name(constructWranglerConfig, \"constructWranglerConfig\");\n\nexport { assertNever, constructWranglerConfig, getTodaysCompatDate, isCompatDate, mapWorkerMetadataBindings };\n","import { __name } from './chunk-DCOBXSFB.mjs';\n\n// src/prometheus-metrics.ts\nvar MetricsRegistry = class {\n static {\n __name(this, \"MetricsRegistry\");\n }\n counters = [];\n /**\n * Create and register a new counter metric.\n *\n * @param name - The metric name (e.g. \"service_request_total\")\n * @param help - A human-readable description of the metric\n * @returns A Counter that can be incremented\n */\n createCounter(name, help) {\n const entry = { name, help, value: 0 };\n this.counters.push(entry);\n return {\n inc: /* @__PURE__ */ __name(() => {\n entry.value++;\n }, \"inc\"),\n add: /* @__PURE__ */ __name((amount) => {\n if (amount < 0) {\n throw new Error(\"Counter value cannot decrease\");\n }\n entry.value += amount;\n }, \"add\")\n };\n }\n /**\n * Serialize all registered metrics in Prometheus text exposition format.\n *\n * @see https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format\n */\n metrics() {\n return this.counters.map((c) => {\n let result = \"\";\n if (c.help.length > 0) {\n result += `# HELP ${c.name} ${c.help}\n`;\n }\n result += `# TYPE ${c.name} counter\n`;\n result += `${c.name} ${c.value}\n`;\n return result;\n }).join(\"\");\n }\n};\n\nexport { MetricsRegistry };\n","import { PATH_TO_DEPLOY_CONFIG } from './chunk-OZQVB3L3.mjs';\nimport { __name } from './chunk-DCOBXSFB.mjs';\nimport fs, { readFileSync as readFileSync$1, statSync, existsSync } from 'node:fs';\nimport path, { resolve, isAbsolute, dirname, join } from 'node:path';\n\n// src/errors.ts\nvar UserError = class extends Error {\n static {\n __name(this, \"UserError\");\n }\n telemetryMessage;\n constructor(message, options) {\n super(message, options);\n Object.setPrototypeOf(this, new.target.prototype);\n this.telemetryMessage = options?.telemetryMessage === true ? message : options?.telemetryMessage;\n }\n};\nvar DeprecationError = class extends UserError {\n static {\n __name(this, \"DeprecationError\");\n }\n constructor(message, options) {\n super(`Deprecation:\n${message}`, options);\n }\n};\nvar FatalError = class extends UserError {\n constructor(message, code, options) {\n super(message, options);\n this.code = code;\n }\n static {\n __name(this, \"FatalError\");\n }\n};\nvar CommandLineArgsError = class extends UserError {\n static {\n __name(this, \"CommandLineArgsError\");\n }\n};\nvar JsonFriendlyFatalError = class extends FatalError {\n constructor(message, code, options) {\n super(message, code, options);\n this.code = code;\n }\n static {\n __name(this, \"JsonFriendlyFatalError\");\n }\n};\nvar MissingConfigError = class extends Error {\n static {\n __name(this, \"MissingConfigError\");\n }\n telemetryMessage;\n constructor(key) {\n super(`Missing config value for ${key}`);\n this.telemetryMessage = `Missing config value for ${key}`;\n }\n};\nfunction createFatalError(message, isJson, code, telemetryMessage) {\n if (isJson) {\n return new JsonFriendlyFatalError(\n JSON.stringify(message),\n code,\n telemetryMessage\n );\n } else {\n return new FatalError(`${message}`, code, telemetryMessage);\n }\n}\n__name(createFatalError, \"createFatalError\");\n\n// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js\nfunction createScanner(text, ignoreTrivia = false) {\n const len = text.length;\n let pos = 0, value = \"\", tokenOffset = 0, token = 16, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0;\n function scanHexDigits(count, exact) {\n let digits = 0;\n let value2 = 0;\n while (digits < count || !exact) {\n let ch = text.charCodeAt(pos);\n if (ch >= 48 && ch <= 57) {\n value2 = value2 * 16 + ch - 48;\n } else if (ch >= 65 && ch <= 70) {\n value2 = value2 * 16 + ch - 65 + 10;\n } else if (ch >= 97 && ch <= 102) {\n value2 = value2 * 16 + ch - 97 + 10;\n } else {\n break;\n }\n pos++;\n digits++;\n }\n if (digits < count) {\n value2 = -1;\n }\n return value2;\n }\n __name(scanHexDigits, \"scanHexDigits\");\n function setPosition(newPosition) {\n pos = newPosition;\n value = \"\";\n tokenOffset = 0;\n token = 16;\n scanError = 0;\n }\n __name(setPosition, \"setPosition\");\n function scanNumber() {\n let start = pos;\n if (text.charCodeAt(pos) === 48) {\n pos++;\n } else {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n }\n if (pos < text.length && text.charCodeAt(pos) === 46) {\n pos++;\n if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n } else {\n scanError = 3;\n return text.substring(start, pos);\n }\n }\n let end = pos;\n if (pos < text.length && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {\n pos++;\n if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {\n pos++;\n }\n if (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n while (pos < text.length && isDigit(text.charCodeAt(pos))) {\n pos++;\n }\n end = pos;\n } else {\n scanError = 3;\n }\n }\n return text.substring(start, end);\n }\n __name(scanNumber, \"scanNumber\");\n function scanString() {\n let result = \"\", start = pos;\n while (true) {\n if (pos >= len) {\n result += text.substring(start, pos);\n scanError = 2;\n break;\n }\n const ch = text.charCodeAt(pos);\n if (ch === 34) {\n result += text.substring(start, pos);\n pos++;\n break;\n }\n if (ch === 92) {\n result += text.substring(start, pos);\n pos++;\n if (pos >= len) {\n scanError = 2;\n break;\n }\n const ch2 = text.charCodeAt(pos++);\n switch (ch2) {\n case 34:\n result += '\"';\n break;\n case 92:\n result += \"\\\\\";\n break;\n case 47:\n result += \"/\";\n break;\n case 98:\n result += \"\\b\";\n break;\n case 102:\n result += \"\\f\";\n break;\n case 110:\n result += \"\\n\";\n break;\n case 114:\n result += \"\\r\";\n break;\n case 116:\n result += \"\t\";\n break;\n case 117:\n const ch3 = scanHexDigits(4, true);\n if (ch3 >= 0) {\n result += String.fromCharCode(ch3);\n } else {\n scanError = 4;\n }\n break;\n default:\n scanError = 5;\n }\n start = pos;\n continue;\n }\n if (ch >= 0 && ch <= 31) {\n if (isLineBreak(ch)) {\n result += text.substring(start, pos);\n scanError = 2;\n break;\n } else {\n scanError = 6;\n }\n }\n pos++;\n }\n return result;\n }\n __name(scanString, \"scanString\");\n function scanNext() {\n value = \"\";\n scanError = 0;\n tokenOffset = pos;\n lineStartOffset = lineNumber;\n prevTokenLineStartOffset = tokenLineStartOffset;\n if (pos >= len) {\n tokenOffset = len;\n return token = 17;\n }\n let code = text.charCodeAt(pos);\n if (isWhiteSpace(code)) {\n do {\n pos++;\n value += String.fromCharCode(code);\n code = text.charCodeAt(pos);\n } while (isWhiteSpace(code));\n return token = 15;\n }\n if (isLineBreak(code)) {\n pos++;\n value += String.fromCharCode(code);\n if (code === 13 && text.charCodeAt(pos) === 10) {\n pos++;\n value += \"\\n\";\n }\n lineNumber++;\n tokenLineStartOffset = pos;\n return token = 14;\n }\n switch (code) {\n // tokens: []{}:,\n case 123:\n pos++;\n return token = 1;\n case 125:\n pos++;\n return token = 2;\n case 91:\n pos++;\n return token = 3;\n case 93:\n pos++;\n return token = 4;\n case 58:\n pos++;\n return token = 6;\n case 44:\n pos++;\n return token = 5;\n // strings\n case 34:\n pos++;\n value = scanString();\n return token = 10;\n // comments\n case 47:\n const start = pos - 1;\n if (text.charCodeAt(pos + 1) === 47) {\n pos += 2;\n while (pos < len) {\n if (isLineBreak(text.charCodeAt(pos))) {\n break;\n }\n pos++;\n }\n value = text.substring(start, pos);\n return token = 12;\n }\n if (text.charCodeAt(pos + 1) === 42) {\n pos += 2;\n const safeLength = len - 1;\n let commentClosed = false;\n while (pos < safeLength) {\n const ch = text.charCodeAt(pos);\n if (ch === 42 && text.charCodeAt(pos + 1) === 47) {\n pos += 2;\n commentClosed = true;\n break;\n }\n pos++;\n if (isLineBreak(ch)) {\n if (ch === 13 && text.charCodeAt(pos) === 10) {\n pos++;\n }\n lineNumber++;\n tokenLineStartOffset = pos;\n }\n }\n if (!commentClosed) {\n pos++;\n scanError = 1;\n }\n value = text.substring(start, pos);\n return token = 13;\n }\n value += String.fromCharCode(code);\n pos++;\n return token = 16;\n // numbers\n case 45:\n value += String.fromCharCode(code);\n pos++;\n if (pos === len || !isDigit(text.charCodeAt(pos))) {\n return token = 16;\n }\n // found a minus, followed by a number so\n // we fall through to proceed with scanning\n // numbers\n case 48:\n case 49:\n case 50:\n case 51:\n case 52:\n case 53:\n case 54:\n case 55:\n case 56:\n case 57:\n value += scanNumber();\n return token = 11;\n // literals and unknown symbols\n default:\n while (pos < len && isUnknownContentCharacter(code)) {\n pos++;\n code = text.charCodeAt(pos);\n }\n if (tokenOffset !== pos) {\n value = text.substring(tokenOffset, pos);\n switch (value) {\n case \"true\":\n return token = 8;\n case \"false\":\n return token = 9;\n case \"null\":\n return token = 7;\n }\n return token = 16;\n }\n value += String.fromCharCode(code);\n pos++;\n return token = 16;\n }\n }\n __name(scanNext, \"scanNext\");\n function isUnknownContentCharacter(code) {\n if (isWhiteSpace(code) || isLineBreak(code)) {\n return false;\n }\n switch (code) {\n case 125:\n case 93:\n case 123:\n case 91:\n case 34:\n case 58:\n case 44:\n case 47:\n return false;\n }\n return true;\n }\n __name(isUnknownContentCharacter, \"isUnknownContentCharacter\");\n function scanNextNonTrivia() {\n let result;\n do {\n result = scanNext();\n } while (result >= 12 && result <= 15);\n return result;\n }\n __name(scanNextNonTrivia, \"scanNextNonTrivia\");\n return {\n setPosition,\n getPosition: /* @__PURE__ */ __name(() => pos, \"getPosition\"),\n scan: ignoreTrivia ? scanNextNonTrivia : scanNext,\n getToken: /* @__PURE__ */ __name(() => token, \"getToken\"),\n getTokenValue: /* @__PURE__ */ __name(() => value, \"getTokenValue\"),\n getTokenOffset: /* @__PURE__ */ __name(() => tokenOffset, \"getTokenOffset\"),\n getTokenLength: /* @__PURE__ */ __name(() => pos - tokenOffset, \"getTokenLength\"),\n getTokenStartLine: /* @__PURE__ */ __name(() => lineStartOffset, \"getTokenStartLine\"),\n getTokenStartCharacter: /* @__PURE__ */ __name(() => tokenOffset - prevTokenLineStartOffset, \"getTokenStartCharacter\"),\n getTokenError: /* @__PURE__ */ __name(() => scanError, \"getTokenError\")\n };\n}\n__name(createScanner, \"createScanner\");\nfunction isWhiteSpace(ch) {\n return ch === 32 || ch === 9;\n}\n__name(isWhiteSpace, \"isWhiteSpace\");\nfunction isLineBreak(ch) {\n return ch === 10 || ch === 13;\n}\n__name(isLineBreak, \"isLineBreak\");\nfunction isDigit(ch) {\n return ch >= 48 && ch <= 57;\n}\n__name(isDigit, \"isDigit\");\nvar CharacterCodes;\n(function(CharacterCodes2) {\n CharacterCodes2[CharacterCodes2[\"lineFeed\"] = 10] = \"lineFeed\";\n CharacterCodes2[CharacterCodes2[\"carriageReturn\"] = 13] = \"carriageReturn\";\n CharacterCodes2[CharacterCodes2[\"space\"] = 32] = \"space\";\n CharacterCodes2[CharacterCodes2[\"_0\"] = 48] = \"_0\";\n CharacterCodes2[CharacterCodes2[\"_1\"] = 49] = \"_1\";\n CharacterCodes2[CharacterCodes2[\"_2\"] = 50] = \"_2\";\n CharacterCodes2[CharacterCodes2[\"_3\"] = 51] = \"_3\";\n CharacterCodes2[CharacterCodes2[\"_4\"] = 52] = \"_4\";\n CharacterCodes2[CharacterCodes2[\"_5\"] = 53] = \"_5\";\n CharacterCodes2[CharacterCodes2[\"_6\"] = 54] = \"_6\";\n CharacterCodes2[CharacterCodes2[\"_7\"] = 55] = \"_7\";\n CharacterCodes2[CharacterCodes2[\"_8\"] = 56] = \"_8\";\n CharacterCodes2[CharacterCodes2[\"_9\"] = 57] = \"_9\";\n CharacterCodes2[CharacterCodes2[\"a\"] = 97] = \"a\";\n CharacterCodes2[CharacterCodes2[\"b\"] = 98] = \"b\";\n CharacterCodes2[CharacterCodes2[\"c\"] = 99] = \"c\";\n CharacterCodes2[CharacterCodes2[\"d\"] = 100] = \"d\";\n CharacterCodes2[CharacterCodes2[\"e\"] = 101] = \"e\";\n CharacterCodes2[CharacterCodes2[\"f\"] = 102] = \"f\";\n CharacterCodes2[CharacterCodes2[\"g\"] = 103] = \"g\";\n CharacterCodes2[CharacterCodes2[\"h\"] = 104] = \"h\";\n CharacterCodes2[CharacterCodes2[\"i\"] = 105] = \"i\";\n CharacterCodes2[CharacterCodes2[\"j\"] = 106] = \"j\";\n CharacterCodes2[CharacterCodes2[\"k\"] = 107] = \"k\";\n CharacterCodes2[CharacterCodes2[\"l\"] = 108] = \"l\";\n CharacterCodes2[CharacterCodes2[\"m\"] = 109] = \"m\";\n CharacterCodes2[CharacterCodes2[\"n\"] = 110] = \"n\";\n CharacterCodes2[CharacterCodes2[\"o\"] = 111] = \"o\";\n CharacterCodes2[CharacterCodes2[\"p\"] = 112] = \"p\";\n CharacterCodes2[CharacterCodes2[\"q\"] = 113] = \"q\";\n CharacterCodes2[CharacterCodes2[\"r\"] = 114] = \"r\";\n CharacterCodes2[CharacterCodes2[\"s\"] = 115] = \"s\";\n CharacterCodes2[CharacterCodes2[\"t\"] = 116] = \"t\";\n CharacterCodes2[CharacterCodes2[\"u\"] = 117] = \"u\";\n CharacterCodes2[CharacterCodes2[\"v\"] = 118] = \"v\";\n CharacterCodes2[CharacterCodes2[\"w\"] = 119] = \"w\";\n CharacterCodes2[CharacterCodes2[\"x\"] = 120] = \"x\";\n CharacterCodes2[CharacterCodes2[\"y\"] = 121] = \"y\";\n CharacterCodes2[CharacterCodes2[\"z\"] = 122] = \"z\";\n CharacterCodes2[CharacterCodes2[\"A\"] = 65] = \"A\";\n CharacterCodes2[CharacterCodes2[\"B\"] = 66] = \"B\";\n CharacterCodes2[CharacterCodes2[\"C\"] = 67] = \"C\";\n CharacterCodes2[CharacterCodes2[\"D\"] = 68] = \"D\";\n CharacterCodes2[CharacterCodes2[\"E\"] = 69] = \"E\";\n CharacterCodes2[CharacterCodes2[\"F\"] = 70] = \"F\";\n CharacterCodes2[CharacterCodes2[\"G\"] = 71] = \"G\";\n CharacterCodes2[CharacterCodes2[\"H\"] = 72] = \"H\";\n CharacterCodes2[CharacterCodes2[\"I\"] = 73] = \"I\";\n CharacterCodes2[CharacterCodes2[\"J\"] = 74] = \"J\";\n CharacterCodes2[CharacterCodes2[\"K\"] = 75] = \"K\";\n CharacterCodes2[CharacterCodes2[\"L\"] = 76] = \"L\";\n CharacterCodes2[CharacterCodes2[\"M\"] = 77] = \"M\";\n CharacterCodes2[CharacterCodes2[\"N\"] = 78] = \"N\";\n CharacterCodes2[CharacterCodes2[\"O\"] = 79] = \"O\";\n CharacterCodes2[CharacterCodes2[\"P\"] = 80] = \"P\";\n CharacterCodes2[CharacterCodes2[\"Q\"] = 81] = \"Q\";\n CharacterCodes2[CharacterCodes2[\"R\"] = 82] = \"R\";\n CharacterCodes2[CharacterCodes2[\"S\"] = 83] = \"S\";\n CharacterCodes2[CharacterCodes2[\"T\"] = 84] = \"T\";\n CharacterCodes2[CharacterCodes2[\"U\"] = 85] = \"U\";\n CharacterCodes2[CharacterCodes2[\"V\"] = 86] = \"V\";\n CharacterCodes2[CharacterCodes2[\"W\"] = 87] = \"W\";\n CharacterCodes2[CharacterCodes2[\"X\"] = 88] = \"X\";\n CharacterCodes2[CharacterCodes2[\"Y\"] = 89] = \"Y\";\n CharacterCodes2[CharacterCodes2[\"Z\"] = 90] = \"Z\";\n CharacterCodes2[CharacterCodes2[\"asterisk\"] = 42] = \"asterisk\";\n CharacterCodes2[CharacterCodes2[\"backslash\"] = 92] = \"backslash\";\n CharacterCodes2[CharacterCodes2[\"closeBrace\"] = 125] = \"closeBrace\";\n CharacterCodes2[CharacterCodes2[\"closeBracket\"] = 93] = \"closeBracket\";\n CharacterCodes2[CharacterCodes2[\"colon\"] = 58] = \"colon\";\n CharacterCodes2[CharacterCodes2[\"comma\"] = 44] = \"comma\";\n CharacterCodes2[CharacterCodes2[\"dot\"] = 46] = \"dot\";\n CharacterCodes2[CharacterCodes2[\"doubleQuote\"] = 34] = \"doubleQuote\";\n CharacterCodes2[CharacterCodes2[\"minus\"] = 45] = \"minus\";\n CharacterCodes2[CharacterCodes2[\"openBrace\"] = 123] = \"openBrace\";\n CharacterCodes2[CharacterCodes2[\"openBracket\"] = 91] = \"openBracket\";\n CharacterCodes2[CharacterCodes2[\"plus\"] = 43] = \"plus\";\n CharacterCodes2[CharacterCodes2[\"slash\"] = 47] = \"slash\";\n CharacterCodes2[CharacterCodes2[\"formFeed\"] = 12] = \"formFeed\";\n CharacterCodes2[CharacterCodes2[\"tab\"] = 9] = \"tab\";\n})(CharacterCodes || (CharacterCodes = {}));\n\n// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/format.js\nfunction format(documentText, range, options) {\n let initialIndentLevel;\n let formatText;\n let formatTextStart;\n let rangeStart;\n let rangeEnd;\n if (range) {\n rangeStart = range.offset;\n rangeEnd = rangeStart + range.length;\n formatTextStart = rangeStart;\n while (formatTextStart > 0 && !isEOL(documentText, formatTextStart - 1)) {\n formatTextStart--;\n }\n let endOffset = rangeEnd;\n while (endOffset < documentText.length && !isEOL(documentText, endOffset)) {\n endOffset++;\n }\n formatText = documentText.substring(formatTextStart, endOffset);\n initialIndentLevel = computeIndentLevel(formatText, options);\n } else {\n formatText = documentText;\n initialIndentLevel = 0;\n formatTextStart = 0;\n rangeStart = 0;\n rangeEnd = documentText.length;\n }\n const eol = getEOL(options, documentText);\n let numberLineBreaks = 0;\n let indentLevel = 0;\n let indentValue;\n if (options.insertSpaces) {\n indentValue = repeat(\" \", options.tabSize || 4);\n } else {\n indentValue = \"\t\";\n }\n let scanner = createScanner(formatText, false);\n let hasError = false;\n function newLinesAndIndent() {\n if (numberLineBreaks > 1) {\n return repeat(eol, numberLineBreaks) + repeat(indentValue, initialIndentLevel + indentLevel);\n } else {\n return eol + repeat(indentValue, initialIndentLevel + indentLevel);\n }\n }\n __name(newLinesAndIndent, \"newLinesAndIndent\");\n function scanNext() {\n let token = scanner.scan();\n numberLineBreaks = 0;\n while (token === 15 || token === 14) {\n if (token === 14 && options.keepLines) {\n numberLineBreaks += 1;\n } else if (token === 14) {\n numberLineBreaks = 1;\n }\n token = scanner.scan();\n }\n hasError = token === 16 || scanner.getTokenError() !== 0;\n return token;\n }\n __name(scanNext, \"scanNext\");\n const editOperations = [];\n function addEdit(text, startOffset, endOffset) {\n if (!hasError && (!range || startOffset < rangeEnd && endOffset > rangeStart) && documentText.substring(startOffset, endOffset) !== text) {\n editOperations.push({ offset: startOffset, length: endOffset - startOffset, content: text });\n }\n }\n __name(addEdit, \"addEdit\");\n let firstToken = scanNext();\n if (options.keepLines && numberLineBreaks > 0) {\n addEdit(repeat(eol, numberLineBreaks), 0, 0);\n }\n if (firstToken !== 17) {\n let firstTokenStart = scanner.getTokenOffset() + formatTextStart;\n let initialIndent = repeat(indentValue, initialIndentLevel);\n addEdit(initialIndent, formatTextStart, firstTokenStart);\n }\n while (firstToken !== 17) {\n let firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;\n let secondToken = scanNext();\n let replaceContent = \"\";\n let needsLineBreak = false;\n while (numberLineBreaks === 0 && (secondToken === 12 || secondToken === 13)) {\n let commentTokenStart = scanner.getTokenOffset() + formatTextStart;\n addEdit(\" \", firstTokenEnd, commentTokenStart);\n firstTokenEnd = scanner.getTokenOffset() + scanner.getTokenLength() + formatTextStart;\n needsLineBreak = secondToken === 12;\n replaceContent = needsLineBreak ? newLinesAndIndent() : \"\";\n secondToken = scanNext();\n }\n if (secondToken === 2) {\n if (firstToken !== 1) {\n indentLevel--;\n }\n if (options.keepLines && numberLineBreaks > 0 || !options.keepLines && firstToken !== 1) {\n replaceContent = newLinesAndIndent();\n } else if (options.keepLines) {\n replaceContent = \" \";\n }\n } else if (secondToken === 4) {\n if (firstToken !== 3) {\n indentLevel--;\n }\n if (options.keepLines && numberLineBreaks > 0 || !options.keepLines && firstToken !== 3) {\n replaceContent = newLinesAndIndent();\n } else if (options.keepLines) {\n replaceContent = \" \";\n }\n } else {\n switch (firstToken) {\n case 3:\n case 1:\n indentLevel++;\n if (options.keepLines && numberLineBreaks > 0 || !options.keepLines) {\n replaceContent = newLinesAndIndent();\n } else {\n replaceContent = \" \";\n }\n break;\n case 5:\n if (options.keepLines && numberLineBreaks > 0 || !options.keepLines) {\n replaceContent = newLinesAndIndent();\n } else {\n replaceContent = \" \";\n }\n break;\n case 12:\n replaceContent = newLinesAndIndent();\n break;\n case 13:\n if (numberLineBreaks > 0) {\n replaceContent = newLinesAndIndent();\n } else if (!needsLineBreak) {\n replaceContent = \" \";\n }\n break;\n case 6:\n if (options.keepLines && numberLineBreaks > 0) {\n replaceContent = newLinesAndIndent();\n } else if (!needsLineBreak) {\n replaceContent = \" \";\n }\n break;\n case 10:\n if (options.keepLines && numberLineBreaks > 0) {\n replaceContent = newLinesAndIndent();\n } else if (secondToken === 6 && !needsLineBreak) {\n replaceContent = \"\";\n }\n break;\n case 7:\n case 8:\n case 9:\n case 11:\n case 2:\n case 4:\n if (options.keepLines && numberLineBreaks > 0) {\n replaceContent = newLinesAndIndent();\n } else {\n if ((secondToken === 12 || secondToken === 13) && !needsLineBreak) {\n replaceContent = \" \";\n } else if (secondToken !== 5 && secondToken !== 17) {\n hasError = true;\n }\n }\n break;\n case 16:\n hasError = true;\n break;\n }\n if (numberLineBreaks > 0 && (secondToken === 12 || secondToken === 13)) {\n replaceContent = newLinesAndIndent();\n }\n }\n if (secondToken === 17) {\n if (options.keepLines && numberLineBreaks > 0) {\n replaceContent = newLinesAndIndent();\n } else {\n replaceContent = options.insertFinalNewline ? eol : \"\";\n }\n }\n const secondTokenStart = scanner.getTokenOffset() + formatTextStart;\n addEdit(replaceContent, firstTokenEnd, secondTokenStart);\n firstToken = secondToken;\n }\n return editOperations;\n}\n__name(format, \"format\");\nfunction repeat(s, count) {\n let result = \"\";\n for (let i = 0; i < count; i++) {\n result += s;\n }\n return result;\n}\n__name(repeat, \"repeat\");\nfunction computeIndentLevel(content, options) {\n let i = 0;\n let nChars = 0;\n const tabSize = options.tabSize || 4;\n while (i < content.length) {\n let ch = content.charAt(i);\n if (ch === \" \") {\n nChars++;\n } else if (ch === \"\t\") {\n nChars += tabSize;\n } else {\n break;\n }\n i++;\n }\n return Math.floor(nChars / tabSize);\n}\n__name(computeIndentLevel, \"computeIndentLevel\");\nfunction getEOL(options, text) {\n for (let i = 0; i < text.length; i++) {\n const ch = text.charAt(i);\n if (ch === \"\\r\") {\n if (i + 1 < text.length && text.charAt(i + 1) === \"\\n\") {\n return \"\\r\\n\";\n }\n return \"\\r\";\n } else if (ch === \"\\n\") {\n return \"\\n\";\n }\n }\n return options && options.eol || \"\\n\";\n}\n__name(getEOL, \"getEOL\");\nfunction isEOL(text, offset) {\n return \"\\r\\n\".indexOf(text.charAt(offset)) !== -1;\n}\n__name(isEOL, \"isEOL\");\n\n// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/parser.js\nvar ParseOptions;\n(function(ParseOptions2) {\n ParseOptions2.DEFAULT = {\n allowTrailingComma: false\n };\n})(ParseOptions || (ParseOptions = {}));\nfunction parse(text, errors = [], options = ParseOptions.DEFAULT) {\n let currentProperty = null;\n let currentParent = [];\n const previousParents = [];\n function onValue(value) {\n if (Array.isArray(currentParent)) {\n currentParent.push(value);\n } else if (currentProperty !== null) {\n currentParent[currentProperty] = value;\n }\n }\n __name(onValue, \"onValue\");\n const visitor = {\n onObjectBegin: /* @__PURE__ */ __name(() => {\n const object = {};\n onValue(object);\n previousParents.push(currentParent);\n currentParent = object;\n currentProperty = null;\n }, \"onObjectBegin\"),\n onObjectProperty: /* @__PURE__ */ __name((name) => {\n currentProperty = name;\n }, \"onObjectProperty\"),\n onObjectEnd: /* @__PURE__ */ __name(() => {\n currentParent = previousParents.pop();\n }, \"onObjectEnd\"),\n onArrayBegin: /* @__PURE__ */ __name(() => {\n const array = [];\n onValue(array);\n previousParents.push(currentParent);\n currentParent = array;\n currentProperty = null;\n }, \"onArrayBegin\"),\n onArrayEnd: /* @__PURE__ */ __name(() => {\n currentParent = previousParents.pop();\n }, \"onArrayEnd\"),\n onLiteralValue: onValue,\n onError: /* @__PURE__ */ __name((error, offset, length) => {\n errors.push({ error, offset, length });\n }, \"onError\")\n };\n visit(text, visitor, options);\n return currentParent[0];\n}\n__name(parse, \"parse\");\nfunction parseTree(text, errors = [], options = ParseOptions.DEFAULT) {\n let currentParent = { type: \"array\", offset: -1, length: -1, children: [], parent: void 0 };\n function ensurePropertyComplete(endOffset) {\n if (currentParent.type === \"property\") {\n currentParent.length = endOffset - currentParent.offset;\n currentParent = currentParent.parent;\n }\n }\n __name(ensurePropertyComplete, \"ensurePropertyComplete\");\n function onValue(valueNode) {\n currentParent.children.push(valueNode);\n return valueNode;\n }\n __name(onValue, \"onValue\");\n const visitor = {\n onObjectBegin: /* @__PURE__ */ __name((offset) => {\n currentParent = onValue({ type: \"object\", offset, length: -1, parent: currentParent, children: [] });\n }, \"onObjectBegin\"),\n onObjectProperty: /* @__PURE__ */ __name((name, offset, length) => {\n currentParent = onValue({ type: \"property\", offset, length: -1, parent: currentParent, children: [] });\n currentParent.children.push({ type: \"string\", value: name, offset, length, parent: currentParent });\n }, \"onObjectProperty\"),\n onObjectEnd: /* @__PURE__ */ __name((offset, length) => {\n ensurePropertyComplete(offset + length);\n currentParent.length = offset + length - currentParent.offset;\n currentParent = currentParent.parent;\n ensurePropertyComplete(offset + length);\n }, \"onObjectEnd\"),\n onArrayBegin: /* @__PURE__ */ __name((offset, length) => {\n currentParent = onValue({ type: \"array\", offset, length: -1, parent: currentParent, children: [] });\n }, \"onArrayBegin\"),\n onArrayEnd: /* @__PURE__ */ __name((offset, length) => {\n currentParent.length = offset + length - currentParent.offset;\n currentParent = currentParent.parent;\n ensurePropertyComplete(offset + length);\n }, \"onArrayEnd\"),\n onLiteralValue: /* @__PURE__ */ __name((value, offset, length) => {\n onValue({ type: getNodeType(value), offset, length, parent: currentParent, value });\n ensurePropertyComplete(offset + length);\n }, \"onLiteralValue\"),\n onSeparator: /* @__PURE__ */ __name((sep, offset, length) => {\n if (currentParent.type === \"property\") {\n if (sep === \":\") {\n currentParent.colonOffset = offset;\n } else if (sep === \",\") {\n ensurePropertyComplete(offset);\n }\n }\n }, \"onSeparator\"),\n onError: /* @__PURE__ */ __name((error, offset, length) => {\n errors.push({ error, offset, length });\n }, \"onError\")\n };\n visit(text, visitor, options);\n const result = currentParent.children[0];\n if (result) {\n delete result.parent;\n }\n return result;\n}\n__name(parseTree, \"parseTree\");\nfunction findNodeAtLocation(root, path2) {\n if (!root) {\n return void 0;\n }\n let node = root;\n for (let segment of path2) {\n if (typeof segment === \"string\") {\n if (node.type !== \"object\" || !Array.isArray(node.children)) {\n return void 0;\n }\n let found = false;\n for (const propertyNode of node.children) {\n if (Array.isArray(propertyNode.children) && propertyNode.children[0].value === segment && propertyNode.children.length === 2) {\n node = propertyNode.children[1];\n found = true;\n break;\n }\n }\n if (!found) {\n return void 0;\n }\n } else {\n const index = segment;\n if (node.type !== \"array\" || index < 0 || !Array.isArray(node.children) || index >= node.children.length) {\n return void 0;\n }\n node = node.children[index];\n }\n }\n return node;\n}\n__name(findNodeAtLocation, \"findNodeAtLocation\");\nfunction visit(text, visitor, options = ParseOptions.DEFAULT) {\n const _scanner = createScanner(text, false);\n const _jsonPath = [];\n function toNoArgVisit(visitFunction) {\n return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;\n }\n __name(toNoArgVisit, \"toNoArgVisit\");\n function toNoArgVisitWithPath(visitFunction) {\n return visitFunction ? () => visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;\n }\n __name(toNoArgVisitWithPath, \"toNoArgVisitWithPath\");\n function toOneArgVisit(visitFunction) {\n return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()) : () => true;\n }\n __name(toOneArgVisit, \"toOneArgVisit\");\n function toOneArgVisitWithPath(visitFunction) {\n return visitFunction ? (arg) => visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter(), () => _jsonPath.slice()) : () => true;\n }\n __name(toOneArgVisitWithPath, \"toOneArgVisitWithPath\");\n const onObjectBegin = toNoArgVisitWithPath(visitor.onObjectBegin), onObjectProperty = toOneArgVisitWithPath(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisitWithPath(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisitWithPath(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);\n const disallowComments = options && options.disallowComments;\n const allowTrailingComma = options && options.allowTrailingComma;\n function scanNext() {\n while (true) {\n const token = _scanner.scan();\n switch (_scanner.getTokenError()) {\n case 4:\n handleError(\n 14\n /* ParseErrorCode.InvalidUnicode */\n );\n break;\n case 5:\n handleError(\n 15\n /* ParseErrorCode.InvalidEscapeCharacter */\n );\n break;\n case 3:\n handleError(\n 13\n /* ParseErrorCode.UnexpectedEndOfNumber */\n );\n break;\n case 1:\n if (!disallowComments) {\n handleError(\n 11\n /* ParseErrorCode.UnexpectedEndOfComment */\n );\n }\n break;\n case 2:\n handleError(\n 12\n /* ParseErrorCode.UnexpectedEndOfString */\n );\n break;\n case 6:\n handleError(\n 16\n /* ParseErrorCode.InvalidCharacter */\n );\n break;\n }\n switch (token) {\n case 12:\n case 13:\n if (disallowComments) {\n handleError(\n 10\n /* ParseErrorCode.InvalidCommentToken */\n );\n } else {\n onComment();\n }\n break;\n case 16:\n handleError(\n 1\n /* ParseErrorCode.InvalidSymbol */\n );\n break;\n case 15:\n case 14:\n break;\n default:\n return token;\n }\n }\n }\n __name(scanNext, \"scanNext\");\n function handleError(error, skipUntilAfter = [], skipUntil2 = []) {\n onError(error);\n if (skipUntilAfter.length + skipUntil2.length > 0) {\n let token = _scanner.getToken();\n while (token !== 17) {\n if (skipUntilAfter.indexOf(token) !== -1) {\n scanNext();\n break;\n } else if (skipUntil2.indexOf(token) !== -1) {\n break;\n }\n token = scanNext();\n }\n }\n }\n __name(handleError, \"handleError\");\n function parseString2(isValue) {\n const value = _scanner.getTokenValue();\n if (isValue) {\n onLiteralValue(value);\n } else {\n onObjectProperty(value);\n _jsonPath.push(value);\n }\n scanNext();\n return true;\n }\n __name(parseString2, \"parseString\");\n function parseLiteral() {\n switch (_scanner.getToken()) {\n case 11:\n const tokenValue = _scanner.getTokenValue();\n let value = Number(tokenValue);\n if (isNaN(value)) {\n handleError(\n 2\n /* ParseErrorCode.InvalidNumberFormat */\n );\n value = 0;\n }\n onLiteralValue(value);\n break;\n case 7:\n onLiteralValue(null);\n break;\n case 8:\n onLiteralValue(true);\n break;\n case 9:\n onLiteralValue(false);\n break;\n default:\n return false;\n }\n scanNext();\n return true;\n }\n __name(parseLiteral, \"parseLiteral\");\n function parseProperty() {\n if (_scanner.getToken() !== 10) {\n handleError(3, [], [\n 2,\n 5\n /* SyntaxKind.CommaToken */\n ]);\n return false;\n }\n parseString2(false);\n if (_scanner.getToken() === 6) {\n onSeparator(\":\");\n scanNext();\n if (!parseValue2()) {\n handleError(4, [], [\n 2,\n 5\n /* SyntaxKind.CommaToken */\n ]);\n }\n } else {\n handleError(5, [], [\n 2,\n 5\n /* SyntaxKind.CommaToken */\n ]);\n }\n _jsonPath.pop();\n return true;\n }\n __name(parseProperty, \"parseProperty\");\n function parseObject() {\n onObjectBegin();\n scanNext();\n let needsComma = false;\n while (_scanner.getToken() !== 2 && _scanner.getToken() !== 17) {\n if (_scanner.getToken() === 5) {\n if (!needsComma) {\n handleError(4, [], []);\n }\n onSeparator(\",\");\n scanNext();\n if (_scanner.getToken() === 2 && allowTrailingComma) {\n break;\n }\n } else if (needsComma) {\n handleError(6, [], []);\n }\n if (!parseProperty()) {\n handleError(4, [], [\n 2,\n 5\n /* SyntaxKind.CommaToken */\n ]);\n }\n needsComma = true;\n }\n onObjectEnd();\n if (_scanner.getToken() !== 2) {\n handleError(7, [\n 2\n /* SyntaxKind.CloseBraceToken */\n ], []);\n } else {\n scanNext();\n }\n return true;\n }\n __name(parseObject, \"parseObject\");\n function parseArray2() {\n onArrayBegin();\n scanNext();\n let isFirstElement = true;\n let needsComma = false;\n while (_scanner.getToken() !== 4 && _scanner.getToken() !== 17) {\n if (_scanner.getToken() === 5) {\n if (!needsComma) {\n handleError(4, [], []);\n }\n onSeparator(\",\");\n scanNext();\n if (_scanner.getToken() === 4 && allowTrailingComma) {\n break;\n }\n } else if (needsComma) {\n handleError(6, [], []);\n }\n if (isFirstElement) {\n _jsonPath.push(0);\n isFirstElement = false;\n } else {\n _jsonPath[_jsonPath.length - 1]++;\n }\n if (!parseValue2()) {\n handleError(4, [], [\n 4,\n 5\n /* SyntaxKind.CommaToken */\n ]);\n }\n needsComma = true;\n }\n onArrayEnd();\n if (!isFirstElement) {\n _jsonPath.pop();\n }\n if (_scanner.getToken() !== 4) {\n handleError(8, [\n 4\n /* SyntaxKind.CloseBracketToken */\n ], []);\n } else {\n scanNext();\n }\n return true;\n }\n __name(parseArray2, \"parseArray\");\n function parseValue2() {\n switch (_scanner.getToken()) {\n case 3:\n return parseArray2();\n case 1:\n return parseObject();\n case 10:\n return parseString2(true);\n default:\n return parseLiteral();\n }\n }\n __name(parseValue2, \"parseValue\");\n scanNext();\n if (_scanner.getToken() === 17) {\n if (options.allowEmptyContent) {\n return true;\n }\n handleError(4, [], []);\n return false;\n }\n if (!parseValue2()) {\n handleError(4, [], []);\n return false;\n }\n if (_scanner.getToken() !== 17) {\n handleError(9, [], []);\n }\n return true;\n}\n__name(visit, \"visit\");\nfunction getNodeType(value) {\n switch (typeof value) {\n case \"boolean\":\n return \"boolean\";\n case \"number\":\n return \"number\";\n case \"string\":\n return \"string\";\n case \"object\": {\n if (!value) {\n return \"null\";\n } else if (Array.isArray(value)) {\n return \"array\";\n }\n return \"object\";\n }\n default:\n return \"null\";\n }\n}\n__name(getNodeType, \"getNodeType\");\n\n// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/edit.js\nfunction setProperty(text, originalPath, value, options) {\n const path2 = originalPath.slice();\n const errors = [];\n const root = parseTree(text, errors);\n let parent = void 0;\n let lastSegment = void 0;\n while (path2.length > 0) {\n lastSegment = path2.pop();\n parent = findNodeAtLocation(root, path2);\n if (parent === void 0 && value !== void 0) {\n if (typeof lastSegment === \"string\") {\n value = { [lastSegment]: value };\n } else {\n value = [value];\n }\n } else {\n break;\n }\n }\n if (!parent) {\n if (value === void 0) {\n throw new Error(\"Can not delete in empty document\");\n }\n return withFormatting(text, { offset: root ? root.offset : 0, length: root ? root.length : 0, content: JSON.stringify(value) }, options);\n } else if (parent.type === \"object\" && typeof lastSegment === \"string\" && Array.isArray(parent.children)) {\n const existing = findNodeAtLocation(parent, [lastSegment]);\n if (existing !== void 0) {\n if (value === void 0) {\n if (!existing.parent) {\n throw new Error(\"Malformed AST\");\n }\n const propertyIndex = parent.children.indexOf(existing.parent);\n let removeBegin;\n let removeEnd = existing.parent.offset + existing.parent.length;\n if (propertyIndex > 0) {\n let previous = parent.children[propertyIndex - 1];\n removeBegin = previous.offset + previous.length;\n } else {\n removeBegin = parent.offset + 1;\n if (parent.children.length > 1) {\n let next = parent.children[1];\n removeEnd = next.offset;\n }\n }\n return withFormatting(text, { offset: removeBegin, length: removeEnd - removeBegin, content: \"\" }, options);\n } else {\n return withFormatting(text, { offset: existing.offset, length: existing.length, content: JSON.stringify(value) }, options);\n }\n } else {\n if (value === void 0) {\n return [];\n }\n const newProperty = `${JSON.stringify(lastSegment)}: ${JSON.stringify(value)}`;\n const index = options.getInsertionIndex ? options.getInsertionIndex(parent.children.map((p) => p.children[0].value)) : parent.children.length;\n let edit;\n if (index > 0) {\n let previous = parent.children[index - 1];\n edit = { offset: previous.offset + previous.length, length: 0, content: \",\" + newProperty };\n } else if (parent.children.length === 0) {\n edit = { offset: parent.offset + 1, length: 0, content: newProperty };\n } else {\n edit = { offset: parent.offset + 1, length: 0, content: newProperty + \",\" };\n }\n return withFormatting(text, edit, options);\n }\n } else if (parent.type === \"array\" && typeof lastSegment === \"number\" && Array.isArray(parent.children)) {\n const insertIndex = lastSegment;\n if (insertIndex === -1) {\n const newProperty = `${JSON.stringify(value)}`;\n let edit;\n if (parent.children.length === 0) {\n edit = { offset: parent.offset + 1, length: 0, content: newProperty };\n } else {\n const previous = parent.children[parent.children.length - 1];\n edit = { offset: previous.offset + previous.length, length: 0, content: \",\" + newProperty };\n }\n return withFormatting(text, edit, options);\n } else if (value === void 0 && parent.children.length >= 0) {\n const removalIndex = lastSegment;\n const toRemove = parent.children[removalIndex];\n let edit;\n if (parent.children.length === 1) {\n edit = { offset: parent.offset + 1, length: parent.length - 2, content: \"\" };\n } else if (parent.children.length - 1 === removalIndex) {\n let previous = parent.children[removalIndex - 1];\n let offset = previous.offset + previous.length;\n let parentEndOffset = parent.offset + parent.length;\n edit = { offset, length: parentEndOffset - 2 - offset, content: \"\" };\n } else {\n edit = { offset: toRemove.offset, length: parent.children[removalIndex + 1].offset - toRemove.offset, content: \"\" };\n }\n return withFormatting(text, edit, options);\n } else if (value !== void 0) {\n let edit;\n const newProperty = `${JSON.stringify(value)}`;\n if (!options.isArrayInsertion && parent.children.length > lastSegment) {\n const toModify = parent.children[lastSegment];\n edit = { offset: toModify.offset, length: toModify.length, content: newProperty };\n } else if (parent.children.length === 0 || lastSegment === 0) {\n edit = { offset: parent.offset + 1, length: 0, content: parent.children.length === 0 ? newProperty : newProperty + \",\" };\n } else {\n const index = lastSegment > parent.children.length ? parent.children.length : lastSegment;\n const previous = parent.children[index - 1];\n edit = { offset: previous.offset + previous.length, length: 0, content: \",\" + newProperty };\n }\n return withFormatting(text, edit, options);\n } else {\n throw new Error(`Can not ${value === void 0 ? \"remove\" : options.isArrayInsertion ? \"insert\" : \"modify\"} Array index ${insertIndex} as length is not sufficient`);\n }\n } else {\n throw new Error(`Can not add ${typeof lastSegment !== \"number\" ? \"index\" : \"property\"} to parent of type ${parent.type}`);\n }\n}\n__name(setProperty, \"setProperty\");\nfunction withFormatting(text, edit, options) {\n if (!options.formattingOptions) {\n return [edit];\n }\n let newText = applyEdit(text, edit);\n let begin = edit.offset;\n let end = edit.offset + edit.content.length;\n if (edit.length === 0 || edit.content.length === 0) {\n while (begin > 0 && !isEOL(newText, begin - 1)) {\n begin--;\n }\n while (end < newText.length && !isEOL(newText, end)) {\n end++;\n }\n }\n const edits = format(newText, { offset: begin, length: end - begin }, { ...options.formattingOptions, keepLines: false });\n for (let i = edits.length - 1; i >= 0; i--) {\n const edit2 = edits[i];\n newText = applyEdit(newText, edit2);\n begin = Math.min(begin, edit2.offset);\n end = Math.max(end, edit2.offset + edit2.length);\n end += edit2.content.length - edit2.length;\n }\n const editLength = text.length - (newText.length - end) - begin;\n return [{ offset: begin, length: editLength, content: newText.substring(begin, end) }];\n}\n__name(withFormatting, \"withFormatting\");\nfunction applyEdit(text, edit) {\n return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length);\n}\n__name(applyEdit, \"applyEdit\");\n\n// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/main.js\nvar ScanError;\n(function(ScanError2) {\n ScanError2[ScanError2[\"None\"] = 0] = \"None\";\n ScanError2[ScanError2[\"UnexpectedEndOfComment\"] = 1] = \"UnexpectedEndOfComment\";\n ScanError2[ScanError2[\"UnexpectedEndOfString\"] = 2] = \"UnexpectedEndOfString\";\n ScanError2[ScanError2[\"UnexpectedEndOfNumber\"] = 3] = \"UnexpectedEndOfNumber\";\n ScanError2[ScanError2[\"InvalidUnicode\"] = 4] = \"InvalidUnicode\";\n ScanError2[ScanError2[\"InvalidEscapeCharacter\"] = 5] = \"InvalidEscapeCharacter\";\n ScanError2[ScanError2[\"InvalidCharacter\"] = 6] = \"InvalidCharacter\";\n})(ScanError || (ScanError = {}));\nvar SyntaxKind;\n(function(SyntaxKind2) {\n SyntaxKind2[SyntaxKind2[\"OpenBraceToken\"] = 1] = \"OpenBraceToken\";\n SyntaxKind2[SyntaxKind2[\"CloseBraceToken\"] = 2] = \"CloseBraceToken\";\n SyntaxKind2[SyntaxKind2[\"OpenBracketToken\"] = 3] = \"OpenBracketToken\";\n SyntaxKind2[SyntaxKind2[\"CloseBracketToken\"] = 4] = \"CloseBracketToken\";\n SyntaxKind2[SyntaxKind2[\"CommaToken\"] = 5] = \"CommaToken\";\n SyntaxKind2[SyntaxKind2[\"ColonToken\"] = 6] = \"ColonToken\";\n SyntaxKind2[SyntaxKind2[\"NullKeyword\"] = 7] = \"NullKeyword\";\n SyntaxKind2[SyntaxKind2[\"TrueKeyword\"] = 8] = \"TrueKeyword\";\n SyntaxKind2[SyntaxKind2[\"FalseKeyword\"] = 9] = \"FalseKeyword\";\n SyntaxKind2[SyntaxKind2[\"StringLiteral\"] = 10] = \"StringLiteral\";\n SyntaxKind2[SyntaxKind2[\"NumericLiteral\"] = 11] = \"NumericLiteral\";\n SyntaxKind2[SyntaxKind2[\"LineCommentTrivia\"] = 12] = \"LineCommentTrivia\";\n SyntaxKind2[SyntaxKind2[\"BlockCommentTrivia\"] = 13] = \"BlockCommentTrivia\";\n SyntaxKind2[SyntaxKind2[\"LineBreakTrivia\"] = 14] = \"LineBreakTrivia\";\n SyntaxKind2[SyntaxKind2[\"Trivia\"] = 15] = \"Trivia\";\n SyntaxKind2[SyntaxKind2[\"Unknown\"] = 16] = \"Unknown\";\n SyntaxKind2[SyntaxKind2[\"EOF\"] = 17] = \"EOF\";\n})(SyntaxKind || (SyntaxKind = {}));\nvar parse2 = parse;\nvar ParseErrorCode;\n(function(ParseErrorCode2) {\n ParseErrorCode2[ParseErrorCode2[\"InvalidSymbol\"] = 1] = \"InvalidSymbol\";\n ParseErrorCode2[ParseErrorCode2[\"InvalidNumberFormat\"] = 2] = \"InvalidNumberFormat\";\n ParseErrorCode2[ParseErrorCode2[\"PropertyNameExpected\"] = 3] = \"PropertyNameExpected\";\n ParseErrorCode2[ParseErrorCode2[\"ValueExpected\"] = 4] = \"ValueExpected\";\n ParseErrorCode2[ParseErrorCode2[\"ColonExpected\"] = 5] = \"ColonExpected\";\n ParseErrorCode2[ParseErrorCode2[\"CommaExpected\"] = 6] = \"CommaExpected\";\n ParseErrorCode2[ParseErrorCode2[\"CloseBraceExpected\"] = 7] = \"CloseBraceExpected\";\n ParseErrorCode2[ParseErrorCode2[\"CloseBracketExpected\"] = 8] = \"CloseBracketExpected\";\n ParseErrorCode2[ParseErrorCode2[\"EndOfFileExpected\"] = 9] = \"EndOfFileExpected\";\n ParseErrorCode2[ParseErrorCode2[\"InvalidCommentToken\"] = 10] = \"InvalidCommentToken\";\n ParseErrorCode2[ParseErrorCode2[\"UnexpectedEndOfComment\"] = 11] = \"UnexpectedEndOfComment\";\n ParseErrorCode2[ParseErrorCode2[\"UnexpectedEndOfString\"] = 12] = \"UnexpectedEndOfString\";\n ParseErrorCode2[ParseErrorCode2[\"UnexpectedEndOfNumber\"] = 13] = \"UnexpectedEndOfNumber\";\n ParseErrorCode2[ParseErrorCode2[\"InvalidUnicode\"] = 14] = \"InvalidUnicode\";\n ParseErrorCode2[ParseErrorCode2[\"InvalidEscapeCharacter\"] = 15] = \"InvalidEscapeCharacter\";\n ParseErrorCode2[ParseErrorCode2[\"InvalidCharacter\"] = 16] = \"InvalidCharacter\";\n})(ParseErrorCode || (ParseErrorCode = {}));\nfunction printParseErrorCode(code) {\n switch (code) {\n case 1:\n return \"InvalidSymbol\";\n case 2:\n return \"InvalidNumberFormat\";\n case 3:\n return \"PropertyNameExpected\";\n case 4:\n return \"ValueExpected\";\n case 5:\n return \"ColonExpected\";\n case 6:\n return \"CommaExpected\";\n case 7:\n return \"CloseBraceExpected\";\n case 8:\n return \"CloseBracketExpected\";\n case 9:\n return \"EndOfFileExpected\";\n case 10:\n return \"InvalidCommentToken\";\n case 11:\n return \"UnexpectedEndOfComment\";\n case 12:\n return \"UnexpectedEndOfString\";\n case 13:\n return \"UnexpectedEndOfNumber\";\n case 14:\n return \"InvalidUnicode\";\n case 15:\n return \"InvalidEscapeCharacter\";\n case 16:\n return \"InvalidCharacter\";\n }\n return \"<unknown ParseErrorCode>\";\n}\n__name(printParseErrorCode, \"printParseErrorCode\");\nfunction format2(documentText, range, options) {\n return format(documentText, range, options);\n}\n__name(format2, \"format\");\nfunction modify(text, path2, value, options) {\n return setProperty(text, path2, value, options);\n}\n__name(modify, \"modify\");\nfunction applyEdits(text, edits) {\n let sortedEdits = edits.slice(0).sort((a, b) => {\n const diff = a.offset - b.offset;\n if (diff === 0) {\n return a.length - b.length;\n }\n return diff;\n });\n let lastModifiedOffset = text.length;\n for (let i = sortedEdits.length - 1; i >= 0; i--) {\n let e = sortedEdits[i];\n if (e.offset + e.length <= lastModifiedOffset) {\n text = applyEdit(text, e);\n } else {\n throw new Error(\"Overlapping edit\");\n }\n lastModifiedOffset = e.offset;\n }\n return text;\n}\n__name(applyEdits, \"applyEdits\");\n\n// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/error.js\nfunction getLineColFromPtr(string, ptr) {\n let lines = string.slice(0, ptr).split(/\\r\\n|\\n|\\r/g);\n return [lines.length, lines.pop().length + 1];\n}\n__name(getLineColFromPtr, \"getLineColFromPtr\");\nfunction makeCodeBlock(string, line, column) {\n let lines = string.split(/\\r\\n|\\n|\\r/g);\n let codeblock = \"\";\n let numberLen = (Math.log10(line + 1) | 0) + 1;\n for (let i = line - 1; i <= line + 1; i++) {\n let l = lines[i - 1];\n if (!l)\n continue;\n codeblock += i.toString().padEnd(numberLen, \" \");\n codeblock += \": \";\n codeblock += l;\n codeblock += \"\\n\";\n if (i === line) {\n codeblock += \" \".repeat(numberLen + column + 2);\n codeblock += \"^\\n\";\n }\n }\n return codeblock;\n}\n__name(makeCodeBlock, \"makeCodeBlock\");\nvar TomlError = class extends Error {\n static {\n __name(this, \"TomlError\");\n }\n line;\n column;\n codeblock;\n constructor(message, options) {\n const [line, column] = getLineColFromPtr(options.toml, options.ptr);\n const codeblock = makeCodeBlock(options.toml, line, column);\n super(`Invalid TOML document: ${message}\n\n${codeblock}`, options);\n this.line = line;\n this.column = column;\n this.codeblock = codeblock;\n }\n};\n\n// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/util.js\nfunction isEscaped(str, ptr) {\n let i = 0;\n while (str[ptr - ++i] === \"\\\\\")\n ;\n return --i && i % 2;\n}\n__name(isEscaped, \"isEscaped\");\nfunction indexOfNewline(str, start = 0, end = str.length) {\n let idx = str.indexOf(\"\\n\", start);\n if (str[idx - 1] === \"\\r\")\n idx--;\n return idx <= end ? idx : -1;\n}\n__name(indexOfNewline, \"indexOfNewline\");\nfunction skipComment(str, ptr) {\n for (let i = ptr; i < str.length; i++) {\n let c = str[i];\n if (c === \"\\n\")\n return i;\n if (c === \"\\r\" && str[i + 1] === \"\\n\")\n return i + 1;\n if (c < \" \" && c !== \"\t\" || c === \"\\x7F\") {\n throw new TomlError(\"control characters are not allowed in comments\", {\n toml: str,\n ptr\n });\n }\n }\n return str.length;\n}\n__name(skipComment, \"skipComment\");\nfunction skipVoid(str, ptr, banNewLines, banComments) {\n let c;\n while ((c = str[ptr]) === \" \" || c === \"\t\" || !banNewLines && (c === \"\\n\" || c === \"\\r\" && str[ptr + 1] === \"\\n\"))\n ptr++;\n return banComments || c !== \"#\" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines);\n}\n__name(skipVoid, \"skipVoid\");\nfunction skipUntil(str, ptr, sep, end, banNewLines = false) {\n if (!end) {\n ptr = indexOfNewline(str, ptr);\n return ptr < 0 ? str.length : ptr;\n }\n for (let i = ptr; i < str.length; i++) {\n let c = str[i];\n if (c === \"#\") {\n i = indexOfNewline(str, i);\n } else if (c === sep) {\n return i + 1;\n } else if (c === end || banNewLines && (c === \"\\n\" || c === \"\\r\" && str[i + 1] === \"\\n\")) {\n return i;\n }\n }\n throw new TomlError(\"cannot find end of structure\", {\n toml: str,\n ptr\n });\n}\n__name(skipUntil, \"skipUntil\");\nfunction getStringEnd(str, seek) {\n let first = str[seek];\n let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;\n seek += target.length - 1;\n do\n seek = str.indexOf(target, ++seek);\n while (seek > -1 && first !== \"'\" && isEscaped(str, seek));\n if (seek > -1) {\n seek += target.length;\n if (target.length > 1) {\n if (str[seek] === first)\n seek++;\n if (str[seek] === first)\n seek++;\n }\n }\n return seek;\n}\n__name(getStringEnd, \"getStringEnd\");\n\n// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/date.js\nvar DATE_TIME_RE = /^(\\d{4}-\\d{2}-\\d{2})?[T ]?(?:(\\d{2}):\\d{2}:\\d{2}(?:\\.\\d+)?)?(Z|[-+]\\d{2}:\\d{2})?$/i;\nvar TomlDate = class _TomlDate extends Date {\n static {\n __name(this, \"TomlDate\");\n }\n #hasDate = false;\n #hasTime = false;\n #offset = null;\n constructor(date) {\n let hasDate = true;\n let hasTime = true;\n let offset = \"Z\";\n if (typeof date === \"string\") {\n let match = date.match(DATE_TIME_RE);\n if (match) {\n if (!match[1]) {\n hasDate = false;\n date = `0000-01-01T${date}`;\n }\n hasTime = !!match[2];\n hasTime && date[10] === \" \" && (date = date.replace(\" \", \"T\"));\n if (match[2] && +match[2] > 23) {\n date = \"\";\n } else {\n offset = match[3] || null;\n date = date.toUpperCase();\n if (!offset && hasTime)\n date += \"Z\";\n }\n } else {\n date = \"\";\n }\n }\n super(date);\n if (!isNaN(this.getTime())) {\n this.#hasDate = hasDate;\n this.#hasTime = hasTime;\n this.#offset = offset;\n }\n }\n isDateTime() {\n return this.#hasDate && this.#hasTime;\n }\n isLocal() {\n return !this.#hasDate || !this.#hasTime || !this.#offset;\n }\n isDate() {\n return this.#hasDate && !this.#hasTime;\n }\n isTime() {\n return this.#hasTime && !this.#hasDate;\n }\n isValid() {\n return this.#hasDate || this.#hasTime;\n }\n toISOString() {\n let iso = super.toISOString();\n if (this.isDate())\n return iso.slice(0, 10);\n if (this.isTime())\n return iso.slice(11, 23);\n if (this.#offset === null)\n return iso.slice(0, -1);\n if (this.#offset === \"Z\")\n return iso;\n let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);\n offset = this.#offset[0] === \"-\" ? offset : -offset;\n let offsetDate = new Date(this.getTime() - offset * 6e4);\n return offsetDate.toISOString().slice(0, -1) + this.#offset;\n }\n static wrapAsOffsetDateTime(jsDate, offset = \"Z\") {\n let date = new _TomlDate(jsDate);\n date.#offset = offset;\n return date;\n }\n static wrapAsLocalDateTime(jsDate) {\n let date = new _TomlDate(jsDate);\n date.#offset = null;\n return date;\n }\n static wrapAsLocalDate(jsDate) {\n let date = new _TomlDate(jsDate);\n date.#hasTime = false;\n date.#offset = null;\n return date;\n }\n static wrapAsLocalTime(jsDate) {\n let date = new _TomlDate(jsDate);\n date.#hasDate = false;\n date.#offset = null;\n return date;\n }\n};\n\n// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/primitive.js\nvar INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\\d(_?\\d)*))$/;\nvar FLOAT_REGEX = /^[+-]?\\d(_?\\d)*(\\.\\d(_?\\d)*)?([eE][+-]?\\d(_?\\d)*)?$/;\nvar LEADING_ZERO = /^[+-]?0[0-9_]/;\nvar ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i;\nvar ESC_MAP = {\n b: \"\\b\",\n t: \"\t\",\n n: \"\\n\",\n f: \"\\f\",\n r: \"\\r\",\n '\"': '\"',\n \"\\\\\": \"\\\\\"\n};\nfunction parseString(str, ptr = 0, endPtr = str.length) {\n let isLiteral = str[ptr] === \"'\";\n let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];\n if (isMultiline) {\n endPtr -= 2;\n if (str[ptr += 2] === \"\\r\")\n ptr++;\n if (str[ptr] === \"\\n\")\n ptr++;\n }\n let tmp = 0;\n let isEscape;\n let parsed = \"\";\n let sliceStart = ptr;\n while (ptr < endPtr - 1) {\n let c = str[ptr++];\n if (c === \"\\n\" || c === \"\\r\" && str[ptr] === \"\\n\") {\n if (!isMultiline) {\n throw new TomlError(\"newlines are not allowed in strings\", {\n toml: str,\n ptr: ptr - 1\n });\n }\n } else if (c < \" \" && c !== \"\t\" || c === \"\\x7F\") {\n throw new TomlError(\"control characters are not allowed in strings\", {\n toml: str,\n ptr: ptr - 1\n });\n }\n if (isEscape) {\n isEscape = false;\n if (c === \"u\" || c === \"U\") {\n let code = str.slice(ptr, ptr += c === \"u\" ? 4 : 8);\n if (!ESCAPE_REGEX.test(code)) {\n throw new TomlError(\"invalid unicode escape\", {\n toml: str,\n ptr: tmp\n });\n }\n try {\n parsed += String.fromCodePoint(parseInt(code, 16));\n } catch {\n throw new TomlError(\"invalid unicode escape\", {\n toml: str,\n ptr: tmp\n });\n }\n } else if (isMultiline && (c === \"\\n\" || c === \" \" || c === \"\t\" || c === \"\\r\")) {\n ptr = skipVoid(str, ptr - 1, true);\n if (str[ptr] !== \"\\n\" && str[ptr] !== \"\\r\") {\n throw new TomlError(\"invalid escape: only line-ending whitespace may be escaped\", {\n toml: str,\n ptr: tmp\n });\n }\n ptr = skipVoid(str, ptr);\n } else if (c in ESC_MAP) {\n parsed += ESC_MAP[c];\n } else {\n throw new TomlError(\"unrecognized escape sequence\", {\n toml: str,\n ptr: tmp\n });\n }\n sliceStart = ptr;\n } else if (!isLiteral && c === \"\\\\\") {\n tmp = ptr - 1;\n isEscape = true;\n parsed += str.slice(sliceStart, tmp);\n }\n }\n return parsed + str.slice(sliceStart, endPtr - 1);\n}\n__name(parseString, \"parseString\");\nfunction parseValue(value, toml, ptr, integersAsBigInt) {\n if (value === \"true\")\n return true;\n if (value === \"false\")\n return false;\n if (value === \"-inf\")\n return -Infinity;\n if (value === \"inf\" || value === \"+inf\")\n return Infinity;\n if (value === \"nan\" || value === \"+nan\" || value === \"-nan\")\n return NaN;\n if (value === \"-0\")\n return integersAsBigInt ? 0n : 0;\n let isInt = INT_REGEX.test(value);\n if (isInt || FLOAT_REGEX.test(value)) {\n if (LEADING_ZERO.test(value)) {\n throw new TomlError(\"leading zeroes are not allowed\", {\n toml,\n ptr\n });\n }\n value = value.replace(/_/g, \"\");\n let numeric = +value;\n if (isNaN(numeric)) {\n throw new TomlError(\"invalid number\", {\n toml,\n ptr\n });\n }\n if (isInt) {\n if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {\n throw new TomlError(\"integer value cannot be represented losslessly\", {\n toml,\n ptr\n });\n }\n if (isInt || integersAsBigInt === true)\n numeric = BigInt(value);\n }\n return numeric;\n }\n const date = new TomlDate(value);\n if (!date.isValid()) {\n throw new TomlError(\"invalid value\", {\n toml,\n ptr\n });\n }\n return date;\n}\n__name(parseValue, \"parseValue\");\n\n// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/extract.js\nfunction sliceAndTrimEndOf(str, startPtr, endPtr, allowNewLines) {\n let value = str.slice(startPtr, endPtr);\n let commentIdx = value.indexOf(\"#\");\n if (commentIdx > -1) {\n skipComment(str, commentIdx);\n value = value.slice(0, commentIdx);\n }\n let trimmed = value.trimEnd();\n if (!allowNewLines) {\n let newlineIdx = value.indexOf(\"\\n\", trimmed.length);\n if (newlineIdx > -1) {\n throw new TomlError(\"newlines are not allowed in inline tables\", {\n toml: str,\n ptr: startPtr + newlineIdx\n });\n }\n }\n return [trimmed, commentIdx];\n}\n__name(sliceAndTrimEndOf, \"sliceAndTrimEndOf\");\nfunction extractValue(str, ptr, end, depth, integersAsBigInt) {\n if (depth === 0) {\n throw new TomlError(\"document contains excessively nested structures. aborting.\", {\n toml: str,\n ptr\n });\n }\n let c = str[ptr];\n if (c === \"[\" || c === \"{\") {\n let [value, endPtr2] = c === \"[\" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);\n let newPtr = end ? skipUntil(str, endPtr2, \",\", end) : endPtr2;\n if (endPtr2 - newPtr && end === \"}\") {\n let nextNewLine = indexOfNewline(str, endPtr2, newPtr);\n if (nextNewLine > -1) {\n throw new TomlError(\"newlines are not allowed in inline tables\", {\n toml: str,\n ptr: nextNewLine\n });\n }\n }\n return [value, newPtr];\n }\n let endPtr;\n if (c === '\"' || c === \"'\") {\n endPtr = getStringEnd(str, ptr);\n let parsed = parseString(str, ptr, endPtr);\n if (end) {\n endPtr = skipVoid(str, endPtr, end !== \"]\");\n if (str[endPtr] && str[endPtr] !== \",\" && str[endPtr] !== end && str[endPtr] !== \"\\n\" && str[endPtr] !== \"\\r\") {\n throw new TomlError(\"unexpected character encountered\", {\n toml: str,\n ptr: endPtr\n });\n }\n endPtr += +(str[endPtr] === \",\");\n }\n return [parsed, endPtr];\n }\n endPtr = skipUntil(str, ptr, \",\", end);\n let slice = sliceAndTrimEndOf(str, ptr, endPtr - +(str[endPtr - 1] === \",\"), end === \"]\");\n if (!slice[0]) {\n throw new TomlError(\"incomplete key-value declaration: no value specified\", {\n toml: str,\n ptr\n });\n }\n if (end && slice[1] > -1) {\n endPtr = skipVoid(str, ptr + slice[1]);\n endPtr += +(str[endPtr] === \",\");\n }\n return [\n parseValue(slice[0], str, ptr, integersAsBigInt),\n endPtr\n ];\n}\n__name(extractValue, \"extractValue\");\n\n// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/struct.js\nvar KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \\t]*$/;\nfunction parseKey(str, ptr, end = \"=\") {\n let dot = ptr - 1;\n let parsed = [];\n let endPtr = str.indexOf(end, ptr);\n if (endPtr < 0) {\n throw new TomlError(\"incomplete key-value: cannot find end of key\", {\n toml: str,\n ptr\n });\n }\n do {\n let c = str[ptr = ++dot];\n if (c !== \" \" && c !== \"\t\") {\n if (c === '\"' || c === \"'\") {\n if (c === str[ptr + 1] && c === str[ptr + 2]) {\n throw new TomlError(\"multiline strings are not allowed in keys\", {\n toml: str,\n ptr\n });\n }\n let eos = getStringEnd(str, ptr);\n if (eos < 0) {\n throw new TomlError(\"unfinished string encountered\", {\n toml: str,\n ptr\n });\n }\n dot = str.indexOf(\".\", eos);\n let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);\n let newLine = indexOfNewline(strEnd);\n if (newLine > -1) {\n throw new TomlError(\"newlines are not allowed in keys\", {\n toml: str,\n ptr: ptr + dot + newLine\n });\n }\n if (strEnd.trimStart()) {\n throw new TomlError(\"found extra tokens after the string part\", {\n toml: str,\n ptr: eos\n });\n }\n if (endPtr < eos) {\n endPtr = str.indexOf(end, eos);\n if (endPtr < 0) {\n throw new TomlError(\"incomplete key-value: cannot find end of key\", {\n toml: str,\n ptr\n });\n }\n }\n parsed.push(parseString(str, ptr, eos));\n } else {\n dot = str.indexOf(\".\", ptr);\n let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);\n if (!KEY_PART_RE.test(part)) {\n throw new TomlError(\"only letter, numbers, dashes and underscores are allowed in keys\", {\n toml: str,\n ptr\n });\n }\n parsed.push(part.trimEnd());\n }\n }\n } while (dot + 1 && dot < endPtr);\n return [parsed, skipVoid(str, endPtr + 1, true, true)];\n}\n__name(parseKey, \"parseKey\");\nfunction parseInlineTable(str, ptr, depth, integersAsBigInt) {\n let res = {};\n let seen = /* @__PURE__ */ new Set();\n let c;\n let comma = 0;\n ptr++;\n while ((c = str[ptr++]) !== \"}\" && c) {\n let err = { toml: str, ptr: ptr - 1 };\n if (c === \"\\n\") {\n throw new TomlError(\"newlines are not allowed in inline tables\", err);\n } else if (c === \"#\") {\n throw new TomlError(\"inline tables cannot contain comments\", err);\n } else if (c === \",\") {\n throw new TomlError(\"expected key-value, found comma\", err);\n } else if (c !== \" \" && c !== \"\t\") {\n let k;\n let t = res;\n let hasOwn = false;\n let [key, keyEndPtr] = parseKey(str, ptr - 1);\n for (let i = 0; i < key.length; i++) {\n if (i)\n t = hasOwn ? t[k] : t[k] = {};\n k = key[i];\n if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== \"object\" || seen.has(t[k]))) {\n throw new TomlError(\"trying to redefine an already defined value\", {\n toml: str,\n ptr\n });\n }\n if (!hasOwn && k === \"__proto__\") {\n Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });\n }\n }\n if (hasOwn) {\n throw new TomlError(\"trying to redefine an already defined value\", {\n toml: str,\n ptr\n });\n }\n let [value, valueEndPtr] = extractValue(str, keyEndPtr, \"}\", depth - 1, integersAsBigInt);\n seen.add(value);\n t[k] = value;\n ptr = valueEndPtr;\n comma = str[ptr - 1] === \",\" ? ptr - 1 : 0;\n }\n }\n if (comma) {\n throw new TomlError(\"trailing commas are not allowed in inline tables\", {\n toml: str,\n ptr: comma\n });\n }\n if (!c) {\n throw new TomlError(\"unfinished table encountered\", {\n toml: str,\n ptr\n });\n }\n return [res, ptr];\n}\n__name(parseInlineTable, \"parseInlineTable\");\nfunction parseArray(str, ptr, depth, integersAsBigInt) {\n let res = [];\n let c;\n ptr++;\n while ((c = str[ptr++]) !== \"]\" && c) {\n if (c === \",\") {\n throw new TomlError(\"expected value, found comma\", {\n toml: str,\n ptr: ptr - 1\n });\n } else if (c === \"#\")\n ptr = skipComment(str, ptr);\n else if (c !== \" \" && c !== \"\t\" && c !== \"\\n\" && c !== \"\\r\") {\n let e = extractValue(str, ptr - 1, \"]\", depth - 1, integersAsBigInt);\n res.push(e[0]);\n ptr = e[1];\n }\n }\n if (!c) {\n throw new TomlError(\"unfinished array encountered\", {\n toml: str,\n ptr\n });\n }\n return [res, ptr];\n}\n__name(parseArray, \"parseArray\");\n\n// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/parse.js\nfunction peekTable(key, table, meta, type) {\n let t = table;\n let m = meta;\n let k;\n let hasOwn = false;\n let state;\n for (let i = 0; i < key.length; i++) {\n if (i) {\n t = hasOwn ? t[k] : t[k] = {};\n m = (state = m[k]).c;\n if (type === 0 && (state.t === 1 || state.t === 2)) {\n return null;\n }\n if (state.t === 2) {\n let l = t.length - 1;\n t = t[l];\n m = m[l].c;\n }\n }\n k = key[i];\n if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 && m[k]?.d) {\n return null;\n }\n if (!hasOwn) {\n if (k === \"__proto__\") {\n Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });\n Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true });\n }\n m[k] = {\n t: i < key.length - 1 && type === 2 ? 3 : type,\n d: false,\n i: 0,\n c: {}\n };\n }\n }\n state = m[k];\n if (state.t !== type && !(type === 1 && state.t === 3)) {\n return null;\n }\n if (type === 2) {\n if (!state.d) {\n state.d = true;\n t[k] = [];\n }\n t[k].push(t = {});\n state.c[state.i++] = state = { t: 1, d: false, i: 0, c: {} };\n }\n if (state.d) {\n return null;\n }\n state.d = true;\n if (type === 1) {\n t = hasOwn ? t[k] : t[k] = {};\n } else if (type === 0 && hasOwn) {\n return null;\n }\n return [k, t, state.c];\n}\n__name(peekTable, \"peekTable\");\nfunction parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {\n let res = {};\n let meta = {};\n let tbl = res;\n let m = meta;\n for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) {\n if (toml[ptr] === \"[\") {\n let isTableArray = toml[++ptr] === \"[\";\n let k = parseKey(toml, ptr += +isTableArray, \"]\");\n if (isTableArray) {\n if (toml[k[1] - 1] !== \"]\") {\n throw new TomlError(\"expected end of table declaration\", {\n toml,\n ptr: k[1] - 1\n });\n }\n k[1]++;\n }\n let p = peekTable(\n k[0],\n res,\n meta,\n isTableArray ? 2 : 1\n /* Type.EXPLICIT */\n );\n if (!p) {\n throw new TomlError(\"trying to redefine an already defined table or value\", {\n toml,\n ptr\n });\n }\n m = p[2];\n tbl = p[1];\n ptr = k[1];\n } else {\n let k = parseKey(toml, ptr);\n let p = peekTable(\n k[0],\n tbl,\n m,\n 0\n /* Type.DOTTED */\n );\n if (!p) {\n throw new TomlError(\"trying to redefine an already defined table or value\", {\n toml,\n ptr\n });\n }\n let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt);\n p[1][p[0]] = v[0];\n ptr = v[1];\n }\n ptr = skipVoid(toml, ptr, true);\n if (toml[ptr] && toml[ptr] !== \"\\n\" && toml[ptr] !== \"\\r\") {\n throw new TomlError(\"each key-value declaration must be followed by an end-of-line\", {\n toml,\n ptr\n });\n }\n ptr = skipVoid(toml, ptr);\n }\n return res;\n}\n__name(parse3, \"parse\");\n\n// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/stringify.js\nvar BARE_KEY = /^[a-z0-9-_]+$/i;\nfunction extendedTypeOf(obj) {\n let type = typeof obj;\n if (type === \"object\") {\n if (Array.isArray(obj))\n return \"array\";\n if (obj instanceof Date)\n return \"date\";\n }\n return type;\n}\n__name(extendedTypeOf, \"extendedTypeOf\");\nfunction isArrayOfTables(obj) {\n for (let i = 0; i < obj.length; i++) {\n if (extendedTypeOf(obj[i]) !== \"object\")\n return false;\n }\n return obj.length != 0;\n}\n__name(isArrayOfTables, \"isArrayOfTables\");\nfunction formatString(s) {\n return JSON.stringify(s).replace(/\\x7f/g, \"\\\\u007f\");\n}\n__name(formatString, \"formatString\");\nfunction stringifyValue(val, type, depth, numberAsFloat) {\n if (depth === 0) {\n throw new Error(\"Could not stringify the object: maximum object depth exceeded\");\n }\n if (type === \"number\") {\n if (isNaN(val))\n return \"nan\";\n if (val === Infinity)\n return \"inf\";\n if (val === -Infinity)\n return \"-inf\";\n if (numberAsFloat && Number.isInteger(val))\n return val.toFixed(1);\n return val.toString();\n }\n if (type === \"bigint\" || type === \"boolean\") {\n return val.toString();\n }\n if (type === \"string\") {\n return formatString(val);\n }\n if (type === \"date\") {\n if (isNaN(val.getTime())) {\n throw new TypeError(\"cannot serialize invalid date\");\n }\n return val.toISOString();\n }\n if (type === \"object\") {\n return stringifyInlineTable(val, depth, numberAsFloat);\n }\n if (type === \"array\") {\n return stringifyArray(val, depth, numberAsFloat);\n }\n}\n__name(stringifyValue, \"stringifyValue\");\nfunction stringifyInlineTable(obj, depth, numberAsFloat) {\n let keys = Object.keys(obj);\n if (keys.length === 0)\n return \"{}\";\n let res = \"{ \";\n for (let i = 0; i < keys.length; i++) {\n let k = keys[i];\n if (i)\n res += \", \";\n res += BARE_KEY.test(k) ? k : formatString(k);\n res += \" = \";\n res += stringifyValue(obj[k], extendedTypeOf(obj[k]), depth - 1, numberAsFloat);\n }\n return res + \" }\";\n}\n__name(stringifyInlineTable, \"stringifyInlineTable\");\nfunction stringifyArray(array, depth, numberAsFloat) {\n if (array.length === 0)\n return \"[]\";\n let res = \"[ \";\n for (let i = 0; i < array.length; i++) {\n if (i)\n res += \", \";\n if (array[i] === null || array[i] === void 0) {\n throw new TypeError(\"arrays cannot contain null or undefined values\");\n }\n res += stringifyValue(array[i], extendedTypeOf(array[i]), depth - 1, numberAsFloat);\n }\n return res + \" ]\";\n}\n__name(stringifyArray, \"stringifyArray\");\nfunction stringifyArrayTable(array, key, depth, numberAsFloat) {\n if (depth === 0) {\n throw new Error(\"Could not stringify the object: maximum object depth exceeded\");\n }\n let res = \"\";\n for (let i = 0; i < array.length; i++) {\n res += `${res && \"\\n\"}[[${key}]]\n`;\n res += stringifyTable(0, array[i], key, depth, numberAsFloat);\n }\n return res;\n}\n__name(stringifyArrayTable, \"stringifyArrayTable\");\nfunction stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {\n if (depth === 0) {\n throw new Error(\"Could not stringify the object: maximum object depth exceeded\");\n }\n let preamble = \"\";\n let tables = \"\";\n let keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n let k = keys[i];\n if (obj[k] !== null && obj[k] !== void 0) {\n let type = extendedTypeOf(obj[k]);\n if (type === \"symbol\" || type === \"function\") {\n throw new TypeError(`cannot serialize values of type '${type}'`);\n }\n let key = BARE_KEY.test(k) ? k : formatString(k);\n if (type === \"array\" && isArrayOfTables(obj[k])) {\n tables += (tables && \"\\n\") + stringifyArrayTable(obj[k], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);\n } else if (type === \"object\") {\n let tblKey = prefix ? `${prefix}.${key}` : key;\n tables += (tables && \"\\n\") + stringifyTable(tblKey, obj[k], tblKey, depth - 1, numberAsFloat);\n } else {\n preamble += key;\n preamble += \" = \";\n preamble += stringifyValue(obj[k], type, depth, numberAsFloat);\n preamble += \"\\n\";\n }\n }\n }\n if (tableKey && (preamble || !tables))\n preamble = preamble ? `[${tableKey}]\n${preamble}` : `[${tableKey}]`;\n return preamble && tables ? `${preamble}\n${tables}` : preamble || tables;\n}\n__name(stringifyTable, \"stringifyTable\");\nfunction stringify(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {\n if (extendedTypeOf(obj) !== \"object\") {\n throw new TypeError(\"stringify can only be called with an object\");\n }\n let str = stringifyTable(0, obj, \"\", maxDepth, numbersAsFloat);\n if (str[str.length - 1] !== \"\\n\")\n return str + \"\\n\";\n return str;\n}\n__name(stringify, \"stringify\");\n\n// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/index.js\nvar dist_default = { parse: parse3, stringify, TomlDate, TomlError };\n\n// src/parse.ts\nvar ParseError = class extends UserError {\n static {\n __name(this, \"ParseError\");\n }\n text;\n notes;\n location;\n kind;\n constructor({ text, notes, location, kind, telemetryMessage }) {\n super(text, { telemetryMessage });\n this.name = this.constructor.name;\n this.text = text;\n this.notes = notes ?? [];\n this.location = location;\n this.kind = kind ?? \"error\";\n }\n};\nvar APIError = class extends ParseError {\n static {\n __name(this, \"APIError\");\n }\n #status;\n code;\n accountTag;\n constructor({ status, ...rest }) {\n super(rest);\n this.name = this.constructor.name;\n this.#status = status;\n }\n get status() {\n return this.#status;\n }\n isGatewayError() {\n if (this.#status !== void 0) {\n return [524].includes(this.#status);\n }\n return false;\n }\n isRetryable() {\n return String(this.#status).startsWith(\"5\");\n }\n // Allow `APIError`s to be marked as handled.\n #reportable = true;\n get reportable() {\n return this.#reportable;\n }\n preventReport() {\n this.#reportable = false;\n }\n};\nfunction parseTOML(tomlContent, filePath) {\n try {\n return dist_default.parse(tomlContent);\n } catch (err) {\n if (!(err instanceof TomlError)) {\n throw err;\n }\n const location = {\n lineText: tomlContent.split(\"\\n\")[err.line - 1],\n line: err.line,\n column: err.column - 1,\n file: filePath,\n fileText: tomlContent\n };\n throw new ParseError({\n text: err.message.substring(0, err.message.indexOf(\"\\n\")),\n location,\n telemetryMessage: \"TOML parse error\"\n });\n }\n}\n__name(parseTOML, \"parseTOML\");\nfunction parsePackageJSON(input, file2) {\n return parseJSON(input, file2);\n}\n__name(parsePackageJSON, \"parsePackageJSON\");\nfunction parseJSON(input, file2) {\n return parseJSONC(input, file2, {\n allowEmptyContent: false,\n allowTrailingComma: false,\n disallowComments: true\n });\n}\n__name(parseJSON, \"parseJSON\");\nfunction parseJSONC(input, file2, options = { allowTrailingComma: true }) {\n const errors = [];\n const data = parse2(input, errors, options);\n if (errors.length) {\n throw new ParseError({\n text: printParseErrorCode(errors[0].error),\n location: {\n ...indexLocation({ file: file2, fileText: input }, errors[0].offset + 1),\n length: errors[0].length\n },\n telemetryMessage: \"JSON(C) parse error\"\n });\n }\n return data;\n}\n__name(parseJSONC, \"parseJSONC\");\nfunction readFileSyncToBuffer(file2) {\n try {\n return readFileSync$1(file2);\n } catch (err) {\n const { message } = err;\n throw new ParseError({\n text: `Could not read file: ${file2}`,\n notes: [\n {\n text: message.replace(file2, resolve(file2))\n }\n ]\n });\n }\n}\n__name(readFileSyncToBuffer, \"readFileSyncToBuffer\");\nfunction readFileSync(file2) {\n try {\n const buffer = readFileSync$1(file2);\n return removeBOMAndValidate(buffer, file2);\n } catch (err) {\n if (err instanceof ParseError) {\n throw err;\n }\n const { message } = err;\n throw new ParseError({\n text: `Could not read file: ${file2}`,\n notes: [\n {\n text: message.replace(file2, resolve(file2))\n }\n ],\n telemetryMessage: \"Could not read file\"\n });\n }\n}\n__name(readFileSync, \"readFileSync\");\nfunction indexLocation(file2, index) {\n let lineText, line = 0, column = 0, cursor = 0;\n const { fileText = \"\" } = file2;\n for (const row of fileText.split(\"\\n\")) {\n line++;\n cursor += row.length + 1;\n if (cursor >= index) {\n lineText = row;\n column = row.length - (cursor - index);\n break;\n }\n }\n return { lineText, line, column, ...file2 };\n}\n__name(indexLocation, \"indexLocation\");\nfunction searchLocation(file2, query) {\n let lineText, length, line = 0, column = 0;\n const queryText = String(query);\n const { fileText = \"\" } = file2;\n for (const content of fileText.split(\"\\n\")) {\n line++;\n const index = content.indexOf(queryText);\n if (index >= 0) {\n lineText = content;\n column = index;\n length = queryText.length;\n break;\n }\n }\n return { lineText, line, column, length, ...file2 };\n}\n__name(searchLocation, \"searchLocation\");\nvar units = {\n nanoseconds: 1e-9,\n nanosecond: 1e-9,\n microseconds: 1e-6,\n microsecond: 1e-6,\n milliseconds: 1e-3,\n millisecond: 1e-3,\n seconds: 1,\n second: 1,\n minutes: 60,\n minute: 60,\n hours: 3600,\n hour: 3600,\n days: 86400,\n day: 86400,\n weeks: 604800,\n week: 604800,\n month: 18144e3,\n year: 220752e3,\n nsecs: 1e-9,\n nsec: 1e-9,\n usecs: 1e-6,\n usec: 1e-6,\n msecs: 1e-3,\n msec: 1e-3,\n secs: 1,\n sec: 1,\n mins: 60,\n min: 60,\n ns: 1e-9,\n us: 1e-6,\n ms: 1e-3,\n mo: 18144e3,\n yr: 220752e3,\n s: 1,\n m: 60,\n h: 3600,\n d: 86400,\n w: 604800,\n y: 220752e3\n};\nfunction parseHumanDuration(s) {\n const unitsMap = new Map(Object.entries(units));\n s = s.trim().toLowerCase();\n let base = 1;\n for (const [name, _] of unitsMap) {\n if (s.endsWith(name)) {\n s = s.substring(0, s.length - name.length);\n base = unitsMap.get(name) || 1;\n break;\n }\n }\n return Number(s) * base;\n}\n__name(parseHumanDuration, \"parseHumanDuration\");\nfunction parseNonHyphenedUuid(uuid) {\n if (uuid == null || uuid.includes(\"-\")) {\n return uuid;\n }\n if (uuid.length != 32) {\n return null;\n }\n const uuid_parts = [];\n uuid_parts.push(uuid.slice(0, 8));\n uuid_parts.push(uuid.slice(8, 12));\n uuid_parts.push(uuid.slice(12, 16));\n uuid_parts.push(uuid.slice(16, 20));\n uuid_parts.push(uuid.slice(20));\n let hyphenated = \"\";\n uuid_parts.forEach((part) => hyphenated += part + \"-\");\n return hyphenated.slice(0, 36);\n}\n__name(parseNonHyphenedUuid, \"parseNonHyphenedUuid\");\nfunction parseByteSize(s, base = void 0) {\n const match = s.match(\n /^(\\d*\\.*\\d*)\\s*([kKmMgGtTpP]{0,1})([i]{0,1}[bB]{0,1})$/\n );\n if (!match) {\n return NaN;\n }\n const size = match[1];\n if (size.length === 0 || isNaN(Number(size))) {\n return NaN;\n }\n const unit = match[2].toLowerCase();\n const sizeUnits = {\n k: 1,\n m: 2,\n g: 3,\n t: 4,\n p: 5\n };\n if (unit.length !== 0 && !(unit in sizeUnits)) {\n return NaN;\n }\n const binary = match[3].toLowerCase() == \"ib\";\n if (binary && unit.length === 0) {\n return NaN;\n }\n const pow = sizeUnits[unit] || 0;\n return Math.floor(\n Number(size) * Math.pow(base ?? (binary ? 1024 : 1e3), pow)\n );\n}\n__name(parseByteSize, \"parseByteSize\");\nvar UNSUPPORTED_BOMS = [\n {\n buffer: Buffer.from([0, 0, 254, 255]),\n encoding: \"UTF-32 BE\"\n },\n {\n buffer: Buffer.from([255, 254, 0, 0]),\n encoding: \"UTF-32 LE\"\n },\n {\n buffer: Buffer.from([254, 255]),\n encoding: \"UTF-16 BE\"\n },\n {\n buffer: Buffer.from([255, 254]),\n encoding: \"UTF-16 LE\"\n }\n];\nfunction removeBOMAndValidate(buffer, file2) {\n for (const bom of UNSUPPORTED_BOMS) {\n if (buffer.length >= bom.buffer.length && buffer.subarray(0, bom.buffer.length).equals(bom.buffer)) {\n throw new ParseError({\n text: `Configuration file contains ${bom.encoding} byte order marker`,\n notes: [\n {\n text: `The file \"${file2}\" appears to be encoded as ${bom.encoding}. Please save the file as UTF-8 without BOM.`\n }\n ],\n location: { file: file2, line: 1, column: 0 },\n telemetryMessage: `${bom.encoding} BOM detected`\n });\n }\n }\n const content = buffer.toString(\"utf-8\");\n if (content.charCodeAt(0) === 65279) {\n return content.slice(1);\n }\n return content;\n}\n__name(removeBOMAndValidate, \"removeBOMAndValidate\");\nfunction absolute(input, root) {\n return isAbsolute(input) ? input : resolve(root || \".\", input);\n}\n__name(absolute, \"absolute\");\n\n// ../../node_modules/.pnpm/empathic@2.0.0/node_modules/empathic/walk.mjs\nfunction up(base, options) {\n let { last, cwd } = options || {};\n let tmp = absolute(base, cwd);\n let root = absolute(last || \"/\", cwd);\n let prev, arr = [];\n while (prev !== root) {\n arr.push(tmp);\n tmp = dirname(prev = tmp);\n if (tmp === prev) break;\n }\n return arr;\n}\n__name(up, \"up\");\n\n// ../../node_modules/.pnpm/empathic@2.0.0/node_modules/empathic/find.mjs\nfunction file(name, options) {\n let dir, tmp;\n let start = options && options.cwd || \"\";\n for (dir of up(start, options)) {\n try {\n tmp = join(dir, name);\n if (statSync(tmp).isFile()) return tmp;\n } catch {\n }\n }\n}\n__name(file, \"file\");\n\n// ../../node_modules/.pnpm/ts-dedent@2.2.0/node_modules/ts-dedent/esm/index.js\nfunction dedent(templ) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n var strings = Array.from(typeof templ === \"string\" ? [templ] : templ);\n strings[strings.length - 1] = strings[strings.length - 1].replace(/\\r?\\n([\\t ]*)$/, \"\");\n var indentLengths = strings.reduce(function(arr, str) {\n var matches = str.match(/\\n([\\t ]+|(?!\\s).)/g);\n if (matches) {\n return arr.concat(matches.map(function(match) {\n var _a, _b;\n return (_b = (_a = match.match(/[\\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;\n }));\n }\n return arr;\n }, []);\n if (indentLengths.length) {\n var pattern_1 = new RegExp(\"\\n[\t ]{\" + Math.min.apply(Math, indentLengths) + \"}\", \"g\");\n strings = strings.map(function(str) {\n return str.replace(pattern_1, \"\\n\");\n });\n }\n strings[0] = strings[0].replace(/^\\r?\\n/, \"\");\n var string = strings[0];\n values.forEach(function(value, i) {\n var endentations = string.match(/(?:^|\\n)( *)$/);\n var endentation = endentations ? endentations[1] : \"\";\n var indentedValue = value;\n if (typeof value === \"string\" && value.includes(\"\\n\")) {\n indentedValue = String(value).split(\"\\n\").map(function(str, i2) {\n return i2 === 0 ? str : \"\" + endentation + str;\n }).join(\"\\n\");\n }\n string += indentedValue + strings[i + 1];\n });\n return string;\n}\n__name(dedent, \"dedent\");\nvar esm_default = dedent;\n\n// src/config/config-helpers.ts\nfunction resolveWranglerConfigPath({\n config,\n script\n}, options) {\n if (config !== void 0) {\n return {\n userConfigPath: config,\n configPath: config,\n deployConfigPath: void 0,\n redirected: false\n };\n }\n const leafPath = script !== void 0 ? path.dirname(script) : process.cwd();\n return findWranglerConfig(leafPath, options);\n}\n__name(resolveWranglerConfigPath, \"resolveWranglerConfigPath\");\nfunction findWranglerConfig(referencePath = process.cwd(), { useRedirectIfAvailable = false } = {}) {\n const userConfigPath = file(`wrangler.json`, { cwd: referencePath }) ?? file(`wrangler.jsonc`, { cwd: referencePath }) ?? file(`wrangler.toml`, { cwd: referencePath });\n if (!useRedirectIfAvailable) {\n return {\n userConfigPath,\n configPath: userConfigPath,\n deployConfigPath: void 0,\n redirected: false\n };\n }\n const { configPath, deployConfigPath, redirected } = findRedirectedWranglerConfig(referencePath, userConfigPath);\n return {\n userConfigPath,\n configPath,\n deployConfigPath,\n redirected\n };\n}\n__name(findWranglerConfig, \"findWranglerConfig\");\nfunction findRedirectedWranglerConfig(cwd, userConfigPath) {\n const deployConfigPath = file(PATH_TO_DEPLOY_CONFIG, { cwd });\n if (deployConfigPath === void 0) {\n return { configPath: userConfigPath, deployConfigPath, redirected: false };\n }\n let redirectedConfigPath;\n const deployConfigFile = readFileSync(deployConfigPath);\n try {\n const deployConfig = parseJSONC(deployConfigFile, deployConfigPath);\n redirectedConfigPath = deployConfig.configPath && path.resolve(path.dirname(deployConfigPath), deployConfig.configPath);\n } catch (e) {\n throw new UserError(\n `Failed to parse the deploy configuration file at ${path.relative(\".\", deployConfigPath)}`,\n { cause: e }\n );\n }\n if (!redirectedConfigPath) {\n throw new UserError(esm_default`\n\t\t\tA deploy configuration file was found at \"${path.relative(\".\", deployConfigPath)}\".\n\t\t\tBut this is not valid - the required \"configPath\" property was not found.\n\t\t\tInstead this file contains:\n\t\t\t\\`\\`\\`\n\t\t\t${deployConfigFile}\n\t\t\t\\`\\`\\`\n\t\t`);\n }\n if (!existsSync(redirectedConfigPath)) {\n throw new UserError(esm_default`\n\t\t\t\tThere is a deploy configuration at \"${path.relative(\".\", deployConfigPath)}\".\n\t\t\t\tBut the redirected configuration path it points to, \"${path.relative(\".\", redirectedConfigPath)}\", does not exist.\n\t\t\t`);\n }\n if (userConfigPath) {\n if (path.join(path.dirname(userConfigPath), PATH_TO_DEPLOY_CONFIG) !== deployConfigPath) {\n throw new UserError(esm_default`\n\t\t\t\t\tFound both a user configuration file at \"${path.relative(\".\", userConfigPath)}\"\n\t\t\t\t\tand a deploy configuration file at \"${path.relative(\".\", deployConfigPath)}\".\n\t\t\t\t\tBut these do not share the same base path so it is not clear which should be used.\n\t\t\t\t`);\n }\n }\n return {\n configPath: redirectedConfigPath,\n deployConfigPath,\n redirected: true\n };\n}\n__name(findRedirectedWranglerConfig, \"findRedirectedWranglerConfig\");\nfunction isRedirectedRawConfig(rawConfig, configPath, userConfigPath) {\n return configPath !== void 0 && configPath !== userConfigPath;\n}\n__name(isRedirectedRawConfig, \"isRedirectedRawConfig\");\n\n// src/config/index.ts\nfunction configFormat(configPath) {\n if (configPath?.endsWith(\"toml\")) {\n return \"toml\";\n }\n if (configPath?.endsWith(\"jsonc\")) {\n return \"jsonc\";\n }\n if (configPath?.endsWith(\"json\")) {\n return \"json\";\n }\n return \"none\";\n}\n__name(configFormat, \"configFormat\");\nfunction configFileName(configPath) {\n const format3 = configFormat(configPath);\n switch (format3) {\n case \"toml\":\n return \"wrangler.toml\";\n case \"json\":\n return \"wrangler.json\";\n case \"jsonc\":\n return \"wrangler.jsonc\";\n default:\n return \"Wrangler configuration\";\n }\n}\n__name(configFileName, \"configFileName\");\nfunction formatConfigSnippet(snippet, configPath, formatted = true) {\n const format3 = configFormat(configPath);\n if (format3 === \"toml\") {\n return dist_default.stringify(snippet);\n } else {\n return formatted ? JSON.stringify(snippet, null, 2) : JSON.stringify(snippet);\n }\n}\n__name(formatConfigSnippet, \"formatConfigSnippet\");\nvar parseRawConfigFile = /* @__PURE__ */ __name((configPath) => {\n if (configPath.endsWith(\".toml\")) {\n return parseTOML(readFileSync(configPath), configPath);\n }\n if (configPath.endsWith(\".json\") || configPath.endsWith(\".jsonc\")) {\n return parseJSONC(readFileSync(configPath), configPath);\n }\n return {};\n}, \"parseRawConfigFile\");\nvar experimental_readRawConfig = /* @__PURE__ */ __name((args, options = {}) => {\n const { configPath, userConfigPath, deployConfigPath, redirected } = resolveWranglerConfigPath(args, options);\n const rawConfig = parseRawConfigFile(configPath ?? \"\");\n return {\n rawConfig,\n configPath,\n userConfigPath,\n deployConfigPath,\n redirected\n };\n}, \"experimental_readRawConfig\");\nfunction isDirectory(path2) {\n return fs.statSync(path2, { throwIfNoEntry: false })?.isDirectory() ?? false;\n}\n__name(isDirectory, \"isDirectory\");\nfunction removeDir(dirPath, { fireAndForget = false } = {}) {\n const result = fs.promises.rm(dirPath, {\n recursive: true,\n force: true,\n maxRetries: 5,\n retryDelay: 100\n });\n if (fireAndForget) {\n void result.catch(() => {\n });\n } else {\n return result;\n }\n}\n__name(removeDir, \"removeDir\");\nfunction removeDirSync(dirPath) {\n fs.rmSync(dirPath, {\n recursive: true,\n force: true,\n maxRetries: 5,\n retryDelay: 100\n });\n}\n__name(removeDirSync, \"removeDirSync\");\n/*! Bundled license information:\n\nsmol-toml/dist/error.js:\n (*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *)\n\nsmol-toml/dist/util.js:\n (*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *)\n\nsmol-toml/dist/date.js:\n (*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *)\n\nsmol-toml/dist/primitive.js:\n (*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *)\n\nsmol-toml/dist/extract.js:\n (*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *)\n\nsmol-toml/dist/struct.js:\n (*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *)\n\nsmol-toml/dist/parse.js:\n (*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *)\n\nsmol-toml/dist/stringify.js:\n (*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *)\n\nsmol-toml/dist/index.js:\n (*!\n * Copyright (c) Squirrel Chat et al., All rights reserved.\n * SPDX-License-Identifier: BSD-3-Clause\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this\n * list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the copyright holder nor the names of its contributors\n * may be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *)\n*/\n\nexport { APIError, CommandLineArgsError, DeprecationError, FatalError, JsonFriendlyFatalError, MissingConfigError, ParseError, UserError, applyEdits, configFileName, configFormat, createFatalError, dedent, dist_default, experimental_readRawConfig, findWranglerConfig, format2 as format, formatConfigSnippet, indexLocation, isDirectory, isRedirectedRawConfig, modify, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, readFileSync, readFileSyncToBuffer, removeDir, removeDirSync, resolveWranglerConfigPath, searchLocation };\n","export { assertNever, constructWranglerConfig, getTodaysCompatDate, isCompatDate, mapWorkerMetadataBindings } from './chunk-LX2YG63L.mjs';\nexport { MetricsRegistry } from './chunk-O4YGOZSW.mjs';\nimport { isDirectory, UserError, isRedirectedRawConfig, dedent, configFileName, formatConfigSnippet, FatalError, readFileSync, parseTOML, modify, applyEdits, format, dist_default, parseJSONC } from './chunk-A4F3D336.mjs';\nexport { APIError, CommandLineArgsError, DeprecationError, FatalError, JsonFriendlyFatalError, MissingConfigError, ParseError, UserError, configFileName, configFormat, createFatalError, experimental_readRawConfig, findWranglerConfig, formatConfigSnippet, indexLocation, isDirectory, parseByteSize, parseHumanDuration, parseJSON, parseJSONC, parseNonHyphenedUuid, parsePackageJSON, parseTOML, readFileSync, readFileSyncToBuffer, removeDir, removeDirSync, resolveWranglerConfigPath, searchLocation } from './chunk-A4F3D336.mjs';\nexport { ENVIRONMENT_TAG_PREFIX, INHERIT_SYMBOL, JSON_CONFIG_FORMATS, PATH_TO_DEPLOY_CONFIG, SERVICE_TAG_PREFIX } from './chunk-OZQVB3L3.mjs';\nimport { __commonJS, __name, __require, __export, __toESM, __reExport } from './chunk-DCOBXSFB.mjs';\nimport fs, { writeFileSync } from 'node:fs';\nimport assert from 'node:assert';\nimport path3 from 'node:path';\nimport os from 'node:os';\n\n// ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js\nvar require_XDGAppPaths = __commonJS({\n \"../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/lib/XDGAppPaths.js\"(exports) {\n exports.__esModule = true;\n exports.Adapt = void 0;\n function isBoolean2(t2) {\n return typeOf(t2) === \"boolean\";\n }\n __name(isBoolean2, \"isBoolean\");\n function isObject(t2) {\n return typeOf(t2) === \"object\";\n }\n __name(isObject, \"isObject\");\n function isString2(t2) {\n return typeOf(t2) === \"string\";\n }\n __name(isString2, \"isString\");\n function typeOf(t2) {\n return typeof t2;\n }\n __name(typeOf, \"typeOf\");\n function Adapt(adapter_) {\n var meta = adapter_.meta, path4 = adapter_.path, xdg = adapter_.xdg;\n var XDGAppPaths_ = /* @__PURE__ */ function() {\n function XDGAppPaths_2(options_) {\n if (options_ === void 0) {\n options_ = {};\n }\n var _a, _b, _c;\n function XDGAppPaths(options2) {\n if (options2 === void 0) {\n options2 = {};\n }\n return new XDGAppPaths_2(options2);\n }\n __name(XDGAppPaths, \"XDGAppPaths\");\n var options = isObject(options_) ? options_ : { name: options_ };\n var suffix = (_a = options.suffix) !== null && _a !== void 0 ? _a : \"\";\n var isolated_ = (_b = options.isolated) !== null && _b !== void 0 ? _b : true;\n var namePriorityList = [\n options.name,\n meta.pkgMainFilename(),\n meta.mainFilename()\n ];\n var nameFallback = \"$eval\";\n var name = path4.parse(((_c = namePriorityList.find(function(e2) {\n return isString2(e2);\n })) !== null && _c !== void 0 ? _c : nameFallback) + suffix).name;\n XDGAppPaths.$name = /* @__PURE__ */ __name(function $name() {\n return name;\n }, \"$name\");\n XDGAppPaths.$isolated = /* @__PURE__ */ __name(function $isolated() {\n return isolated_;\n }, \"$isolated\");\n function isIsolated(dirOptions) {\n var _a2;\n dirOptions = dirOptions !== null && dirOptions !== void 0 ? dirOptions : { isolated: isolated_ };\n var isolated = isBoolean2(dirOptions) ? dirOptions : (_a2 = dirOptions.isolated) !== null && _a2 !== void 0 ? _a2 : isolated_;\n return isolated;\n }\n __name(isIsolated, \"isIsolated\");\n function finalPathSegment(dirOptions) {\n return isIsolated(dirOptions) ? name : \"\";\n }\n __name(finalPathSegment, \"finalPathSegment\");\n XDGAppPaths.cache = /* @__PURE__ */ __name(function cache(dirOptions) {\n return path4.join(xdg.cache(), finalPathSegment(dirOptions));\n }, \"cache\");\n XDGAppPaths.config = /* @__PURE__ */ __name(function config(dirOptions) {\n return path4.join(xdg.config(), finalPathSegment(dirOptions));\n }, \"config\");\n XDGAppPaths.data = /* @__PURE__ */ __name(function data(dirOptions) {\n return path4.join(xdg.data(), finalPathSegment(dirOptions));\n }, \"data\");\n XDGAppPaths.runtime = /* @__PURE__ */ __name(function runtime(dirOptions) {\n return xdg.runtime() ? path4.join(xdg.runtime(), finalPathSegment(dirOptions)) : void 0;\n }, \"runtime\");\n XDGAppPaths.state = /* @__PURE__ */ __name(function state(dirOptions) {\n return path4.join(xdg.state(), finalPathSegment(dirOptions));\n }, \"state\");\n XDGAppPaths.configDirs = /* @__PURE__ */ __name(function configDirs(dirOptions) {\n return xdg.configDirs().map(function(s) {\n return path4.join(s, finalPathSegment(dirOptions));\n });\n }, \"configDirs\");\n XDGAppPaths.dataDirs = /* @__PURE__ */ __name(function dataDirs(dirOptions) {\n return xdg.dataDirs().map(function(s) {\n return path4.join(s, finalPathSegment(dirOptions));\n });\n }, \"dataDirs\");\n return XDGAppPaths;\n }\n __name(XDGAppPaths_2, \"XDGAppPaths_\");\n return XDGAppPaths_2;\n }();\n return { XDGAppPaths: new XDGAppPaths_() };\n }\n __name(Adapt, \"Adapt\");\n exports.Adapt = Adapt;\n }\n});\n\n// ../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/lib/XDG.js\nvar require_XDG = __commonJS({\n \"../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/lib/XDG.js\"(exports) {\n var __spreadArray = exports && exports.__spreadArray || function(to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n };\n exports.__esModule = true;\n exports.Adapt = void 0;\n function Adapt(adapter_) {\n var env = adapter_.env, osPaths = adapter_.osPaths, path4 = adapter_.path;\n var isMacOS = /^darwin$/i.test(adapter_.process.platform);\n var isWinOS = /^win/i.test(adapter_.process.platform);\n function baseDir() {\n return osPaths.home() || osPaths.temp();\n }\n __name(baseDir, \"baseDir\");\n function valOrPath(val, pathSegments) {\n return val || path4.join.apply(path4, pathSegments);\n }\n __name(valOrPath, \"valOrPath\");\n var linux = /* @__PURE__ */ __name(function() {\n var cache = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_CACHE_HOME\"), [baseDir(), \".cache\"]);\n }, \"cache\");\n var config = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_CONFIG_HOME\"), [baseDir(), \".config\"]);\n }, \"config\");\n var data = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_DATA_HOME\"), [baseDir(), \".local\", \"share\"]);\n }, \"data\");\n var runtime = /* @__PURE__ */ __name(function() {\n return env.get(\"XDG_RUNTIME_DIR\") || void 0;\n }, \"runtime\");\n var state = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_STATE_HOME\"), [baseDir(), \".local\", \"state\"]);\n }, \"state\");\n return { cache, config, data, runtime, state };\n }, \"linux\");\n var macos = /* @__PURE__ */ __name(function() {\n var cache = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_CACHE_HOME\"), [baseDir(), \"Library\", \"Caches\"]);\n }, \"cache\");\n var config = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_CONFIG_HOME\"), [baseDir(), \"Library\", \"Preferences\"]);\n }, \"config\");\n var data = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_DATA_HOME\"), [baseDir(), \"Library\", \"Application Support\"]);\n }, \"data\");\n var runtime = /* @__PURE__ */ __name(function() {\n return env.get(\"XDG_RUNTIME_DIR\") || void 0;\n }, \"runtime\");\n var state = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_STATE_HOME\"), [baseDir(), \"Library\", \"State\"]);\n }, \"state\");\n return { cache, config, data, runtime, state };\n }, \"macos\");\n var windows = /* @__PURE__ */ __name(function() {\n function appData() {\n return valOrPath(env.get(\"APPDATA\"), [baseDir(), \"AppData\", \"Roaming\"]);\n }\n __name(appData, \"appData\");\n function localAppData() {\n return valOrPath(env.get(\"LOCALAPPDATA\"), [baseDir(), \"AppData\", \"Local\"]);\n }\n __name(localAppData, \"localAppData\");\n var cache = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_CACHE_HOME\"), [localAppData(), \"xdg.cache\"]);\n }, \"cache\");\n var config = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_CONFIG_HOME\"), [appData(), \"xdg.config\"]);\n }, \"config\");\n var data = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_DATA_HOME\"), [appData(), \"xdg.data\"]);\n }, \"data\");\n var runtime = /* @__PURE__ */ __name(function() {\n return env.get(\"XDG_RUNTIME_DIR\") || void 0;\n }, \"runtime\");\n var state = /* @__PURE__ */ __name(function() {\n return valOrPath(env.get(\"XDG_STATE_HOME\"), [localAppData(), \"xdg.state\"]);\n }, \"state\");\n return { cache, config, data, runtime, state };\n }, \"windows\");\n var XDG_ = /* @__PURE__ */ function() {\n function XDG_2() {\n function XDG() {\n return new XDG_2();\n }\n __name(XDG, \"XDG\");\n var extension = isMacOS ? macos() : isWinOS ? windows() : linux();\n XDG.cache = extension.cache;\n XDG.config = extension.config;\n XDG.data = extension.data;\n XDG.runtime = extension.runtime;\n XDG.state = extension.state;\n XDG.configDirs = /* @__PURE__ */ __name(function configDirs() {\n var pathList = env.get(\"XDG_CONFIG_DIRS\");\n return __spreadArray([extension.config()], pathList ? pathList.split(path4.delimiter) : []);\n }, \"configDirs\");\n XDG.dataDirs = /* @__PURE__ */ __name(function dataDirs() {\n var pathList = env.get(\"XDG_DATA_DIRS\");\n return __spreadArray([extension.data()], pathList ? pathList.split(path4.delimiter) : []);\n }, \"dataDirs\");\n return XDG;\n }\n __name(XDG_2, \"XDG_\");\n return XDG_2;\n }();\n return { XDG: new XDG_() };\n }\n __name(Adapt, \"Adapt\");\n exports.Adapt = Adapt;\n }\n});\n\n// ../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/lib/OSPaths.js\nvar require_OSPaths = __commonJS({\n \"../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/lib/OSPaths.js\"(exports) {\n var __spreadArray = exports && exports.__spreadArray || function(to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n };\n exports.__esModule = true;\n exports.Adapt = void 0;\n function isEmpty(s) {\n return !s;\n }\n __name(isEmpty, \"isEmpty\");\n function Adapt(adapter_) {\n var env = adapter_.env, os2 = adapter_.os, path4 = adapter_.path;\n var isWinOS = /^win/i.test(adapter_.process.platform);\n function normalizePath(path_) {\n return path_ ? adapter_.path.normalize(adapter_.path.join(path_, \".\")) : void 0;\n }\n __name(normalizePath, \"normalizePath\");\n function home() {\n var posix = /* @__PURE__ */ __name(function() {\n return normalizePath((typeof os2.homedir === \"function\" ? os2.homedir() : void 0) || env.get(\"HOME\"));\n }, \"posix\");\n var windows = /* @__PURE__ */ __name(function() {\n var priorityList = [\n typeof os2.homedir === \"function\" ? os2.homedir() : void 0,\n env.get(\"USERPROFILE\"),\n env.get(\"HOME\"),\n env.get(\"HOMEDRIVE\") || env.get(\"HOMEPATH\") ? path4.join(env.get(\"HOMEDRIVE\") || \"\", env.get(\"HOMEPATH\") || \"\") : void 0\n ];\n return normalizePath(priorityList.find(function(v) {\n return !isEmpty(v);\n }));\n }, \"windows\");\n return isWinOS ? windows() : posix();\n }\n __name(home, \"home\");\n function temp() {\n function joinPathToBase(base, segments) {\n return base ? path4.join.apply(path4, __spreadArray([base], segments)) : void 0;\n }\n __name(joinPathToBase, \"joinPathToBase\");\n function posix() {\n var fallback = \"/tmp\";\n var priorityList = [\n typeof os2.tmpdir === \"function\" ? os2.tmpdir() : void 0,\n env.get(\"TMPDIR\"),\n env.get(\"TEMP\"),\n env.get(\"TMP\")\n ];\n return normalizePath(priorityList.find(function(v) {\n return !isEmpty(v);\n })) || fallback;\n }\n __name(posix, \"posix\");\n function windows() {\n var fallback = \"C:\\\\Temp\";\n var priorityListLazy = [\n typeof os2.tmpdir === \"function\" ? os2.tmpdir : function() {\n return void 0;\n },\n function() {\n return env.get(\"TEMP\");\n },\n function() {\n return env.get(\"TMP\");\n },\n function() {\n return joinPathToBase(env.get(\"LOCALAPPDATA\"), [\"Temp\"]);\n },\n function() {\n return joinPathToBase(home(), [\"AppData\", \"Local\", \"Temp\"]);\n },\n function() {\n return joinPathToBase(env.get(\"ALLUSERSPROFILE\"), [\"Temp\"]);\n },\n function() {\n return joinPathToBase(env.get(\"SystemRoot\"), [\"Temp\"]);\n },\n function() {\n return joinPathToBase(env.get(\"windir\"), [\"Temp\"]);\n },\n function() {\n return joinPathToBase(env.get(\"SystemDrive\"), [\"\\\\\", \"Temp\"]);\n }\n ];\n var v = priorityListLazy.find(function(v2) {\n return v2 && !isEmpty(v2());\n });\n return v && normalizePath(v()) || fallback;\n }\n __name(windows, \"windows\");\n return isWinOS ? windows() : posix();\n }\n __name(temp, \"temp\");\n var OSPaths_ = /* @__PURE__ */ function() {\n function OSPaths_2() {\n function OSPaths() {\n return new OSPaths_2();\n }\n __name(OSPaths, \"OSPaths\");\n OSPaths.home = home;\n OSPaths.temp = temp;\n return OSPaths;\n }\n __name(OSPaths_2, \"OSPaths_\");\n return OSPaths_2;\n }();\n return { OSPaths: new OSPaths_() };\n }\n __name(Adapt, \"Adapt\");\n exports.Adapt = Adapt;\n }\n});\n\n// ../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/platform-adapters/node.js\nvar require_node = __commonJS({\n \"../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/platform-adapters/node.js\"(exports) {\n var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {\n if (k2 === void 0) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: /* @__PURE__ */ __name(function() {\n return m[k];\n }, \"get\") });\n } : function(o, m, k, k2) {\n if (k2 === void 0) k2 = k;\n o[k2] = m[k];\n });\n var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n } : function(o, v) {\n o[\"default\"] = v;\n });\n var __importStar = exports && exports.__importStar || function(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) {\n for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n }\n __setModuleDefault(result, mod);\n return result;\n };\n exports.__esModule = true;\n exports.adapter = void 0;\n var os2 = __importStar(__require(\"os\"));\n var path4 = __importStar(__require(\"path\"));\n exports.adapter = {\n atImportPermissions: { env: true },\n env: {\n get: /* @__PURE__ */ __name(function(s) {\n return process.env[s];\n }, \"get\")\n },\n os: os2,\n path: path4,\n process\n };\n }\n});\n\n// ../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/mod.cjs.js\nvar require_mod_cjs = __commonJS({\n \"../../node_modules/.pnpm/os-paths@7.4.0/node_modules/os-paths/dist/cjs/mod.cjs.js\"(exports, module) {\n var OSPaths_js_1 = require_OSPaths();\n var node_js_1 = require_node();\n module.exports = OSPaths_js_1.Adapt(node_js_1.adapter).OSPaths;\n }\n});\n\n// ../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/platform-adapters/node.js\nvar require_node2 = __commonJS({\n \"../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/platform-adapters/node.js\"(exports) {\n var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {\n if (k2 === void 0) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: /* @__PURE__ */ __name(function() {\n return m[k];\n }, \"get\") });\n } : function(o, m, k, k2) {\n if (k2 === void 0) k2 = k;\n o[k2] = m[k];\n });\n var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n } : function(o, v) {\n o[\"default\"] = v;\n });\n var __importStar = exports && exports.__importStar || function(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) {\n for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n }\n __setModuleDefault(result, mod);\n return result;\n };\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule ? mod : { \"default\": mod };\n };\n exports.__esModule = true;\n exports.adapter = void 0;\n var path4 = __importStar(__require(\"path\"));\n var os_paths_1 = __importDefault(require_mod_cjs());\n exports.adapter = {\n atImportPermissions: { env: true },\n env: {\n get: /* @__PURE__ */ __name(function(s) {\n return process.env[s];\n }, \"get\")\n },\n osPaths: os_paths_1[\"default\"],\n path: path4,\n process\n };\n }\n});\n\n// ../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/mod.cjs.js\nvar require_mod_cjs2 = __commonJS({\n \"../../node_modules/.pnpm/xdg-portable@10.6.0/node_modules/xdg-portable/dist/cjs/mod.cjs.js\"(exports, module) {\n var XDG_js_1 = require_XDG();\n var node_js_1 = require_node2();\n module.exports = XDG_js_1.Adapt(node_js_1.adapter).XDG;\n }\n});\n\n// ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/platform-adapters/node.js\nvar require_node3 = __commonJS({\n \"../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/platform-adapters/node.js\"(exports) {\n var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {\n if (k2 === void 0) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: /* @__PURE__ */ __name(function() {\n return m[k];\n }, \"get\") });\n } : function(o, m, k, k2) {\n if (k2 === void 0) k2 = k;\n o[k2] = m[k];\n });\n var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n } : function(o, v) {\n o[\"default\"] = v;\n });\n var __importStar = exports && exports.__importStar || function(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) {\n for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n }\n __setModuleDefault(result, mod);\n return result;\n };\n var __importDefault = exports && exports.__importDefault || function(mod) {\n return mod && mod.__esModule ? mod : { \"default\": mod };\n };\n exports.__esModule = true;\n exports.adapter = void 0;\n var path4 = __importStar(__require(\"path\"));\n var xdg_portable_1 = __importDefault(require_mod_cjs2());\n exports.adapter = {\n atImportPermissions: { env: true, read: true },\n meta: {\n mainFilename: /* @__PURE__ */ __name(function() {\n var requireMain = typeof __require !== \"undefined\" && __require !== null && __require.main ? __require.main : { filename: void 0 };\n var requireMainFilename = requireMain.filename;\n var filename = (requireMainFilename !== process.execArgv[0] ? requireMainFilename : void 0) || (typeof process._eval === \"undefined\" ? process.argv[1] : void 0);\n return filename;\n }, \"mainFilename\"),\n pkgMainFilename: /* @__PURE__ */ __name(function() {\n return process.pkg ? process.execPath : void 0;\n }, \"pkgMainFilename\")\n },\n path: path4,\n process,\n xdg: xdg_portable_1[\"default\"]\n };\n }\n});\n\n// ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/mod.cjs.js\nvar require_mod_cjs3 = __commonJS({\n \"../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/mod.cjs.js\"(exports, module) {\n var XDGAppPaths_js_1 = require_XDGAppPaths();\n var node_js_1 = require_node3();\n module.exports = XDGAppPaths_js_1.Adapt(node_js_1.adapter).XDGAppPaths;\n }\n});\n\n// src/config/config.ts\nvar defaultWranglerConfig = {\n /* COMPUTED_FIELDS */\n configPath: void 0,\n userConfigPath: void 0,\n topLevelName: void 0,\n definedEnvironments: void 0,\n targetEnvironment: void 0,\n /*====================================================*/\n /* Fields supported by both Workers & Pages */\n /*====================================================*/\n /* TOP-LEVEL ONLY FIELDS */\n pages_build_output_dir: void 0,\n send_metrics: void 0,\n dev: {\n ip: process.platform === \"win32\" ? \"127.0.0.1\" : \"localhost\",\n port: void 0,\n // the default of 8787 is set at runtime\n inspector_port: void 0,\n // the default of 9229 is set at runtime\n inspector_ip: void 0,\n // the default of 127.0.0.1 is set at runtime\n local_protocol: \"http\",\n upstream_protocol: \"http\",\n host: void 0,\n // Note this one is also workers only\n enable_containers: true,\n container_engine: void 0,\n generate_types: false\n },\n /** INHERITABLE ENVIRONMENT FIELDS **/\n name: void 0,\n compatibility_date: void 0,\n compatibility_flags: [],\n limits: void 0,\n placement: void 0,\n /** NON-INHERITABLE ENVIRONMENT FIELDS **/\n vars: {},\n durable_objects: { bindings: [] },\n kv_namespaces: [],\n queues: {\n producers: [],\n consumers: []\n // WORKERS SUPPORT ONLY!!\n },\n r2_buckets: [],\n d1_databases: [],\n vectorize: [],\n ai_search_namespaces: [],\n ai_search: [],\n hyperdrive: [],\n workflows: [],\n secrets_store_secrets: [],\n services: [],\n analytics_engine_datasets: [],\n ai: void 0,\n images: void 0,\n stream: void 0,\n media: void 0,\n version_metadata: void 0,\n unsafe_hello_world: [],\n ratelimits: [],\n worker_loaders: [],\n /*====================================================*/\n /* Fields supported by Workers only */\n /*====================================================*/\n /* TOP-LEVEL ONLY FIELDS */\n legacy_env: true,\n site: void 0,\n wasm_modules: void 0,\n text_blobs: void 0,\n data_blobs: void 0,\n keep_vars: void 0,\n alias: void 0,\n /** INHERITABLE ENVIRONMENT FIELDS **/\n account_id: void 0,\n main: void 0,\n find_additional_modules: void 0,\n preserve_file_names: void 0,\n base_dir: void 0,\n workers_dev: void 0,\n preview_urls: void 0,\n route: void 0,\n routes: void 0,\n tsconfig: void 0,\n jsx_factory: \"React.createElement\",\n jsx_fragment: \"React.Fragment\",\n migrations: [],\n triggers: {\n crons: void 0\n },\n rules: [],\n build: { command: void 0, watch_dir: \"./src\", cwd: void 0 },\n no_bundle: void 0,\n minify: void 0,\n keep_names: void 0,\n dispatch_namespaces: [],\n first_party_worker: void 0,\n logfwdr: { bindings: [] },\n logpush: void 0,\n upload_source_maps: void 0,\n assets: void 0,\n observability: { enabled: true },\n cache: void 0,\n /** The default here is undefined so that we can delegate to the CLOUDFLARE_COMPLIANCE_REGION environment variable. */\n compliance_region: void 0,\n python_modules: { exclude: [\"**/*.pyc\"] },\n /** NON-INHERITABLE ENVIRONMENT FIELDS **/\n define: {},\n cloudchamber: {},\n containers: void 0,\n send_email: [],\n browser: void 0,\n unsafe: {},\n mtls_certificates: [],\n tail_consumers: void 0,\n streaming_tail_consumers: void 0,\n pipelines: [],\n vpc_services: [],\n vpc_networks: []\n};\nvar experimental_patchConfig = /* @__PURE__ */ __name((configPath, patch, isArrayInsertion = true) => {\n let configString = readFileSync(configPath);\n if (configPath.endsWith(\"toml\")) {\n if (configString.includes(\"#\")) {\n throw new PatchConfigError(\n \"cannot patch .toml config if comments are present\"\n );\n } else {\n configString = JSON.stringify(parseTOML(configString));\n }\n }\n const patchPaths = [];\n getJSONPath(patch, patchPaths, isArrayInsertion);\n for (const patchPath of patchPaths) {\n const value = patchPath.pop();\n const edit = modify(configString, patchPath, value, {\n isArrayInsertion\n });\n configString = applyEdits(configString, edit);\n }\n const formatEdit = format(configString, void 0, {});\n configString = applyEdits(configString, formatEdit);\n if (configPath.endsWith(\".toml\")) {\n configString = dist_default.stringify(parseJSONC(configString));\n }\n writeFileSync(configPath, configString);\n return configString;\n}, \"experimental_patchConfig\");\nvar getJSONPath = /* @__PURE__ */ __name((obj, allPaths, isArrayInsertion, prevPath = []) => {\n for (const [k, v] of Object.entries(obj)) {\n const currentPath = [...prevPath, k];\n if (Array.isArray(v)) {\n v.forEach((x, i) => {\n if (isArrayInsertion) {\n allPaths.push([...currentPath, -1, x]);\n } else if (typeof x === \"object\" && x !== null) {\n getJSONPath(x, allPaths, isArrayInsertion, [...currentPath, i]);\n } else {\n allPaths.push([...currentPath, i, x]);\n }\n });\n } else if (typeof v === \"object\" && v !== null) {\n getJSONPath(v, allPaths, isArrayInsertion, currentPath);\n } else {\n allPaths.push([...currentPath, v]);\n }\n }\n}, \"getJSONPath\");\nvar PatchConfigError = class extends Error {\n static {\n __name(this, \"PatchConfigError\");\n }\n};\n\n// ../../node_modules/.pnpm/zod@3.22.3/node_modules/zod/lib/index.mjs\nvar util;\n(function(util2) {\n util2.assertEqual = (val) => val;\n function assertIs(_arg) {\n }\n __name(assertIs, \"assertIs\");\n util2.assertIs = assertIs;\n function assertNever2(_x) {\n throw new Error();\n }\n __name(assertNever2, \"assertNever\");\n util2.assertNever = assertNever2;\n util2.arrayToEnum = (items) => {\n const obj = {};\n for (const item of items) {\n obj[item] = item;\n }\n return obj;\n };\n util2.getValidEnumValues = (obj) => {\n const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== \"number\");\n const filtered = {};\n for (const k of validKeys) {\n filtered[k] = obj[k];\n }\n return util2.objectValues(filtered);\n };\n util2.objectValues = (obj) => {\n return util2.objectKeys(obj).map(function(e2) {\n return obj[e2];\n });\n };\n util2.objectKeys = typeof Object.keys === \"function\" ? (obj) => Object.keys(obj) : (object) => {\n const keys = [];\n for (const key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n keys.push(key);\n }\n }\n return keys;\n };\n util2.find = (arr, checker) => {\n for (const item of arr) {\n if (checker(item))\n return item;\n }\n return void 0;\n };\n util2.isInteger = typeof Number.isInteger === \"function\" ? (val) => Number.isInteger(val) : (val) => typeof val === \"number\" && isFinite(val) && Math.floor(val) === val;\n function joinValues(array, separator = \" | \") {\n return array.map((val) => typeof val === \"string\" ? `'${val}'` : val).join(separator);\n }\n __name(joinValues, \"joinValues\");\n util2.joinValues = joinValues;\n util2.jsonStringifyReplacer = (_2, value) => {\n if (typeof value === \"bigint\") {\n return value.toString();\n }\n return value;\n };\n})(util || (util = {}));\nvar objectUtil;\n(function(objectUtil2) {\n objectUtil2.mergeShapes = (first, second) => {\n return {\n ...first,\n ...second\n // second overwrites first\n };\n };\n})(objectUtil || (objectUtil = {}));\nvar ZodParsedType = util.arrayToEnum([\n \"string\",\n \"nan\",\n \"number\",\n \"integer\",\n \"float\",\n \"boolean\",\n \"date\",\n \"bigint\",\n \"symbol\",\n \"function\",\n \"undefined\",\n \"null\",\n \"array\",\n \"object\",\n \"unknown\",\n \"promise\",\n \"void\",\n \"never\",\n \"map\",\n \"set\"\n]);\nvar getParsedType = /* @__PURE__ */ __name((data) => {\n const t2 = typeof data;\n switch (t2) {\n case \"undefined\":\n return ZodParsedType.undefined;\n case \"string\":\n return ZodParsedType.string;\n case \"number\":\n return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number;\n case \"boolean\":\n return ZodParsedType.boolean;\n case \"function\":\n return ZodParsedType.function;\n case \"bigint\":\n return ZodParsedType.bigint;\n case \"symbol\":\n return ZodParsedType.symbol;\n case \"object\":\n if (Array.isArray(data)) {\n return ZodParsedType.array;\n }\n if (data === null) {\n return ZodParsedType.null;\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return ZodParsedType.promise;\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return ZodParsedType.map;\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return ZodParsedType.set;\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return ZodParsedType.date;\n }\n return ZodParsedType.object;\n default:\n return ZodParsedType.unknown;\n }\n}, \"getParsedType\");\nvar ZodIssueCode = util.arrayToEnum([\n \"invalid_type\",\n \"invalid_literal\",\n \"custom\",\n \"invalid_union\",\n \"invalid_union_discriminator\",\n \"invalid_enum_value\",\n \"unrecognized_keys\",\n \"invalid_arguments\",\n \"invalid_return_type\",\n \"invalid_date\",\n \"invalid_string\",\n \"too_small\",\n \"too_big\",\n \"invalid_intersection_types\",\n \"not_multiple_of\",\n \"not_finite\"\n]);\nvar quotelessJson = /* @__PURE__ */ __name((obj) => {\n const json = JSON.stringify(obj, null, 2);\n return json.replace(/\"([^\"]+)\":/g, \"$1:\");\n}, \"quotelessJson\");\nvar ZodError = class extends Error {\n static {\n __name(this, \"ZodError\");\n }\n constructor(issues) {\n super();\n this.issues = [];\n this.addIssue = (sub) => {\n this.issues = [...this.issues, sub];\n };\n this.addIssues = (subs = []) => {\n this.issues = [...this.issues, ...subs];\n };\n const actualProto = new.target.prototype;\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(this, actualProto);\n } else {\n this.__proto__ = actualProto;\n }\n this.name = \"ZodError\";\n this.issues = issues;\n }\n get errors() {\n return this.issues;\n }\n format(_mapper) {\n const mapper = _mapper || function(issue) {\n return issue.message;\n };\n const fieldErrors = { _errors: [] };\n const processError = /* @__PURE__ */ __name((error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\") {\n issue.unionErrors.map(processError);\n } else if (issue.code === \"invalid_return_type\") {\n processError(issue.returnTypeError);\n } else if (issue.code === \"invalid_arguments\") {\n processError(issue.argumentsError);\n } else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n } else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n } else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n }, \"processError\");\n processError(this);\n return fieldErrors;\n }\n toString() {\n return this.message;\n }\n get message() {\n return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2);\n }\n get isEmpty() {\n return this.issues.length === 0;\n }\n flatten(mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of this.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n } else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n }\n get formErrors() {\n return this.flatten();\n }\n};\nZodError.create = (issues) => {\n const error = new ZodError(issues);\n return error;\n};\nvar errorMap = /* @__PURE__ */ __name((issue, _ctx) => {\n let message;\n switch (issue.code) {\n case ZodIssueCode.invalid_type:\n if (issue.received === ZodParsedType.undefined) {\n message = \"Required\";\n } else {\n message = `Expected ${issue.expected}, received ${issue.received}`;\n }\n break;\n case ZodIssueCode.invalid_literal:\n message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`;\n break;\n case ZodIssueCode.unrecognized_keys:\n message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, \", \")}`;\n break;\n case ZodIssueCode.invalid_union:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_union_discriminator:\n message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`;\n break;\n case ZodIssueCode.invalid_enum_value:\n message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`;\n break;\n case ZodIssueCode.invalid_arguments:\n message = `Invalid function arguments`;\n break;\n case ZodIssueCode.invalid_return_type:\n message = `Invalid function return type`;\n break;\n case ZodIssueCode.invalid_date:\n message = `Invalid date`;\n break;\n case ZodIssueCode.invalid_string:\n if (typeof issue.validation === \"object\") {\n if (\"includes\" in issue.validation) {\n message = `Invalid input: must include \"${issue.validation.includes}\"`;\n if (typeof issue.validation.position === \"number\") {\n message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`;\n }\n } else if (\"startsWith\" in issue.validation) {\n message = `Invalid input: must start with \"${issue.validation.startsWith}\"`;\n } else if (\"endsWith\" in issue.validation) {\n message = `Invalid input: must end with \"${issue.validation.endsWith}\"`;\n } else {\n util.assertNever(issue.validation);\n }\n } else if (issue.validation !== \"regex\") {\n message = `Invalid ${issue.validation}`;\n } else {\n message = \"Invalid\";\n }\n break;\n case ZodIssueCode.too_small:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? \"exactly\" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.too_big:\n if (issue.type === \"array\")\n message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`;\n else if (issue.type === \"string\")\n message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`;\n else if (issue.type === \"number\")\n message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"bigint\")\n message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`;\n else if (issue.type === \"date\")\n message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`;\n else\n message = \"Invalid input\";\n break;\n case ZodIssueCode.custom:\n message = `Invalid input`;\n break;\n case ZodIssueCode.invalid_intersection_types:\n message = `Intersection results could not be merged`;\n break;\n case ZodIssueCode.not_multiple_of:\n message = `Number must be a multiple of ${issue.multipleOf}`;\n break;\n case ZodIssueCode.not_finite:\n message = \"Number must be finite\";\n break;\n default:\n message = _ctx.defaultError;\n util.assertNever(issue);\n }\n return { message };\n}, \"errorMap\");\nvar overrideErrorMap = errorMap;\nfunction setErrorMap(map) {\n overrideErrorMap = map;\n}\n__name(setErrorMap, \"setErrorMap\");\nfunction getErrorMap() {\n return overrideErrorMap;\n}\n__name(getErrorMap, \"getErrorMap\");\nvar makeIssue = /* @__PURE__ */ __name((params) => {\n const { data, path: path4, errorMaps, issueData } = params;\n const fullPath = [...path4, ...issueData.path || []];\n const fullIssue = {\n ...issueData,\n path: fullPath\n };\n let errorMessage = \"\";\n const maps = errorMaps.filter((m) => !!m).slice().reverse();\n for (const map of maps) {\n errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message;\n }\n return {\n ...issueData,\n path: fullPath,\n message: issueData.message || errorMessage\n };\n}, \"makeIssue\");\nvar EMPTY_PATH = [];\nfunction addIssueToContext(ctx, issueData) {\n const issue = makeIssue({\n issueData,\n data: ctx.data,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap\n // then global default map\n ].filter((x) => !!x)\n });\n ctx.common.issues.push(issue);\n}\n__name(addIssueToContext, \"addIssueToContext\");\nvar ParseStatus = class _ParseStatus {\n static {\n __name(this, \"ParseStatus\");\n }\n constructor() {\n this.value = \"valid\";\n }\n dirty() {\n if (this.value === \"valid\")\n this.value = \"dirty\";\n }\n abort() {\n if (this.value !== \"aborted\")\n this.value = \"aborted\";\n }\n static mergeArray(status, results) {\n const arrayValue = [];\n for (const s of results) {\n if (s.status === \"aborted\")\n return INVALID;\n if (s.status === \"dirty\")\n status.dirty();\n arrayValue.push(s.value);\n }\n return { status: status.value, value: arrayValue };\n }\n static async mergeObjectAsync(status, pairs) {\n const syncPairs = [];\n for (const pair of pairs) {\n syncPairs.push({\n key: await pair.key,\n value: await pair.value\n });\n }\n return _ParseStatus.mergeObjectSync(status, syncPairs);\n }\n static mergeObjectSync(status, pairs) {\n const finalObject = {};\n for (const pair of pairs) {\n const { key, value } = pair;\n if (key.status === \"aborted\")\n return INVALID;\n if (value.status === \"aborted\")\n return INVALID;\n if (key.status === \"dirty\")\n status.dirty();\n if (value.status === \"dirty\")\n status.dirty();\n if (key.value !== \"__proto__\" && (typeof value.value !== \"undefined\" || pair.alwaysSet)) {\n finalObject[key.value] = value.value;\n }\n }\n return { status: status.value, value: finalObject };\n }\n};\nvar INVALID = Object.freeze({\n status: \"aborted\"\n});\nvar DIRTY = /* @__PURE__ */ __name((value) => ({ status: \"dirty\", value }), \"DIRTY\");\nvar OK = /* @__PURE__ */ __name((value) => ({ status: \"valid\", value }), \"OK\");\nvar isAborted = /* @__PURE__ */ __name((x) => x.status === \"aborted\", \"isAborted\");\nvar isDirty = /* @__PURE__ */ __name((x) => x.status === \"dirty\", \"isDirty\");\nvar isValid = /* @__PURE__ */ __name((x) => x.status === \"valid\", \"isValid\");\nvar isAsync = /* @__PURE__ */ __name((x) => typeof Promise !== \"undefined\" && x instanceof Promise, \"isAsync\");\nvar errorUtil;\n(function(errorUtil2) {\n errorUtil2.errToObj = (message) => typeof message === \"string\" ? { message } : message || {};\n errorUtil2.toString = (message) => typeof message === \"string\" ? message : message === null || message === void 0 ? void 0 : message.message;\n})(errorUtil || (errorUtil = {}));\nvar ParseInputLazyPath = class {\n static {\n __name(this, \"ParseInputLazyPath\");\n }\n constructor(parent, value, path4, key) {\n this._cachedPath = [];\n this.parent = parent;\n this.data = value;\n this._path = path4;\n this._key = key;\n }\n get path() {\n if (!this._cachedPath.length) {\n if (this._key instanceof Array) {\n this._cachedPath.push(...this._path, ...this._key);\n } else {\n this._cachedPath.push(...this._path, this._key);\n }\n }\n return this._cachedPath;\n }\n};\nvar handleResult = /* @__PURE__ */ __name((ctx, result) => {\n if (isValid(result)) {\n return { success: true, data: result.value };\n } else {\n if (!ctx.common.issues.length) {\n throw new Error(\"Validation failed but no issues detected.\");\n }\n return {\n success: false,\n get error() {\n if (this._error)\n return this._error;\n const error = new ZodError(ctx.common.issues);\n this._error = error;\n return this._error;\n }\n };\n }\n}, \"handleResult\");\nfunction processCreateParams(params) {\n if (!params)\n return {};\n const { errorMap: errorMap2, invalid_type_error, required_error, description } = params;\n if (errorMap2 && (invalid_type_error || required_error)) {\n throw new Error(`Can't use \"invalid_type_error\" or \"required_error\" in conjunction with custom error map.`);\n }\n if (errorMap2)\n return { errorMap: errorMap2, description };\n const customMap = /* @__PURE__ */ __name((iss, ctx) => {\n if (iss.code !== \"invalid_type\")\n return { message: ctx.defaultError };\n if (typeof ctx.data === \"undefined\") {\n return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError };\n }\n return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError };\n }, \"customMap\");\n return { errorMap: customMap, description };\n}\n__name(processCreateParams, \"processCreateParams\");\nvar ZodType = class {\n static {\n __name(this, \"ZodType\");\n }\n constructor(def) {\n this.spa = this.safeParseAsync;\n this._def = def;\n this.parse = this.parse.bind(this);\n this.safeParse = this.safeParse.bind(this);\n this.parseAsync = this.parseAsync.bind(this);\n this.safeParseAsync = this.safeParseAsync.bind(this);\n this.spa = this.spa.bind(this);\n this.refine = this.refine.bind(this);\n this.refinement = this.refinement.bind(this);\n this.superRefine = this.superRefine.bind(this);\n this.optional = this.optional.bind(this);\n this.nullable = this.nullable.bind(this);\n this.nullish = this.nullish.bind(this);\n this.array = this.array.bind(this);\n this.promise = this.promise.bind(this);\n this.or = this.or.bind(this);\n this.and = this.and.bind(this);\n this.transform = this.transform.bind(this);\n this.brand = this.brand.bind(this);\n this.default = this.default.bind(this);\n this.catch = this.catch.bind(this);\n this.describe = this.describe.bind(this);\n this.pipe = this.pipe.bind(this);\n this.readonly = this.readonly.bind(this);\n this.isNullable = this.isNullable.bind(this);\n this.isOptional = this.isOptional.bind(this);\n }\n get description() {\n return this._def.description;\n }\n _getType(input) {\n return getParsedType(input.data);\n }\n _getOrReturnCtx(input, ctx) {\n return ctx || {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent\n };\n }\n _processInputParams(input) {\n return {\n status: new ParseStatus(),\n ctx: {\n common: input.parent.common,\n data: input.data,\n parsedType: getParsedType(input.data),\n schemaErrorMap: this._def.errorMap,\n path: input.path,\n parent: input.parent\n }\n };\n }\n _parseSync(input) {\n const result = this._parse(input);\n if (isAsync(result)) {\n throw new Error(\"Synchronous parse encountered promise.\");\n }\n return result;\n }\n _parseAsync(input) {\n const result = this._parse(input);\n return Promise.resolve(result);\n }\n parse(data, params) {\n const result = this.safeParse(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n safeParse(data, params) {\n var _a;\n const ctx = {\n common: {\n issues: [],\n async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false,\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data)\n };\n const result = this._parseSync({ data, path: ctx.path, parent: ctx });\n return handleResult(ctx, result);\n }\n async parseAsync(data, params) {\n const result = await this.safeParseAsync(data, params);\n if (result.success)\n return result.data;\n throw result.error;\n }\n async safeParseAsync(data, params) {\n const ctx = {\n common: {\n issues: [],\n contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap,\n async: true\n },\n path: (params === null || params === void 0 ? void 0 : params.path) || [],\n schemaErrorMap: this._def.errorMap,\n parent: null,\n data,\n parsedType: getParsedType(data)\n };\n const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });\n const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));\n return handleResult(ctx, result);\n }\n refine(check, message) {\n const getIssueProperties = /* @__PURE__ */ __name((val) => {\n if (typeof message === \"string\" || typeof message === \"undefined\") {\n return { message };\n } else if (typeof message === \"function\") {\n return message(val);\n } else {\n return message;\n }\n }, \"getIssueProperties\");\n return this._refinement((val, ctx) => {\n const result = check(val);\n const setError = /* @__PURE__ */ __name(() => ctx.addIssue({\n code: ZodIssueCode.custom,\n ...getIssueProperties(val)\n }), \"setError\");\n if (typeof Promise !== \"undefined\" && result instanceof Promise) {\n return result.then((data) => {\n if (!data) {\n setError();\n return false;\n } else {\n return true;\n }\n });\n }\n if (!result) {\n setError();\n return false;\n } else {\n return true;\n }\n });\n }\n refinement(check, refinementData) {\n return this._refinement((val, ctx) => {\n if (!check(val)) {\n ctx.addIssue(typeof refinementData === \"function\" ? refinementData(val, ctx) : refinementData);\n return false;\n } else {\n return true;\n }\n });\n }\n _refinement(refinement) {\n return new ZodEffects({\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"refinement\", refinement }\n });\n }\n superRefine(refinement) {\n return this._refinement(refinement);\n }\n optional() {\n return ZodOptional.create(this, this._def);\n }\n nullable() {\n return ZodNullable.create(this, this._def);\n }\n nullish() {\n return this.nullable().optional();\n }\n array() {\n return ZodArray.create(this, this._def);\n }\n promise() {\n return ZodPromise.create(this, this._def);\n }\n or(option) {\n return ZodUnion.create([this, option], this._def);\n }\n and(incoming) {\n return ZodIntersection.create(this, incoming, this._def);\n }\n transform(transform) {\n return new ZodEffects({\n ...processCreateParams(this._def),\n schema: this,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect: { type: \"transform\", transform }\n });\n }\n default(def) {\n const defaultValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodDefault({\n ...processCreateParams(this._def),\n innerType: this,\n defaultValue: defaultValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodDefault\n });\n }\n brand() {\n return new ZodBranded({\n typeName: ZodFirstPartyTypeKind.ZodBranded,\n type: this,\n ...processCreateParams(this._def)\n });\n }\n catch(def) {\n const catchValueFunc = typeof def === \"function\" ? def : () => def;\n return new ZodCatch({\n ...processCreateParams(this._def),\n innerType: this,\n catchValue: catchValueFunc,\n typeName: ZodFirstPartyTypeKind.ZodCatch\n });\n }\n describe(description) {\n const This = this.constructor;\n return new This({\n ...this._def,\n description\n });\n }\n pipe(target) {\n return ZodPipeline.create(this, target);\n }\n readonly() {\n return ZodReadonly.create(this);\n }\n isOptional() {\n return this.safeParse(void 0).success;\n }\n isNullable() {\n return this.safeParse(null).success;\n }\n};\nvar cuidRegex = /^c[^\\s-]{8,}$/i;\nvar cuid2Regex = /^[a-z][a-z0-9]*$/;\nvar ulidRegex = /[0-9A-HJKMNP-TV-Z]{26}/;\nvar 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;\nvar emailRegex = /^(?!\\.)(?!.*\\.\\.)([A-Z0-9_+-\\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\\-]*\\.)+[A-Z]{2,}$/i;\nvar emojiRegex = /^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$/u;\nvar ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/;\nvar ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;\nvar datetimeRegex = /* @__PURE__ */ __name((args) => {\n if (args.precision) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n } else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\.\\\\d{${args.precision}}Z$`);\n }\n } else if (args.precision === 0) {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n } else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}Z$`);\n }\n } else {\n if (args.offset) {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?(([+-]\\\\d{2}(:?\\\\d{2})?)|Z)$`);\n } else {\n return new RegExp(`^\\\\d{4}-\\\\d{2}-\\\\d{2}T\\\\d{2}:\\\\d{2}:\\\\d{2}(\\\\.\\\\d+)?Z$`);\n }\n }\n}, \"datetimeRegex\");\nfunction isValidIP(ip, version) {\n if ((version === \"v4\" || !version) && ipv4Regex.test(ip)) {\n return true;\n }\n if ((version === \"v6\" || !version) && ipv6Regex.test(ip)) {\n return true;\n }\n return false;\n}\n__name(isValidIP, \"isValidIP\");\nvar ZodString = class _ZodString extends ZodType {\n static {\n __name(this, \"ZodString\");\n }\n constructor() {\n super(...arguments);\n this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {\n validation,\n code: ZodIssueCode.invalid_string,\n ...errorUtil.errToObj(message)\n });\n this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));\n this.trim = () => new _ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"trim\" }]\n });\n this.toLowerCase = () => new _ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toLowerCase\" }]\n });\n this.toUpperCase = () => new _ZodString({\n ...this._def,\n checks: [...this._def.checks, { kind: \"toUpperCase\" }]\n });\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = String(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.string) {\n const ctx2 = this._getOrReturnCtx(input);\n addIssueToContext(\n ctx2,\n {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.string,\n received: ctx2.parsedType\n }\n //\n );\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = void 0;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.length < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"max\") {\n if (input.data.length > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: false,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"length\") {\n const tooBig = input.data.length > check.value;\n const tooSmall = input.data.length < check.value;\n if (tooBig || tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n if (tooBig) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message\n });\n } else if (tooSmall) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"string\",\n inclusive: true,\n exact: true,\n message: check.message\n });\n }\n status.dirty();\n }\n } else if (check.kind === \"email\") {\n if (!emailRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"email\",\n code: ZodIssueCode.invalid_string,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"emoji\") {\n if (!emojiRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"emoji\",\n code: ZodIssueCode.invalid_string,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"uuid\") {\n if (!uuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"uuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"cuid\") {\n if (!cuidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid\",\n code: ZodIssueCode.invalid_string,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"cuid2\") {\n if (!cuid2Regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"cuid2\",\n code: ZodIssueCode.invalid_string,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"ulid\") {\n if (!ulidRegex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ulid\",\n code: ZodIssueCode.invalid_string,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"url\") {\n try {\n new URL(input.data);\n } catch (_a) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"url\",\n code: ZodIssueCode.invalid_string,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"regex\") {\n check.regex.lastIndex = 0;\n const testResult = check.regex.test(input.data);\n if (!testResult) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"regex\",\n code: ZodIssueCode.invalid_string,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"trim\") {\n input.data = input.data.trim();\n } else if (check.kind === \"includes\") {\n if (!input.data.includes(check.value, check.position)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { includes: check.value, position: check.position },\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"toLowerCase\") {\n input.data = input.data.toLowerCase();\n } else if (check.kind === \"toUpperCase\") {\n input.data = input.data.toUpperCase();\n } else if (check.kind === \"startsWith\") {\n if (!input.data.startsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { startsWith: check.value },\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"endsWith\") {\n if (!input.data.endsWith(check.value)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: { endsWith: check.value },\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"datetime\") {\n const regex = datetimeRegex(check);\n if (!regex.test(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_string,\n validation: \"datetime\",\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"ip\") {\n if (!isValidIP(input.data, check.version)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n validation: \"ip\",\n code: ZodIssueCode.invalid_string,\n message: check.message\n });\n status.dirty();\n }\n } else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n _addCheck(check) {\n return new _ZodString({\n ...this._def,\n checks: [...this._def.checks, check]\n });\n }\n email(message) {\n return this._addCheck({ kind: \"email\", ...errorUtil.errToObj(message) });\n }\n url(message) {\n return this._addCheck({ kind: \"url\", ...errorUtil.errToObj(message) });\n }\n emoji(message) {\n return this._addCheck({ kind: \"emoji\", ...errorUtil.errToObj(message) });\n }\n uuid(message) {\n return this._addCheck({ kind: \"uuid\", ...errorUtil.errToObj(message) });\n }\n cuid(message) {\n return this._addCheck({ kind: \"cuid\", ...errorUtil.errToObj(message) });\n }\n cuid2(message) {\n return this._addCheck({ kind: \"cuid2\", ...errorUtil.errToObj(message) });\n }\n ulid(message) {\n return this._addCheck({ kind: \"ulid\", ...errorUtil.errToObj(message) });\n }\n ip(options) {\n return this._addCheck({ kind: \"ip\", ...errorUtil.errToObj(options) });\n }\n datetime(options) {\n var _a;\n if (typeof options === \"string\") {\n return this._addCheck({\n kind: \"datetime\",\n precision: null,\n offset: false,\n message: options\n });\n }\n return this._addCheck({\n kind: \"datetime\",\n precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === \"undefined\" ? null : options === null || options === void 0 ? void 0 : options.precision,\n offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)\n });\n }\n regex(regex, message) {\n return this._addCheck({\n kind: \"regex\",\n regex,\n ...errorUtil.errToObj(message)\n });\n }\n includes(value, options) {\n return this._addCheck({\n kind: \"includes\",\n value,\n position: options === null || options === void 0 ? void 0 : options.position,\n ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)\n });\n }\n startsWith(value, message) {\n return this._addCheck({\n kind: \"startsWith\",\n value,\n ...errorUtil.errToObj(message)\n });\n }\n endsWith(value, message) {\n return this._addCheck({\n kind: \"endsWith\",\n value,\n ...errorUtil.errToObj(message)\n });\n }\n min(minLength, message) {\n return this._addCheck({\n kind: \"min\",\n value: minLength,\n ...errorUtil.errToObj(message)\n });\n }\n max(maxLength, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxLength,\n ...errorUtil.errToObj(message)\n });\n }\n length(len, message) {\n return this._addCheck({\n kind: \"length\",\n value: len,\n ...errorUtil.errToObj(message)\n });\n }\n get isDatetime() {\n return !!this._def.checks.find((ch) => ch.kind === \"datetime\");\n }\n get isEmail() {\n return !!this._def.checks.find((ch) => ch.kind === \"email\");\n }\n get isURL() {\n return !!this._def.checks.find((ch) => ch.kind === \"url\");\n }\n get isEmoji() {\n return !!this._def.checks.find((ch) => ch.kind === \"emoji\");\n }\n get isUUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"uuid\");\n }\n get isCUID() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid\");\n }\n get isCUID2() {\n return !!this._def.checks.find((ch) => ch.kind === \"cuid2\");\n }\n get isULID() {\n return !!this._def.checks.find((ch) => ch.kind === \"ulid\");\n }\n get isIP() {\n return !!this._def.checks.find((ch) => ch.kind === \"ip\");\n }\n get minLength() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxLength() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n};\nZodString.create = (params) => {\n var _a;\n return new ZodString({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodString,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params)\n });\n};\nfunction floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepDecCount = (step.toString().split(\".\")[1] || \"\").length;\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return valInt % stepInt / Math.pow(10, decCount);\n}\n__name(floatSafeRemainder, \"floatSafeRemainder\");\nvar ZodNumber = class _ZodNumber extends ZodType {\n static {\n __name(this, \"ZodNumber\");\n }\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n this.step = this.multipleOf;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Number(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.number) {\n const ctx2 = this._getOrReturnCtx(input);\n addIssueToContext(ctx2, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.number,\n received: ctx2.parsedType\n });\n return INVALID;\n }\n let ctx = void 0;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"int\") {\n if (!util.isInteger(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: \"integer\",\n received: \"float\",\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: check.value,\n type: \"number\",\n inclusive: check.inclusive,\n exact: false,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"multipleOf\") {\n if (floatSafeRemainder(input.data, check.value) !== 0) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"finite\") {\n if (!Number.isFinite(input.data)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_finite,\n message: check.message\n });\n status.dirty();\n }\n } else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new _ZodNumber({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message)\n }\n ]\n });\n }\n _addCheck(check) {\n return new _ZodNumber({\n ...this._def,\n checks: [...this._def.checks, check]\n });\n }\n int(message) {\n return this._addCheck({\n kind: \"int\",\n message: errorUtil.toString(message)\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message)\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: false,\n message: errorUtil.toString(message)\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message)\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: 0,\n inclusive: true,\n message: errorUtil.toString(message)\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message)\n });\n }\n finite(message) {\n return this._addCheck({\n kind: \"finite\",\n message: errorUtil.toString(message)\n });\n }\n safe(message) {\n return this._addCheck({\n kind: \"min\",\n inclusive: true,\n value: Number.MIN_SAFE_INTEGER,\n message: errorUtil.toString(message)\n })._addCheck({\n kind: \"max\",\n inclusive: true,\n value: Number.MAX_SAFE_INTEGER,\n message: errorUtil.toString(message)\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n get isInt() {\n return !!this._def.checks.find((ch) => ch.kind === \"int\" || ch.kind === \"multipleOf\" && util.isInteger(ch.value));\n }\n get isFinite() {\n let max = null, min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"finite\" || ch.kind === \"int\" || ch.kind === \"multipleOf\") {\n return true;\n } else if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n } else if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return Number.isFinite(min) && Number.isFinite(max);\n }\n};\nZodNumber.create = (params) => {\n return new ZodNumber({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodNumber,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params)\n });\n};\nvar ZodBigInt = class _ZodBigInt extends ZodType {\n static {\n __name(this, \"ZodBigInt\");\n }\n constructor() {\n super(...arguments);\n this.min = this.gte;\n this.max = this.lte;\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = BigInt(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.bigint) {\n const ctx2 = this._getOrReturnCtx(input);\n addIssueToContext(ctx2, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.bigint,\n received: ctx2.parsedType\n });\n return INVALID;\n }\n let ctx = void 0;\n const status = new ParseStatus();\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;\n if (tooSmall) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n type: \"bigint\",\n minimum: check.value,\n inclusive: check.inclusive,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"max\") {\n const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;\n if (tooBig) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n type: \"bigint\",\n maximum: check.value,\n inclusive: check.inclusive,\n message: check.message\n });\n status.dirty();\n }\n } else if (check.kind === \"multipleOf\") {\n if (input.data % check.value !== BigInt(0)) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.not_multiple_of,\n multipleOf: check.value,\n message: check.message\n });\n status.dirty();\n }\n } else {\n util.assertNever(check);\n }\n }\n return { status: status.value, value: input.data };\n }\n gte(value, message) {\n return this.setLimit(\"min\", value, true, errorUtil.toString(message));\n }\n gt(value, message) {\n return this.setLimit(\"min\", value, false, errorUtil.toString(message));\n }\n lte(value, message) {\n return this.setLimit(\"max\", value, true, errorUtil.toString(message));\n }\n lt(value, message) {\n return this.setLimit(\"max\", value, false, errorUtil.toString(message));\n }\n setLimit(kind, value, inclusive, message) {\n return new _ZodBigInt({\n ...this._def,\n checks: [\n ...this._def.checks,\n {\n kind,\n value,\n inclusive,\n message: errorUtil.toString(message)\n }\n ]\n });\n }\n _addCheck(check) {\n return new _ZodBigInt({\n ...this._def,\n checks: [...this._def.checks, check]\n });\n }\n positive(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message)\n });\n }\n negative(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: false,\n message: errorUtil.toString(message)\n });\n }\n nonpositive(message) {\n return this._addCheck({\n kind: \"max\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message)\n });\n }\n nonnegative(message) {\n return this._addCheck({\n kind: \"min\",\n value: BigInt(0),\n inclusive: true,\n message: errorUtil.toString(message)\n });\n }\n multipleOf(value, message) {\n return this._addCheck({\n kind: \"multipleOf\",\n value,\n message: errorUtil.toString(message)\n });\n }\n get minValue() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min;\n }\n get maxValue() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max;\n }\n};\nZodBigInt.create = (params) => {\n var _a;\n return new ZodBigInt({\n checks: [],\n typeName: ZodFirstPartyTypeKind.ZodBigInt,\n coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false,\n ...processCreateParams(params)\n });\n};\nvar ZodBoolean = class extends ZodType {\n static {\n __name(this, \"ZodBoolean\");\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = Boolean(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.boolean) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.boolean,\n received: ctx.parsedType\n });\n return INVALID;\n }\n return OK(input.data);\n }\n};\nZodBoolean.create = (params) => {\n return new ZodBoolean({\n typeName: ZodFirstPartyTypeKind.ZodBoolean,\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n ...processCreateParams(params)\n });\n};\nvar ZodDate = class _ZodDate extends ZodType {\n static {\n __name(this, \"ZodDate\");\n }\n _parse(input) {\n if (this._def.coerce) {\n input.data = new Date(input.data);\n }\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.date) {\n const ctx2 = this._getOrReturnCtx(input);\n addIssueToContext(ctx2, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.date,\n received: ctx2.parsedType\n });\n return INVALID;\n }\n if (isNaN(input.data.getTime())) {\n const ctx2 = this._getOrReturnCtx(input);\n addIssueToContext(ctx2, {\n code: ZodIssueCode.invalid_date\n });\n return INVALID;\n }\n const status = new ParseStatus();\n let ctx = void 0;\n for (const check of this._def.checks) {\n if (check.kind === \"min\") {\n if (input.data.getTime() < check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n message: check.message,\n inclusive: true,\n exact: false,\n minimum: check.value,\n type: \"date\"\n });\n status.dirty();\n }\n } else if (check.kind === \"max\") {\n if (input.data.getTime() > check.value) {\n ctx = this._getOrReturnCtx(input, ctx);\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n message: check.message,\n inclusive: true,\n exact: false,\n maximum: check.value,\n type: \"date\"\n });\n status.dirty();\n }\n } else {\n util.assertNever(check);\n }\n }\n return {\n status: status.value,\n value: new Date(input.data.getTime())\n };\n }\n _addCheck(check) {\n return new _ZodDate({\n ...this._def,\n checks: [...this._def.checks, check]\n });\n }\n min(minDate, message) {\n return this._addCheck({\n kind: \"min\",\n value: minDate.getTime(),\n message: errorUtil.toString(message)\n });\n }\n max(maxDate, message) {\n return this._addCheck({\n kind: \"max\",\n value: maxDate.getTime(),\n message: errorUtil.toString(message)\n });\n }\n get minDate() {\n let min = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"min\") {\n if (min === null || ch.value > min)\n min = ch.value;\n }\n }\n return min != null ? new Date(min) : null;\n }\n get maxDate() {\n let max = null;\n for (const ch of this._def.checks) {\n if (ch.kind === \"max\") {\n if (max === null || ch.value < max)\n max = ch.value;\n }\n }\n return max != null ? new Date(max) : null;\n }\n};\nZodDate.create = (params) => {\n return new ZodDate({\n checks: [],\n coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false,\n typeName: ZodFirstPartyTypeKind.ZodDate,\n ...processCreateParams(params)\n });\n};\nvar ZodSymbol = class extends ZodType {\n static {\n __name(this, \"ZodSymbol\");\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.symbol) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.symbol,\n received: ctx.parsedType\n });\n return INVALID;\n }\n return OK(input.data);\n }\n};\nZodSymbol.create = (params) => {\n return new ZodSymbol({\n typeName: ZodFirstPartyTypeKind.ZodSymbol,\n ...processCreateParams(params)\n });\n};\nvar ZodUndefined = class extends ZodType {\n static {\n __name(this, \"ZodUndefined\");\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.undefined,\n received: ctx.parsedType\n });\n return INVALID;\n }\n return OK(input.data);\n }\n};\nZodUndefined.create = (params) => {\n return new ZodUndefined({\n typeName: ZodFirstPartyTypeKind.ZodUndefined,\n ...processCreateParams(params)\n });\n};\nvar ZodNull = class extends ZodType {\n static {\n __name(this, \"ZodNull\");\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.null) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.null,\n received: ctx.parsedType\n });\n return INVALID;\n }\n return OK(input.data);\n }\n};\nZodNull.create = (params) => {\n return new ZodNull({\n typeName: ZodFirstPartyTypeKind.ZodNull,\n ...processCreateParams(params)\n });\n};\nvar ZodAny = class extends ZodType {\n static {\n __name(this, \"ZodAny\");\n }\n constructor() {\n super(...arguments);\n this._any = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n};\nZodAny.create = (params) => {\n return new ZodAny({\n typeName: ZodFirstPartyTypeKind.ZodAny,\n ...processCreateParams(params)\n });\n};\nvar ZodUnknown = class extends ZodType {\n static {\n __name(this, \"ZodUnknown\");\n }\n constructor() {\n super(...arguments);\n this._unknown = true;\n }\n _parse(input) {\n return OK(input.data);\n }\n};\nZodUnknown.create = (params) => {\n return new ZodUnknown({\n typeName: ZodFirstPartyTypeKind.ZodUnknown,\n ...processCreateParams(params)\n });\n};\nvar ZodNever = class extends ZodType {\n static {\n __name(this, \"ZodNever\");\n }\n _parse(input) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.never,\n received: ctx.parsedType\n });\n return INVALID;\n }\n};\nZodNever.create = (params) => {\n return new ZodNever({\n typeName: ZodFirstPartyTypeKind.ZodNever,\n ...processCreateParams(params)\n });\n};\nvar ZodVoid = class extends ZodType {\n static {\n __name(this, \"ZodVoid\");\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.undefined) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.void,\n received: ctx.parsedType\n });\n return INVALID;\n }\n return OK(input.data);\n }\n};\nZodVoid.create = (params) => {\n return new ZodVoid({\n typeName: ZodFirstPartyTypeKind.ZodVoid,\n ...processCreateParams(params)\n });\n};\nvar ZodArray = class _ZodArray extends ZodType {\n static {\n __name(this, \"ZodArray\");\n }\n _parse(input) {\n const { ctx, status } = this._processInputParams(input);\n const def = this._def;\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType\n });\n return INVALID;\n }\n if (def.exactLength !== null) {\n const tooBig = ctx.data.length > def.exactLength.value;\n const tooSmall = ctx.data.length < def.exactLength.value;\n if (tooBig || tooSmall) {\n addIssueToContext(ctx, {\n code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,\n minimum: tooSmall ? def.exactLength.value : void 0,\n maximum: tooBig ? def.exactLength.value : void 0,\n type: \"array\",\n inclusive: true,\n exact: true,\n message: def.exactLength.message\n });\n status.dirty();\n }\n }\n if (def.minLength !== null) {\n if (ctx.data.length < def.minLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.minLength.message\n });\n status.dirty();\n }\n }\n if (def.maxLength !== null) {\n if (ctx.data.length > def.maxLength.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxLength.value,\n type: \"array\",\n inclusive: true,\n exact: false,\n message: def.maxLength.message\n });\n status.dirty();\n }\n }\n if (ctx.common.async) {\n return Promise.all([...ctx.data].map((item, i) => {\n return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n })).then((result2) => {\n return ParseStatus.mergeArray(status, result2);\n });\n }\n const result = [...ctx.data].map((item, i) => {\n return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));\n });\n return ParseStatus.mergeArray(status, result);\n }\n get element() {\n return this._def.type;\n }\n min(minLength, message) {\n return new _ZodArray({\n ...this._def,\n minLength: { value: minLength, message: errorUtil.toString(message) }\n });\n }\n max(maxLength, message) {\n return new _ZodArray({\n ...this._def,\n maxLength: { value: maxLength, message: errorUtil.toString(message) }\n });\n }\n length(len, message) {\n return new _ZodArray({\n ...this._def,\n exactLength: { value: len, message: errorUtil.toString(message) }\n });\n }\n nonempty(message) {\n return this.min(1, message);\n }\n};\nZodArray.create = (schema, params) => {\n return new ZodArray({\n type: schema,\n minLength: null,\n maxLength: null,\n exactLength: null,\n typeName: ZodFirstPartyTypeKind.ZodArray,\n ...processCreateParams(params)\n });\n};\nfunction deepPartialify(schema) {\n if (schema instanceof ZodObject) {\n const newShape = {};\n for (const key in schema.shape) {\n const fieldSchema = schema.shape[key];\n newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));\n }\n return new ZodObject({\n ...schema._def,\n shape: /* @__PURE__ */ __name(() => newShape, \"shape\")\n });\n } else if (schema instanceof ZodArray) {\n return new ZodArray({\n ...schema._def,\n type: deepPartialify(schema.element)\n });\n } else if (schema instanceof ZodOptional) {\n return ZodOptional.create(deepPartialify(schema.unwrap()));\n } else if (schema instanceof ZodNullable) {\n return ZodNullable.create(deepPartialify(schema.unwrap()));\n } else if (schema instanceof ZodTuple) {\n return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));\n } else {\n return schema;\n }\n}\n__name(deepPartialify, \"deepPartialify\");\nvar ZodObject = class _ZodObject extends ZodType {\n static {\n __name(this, \"ZodObject\");\n }\n constructor() {\n super(...arguments);\n this._cached = null;\n this.nonstrict = this.passthrough;\n this.augment = this.extend;\n }\n _getCached() {\n if (this._cached !== null)\n return this._cached;\n const shape = this._def.shape();\n const keys = util.objectKeys(shape);\n return this._cached = { shape, keys };\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.object) {\n const ctx2 = this._getOrReturnCtx(input);\n addIssueToContext(ctx2, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx2.parsedType\n });\n return INVALID;\n }\n const { status, ctx } = this._processInputParams(input);\n const { shape, keys: shapeKeys } = this._getCached();\n const extraKeys = [];\n if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === \"strip\")) {\n for (const key in ctx.data) {\n if (!shapeKeys.includes(key)) {\n extraKeys.push(key);\n }\n }\n }\n const pairs = [];\n for (const key of shapeKeys) {\n const keyValidator = shape[key];\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),\n alwaysSet: key in ctx.data\n });\n }\n if (this._def.catchall instanceof ZodNever) {\n const unknownKeys = this._def.unknownKeys;\n if (unknownKeys === \"passthrough\") {\n for (const key of extraKeys) {\n pairs.push({\n key: { status: \"valid\", value: key },\n value: { status: \"valid\", value: ctx.data[key] }\n });\n }\n } else if (unknownKeys === \"strict\") {\n if (extraKeys.length > 0) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.unrecognized_keys,\n keys: extraKeys\n });\n status.dirty();\n }\n } else if (unknownKeys === \"strip\") ;\n else {\n throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);\n }\n } else {\n const catchall = this._def.catchall;\n for (const key of extraKeys) {\n const value = ctx.data[key];\n pairs.push({\n key: { status: \"valid\", value: key },\n value: catchall._parse(\n new ParseInputLazyPath(ctx, value, ctx.path, key)\n //, ctx.child(key), value, getParsedType(value)\n ),\n alwaysSet: key in ctx.data\n });\n }\n }\n if (ctx.common.async) {\n return Promise.resolve().then(async () => {\n const syncPairs = [];\n for (const pair of pairs) {\n const key = await pair.key;\n syncPairs.push({\n key,\n value: await pair.value,\n alwaysSet: pair.alwaysSet\n });\n }\n return syncPairs;\n }).then((syncPairs) => {\n return ParseStatus.mergeObjectSync(status, syncPairs);\n });\n } else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get shape() {\n return this._def.shape();\n }\n strict(message) {\n errorUtil.errToObj;\n return new _ZodObject({\n ...this._def,\n unknownKeys: \"strict\",\n ...message !== void 0 ? {\n errorMap: /* @__PURE__ */ __name((issue, ctx) => {\n var _a, _b, _c, _d;\n const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError;\n if (issue.code === \"unrecognized_keys\")\n return {\n message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError\n };\n return {\n message: defaultError\n };\n }, \"errorMap\")\n } : {}\n });\n }\n strip() {\n return new _ZodObject({\n ...this._def,\n unknownKeys: \"strip\"\n });\n }\n passthrough() {\n return new _ZodObject({\n ...this._def,\n unknownKeys: \"passthrough\"\n });\n }\n // const AugmentFactory =\n // <Def extends ZodObjectDef>(def: Def) =>\n // <Augmentation extends ZodRawShape>(\n // augmentation: Augmentation\n // ): ZodObject<\n // extendShape<ReturnType<Def[\"shape\"]>, Augmentation>,\n // Def[\"unknownKeys\"],\n // Def[\"catchall\"]\n // > => {\n // return new ZodObject({\n // ...def,\n // shape: () => ({\n // ...def.shape(),\n // ...augmentation,\n // }),\n // }) as any;\n // };\n extend(augmentation) {\n return new _ZodObject({\n ...this._def,\n shape: /* @__PURE__ */ __name(() => ({\n ...this._def.shape(),\n ...augmentation\n }), \"shape\")\n });\n }\n /**\n * Prior to zod@1.0.12 there was a bug in the\n * inferred type of merged objects. Please\n * upgrade if you are experiencing issues.\n */\n merge(merging) {\n const merged = new _ZodObject({\n unknownKeys: merging._def.unknownKeys,\n catchall: merging._def.catchall,\n shape: /* @__PURE__ */ __name(() => ({\n ...this._def.shape(),\n ...merging._def.shape()\n }), \"shape\"),\n typeName: ZodFirstPartyTypeKind.ZodObject\n });\n return merged;\n }\n // merge<\n // Incoming extends AnyZodObject,\n // Augmentation extends Incoming[\"shape\"],\n // NewOutput extends {\n // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation\n // ? Augmentation[k][\"_output\"]\n // : k extends keyof Output\n // ? Output[k]\n // : never;\n // },\n // NewInput extends {\n // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation\n // ? Augmentation[k][\"_input\"]\n // : k extends keyof Input\n // ? Input[k]\n // : never;\n // }\n // >(\n // merging: Incoming\n // ): ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"],\n // NewOutput,\n // NewInput\n // > {\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n setKey(key, schema) {\n return this.augment({ [key]: schema });\n }\n // merge<Incoming extends AnyZodObject>(\n // merging: Incoming\n // ): //ZodObject<T & Incoming[\"_shape\"], UnknownKeys, Catchall> = (merging) => {\n // ZodObject<\n // extendShape<T, ReturnType<Incoming[\"_def\"][\"shape\"]>>,\n // Incoming[\"_def\"][\"unknownKeys\"],\n // Incoming[\"_def\"][\"catchall\"]\n // > {\n // // const mergedShape = objectUtil.mergeShapes(\n // // this._def.shape(),\n // // merging._def.shape()\n // // );\n // const merged: any = new ZodObject({\n // unknownKeys: merging._def.unknownKeys,\n // catchall: merging._def.catchall,\n // shape: () =>\n // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),\n // typeName: ZodFirstPartyTypeKind.ZodObject,\n // }) as any;\n // return merged;\n // }\n catchall(index) {\n return new _ZodObject({\n ...this._def,\n catchall: index\n });\n }\n pick(mask) {\n const shape = {};\n util.objectKeys(mask).forEach((key) => {\n if (mask[key] && this.shape[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new _ZodObject({\n ...this._def,\n shape: /* @__PURE__ */ __name(() => shape, \"shape\")\n });\n }\n omit(mask) {\n const shape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (!mask[key]) {\n shape[key] = this.shape[key];\n }\n });\n return new _ZodObject({\n ...this._def,\n shape: /* @__PURE__ */ __name(() => shape, \"shape\")\n });\n }\n /**\n * @deprecated\n */\n deepPartial() {\n return deepPartialify(this);\n }\n partial(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n const fieldSchema = this.shape[key];\n if (mask && !mask[key]) {\n newShape[key] = fieldSchema;\n } else {\n newShape[key] = fieldSchema.optional();\n }\n });\n return new _ZodObject({\n ...this._def,\n shape: /* @__PURE__ */ __name(() => newShape, \"shape\")\n });\n }\n required(mask) {\n const newShape = {};\n util.objectKeys(this.shape).forEach((key) => {\n if (mask && !mask[key]) {\n newShape[key] = this.shape[key];\n } else {\n const fieldSchema = this.shape[key];\n let newField = fieldSchema;\n while (newField instanceof ZodOptional) {\n newField = newField._def.innerType;\n }\n newShape[key] = newField;\n }\n });\n return new _ZodObject({\n ...this._def,\n shape: /* @__PURE__ */ __name(() => newShape, \"shape\")\n });\n }\n keyof() {\n return createZodEnum(util.objectKeys(this.shape));\n }\n};\nZodObject.create = (shape, params) => {\n return new ZodObject({\n shape: /* @__PURE__ */ __name(() => shape, \"shape\"),\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params)\n });\n};\nZodObject.strictCreate = (shape, params) => {\n return new ZodObject({\n shape: /* @__PURE__ */ __name(() => shape, \"shape\"),\n unknownKeys: \"strict\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params)\n });\n};\nZodObject.lazycreate = (shape, params) => {\n return new ZodObject({\n shape,\n unknownKeys: \"strip\",\n catchall: ZodNever.create(),\n typeName: ZodFirstPartyTypeKind.ZodObject,\n ...processCreateParams(params)\n });\n};\nvar ZodUnion = class extends ZodType {\n static {\n __name(this, \"ZodUnion\");\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const options = this._def.options;\n function handleResults(results) {\n for (const result of results) {\n if (result.result.status === \"valid\") {\n return result.result;\n }\n }\n for (const result of results) {\n if (result.result.status === \"dirty\") {\n ctx.common.issues.push(...result.ctx.common.issues);\n return result.result;\n }\n }\n const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors\n });\n return INVALID;\n }\n __name(handleResults, \"handleResults\");\n if (ctx.common.async) {\n return Promise.all(options.map(async (option) => {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: []\n },\n parent: null\n };\n return {\n result: await option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx\n }),\n ctx: childCtx\n };\n })).then(handleResults);\n } else {\n let dirty = void 0;\n const issues = [];\n for (const option of options) {\n const childCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: []\n },\n parent: null\n };\n const result = option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: childCtx\n });\n if (result.status === \"valid\") {\n return result;\n } else if (result.status === \"dirty\" && !dirty) {\n dirty = { result, ctx: childCtx };\n }\n if (childCtx.common.issues.length) {\n issues.push(childCtx.common.issues);\n }\n }\n if (dirty) {\n ctx.common.issues.push(...dirty.ctx.common.issues);\n return dirty.result;\n }\n const unionErrors = issues.map((issues2) => new ZodError(issues2));\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union,\n unionErrors\n });\n return INVALID;\n }\n }\n get options() {\n return this._def.options;\n }\n};\nZodUnion.create = (types, params) => {\n return new ZodUnion({\n options: types,\n typeName: ZodFirstPartyTypeKind.ZodUnion,\n ...processCreateParams(params)\n });\n};\nvar getDiscriminator = /* @__PURE__ */ __name((type) => {\n if (type instanceof ZodLazy) {\n return getDiscriminator(type.schema);\n } else if (type instanceof ZodEffects) {\n return getDiscriminator(type.innerType());\n } else if (type instanceof ZodLiteral) {\n return [type.value];\n } else if (type instanceof ZodEnum) {\n return type.options;\n } else if (type instanceof ZodNativeEnum) {\n return Object.keys(type.enum);\n } else if (type instanceof ZodDefault) {\n return getDiscriminator(type._def.innerType);\n } else if (type instanceof ZodUndefined) {\n return [void 0];\n } else if (type instanceof ZodNull) {\n return [null];\n } else {\n return null;\n }\n}, \"getDiscriminator\");\nvar ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {\n static {\n __name(this, \"ZodDiscriminatedUnion\");\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType\n });\n return INVALID;\n }\n const discriminator = this.discriminator;\n const discriminatorValue = ctx.data[discriminator];\n const option = this.optionsMap.get(discriminatorValue);\n if (!option) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_union_discriminator,\n options: Array.from(this.optionsMap.keys()),\n path: [discriminator]\n });\n return INVALID;\n }\n if (ctx.common.async) {\n return option._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n });\n } else {\n return option._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n });\n }\n }\n get discriminator() {\n return this._def.discriminator;\n }\n get options() {\n return this._def.options;\n }\n get optionsMap() {\n return this._def.optionsMap;\n }\n /**\n * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor.\n * However, it only allows a union of objects, all of which need to share a discriminator property. This property must\n * have a different value for each object in the union.\n * @param discriminator the name of the discriminator property\n * @param types an array of object schemas\n * @param params\n */\n static create(discriminator, options, params) {\n const optionsMap = /* @__PURE__ */ new Map();\n for (const type of options) {\n const discriminatorValues = getDiscriminator(type.shape[discriminator]);\n if (!discriminatorValues) {\n throw new Error(`A discriminator value for key \\`${discriminator}\\` could not be extracted from all schema options`);\n }\n for (const value of discriminatorValues) {\n if (optionsMap.has(value)) {\n throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`);\n }\n optionsMap.set(value, type);\n }\n }\n return new _ZodDiscriminatedUnion({\n typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,\n discriminator,\n options,\n optionsMap,\n ...processCreateParams(params)\n });\n }\n};\nfunction mergeValues(a, b) {\n const aType = getParsedType(a);\n const bType = getParsedType(b);\n if (a === b) {\n return { valid: true, data: a };\n } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {\n const bKeys = util.objectKeys(b);\n const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {\n if (a.length !== b.length) {\n return { valid: false };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return { valid: false };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {\n return { valid: true, data: a };\n } else {\n return { valid: false };\n }\n}\n__name(mergeValues, \"mergeValues\");\nvar ZodIntersection = class extends ZodType {\n static {\n __name(this, \"ZodIntersection\");\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const handleParsed = /* @__PURE__ */ __name((parsedLeft, parsedRight) => {\n if (isAborted(parsedLeft) || isAborted(parsedRight)) {\n return INVALID;\n }\n const merged = mergeValues(parsedLeft.value, parsedRight.value);\n if (!merged.valid) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_intersection_types\n });\n return INVALID;\n }\n if (isDirty(parsedLeft) || isDirty(parsedRight)) {\n status.dirty();\n }\n return { status: status.value, value: merged.data };\n }, \"handleParsed\");\n if (ctx.common.async) {\n return Promise.all([\n this._def.left._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n }),\n this._def.right._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n })\n ]).then(([left, right]) => handleParsed(left, right));\n } else {\n return handleParsed(this._def.left._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n }), this._def.right._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n }));\n }\n }\n};\nZodIntersection.create = (left, right, params) => {\n return new ZodIntersection({\n left,\n right,\n typeName: ZodFirstPartyTypeKind.ZodIntersection,\n ...processCreateParams(params)\n });\n};\nvar ZodTuple = class _ZodTuple extends ZodType {\n static {\n __name(this, \"ZodTuple\");\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.array) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.array,\n received: ctx.parsedType\n });\n return INVALID;\n }\n if (ctx.data.length < this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\"\n });\n return INVALID;\n }\n const rest = this._def.rest;\n if (!rest && ctx.data.length > this._def.items.length) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: this._def.items.length,\n inclusive: true,\n exact: false,\n type: \"array\"\n });\n status.dirty();\n }\n const items = [...ctx.data].map((item, itemIndex) => {\n const schema = this._def.items[itemIndex] || this._def.rest;\n if (!schema)\n return null;\n return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));\n }).filter((x) => !!x);\n if (ctx.common.async) {\n return Promise.all(items).then((results) => {\n return ParseStatus.mergeArray(status, results);\n });\n } else {\n return ParseStatus.mergeArray(status, items);\n }\n }\n get items() {\n return this._def.items;\n }\n rest(rest) {\n return new _ZodTuple({\n ...this._def,\n rest\n });\n }\n};\nZodTuple.create = (schemas, params) => {\n if (!Array.isArray(schemas)) {\n throw new Error(\"You must pass an array of schemas to z.tuple([ ... ])\");\n }\n return new ZodTuple({\n items: schemas,\n typeName: ZodFirstPartyTypeKind.ZodTuple,\n rest: null,\n ...processCreateParams(params)\n });\n};\nvar ZodRecord = class _ZodRecord extends ZodType {\n static {\n __name(this, \"ZodRecord\");\n }\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.object) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.object,\n received: ctx.parsedType\n });\n return INVALID;\n }\n const pairs = [];\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n for (const key in ctx.data) {\n pairs.push({\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)),\n value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key))\n });\n }\n if (ctx.common.async) {\n return ParseStatus.mergeObjectAsync(status, pairs);\n } else {\n return ParseStatus.mergeObjectSync(status, pairs);\n }\n }\n get element() {\n return this._def.valueType;\n }\n static create(first, second, third) {\n if (second instanceof ZodType) {\n return new _ZodRecord({\n keyType: first,\n valueType: second,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(third)\n });\n }\n return new _ZodRecord({\n keyType: ZodString.create(),\n valueType: first,\n typeName: ZodFirstPartyTypeKind.ZodRecord,\n ...processCreateParams(second)\n });\n }\n};\nvar ZodMap = class extends ZodType {\n static {\n __name(this, \"ZodMap\");\n }\n get keySchema() {\n return this._def.keyType;\n }\n get valueSchema() {\n return this._def.valueType;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.map) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.map,\n received: ctx.parsedType\n });\n return INVALID;\n }\n const keyType = this._def.keyType;\n const valueType = this._def.valueType;\n const pairs = [...ctx.data.entries()].map(([key, value], index) => {\n return {\n key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, \"key\"])),\n value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, \"value\"]))\n };\n });\n if (ctx.common.async) {\n const finalMap = /* @__PURE__ */ new Map();\n return Promise.resolve().then(async () => {\n for (const pair of pairs) {\n const key = await pair.key;\n const value = await pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n });\n } else {\n const finalMap = /* @__PURE__ */ new Map();\n for (const pair of pairs) {\n const key = pair.key;\n const value = pair.value;\n if (key.status === \"aborted\" || value.status === \"aborted\") {\n return INVALID;\n }\n if (key.status === \"dirty\" || value.status === \"dirty\") {\n status.dirty();\n }\n finalMap.set(key.value, value.value);\n }\n return { status: status.value, value: finalMap };\n }\n }\n};\nZodMap.create = (keyType, valueType, params) => {\n return new ZodMap({\n valueType,\n keyType,\n typeName: ZodFirstPartyTypeKind.ZodMap,\n ...processCreateParams(params)\n });\n};\nvar ZodSet = class _ZodSet extends ZodType {\n static {\n __name(this, \"ZodSet\");\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.set) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.set,\n received: ctx.parsedType\n });\n return INVALID;\n }\n const def = this._def;\n if (def.minSize !== null) {\n if (ctx.data.size < def.minSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_small,\n minimum: def.minSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.minSize.message\n });\n status.dirty();\n }\n }\n if (def.maxSize !== null) {\n if (ctx.data.size > def.maxSize.value) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.too_big,\n maximum: def.maxSize.value,\n type: \"set\",\n inclusive: true,\n exact: false,\n message: def.maxSize.message\n });\n status.dirty();\n }\n }\n const valueType = this._def.valueType;\n function finalizeSet(elements2) {\n const parsedSet = /* @__PURE__ */ new Set();\n for (const element of elements2) {\n if (element.status === \"aborted\")\n return INVALID;\n if (element.status === \"dirty\")\n status.dirty();\n parsedSet.add(element.value);\n }\n return { status: status.value, value: parsedSet };\n }\n __name(finalizeSet, \"finalizeSet\");\n const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));\n if (ctx.common.async) {\n return Promise.all(elements).then((elements2) => finalizeSet(elements2));\n } else {\n return finalizeSet(elements);\n }\n }\n min(minSize, message) {\n return new _ZodSet({\n ...this._def,\n minSize: { value: minSize, message: errorUtil.toString(message) }\n });\n }\n max(maxSize, message) {\n return new _ZodSet({\n ...this._def,\n maxSize: { value: maxSize, message: errorUtil.toString(message) }\n });\n }\n size(size, message) {\n return this.min(size, message).max(size, message);\n }\n nonempty(message) {\n return this.min(1, message);\n }\n};\nZodSet.create = (valueType, params) => {\n return new ZodSet({\n valueType,\n minSize: null,\n maxSize: null,\n typeName: ZodFirstPartyTypeKind.ZodSet,\n ...processCreateParams(params)\n });\n};\nvar ZodFunction = class _ZodFunction extends ZodType {\n static {\n __name(this, \"ZodFunction\");\n }\n constructor() {\n super(...arguments);\n this.validate = this.implement;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.function) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.function,\n received: ctx.parsedType\n });\n return INVALID;\n }\n function makeArgsIssue(args, error) {\n return makeIssue({\n data: args,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_arguments,\n argumentsError: error\n }\n });\n }\n __name(makeArgsIssue, \"makeArgsIssue\");\n function makeReturnsIssue(returns, error) {\n return makeIssue({\n data: returns,\n path: ctx.path,\n errorMaps: [\n ctx.common.contextualErrorMap,\n ctx.schemaErrorMap,\n getErrorMap(),\n errorMap\n ].filter((x) => !!x),\n issueData: {\n code: ZodIssueCode.invalid_return_type,\n returnTypeError: error\n }\n });\n }\n __name(makeReturnsIssue, \"makeReturnsIssue\");\n const params = { errorMap: ctx.common.contextualErrorMap };\n const fn = ctx.data;\n if (this._def.returns instanceof ZodPromise) {\n const me = this;\n return OK(async function(...args) {\n const error = new ZodError([]);\n const parsedArgs = await me._def.args.parseAsync(args, params).catch((e2) => {\n error.addIssue(makeArgsIssue(args, e2));\n throw error;\n });\n const result = await Reflect.apply(fn, this, parsedArgs);\n const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e2) => {\n error.addIssue(makeReturnsIssue(result, e2));\n throw error;\n });\n return parsedReturns;\n });\n } else {\n const me = this;\n return OK(function(...args) {\n const parsedArgs = me._def.args.safeParse(args, params);\n if (!parsedArgs.success) {\n throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);\n }\n const result = Reflect.apply(fn, this, parsedArgs.data);\n const parsedReturns = me._def.returns.safeParse(result, params);\n if (!parsedReturns.success) {\n throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);\n }\n return parsedReturns.data;\n });\n }\n }\n parameters() {\n return this._def.args;\n }\n returnType() {\n return this._def.returns;\n }\n args(...items) {\n return new _ZodFunction({\n ...this._def,\n args: ZodTuple.create(items).rest(ZodUnknown.create())\n });\n }\n returns(returnType) {\n return new _ZodFunction({\n ...this._def,\n returns: returnType\n });\n }\n implement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n strictImplement(func) {\n const validatedFunc = this.parse(func);\n return validatedFunc;\n }\n static create(args, returns, params) {\n return new _ZodFunction({\n args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),\n returns: returns || ZodUnknown.create(),\n typeName: ZodFirstPartyTypeKind.ZodFunction,\n ...processCreateParams(params)\n });\n }\n};\nvar ZodLazy = class extends ZodType {\n static {\n __name(this, \"ZodLazy\");\n }\n get schema() {\n return this._def.getter();\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const lazySchema = this._def.getter();\n return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });\n }\n};\nZodLazy.create = (getter, params) => {\n return new ZodLazy({\n getter,\n typeName: ZodFirstPartyTypeKind.ZodLazy,\n ...processCreateParams(params)\n });\n};\nvar ZodLiteral = class extends ZodType {\n static {\n __name(this, \"ZodLiteral\");\n }\n _parse(input) {\n if (input.data !== this._def.value) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_literal,\n expected: this._def.value\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n get value() {\n return this._def.value;\n }\n};\nZodLiteral.create = (value, params) => {\n return new ZodLiteral({\n value,\n typeName: ZodFirstPartyTypeKind.ZodLiteral,\n ...processCreateParams(params)\n });\n};\nfunction createZodEnum(values, params) {\n return new ZodEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodEnum,\n ...processCreateParams(params)\n });\n}\n__name(createZodEnum, \"createZodEnum\");\nvar ZodEnum = class _ZodEnum extends ZodType {\n static {\n __name(this, \"ZodEnum\");\n }\n _parse(input) {\n if (typeof input.data !== \"string\") {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type\n });\n return INVALID;\n }\n if (this._def.values.indexOf(input.data) === -1) {\n const ctx = this._getOrReturnCtx(input);\n const expectedValues = this._def.values;\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get options() {\n return this._def.values;\n }\n get enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Values() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n get Enum() {\n const enumValues = {};\n for (const val of this._def.values) {\n enumValues[val] = val;\n }\n return enumValues;\n }\n extract(values) {\n return _ZodEnum.create(values);\n }\n exclude(values) {\n return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt)));\n }\n};\nZodEnum.create = createZodEnum;\nvar ZodNativeEnum = class extends ZodType {\n static {\n __name(this, \"ZodNativeEnum\");\n }\n _parse(input) {\n const nativeEnumValues = util.getValidEnumValues(this._def.values);\n const ctx = this._getOrReturnCtx(input);\n if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n expected: util.joinValues(expectedValues),\n received: ctx.parsedType,\n code: ZodIssueCode.invalid_type\n });\n return INVALID;\n }\n if (nativeEnumValues.indexOf(input.data) === -1) {\n const expectedValues = util.objectValues(nativeEnumValues);\n addIssueToContext(ctx, {\n received: ctx.data,\n code: ZodIssueCode.invalid_enum_value,\n options: expectedValues\n });\n return INVALID;\n }\n return OK(input.data);\n }\n get enum() {\n return this._def.values;\n }\n};\nZodNativeEnum.create = (values, params) => {\n return new ZodNativeEnum({\n values,\n typeName: ZodFirstPartyTypeKind.ZodNativeEnum,\n ...processCreateParams(params)\n });\n};\nvar ZodPromise = class extends ZodType {\n static {\n __name(this, \"ZodPromise\");\n }\n unwrap() {\n return this._def.type;\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.promise,\n received: ctx.parsedType\n });\n return INVALID;\n }\n const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);\n return OK(promisified.then((data) => {\n return this._def.type.parseAsync(data, {\n path: ctx.path,\n errorMap: ctx.common.contextualErrorMap\n });\n }));\n }\n};\nZodPromise.create = (schema, params) => {\n return new ZodPromise({\n type: schema,\n typeName: ZodFirstPartyTypeKind.ZodPromise,\n ...processCreateParams(params)\n });\n};\nvar ZodEffects = class extends ZodType {\n static {\n __name(this, \"ZodEffects\");\n }\n innerType() {\n return this._def.schema;\n }\n sourceType() {\n return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n const effect = this._def.effect || null;\n const checkCtx = {\n addIssue: /* @__PURE__ */ __name((arg) => {\n addIssueToContext(ctx, arg);\n if (arg.fatal) {\n status.abort();\n } else {\n status.dirty();\n }\n }, \"addIssue\"),\n get path() {\n return ctx.path;\n }\n };\n checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);\n if (effect.type === \"preprocess\") {\n const processed = effect.transform(ctx.data, checkCtx);\n if (ctx.common.issues.length) {\n return {\n status: \"dirty\",\n value: ctx.data\n };\n }\n if (ctx.common.async) {\n return Promise.resolve(processed).then((processed2) => {\n return this._def.schema._parseAsync({\n data: processed2,\n path: ctx.path,\n parent: ctx\n });\n });\n } else {\n return this._def.schema._parseSync({\n data: processed,\n path: ctx.path,\n parent: ctx\n });\n }\n }\n if (effect.type === \"refinement\") {\n const executeRefinement = /* @__PURE__ */ __name((acc) => {\n const result = effect.refinement(acc, checkCtx);\n if (ctx.common.async) {\n return Promise.resolve(result);\n }\n if (result instanceof Promise) {\n throw new Error(\"Async refinement encountered during synchronous parse operation. Use .parseAsync instead.\");\n }\n return acc;\n }, \"executeRefinement\");\n if (ctx.common.async === false) {\n const inner = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n });\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n executeRefinement(inner.value);\n return { status: status.value, value: inner.value };\n } else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {\n if (inner.status === \"aborted\")\n return INVALID;\n if (inner.status === \"dirty\")\n status.dirty();\n return executeRefinement(inner.value).then(() => {\n return { status: status.value, value: inner.value };\n });\n });\n }\n }\n if (effect.type === \"transform\") {\n if (ctx.common.async === false) {\n const base = this._def.schema._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n });\n if (!isValid(base))\n return base;\n const result = effect.transform(base.value, checkCtx);\n if (result instanceof Promise) {\n throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);\n }\n return { status: status.value, value: result };\n } else {\n return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {\n if (!isValid(base))\n return base;\n return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result }));\n });\n }\n }\n util.assertNever(effect);\n }\n};\nZodEffects.create = (schema, effect, params) => {\n return new ZodEffects({\n schema,\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n effect,\n ...processCreateParams(params)\n });\n};\nZodEffects.createWithPreprocess = (preprocess, schema, params) => {\n return new ZodEffects({\n schema,\n effect: { type: \"preprocess\", transform: preprocess },\n typeName: ZodFirstPartyTypeKind.ZodEffects,\n ...processCreateParams(params)\n });\n};\nvar ZodOptional = class extends ZodType {\n static {\n __name(this, \"ZodOptional\");\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.undefined) {\n return OK(void 0);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n};\nZodOptional.create = (type, params) => {\n return new ZodOptional({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodOptional,\n ...processCreateParams(params)\n });\n};\nvar ZodNullable = class extends ZodType {\n static {\n __name(this, \"ZodNullable\");\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType === ZodParsedType.null) {\n return OK(null);\n }\n return this._def.innerType._parse(input);\n }\n unwrap() {\n return this._def.innerType;\n }\n};\nZodNullable.create = (type, params) => {\n return new ZodNullable({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodNullable,\n ...processCreateParams(params)\n });\n};\nvar ZodDefault = class extends ZodType {\n static {\n __name(this, \"ZodDefault\");\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n let data = ctx.data;\n if (ctx.parsedType === ZodParsedType.undefined) {\n data = this._def.defaultValue();\n }\n return this._def.innerType._parse({\n data,\n path: ctx.path,\n parent: ctx\n });\n }\n removeDefault() {\n return this._def.innerType;\n }\n};\nZodDefault.create = (type, params) => {\n return new ZodDefault({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodDefault,\n defaultValue: typeof params.default === \"function\" ? params.default : () => params.default,\n ...processCreateParams(params)\n });\n};\nvar ZodCatch = class extends ZodType {\n static {\n __name(this, \"ZodCatch\");\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const newCtx = {\n ...ctx,\n common: {\n ...ctx.common,\n issues: []\n }\n };\n const result = this._def.innerType._parse({\n data: newCtx.data,\n path: newCtx.path,\n parent: {\n ...newCtx\n }\n });\n if (isAsync(result)) {\n return result.then((result2) => {\n return {\n status: \"valid\",\n value: result2.status === \"valid\" ? result2.value : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data\n })\n };\n });\n } else {\n return {\n status: \"valid\",\n value: result.status === \"valid\" ? result.value : this._def.catchValue({\n get error() {\n return new ZodError(newCtx.common.issues);\n },\n input: newCtx.data\n })\n };\n }\n }\n removeCatch() {\n return this._def.innerType;\n }\n};\nZodCatch.create = (type, params) => {\n return new ZodCatch({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodCatch,\n catchValue: typeof params.catch === \"function\" ? params.catch : () => params.catch,\n ...processCreateParams(params)\n });\n};\nvar ZodNaN = class extends ZodType {\n static {\n __name(this, \"ZodNaN\");\n }\n _parse(input) {\n const parsedType = this._getType(input);\n if (parsedType !== ZodParsedType.nan) {\n const ctx = this._getOrReturnCtx(input);\n addIssueToContext(ctx, {\n code: ZodIssueCode.invalid_type,\n expected: ZodParsedType.nan,\n received: ctx.parsedType\n });\n return INVALID;\n }\n return { status: \"valid\", value: input.data };\n }\n};\nZodNaN.create = (params) => {\n return new ZodNaN({\n typeName: ZodFirstPartyTypeKind.ZodNaN,\n ...processCreateParams(params)\n });\n};\nvar BRAND = Symbol(\"zod_brand\");\nvar ZodBranded = class extends ZodType {\n static {\n __name(this, \"ZodBranded\");\n }\n _parse(input) {\n const { ctx } = this._processInputParams(input);\n const data = ctx.data;\n return this._def.type._parse({\n data,\n path: ctx.path,\n parent: ctx\n });\n }\n unwrap() {\n return this._def.type;\n }\n};\nvar ZodPipeline = class _ZodPipeline extends ZodType {\n static {\n __name(this, \"ZodPipeline\");\n }\n _parse(input) {\n const { status, ctx } = this._processInputParams(input);\n if (ctx.common.async) {\n const handleAsync = /* @__PURE__ */ __name(async () => {\n const inResult = await this._def.in._parseAsync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return DIRTY(inResult.value);\n } else {\n return this._def.out._parseAsync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx\n });\n }\n }, \"handleAsync\");\n return handleAsync();\n } else {\n const inResult = this._def.in._parseSync({\n data: ctx.data,\n path: ctx.path,\n parent: ctx\n });\n if (inResult.status === \"aborted\")\n return INVALID;\n if (inResult.status === \"dirty\") {\n status.dirty();\n return {\n status: \"dirty\",\n value: inResult.value\n };\n } else {\n return this._def.out._parseSync({\n data: inResult.value,\n path: ctx.path,\n parent: ctx\n });\n }\n }\n }\n static create(a, b) {\n return new _ZodPipeline({\n in: a,\n out: b,\n typeName: ZodFirstPartyTypeKind.ZodPipeline\n });\n }\n};\nvar ZodReadonly = class extends ZodType {\n static {\n __name(this, \"ZodReadonly\");\n }\n _parse(input) {\n const result = this._def.innerType._parse(input);\n if (isValid(result)) {\n result.value = Object.freeze(result.value);\n }\n return result;\n }\n};\nZodReadonly.create = (type, params) => {\n return new ZodReadonly({\n innerType: type,\n typeName: ZodFirstPartyTypeKind.ZodReadonly,\n ...processCreateParams(params)\n });\n};\nvar custom = /* @__PURE__ */ __name((check, params = {}, fatal) => {\n if (check)\n return ZodAny.create().superRefine((data, ctx) => {\n var _a, _b;\n if (!check(data)) {\n const p = typeof params === \"function\" ? params(data) : typeof params === \"string\" ? { message: params } : params;\n const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true;\n const p2 = typeof p === \"string\" ? { message: p } : p;\n ctx.addIssue({ code: \"custom\", ...p2, fatal: _fatal });\n }\n });\n return ZodAny.create();\n}, \"custom\");\nvar late = {\n object: ZodObject.lazycreate\n};\nvar ZodFirstPartyTypeKind;\n(function(ZodFirstPartyTypeKind2) {\n ZodFirstPartyTypeKind2[\"ZodString\"] = \"ZodString\";\n ZodFirstPartyTypeKind2[\"ZodNumber\"] = \"ZodNumber\";\n ZodFirstPartyTypeKind2[\"ZodNaN\"] = \"ZodNaN\";\n ZodFirstPartyTypeKind2[\"ZodBigInt\"] = \"ZodBigInt\";\n ZodFirstPartyTypeKind2[\"ZodBoolean\"] = \"ZodBoolean\";\n ZodFirstPartyTypeKind2[\"ZodDate\"] = \"ZodDate\";\n ZodFirstPartyTypeKind2[\"ZodSymbol\"] = \"ZodSymbol\";\n ZodFirstPartyTypeKind2[\"ZodUndefined\"] = \"ZodUndefined\";\n ZodFirstPartyTypeKind2[\"ZodNull\"] = \"ZodNull\";\n ZodFirstPartyTypeKind2[\"ZodAny\"] = \"ZodAny\";\n ZodFirstPartyTypeKind2[\"ZodUnknown\"] = \"ZodUnknown\";\n ZodFirstPartyTypeKind2[\"ZodNever\"] = \"ZodNever\";\n ZodFirstPartyTypeKind2[\"ZodVoid\"] = \"ZodVoid\";\n ZodFirstPartyTypeKind2[\"ZodArray\"] = \"ZodArray\";\n ZodFirstPartyTypeKind2[\"ZodObject\"] = \"ZodObject\";\n ZodFirstPartyTypeKind2[\"ZodUnion\"] = \"ZodUnion\";\n ZodFirstPartyTypeKind2[\"ZodDiscriminatedUnion\"] = \"ZodDiscriminatedUnion\";\n ZodFirstPartyTypeKind2[\"ZodIntersection\"] = \"ZodIntersection\";\n ZodFirstPartyTypeKind2[\"ZodTuple\"] = \"ZodTuple\";\n ZodFirstPartyTypeKind2[\"ZodRecord\"] = \"ZodRecord\";\n ZodFirstPartyTypeKind2[\"ZodMap\"] = \"ZodMap\";\n ZodFirstPartyTypeKind2[\"ZodSet\"] = \"ZodSet\";\n ZodFirstPartyTypeKind2[\"ZodFunction\"] = \"ZodFunction\";\n ZodFirstPartyTypeKind2[\"ZodLazy\"] = \"ZodLazy\";\n ZodFirstPartyTypeKind2[\"ZodLiteral\"] = \"ZodLiteral\";\n ZodFirstPartyTypeKind2[\"ZodEnum\"] = \"ZodEnum\";\n ZodFirstPartyTypeKind2[\"ZodEffects\"] = \"ZodEffects\";\n ZodFirstPartyTypeKind2[\"ZodNativeEnum\"] = \"ZodNativeEnum\";\n ZodFirstPartyTypeKind2[\"ZodOptional\"] = \"ZodOptional\";\n ZodFirstPartyTypeKind2[\"ZodNullable\"] = \"ZodNullable\";\n ZodFirstPartyTypeKind2[\"ZodDefault\"] = \"ZodDefault\";\n ZodFirstPartyTypeKind2[\"ZodCatch\"] = \"ZodCatch\";\n ZodFirstPartyTypeKind2[\"ZodPromise\"] = \"ZodPromise\";\n ZodFirstPartyTypeKind2[\"ZodBranded\"] = \"ZodBranded\";\n ZodFirstPartyTypeKind2[\"ZodPipeline\"] = \"ZodPipeline\";\n ZodFirstPartyTypeKind2[\"ZodReadonly\"] = \"ZodReadonly\";\n})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));\nvar instanceOfType = /* @__PURE__ */ __name((cls, params = {\n message: `Input not instance of ${cls.name}`\n}) => custom((data) => data instanceof cls, params), \"instanceOfType\");\nvar stringType = ZodString.create;\nvar numberType = ZodNumber.create;\nvar nanType = ZodNaN.create;\nvar bigIntType = ZodBigInt.create;\nvar booleanType = ZodBoolean.create;\nvar dateType = ZodDate.create;\nvar symbolType = ZodSymbol.create;\nvar undefinedType = ZodUndefined.create;\nvar nullType = ZodNull.create;\nvar anyType = ZodAny.create;\nvar unknownType = ZodUnknown.create;\nvar neverType = ZodNever.create;\nvar voidType = ZodVoid.create;\nvar arrayType = ZodArray.create;\nvar objectType = ZodObject.create;\nvar strictObjectType = ZodObject.strictCreate;\nvar unionType = ZodUnion.create;\nvar discriminatedUnionType = ZodDiscriminatedUnion.create;\nvar intersectionType = ZodIntersection.create;\nvar tupleType = ZodTuple.create;\nvar recordType = ZodRecord.create;\nvar mapType = ZodMap.create;\nvar setType = ZodSet.create;\nvar functionType = ZodFunction.create;\nvar lazyType = ZodLazy.create;\nvar literalType = ZodLiteral.create;\nvar enumType = ZodEnum.create;\nvar nativeEnumType = ZodNativeEnum.create;\nvar promiseType = ZodPromise.create;\nvar effectsType = ZodEffects.create;\nvar optionalType = ZodOptional.create;\nvar nullableType = ZodNullable.create;\nvar preprocessType = ZodEffects.createWithPreprocess;\nvar pipelineType = ZodPipeline.create;\nvar ostring = /* @__PURE__ */ __name(() => stringType().optional(), \"ostring\");\nvar onumber = /* @__PURE__ */ __name(() => numberType().optional(), \"onumber\");\nvar oboolean = /* @__PURE__ */ __name(() => booleanType().optional(), \"oboolean\");\nvar coerce = {\n string: /* @__PURE__ */ __name((arg) => ZodString.create({ ...arg, coerce: true }), \"string\"),\n number: /* @__PURE__ */ __name((arg) => ZodNumber.create({ ...arg, coerce: true }), \"number\"),\n boolean: /* @__PURE__ */ __name((arg) => ZodBoolean.create({\n ...arg,\n coerce: true\n }), \"boolean\"),\n bigint: /* @__PURE__ */ __name((arg) => ZodBigInt.create({ ...arg, coerce: true }), \"bigint\"),\n date: /* @__PURE__ */ __name((arg) => ZodDate.create({ ...arg, coerce: true }), \"date\")\n};\nvar NEVER = INVALID;\nvar z = /* @__PURE__ */ Object.freeze({\n __proto__: null,\n defaultErrorMap: errorMap,\n setErrorMap,\n getErrorMap,\n makeIssue,\n EMPTY_PATH,\n addIssueToContext,\n ParseStatus,\n INVALID,\n DIRTY,\n OK,\n isAborted,\n isDirty,\n isValid,\n isAsync,\n get util() {\n return util;\n },\n get objectUtil() {\n return objectUtil;\n },\n ZodParsedType,\n getParsedType,\n ZodType,\n ZodString,\n ZodNumber,\n ZodBigInt,\n ZodBoolean,\n ZodDate,\n ZodSymbol,\n ZodUndefined,\n ZodNull,\n ZodAny,\n ZodUnknown,\n ZodNever,\n ZodVoid,\n ZodArray,\n ZodObject,\n ZodUnion,\n ZodDiscriminatedUnion,\n ZodIntersection,\n ZodTuple,\n ZodRecord,\n ZodMap,\n ZodSet,\n ZodFunction,\n ZodLazy,\n ZodLiteral,\n ZodEnum,\n ZodNativeEnum,\n ZodPromise,\n ZodEffects,\n ZodTransformer: ZodEffects,\n ZodOptional,\n ZodNullable,\n ZodDefault,\n ZodCatch,\n ZodNaN,\n BRAND,\n ZodBranded,\n ZodPipeline,\n ZodReadonly,\n custom,\n Schema: ZodType,\n ZodSchema: ZodType,\n late,\n get ZodFirstPartyTypeKind() {\n return ZodFirstPartyTypeKind;\n },\n coerce,\n any: anyType,\n array: arrayType,\n bigint: bigIntType,\n boolean: booleanType,\n date: dateType,\n discriminatedUnion: discriminatedUnionType,\n effect: effectsType,\n \"enum\": enumType,\n \"function\": functionType,\n \"instanceof\": instanceOfType,\n intersection: intersectionType,\n lazy: lazyType,\n literal: literalType,\n map: mapType,\n nan: nanType,\n nativeEnum: nativeEnumType,\n never: neverType,\n \"null\": nullType,\n nullable: nullableType,\n number: numberType,\n object: objectType,\n oboolean,\n onumber,\n optional: optionalType,\n ostring,\n pipeline: pipelineType,\n preprocess: preprocessType,\n promise: promiseType,\n record: recordType,\n set: setType,\n strictObject: strictObjectType,\n string: stringType,\n symbol: symbolType,\n transformer: effectsType,\n tuple: tupleType,\n \"undefined\": undefinedType,\n union: unionType,\n unknown: unknownType,\n \"void\": voidType,\n NEVER,\n ZodIssueCode,\n quotelessJson,\n ZodError\n});\n\n// ../workflows-shared/src/lib/validators.ts\nvar MAX_WORKFLOW_NAME_LENGTH = 64;\nvar ALLOWED_STRING_ID_PATTERN = \"^[a-zA-Z0-9_][a-zA-Z0-9-_]*$\";\nvar ALLOWED_WORKFLOW_INSTANCE_ID_REGEX = new RegExp(\n ALLOWED_STRING_ID_PATTERN\n);\nvar ALLOWED_WORKFLOW_NAME_REGEX = ALLOWED_WORKFLOW_INSTANCE_ID_REGEX;\nfunction isValidWorkflowName(name) {\n if (typeof name !== \"string\") {\n return false;\n }\n if (name.length > MAX_WORKFLOW_NAME_LENGTH) {\n return false;\n }\n return ALLOWED_WORKFLOW_NAME_REGEX.test(name);\n}\n__name(isValidWorkflowName, \"isValidWorkflowName\");\nz.object({\n retries: z.object({\n delay: z.number().gte(0).or(z.string()),\n limit: z.number().gte(0),\n backoff: z.enum([\"constant\", \"linear\", \"exponential\"]).optional()\n }).strict().optional(),\n timeout: z.number().gte(0).or(z.string()).optional()\n}).strict();\n\n// ../../node_modules/.pnpm/xdg-app-paths@8.3.0/node_modules/xdg-app-paths/dist/cjs/esm-wrapper/mod.esm.js\nvar mod_esm_exports = {};\n__export(mod_esm_exports, {\n default: () => mod_esm_default\n});\nvar import_mod_cjs = __toESM(require_mod_cjs3(), 1);\n__reExport(mod_esm_exports, __toESM(require_mod_cjs3(), 1));\nvar mod_esm_default = import_mod_cjs.default;\n\n// src/global-wrangler-config-path.ts\nfunction getGlobalWranglerConfigPath() {\n const configDir = mod_esm_default(\".wrangler\").config();\n const legacyConfigDir = path3.join(os.homedir(), \".wrangler\");\n if (isDirectory(legacyConfigDir)) {\n return legacyConfigDir;\n } else {\n return configDir;\n }\n}\n__name(getGlobalWranglerConfigPath, \"getGlobalWranglerConfigPath\");\n\n// src/environment-variables/factory.ts\nfunction getBooleanEnvironmentVariableFactory(options) {\n return () => {\n if (!(options.variableName in process.env) || process.env[options.variableName] === void 0) {\n return typeof options.defaultValue === \"function\" ? options.defaultValue() : options.defaultValue;\n }\n switch (process.env[options.variableName]?.toLowerCase()) {\n case \"true\":\n return true;\n case \"false\":\n return false;\n default:\n throw new UserError(\n `Expected ${options.variableName} to be \"true\" or \"false\", but got ${JSON.stringify(\n process.env[options.variableName]\n )}`\n );\n }\n };\n}\n__name(getBooleanEnvironmentVariableFactory, \"getBooleanEnvironmentVariableFactory\");\nfunction getEnvironmentVariableFactory({\n variableName,\n deprecatedName,\n choices,\n defaultValue\n}) {\n let hasWarned = false;\n return () => {\n if (variableName in process.env) {\n return getProcessEnv(variableName, choices);\n }\n if (deprecatedName && deprecatedName in process.env) {\n if (!hasWarned) {\n hasWarned = true;\n console.warn(\n `Using \"${deprecatedName}\" environment variable. This is deprecated. Please use \"${variableName}\", instead.`\n );\n }\n return getProcessEnv(deprecatedName, choices);\n }\n return defaultValue?.();\n };\n}\n__name(getEnvironmentVariableFactory, \"getEnvironmentVariableFactory\");\nfunction getProcessEnv(variableName, choices) {\n assertOneOf(choices, process.env[variableName]);\n return process.env[variableName];\n}\n__name(getProcessEnv, \"getProcessEnv\");\nfunction assertOneOf(choices, value) {\n if (Array.isArray(choices) && !choices.includes(value)) {\n throw new UserError(\n `Expected ${JSON.stringify(value)} to be one of ${JSON.stringify(choices)}`\n );\n }\n}\n__name(assertOneOf, \"assertOneOf\");\n\n// src/environment-variables/misc-variables.ts\nvar getC3CommandFromEnv = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_C3_COMMAND\",\n defaultValue: /* @__PURE__ */ __name(() => \"create cloudflare\", \"defaultValue\")\n});\nvar getWranglerSendMetricsFromEnv = getBooleanEnvironmentVariableFactory({\n variableName: \"WRANGLER_SEND_METRICS\"\n});\nvar getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({\n variableName: \"WRANGLER_SEND_ERROR_REPORTS\"\n});\nvar getCloudflareApiEnvironmentFromEnv = getEnvironmentVariableFactory(\n {\n variableName: \"WRANGLER_API_ENVIRONMENT\",\n defaultValue: /* @__PURE__ */ __name(() => \"production\", \"defaultValue\"),\n choices: [\"production\", \"staging\"]\n }\n);\nvar COMPLIANCE_REGION_CONFIG_PUBLIC = {\n compliance_region: \"public\"\n};\nvar COMPLIANCE_REGION_CONFIG_UNKNOWN = {\n compliance_region: void 0\n};\nvar getCloudflareComplianceRegionFromEnv = getEnvironmentVariableFactory({\n variableName: \"CLOUDFLARE_COMPLIANCE_REGION\",\n choices: [\"public\", \"fedramp_high\"]\n});\nvar getCloudflareComplianceRegion = /* @__PURE__ */ __name((complianceConfig) => {\n const complianceRegionFromEnv = getCloudflareComplianceRegionFromEnv();\n if (complianceRegionFromEnv !== void 0 && complianceConfig?.compliance_region !== void 0 && complianceRegionFromEnv !== complianceConfig.compliance_region) {\n throw new UserError(dedent`\n\t\t\tThe compliance region has been set to different values in two places:\n\t\t\t - \\`CLOUDFLARE_COMPLIANCE_REGION\\` environment variable: \\`${complianceRegionFromEnv}\\`\n\t\t\t - \\`compliance_region\\` configuration property: \\`${complianceConfig.compliance_region}\\`\n\t\t\t`);\n }\n return complianceRegionFromEnv || complianceConfig?.compliance_region || \"public\";\n}, \"getCloudflareComplianceRegion\");\nvar getCloudflareApiBaseUrlFromEnv = getEnvironmentVariableFactory({\n variableName: \"CLOUDFLARE_API_BASE_URL\",\n deprecatedName: \"CF_API_BASE_URL\"\n});\nvar getCloudflareApiBaseUrl = /* @__PURE__ */ __name((complianceConfig) => getCloudflareApiBaseUrlFromEnv() ?? `https://api${getComplianceRegionSubdomain(complianceConfig)}${getStagingSubdomain()}.cloudflare.com/client/v4`, \"getCloudflareApiBaseUrl\");\nfunction getComplianceRegionSubdomain(complianceConfig) {\n return getCloudflareComplianceRegion(complianceConfig) === \"fedramp_high\" ? \".fed\" : \"\";\n}\n__name(getComplianceRegionSubdomain, \"getComplianceRegionSubdomain\");\nfunction getStagingSubdomain() {\n return getCloudflareApiEnvironmentFromEnv() === \"staging\" ? \".staging\" : \"\";\n}\n__name(getStagingSubdomain, \"getStagingSubdomain\");\nvar getSanitizeLogs = getBooleanEnvironmentVariableFactory({\n variableName: \"WRANGLER_LOG_SANITIZE\",\n defaultValue: true\n});\nvar getOutputFileDirectoryFromEnv = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_OUTPUT_FILE_DIRECTORY\"\n});\nvar getOutputFilePathFromEnv = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_OUTPUT_FILE_PATH\"\n});\nvar getCIMatchTag = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_CI_MATCH_TAG\"\n});\nvar getCIOverrideName = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_CI_OVERRIDE_NAME\"\n});\nvar getCIOverrideNetworkModeHost = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_CI_OVERRIDE_NETWORK_MODE_HOST\"\n});\nvar getCIGeneratePreviewAlias = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_CI_GENERATE_PREVIEW_ALIAS\",\n defaultValue: /* @__PURE__ */ __name(() => \"false\", \"defaultValue\"),\n choices: [\"true\", \"false\"]\n});\nvar getWorkersCIBranchName = getEnvironmentVariableFactory({\n variableName: \"WORKERS_CI_BRANCH\"\n});\nvar getBuildConditionsFromEnv = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_BUILD_CONDITIONS\"\n});\nvar getBuildPlatformFromEnv = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_BUILD_PLATFORM\"\n});\nvar getRegistryPath = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_REGISTRY_PATH\",\n defaultValue() {\n return path3.join(getGlobalWranglerConfigPath(), \"registry\");\n }\n});\nvar getD1ExtraLocationChoices = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_D1_EXTRA_LOCATION_CHOICES\"\n});\nvar getDockerPath = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_DOCKER_BIN\",\n defaultValue() {\n return \"docker\";\n }\n});\nvar getSubdomainMixedStateCheckDisabled = getBooleanEnvironmentVariableFactory({\n variableName: \"WRANGLER_DISABLE_SUBDOMAIN_MIXED_STATE_CHECK\",\n defaultValue: false\n});\nvar getCloudflareLoadDevVarsFromDotEnv = getBooleanEnvironmentVariableFactory({\n variableName: \"CLOUDFLARE_LOAD_DEV_VARS_FROM_DOT_ENV\",\n defaultValue: true\n});\nvar getCloudflareIncludeProcessEnvFromEnv = getBooleanEnvironmentVariableFactory({\n variableName: \"CLOUDFLARE_INCLUDE_PROCESS_ENV\",\n defaultValue: false\n});\nvar getTraceHeader = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_TRACE_ID\"\n});\nvar getDisableConfigWatching = getBooleanEnvironmentVariableFactory({\n variableName: \"WRANGLER_CI_DISABLE_CONFIG_WATCHING\",\n defaultValue: false\n});\nvar getWranglerHideBanner = getBooleanEnvironmentVariableFactory({\n variableName: \"WRANGLER_HIDE_BANNER\",\n defaultValue: false\n});\nvar getCloudflareEnv = getEnvironmentVariableFactory({\n variableName: \"CLOUDFLARE_ENV\"\n});\nvar getOpenNextDeployFromEnv = getEnvironmentVariableFactory({\n variableName: \"OPEN_NEXT_DEPLOY\"\n});\nvar getLocalExplorerEnabledFromEnv = getBooleanEnvironmentVariableFactory({\n variableName: \"X_LOCAL_EXPLORER\",\n defaultValue: true\n});\nvar getBrowserRenderingHeadfulFromEnv = getBooleanEnvironmentVariableFactory({\n variableName: \"X_BROWSER_HEADFUL\",\n defaultValue: false\n});\nvar getCfFetchEnabledFromEnv = getBooleanEnvironmentVariableFactory({\n variableName: \"CLOUDFLARE_CF_FETCH_ENABLED\",\n defaultValue: true\n});\nvar getCfFetchPathFromEnv = getEnvironmentVariableFactory({\n variableName: \"CLOUDFLARE_CF_FETCH_PATH\"\n});\nvar getWranglerCacheDirFromEnv = getEnvironmentVariableFactory({\n variableName: \"WRANGLER_CACHE_DIR\"\n});\nvar getCloudflaredPathFromEnv = getEnvironmentVariableFactory({\n variableName: \"CLOUDFLARED_PATH\"\n});\n\n// src/config/diagnostics.ts\nvar Diagnostics = class {\n /**\n * Create a new Diagnostics object.\n * @param description A general description of this collection of messages.\n */\n constructor(description) {\n this.description = description;\n }\n static {\n __name(this, \"Diagnostics\");\n }\n errors = [];\n warnings = [];\n children = [];\n /** Set to true when an unexpected/unknown field is encountered during validation. */\n hasUnexpectedFields = false;\n /**\n * Merge the given `diagnostics` into this as a child.\n */\n addChild(diagnostics) {\n if (diagnostics.hasErrors() || diagnostics.hasWarnings()) {\n this.children.push(diagnostics);\n }\n }\n /** Does this or any of its children have errors. */\n hasErrors() {\n if (this.errors.length > 0) {\n return true;\n } else {\n return this.children.some((child) => child.hasErrors());\n }\n }\n /** Does this or any of its children have unexpected fields. */\n hasUnexpectedFieldsInTree() {\n if (this.hasUnexpectedFields) {\n return true;\n } else {\n return this.children.some((child) => child.hasUnexpectedFieldsInTree());\n }\n }\n /** Render the errors of this and all its children. */\n renderErrors() {\n return this.render(\"errors\");\n }\n /** Does this or any of its children have warnings. */\n hasWarnings() {\n if (this.warnings.length > 0) {\n return true;\n } else {\n return this.children.some((child) => child.hasWarnings());\n }\n }\n /** Render the warnings of this and all its children. */\n renderWarnings() {\n return this.render(\"warnings\");\n }\n render(field) {\n const hasMethod = field === \"errors\" ? \"hasErrors\" : \"hasWarnings\";\n return indentText(\n `${this.description}\n` + // Output all the fields (errors or warnings) at this level\n this[field].map((message) => `- ${indentText(message)}`).join(\"\\n\") + // Output all the child diagnostics at the next level\n this.children.map(\n (child) => child[hasMethod]() ? \"\\n- \" + child.render(field) : \"\"\n ).filter((output) => output !== \"\").join(\"\\n\")\n );\n }\n};\nfunction indentText(str) {\n return str.split(\"\\n\").map(\n (line, index) => (index === 0 ? line : ` ${line}`).replace(/^\\s*$/, \"\")\n ).join(\"\\n\");\n}\n__name(indentText, \"indentText\");\n\n// src/config/validation-helpers.ts\nfunction deprecated(diagnostics, config, fieldPath, message, remove, title = \"Deprecation\", type = \"warning\") {\n const BOLD = \"\\x1B[1m\";\n const NORMAL = \"\\x1B[0m\";\n const diagnosticMessage = `${BOLD}${title}${NORMAL}: \"${fieldPath}\":\n${message}`;\n const result = unwindPropertyPath(config, fieldPath);\n if (result !== void 0 && result.field in result.container) {\n diagnostics[`${type}s`].push(diagnosticMessage);\n if (remove) {\n delete result.container[result.field];\n }\n }\n}\n__name(deprecated, \"deprecated\");\nfunction experimental(diagnostics, config, fieldPath) {\n const result = unwindPropertyPath(config, fieldPath);\n if (result !== void 0 && result.field in result.container && !(\"WRANGLER_DISABLE_EXPERIMENTAL_WARNING\" in process.env)) {\n diagnostics.warnings.push(\n `\"${fieldPath}\" fields are experimental and may change or break at any time.`\n );\n }\n}\n__name(experimental, \"experimental\");\nfunction inheritable(diagnostics, topLevelEnv, rawEnv, field, validate, defaultValue, transformFn = (v) => v) {\n validate(diagnostics, field, rawEnv[field], topLevelEnv);\n return (\n // `rawEnv === topLevelEnv` is a special case where the user has provided an environment name\n // but that named environment is not actually defined in the configuration.\n // In that case we have reused the topLevelEnv as the rawEnv,\n // and so we need to process the `transformFn()` anyway rather than just using the field in the `rawEnv`.\n (rawEnv !== topLevelEnv ? rawEnv[field] : void 0) ?? transformFn(topLevelEnv?.[field]) ?? defaultValue\n );\n}\n__name(inheritable, \"inheritable\");\nfunction inheritableInWranglerEnvironments(diagnostics, useServiceEnvironments, topLevelEnv, rawEnv, field, validate, transformFn = (v) => v, defaultValue) {\n const usingServiceEnvironments = useServiceEnvironments && topLevelEnv !== void 0;\n return usingServiceEnvironments ? notAllowedInNamedServiceEnvironment(\n diagnostics,\n topLevelEnv,\n rawEnv,\n field\n ) : inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n field,\n validate,\n defaultValue,\n transformFn\n );\n}\n__name(inheritableInWranglerEnvironments, \"inheritableInWranglerEnvironments\");\nvar appendEnvName = /* @__PURE__ */ __name((envName) => (fieldValue) => fieldValue ? `${fieldValue}-${envName}` : void 0, \"appendEnvName\");\nfunction notAllowedInNamedServiceEnvironment(diagnostics, topLevelEnv, rawEnv, field) {\n if (field in rawEnv) {\n diagnostics.errors.push(\n `The \"${field}\" field is not allowed in named service environments.\nPlease remove the field from this environment.`\n );\n }\n return topLevelEnv[field];\n}\n__name(notAllowedInNamedServiceEnvironment, \"notAllowedInNamedServiceEnvironment\");\nfunction notInheritable(diagnostics, topLevelEnv, rawConfig, rawEnv, envName, field, validate, defaultValue) {\n if (rawEnv[field] !== void 0) {\n validate(diagnostics, field, rawEnv[field], topLevelEnv);\n } else {\n if (rawConfig?.[field] !== void 0) {\n diagnostics.warnings.push(\n `\"${field}\" exists at the top level, but not on \"env.${envName}\".\nThis is not what you probably want, since \"${field}\" is not inherited by environments.\nPlease add \"${field}\" to \"env.${envName}\".`\n );\n }\n }\n return rawEnv[field] ?? defaultValue;\n}\n__name(notInheritable, \"notInheritable\");\nfunction unwindPropertyPath(root, path4) {\n let container = root;\n const parts = path4.split(\".\");\n for (let i = 0; i < parts.length - 1; i++) {\n if (!hasProperty(container, parts[i])) {\n return;\n }\n container = container[parts[i]];\n }\n return { container, field: parts[parts.length - 1] };\n}\n__name(unwindPropertyPath, \"unwindPropertyPath\");\nvar isString = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (value !== void 0 && typeof value !== \"string\") {\n diagnostics.errors.push(\n `Expected \"${field}\" to be of type string but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n return true;\n}, \"isString\");\nvar isValidName = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value === \"string\" && /^$|^[a-z0-9_][a-z0-9-_]*$/.test(value) || value === void 0) {\n return true;\n } else {\n diagnostics.errors.push(\n `Expected \"${field}\" to be of type string, alphanumeric and lowercase with dashes only but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n}, \"isValidName\");\nvar isValidDateTimeStringFormat = /* @__PURE__ */ __name((diagnostics, field, value) => {\n let isValid2 = true;\n if (value.includes(\"\\u2013\") || // en-dash\n value.includes(\"\\u2014\")) {\n diagnostics.errors.push(\n `\"${field}\" field should use ISO-8601 accepted hyphens (-) rather than en-dashes (\\u2013) or em-dashes (\\u2014).`\n );\n isValid2 = false;\n }\n const data = new Date(value.replaceAll(/–|—/g, \"-\"));\n if (isNaN(data.getTime())) {\n diagnostics.errors.push(\n `\"${field}\" field should be a valid ISO-8601 date (YYYY-MM-DD), but got ${JSON.stringify(value)}.`\n );\n isValid2 = false;\n }\n return isValid2;\n}, \"isValidDateTimeStringFormat\");\nvar isStringArray = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (value !== void 0 && (!Array.isArray(value) || value.some((item) => typeof item !== \"string\"))) {\n diagnostics.errors.push(\n `Expected \"${field}\" to be of type string array but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n return true;\n}, \"isStringArray\");\nvar isOneOf = /* @__PURE__ */ __name((...choices) => (diagnostics, field, value) => {\n if (value !== void 0 && !choices.some((choice) => value === choice)) {\n diagnostics.errors.push(\n `Expected \"${field}\" field to be one of ${JSON.stringify(\n choices\n )} but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n return true;\n}, \"isOneOf\");\nvar all = /* @__PURE__ */ __name((...validations) => {\n return (diagnostics, field, value, config) => {\n let passedValidations = true;\n for (const validate of validations) {\n if (!validate(diagnostics, field, value, config)) {\n passedValidations = false;\n }\n }\n return passedValidations;\n };\n}, \"all\");\nvar isMutuallyExclusiveWith = /* @__PURE__ */ __name((container, ...fields) => {\n return (diagnostics, field, value) => {\n if (value === void 0) {\n return true;\n }\n for (const exclusiveWith of fields) {\n if (container[exclusiveWith] !== void 0) {\n diagnostics.errors.push(\n `Expected exactly one of the following fields ${JSON.stringify([\n field,\n ...fields\n ])}.`\n );\n return false;\n }\n }\n return true;\n };\n}, \"isMutuallyExclusiveWith\");\nvar isBoolean = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (value !== void 0 && typeof value !== \"boolean\") {\n diagnostics.errors.push(\n `Expected \"${field}\" to be of type boolean but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n return true;\n}, \"isBoolean\");\nvar validateRequiredProperty = /* @__PURE__ */ __name((diagnostics, container, key, value, type, choices) => {\n if (container) {\n container += \".\";\n }\n if (value === void 0) {\n diagnostics.errors.push(`\"${container}${key}\" is a required field.`);\n return false;\n } else if (typeof value !== type) {\n diagnostics.errors.push(\n `Expected \"${container}${key}\" to be of type ${type} but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n } else if (choices) {\n if (!isOneOf(...choices)(diagnostics, `${container}${key}`, value, void 0)) {\n return false;\n }\n }\n return true;\n}, \"validateRequiredProperty\");\nvar validateAtLeastOnePropertyRequired = /* @__PURE__ */ __name((diagnostics, container, properties) => {\n const containerPath = container ? `${container}.` : \"\";\n if (properties.every((property) => property.value === void 0)) {\n diagnostics.errors.push(\n `${properties.map(({ key }) => `\"${containerPath}${key}\"`).join(\" or \")} is required.`\n );\n return false;\n }\n const errors = [];\n for (const prop of properties) {\n if (typeof prop.value === prop.type) {\n return true;\n }\n errors.push(\n `Expected \"${containerPath}${prop.key}\" to be of type ${prop.type} but got ${JSON.stringify(\n prop.value\n )}.`\n );\n }\n diagnostics.errors.push(...errors);\n return false;\n}, \"validateAtLeastOnePropertyRequired\");\nvar validateOptionalProperty = /* @__PURE__ */ __name((diagnostics, container, key, value, type, choices) => {\n if (value !== void 0) {\n return validateRequiredProperty(\n diagnostics,\n container,\n key,\n value,\n type,\n choices\n );\n }\n return true;\n}, \"validateOptionalProperty\");\nvar validateTypedArray = /* @__PURE__ */ __name((diagnostics, container, value, type) => {\n let isValid2 = true;\n if (!Array.isArray(value)) {\n diagnostics.errors.push(\n `Expected \"${container}\" to be an array of ${type}s but got ${JSON.stringify(\n value\n )}`\n );\n isValid2 = false;\n } else {\n for (let i = 0; i < value.length; i++) {\n isValid2 = validateRequiredProperty(\n diagnostics,\n container,\n `[${i}]`,\n value[i],\n type\n ) && isValid2;\n }\n }\n return isValid2;\n}, \"validateTypedArray\");\nvar validateOptionalTypedArray = /* @__PURE__ */ __name((diagnostics, container, value, type) => {\n if (value !== void 0) {\n return validateTypedArray(diagnostics, container, value, type);\n }\n return true;\n}, \"validateOptionalTypedArray\");\nvar isRequiredProperty = /* @__PURE__ */ __name((target, property, type, choices) => hasProperty(target, property) && typeof target[property] === type && (choices === void 0 || choices.includes(target[property])), \"isRequiredProperty\");\nvar isOptionalProperty = /* @__PURE__ */ __name((target, property, type) => !hasProperty(target, property) || typeof target[property] === type, \"isOptionalProperty\");\nvar hasProperty = /* @__PURE__ */ __name((target, property) => property in target, \"hasProperty\");\nvar validateAdditionalProperties = /* @__PURE__ */ __name((diagnostics, fieldPath, restProps, knownProps) => {\n const restPropSet = new Set(restProps);\n for (const knownProp of knownProps) {\n restPropSet.delete(knownProp);\n }\n if (restPropSet.size > 0) {\n const fields = Array.from(restPropSet.keys()).map((field) => `\"${field}\"`);\n diagnostics.warnings.push(\n `Unexpected fields found in ${fieldPath} field: ${fields}`\n );\n diagnostics.hasUnexpectedFields = true;\n return false;\n }\n return true;\n}, \"validateAdditionalProperties\");\nvar getBindingNames = /* @__PURE__ */ __name((value) => {\n if (typeof value !== \"object\" || value === null) {\n return [];\n }\n if (isBindingList(value)) {\n return value.bindings.map(({ name }) => name);\n } else if (isNamespaceList(value)) {\n return value.map(({ binding }) => binding);\n } else if (isRecord(value)) {\n if (value[\"binding\"] !== void 0) {\n return [value[\"binding\"]];\n }\n return Object.keys(value).filter((k) => value[k] !== void 0);\n } else {\n return [];\n }\n}, \"getBindingNames\");\nvar isBindingList = /* @__PURE__ */ __name((value) => isRecord(value) && \"bindings\" in value && Array.isArray(value.bindings) && value.bindings.every(\n (binding) => isRecord(binding) && \"name\" in binding && typeof binding.name === \"string\"\n), \"isBindingList\");\nvar isNamespaceList = /* @__PURE__ */ __name((value) => Array.isArray(value) && value.every(\n (entry) => isRecord(entry) && \"binding\" in entry && typeof entry.binding === \"string\"\n), \"isNamespaceList\");\nvar isRecord = /* @__PURE__ */ __name((value) => typeof value === \"object\" && value !== null && !Array.isArray(value), \"isRecord\");\nvar validateUniqueNameProperty = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (Array.isArray(value)) {\n const nameCount = /* @__PURE__ */ new Map();\n Object.entries(value).forEach(([_2, entry]) => {\n nameCount.set(entry.name, (nameCount.get(entry.name) ?? 0) + 1);\n });\n const duplicates = Array.from(nameCount.entries()).filter(([_2, count]) => count > 1).map(([name]) => name);\n if (duplicates.length > 0) {\n const list = duplicates.join('\", \"');\n diagnostics.errors.push(\n `\"${field}\" bindings must have unique \"name\" values; duplicate(s) found: \"${list}\"`\n );\n return false;\n }\n }\n return true;\n}, \"validateUniqueNameProperty\");\n\n// src/config/validation.ts\nfunction isValidR2BucketName(name) {\n return typeof name === \"string\" && /^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$/.test(name);\n}\n__name(isValidR2BucketName, \"isValidR2BucketName\");\nvar bucketFormatMessage = `Bucket names must begin and end with an alphanumeric character, only contain lowercase letters, numbers, and hyphens, and be between 3 and 63 characters long.`;\nvar friendlyBindingNames = {\n data_blobs: \"Data Blob\",\n durable_objects: \"Durable Object\",\n kv_namespaces: \"KV Namespace\",\n send_email: \"Send Email\",\n queues: \"Queue\",\n d1_databases: \"D1 Database\",\n vectorize: \"Vectorize Index\",\n ai_search_namespaces: \"AI Search Namespace\",\n ai_search: \"AI Search Instance\",\n hyperdrive: \"Hyperdrive Config\",\n r2_buckets: \"R2 Bucket\",\n logfwdr: \"logfwdr\",\n services: \"Worker\",\n analytics_engine_datasets: \"Analytics Engine Dataset\",\n text_blobs: \"Text Blob\",\n browser: \"Browser\",\n ai: \"AI\",\n images: \"Images\",\n stream: \"Stream\",\n media: \"Media\",\n version_metadata: \"Worker Version Metadata\",\n unsafe: \"Unsafe Metadata\",\n vars: \"Environment Variable\",\n wasm_modules: \"Wasm Module\",\n dispatch_namespaces: \"Dispatch Namespace\",\n mtls_certificates: \"mTLS Certificate\",\n workflows: \"Workflow\",\n pipelines: \"Pipeline\",\n secrets_store_secrets: \"Secrets Store Secret\",\n ratelimits: \"Rate Limit\",\n assets: \"Assets\",\n unsafe_hello_world: \"Hello World\",\n worker_loaders: \"Worker Loader\",\n vpc_services: \"VPC Service\",\n vpc_networks: \"VPC Network\"\n};\nvar bindingTypeFriendlyNames = {\n // The 3 binding types below are all rendered as \"Environment Variable\" to preserve existing behaviour (friendlyBindingNames.vars)\n plain_text: \"Environment Variable\",\n secret_text: \"Environment Variable\",\n json: \"Environment Variable\",\n kv_namespace: \"KV Namespace\",\n send_email: \"Send Email\",\n wasm_module: \"Wasm Module\",\n text_blob: \"Text Blob\",\n browser: \"Browser\",\n ai: \"AI\",\n images: \"Images\",\n stream: \"Stream\",\n version_metadata: \"Worker Version Metadata\",\n data_blob: \"Data Blob\",\n durable_object_namespace: \"Durable Object\",\n workflow: \"Workflow\",\n queue: \"Queue\",\n r2_bucket: \"R2 Bucket\",\n d1: \"D1 Database\",\n vectorize: \"Vectorize Index\",\n ai_search_namespace: \"AI Search Namespace\",\n ai_search: \"AI Search Instance\",\n hyperdrive: \"Hyperdrive Config\",\n service: \"Worker\",\n fetcher: \"Service Binding\",\n analytics_engine: \"Analytics Engine Dataset\",\n dispatch_namespace: \"Dispatch Namespace\",\n mtls_certificate: \"mTLS Certificate\",\n pipeline: \"Pipeline\",\n secrets_store_secret: \"Secrets Store Secret\",\n logfwdr: \"logfwdr\",\n unsafe_hello_world: \"Hello World\",\n ratelimit: \"Rate Limit\",\n worker_loader: \"Worker Loader\",\n vpc_service: \"VPC Service\",\n vpc_network: \"VPC Network\",\n media: \"Media\",\n assets: \"Assets\",\n inherit: \"Inherited\"\n};\nfunction getBindingTypeFriendlyName(bindingType) {\n if (bindingType in bindingTypeFriendlyNames) {\n return bindingTypeFriendlyNames[bindingType];\n }\n if (bindingType.startsWith(\"unsafe_\")) {\n return \"Unsafe Metadata\";\n }\n return bindingType;\n}\n__name(getBindingTypeFriendlyName, \"getBindingTypeFriendlyName\");\nvar ENGLISH = new Intl.ListFormat(\"en-US\");\nvar ALLOWED_INSTANCE_TYPES = [\n \"lite\",\n \"basic\",\n \"standard-1\",\n \"standard-2\",\n \"standard-3\",\n \"standard-4\",\n \"dev\",\n // legacy\n \"standard\"\n // legacy\n];\nfunction isPagesConfig(rawConfig) {\n return rawConfig.pages_build_output_dir !== void 0;\n}\n__name(isPagesConfig, \"isPagesConfig\");\nfunction normalizeAndValidateConfig(rawConfig, configPath, userConfigPath, args, preserveOriginalMain = false) {\n const diagnostics = new Diagnostics(\n `Processing ${configPath ? path3.relative(process.cwd(), configPath) : \"wrangler\"} configuration:`\n );\n validateOptionalProperty(\n diagnostics,\n \"\",\n \"legacy_env\",\n rawConfig.legacy_env,\n \"boolean\"\n );\n validateOptionalProperty(\n diagnostics,\n \"\",\n \"send_metrics\",\n rawConfig.send_metrics,\n \"boolean\"\n );\n validateOptionalProperty(\n diagnostics,\n \"\",\n \"keep_vars\",\n rawConfig.keep_vars,\n \"boolean\"\n );\n validateOptionalProperty(\n diagnostics,\n \"\",\n \"pages_build_output_dir\",\n rawConfig.pages_build_output_dir,\n \"string\"\n );\n validateOptionalProperty(\n diagnostics,\n \"\",\n \"$schema\",\n rawConfig.$schema,\n \"string\"\n );\n const useServiceEnvironments = !(args[\"legacy-env\"] ?? rawConfig.legacy_env ?? true);\n if (useServiceEnvironments) {\n diagnostics.warnings.push(\n \"Service environments are deprecated, and will be removed in the future. DO NOT USE IN PRODUCTION.\"\n );\n }\n const isDispatchNamespace = typeof args[\"dispatch-namespace\"] === \"string\" && args[\"dispatch-namespace\"].trim() !== \"\";\n const topLevelEnv = normalizeAndValidateEnvironment(\n diagnostics,\n configPath,\n rawConfig,\n isDispatchNamespace,\n preserveOriginalMain\n );\n const isRedirectedConfig = isRedirectedRawConfig(\n rawConfig,\n configPath,\n userConfigPath\n );\n const definedEnvironments = Object.keys(rawConfig.env ?? {});\n if (isRedirectedConfig && definedEnvironments.length > 0) {\n diagnostics.errors.push(\n dedent`\n\t\t\t\tRedirected configurations cannot include environments but the following have been found:\\n${definedEnvironments.map((env) => `\t- ${env}`).join(\"\\n\")}\n\n\n\t\t\t\tSuch configurations are generated by tools, meaning that one of the tools\n\t\t\t\tyour application is using is generating the incorrect configuration.\n\t\t\t\tReport this issue to the tool's author so that this can be fixed there.\n\t\t\t\t`\n );\n }\n const envName = args.env ?? getCloudflareEnv();\n assert(envName === void 0 || typeof envName === \"string\");\n let activeEnv = topLevelEnv;\n if (envName) {\n if (isRedirectedConfig) {\n if (!isPagesConfig(rawConfig) && rawConfig.targetEnvironment && rawConfig.targetEnvironment !== envName) {\n const via = args.env !== void 0 ? \"via the `--env/-e` CLI argument\" : \"via the CLOUDFLARE_ENV environment variable\";\n throw new Error(dedent`\n\t\t\t\t\tYou have specified the environment \"${envName}\" ${via}.\n\t\t\t\t\tThis does not match the target environment \"${rawConfig.targetEnvironment}\" that was used when building the application.\n\t\t\t\t\tPerhaps you need to re-run the custom build of the project with \"${envName}\" as the selected environment?\n\t\t\t\t`);\n }\n } else {\n const envDiagnostics = new Diagnostics(\n `\"env.${envName}\" environment configuration`\n );\n const rawEnv = rawConfig.env?.[envName];\n if (rawEnv !== void 0) {\n activeEnv = normalizeAndValidateEnvironment(\n envDiagnostics,\n configPath,\n rawEnv,\n isDispatchNamespace,\n preserveOriginalMain,\n envName,\n topLevelEnv,\n useServiceEnvironments,\n rawConfig\n );\n diagnostics.addChild(envDiagnostics);\n } else if (!isPagesConfig(rawConfig)) {\n activeEnv = normalizeAndValidateEnvironment(\n envDiagnostics,\n configPath,\n topLevelEnv,\n // in this case reuse the topLevelEnv to ensure that nonInherited fields are not removed\n isDispatchNamespace,\n preserveOriginalMain,\n envName,\n topLevelEnv,\n useServiceEnvironments,\n rawConfig\n );\n const envNames = rawConfig.env ? `The available configured environment names are: ${JSON.stringify(\n Object.keys(rawConfig.env)\n )}\n` : \"\";\n const message = `No environment found in configuration with name \"${envName}\".\nBefore using \\`--env=${envName}\\` there should be an equivalent environment section in the configuration.\n${envNames}\nConsider adding an environment configuration section to the ${configFileName(configPath)} file:\n\\`\\`\\`\n[env.` + envName + \"]\\n```\\n\";\n if (envNames.length > 0) {\n diagnostics.errors.push(message);\n } else {\n diagnostics.warnings.push(message);\n }\n }\n }\n }\n const config = {\n configPath,\n userConfigPath,\n topLevelName: isRedirectedConfig ? rawConfig.topLevelName : rawConfig.name,\n definedEnvironments: isRedirectedConfig ? rawConfig.definedEnvironments : definedEnvironments,\n targetEnvironment: isRedirectedConfig ? rawConfig.targetEnvironment : envName,\n pages_build_output_dir: normalizeAndValidatePagesBuildOutputDir(\n configPath,\n rawConfig.pages_build_output_dir\n ),\n /** Legacy_env is wrangler environments, as opposed to service environments. Wrangler environments is not legacy. */\n legacy_env: !useServiceEnvironments,\n send_metrics: rawConfig.send_metrics,\n keep_vars: rawConfig.keep_vars,\n ...activeEnv,\n dev: normalizeAndValidateDev(diagnostics, rawConfig.dev ?? {}, args),\n site: normalizeAndValidateSite(\n diagnostics,\n configPath,\n rawConfig,\n activeEnv.main\n ),\n alias: normalizeAndValidateAliases(diagnostics, configPath, rawConfig),\n wasm_modules: normalizeAndValidateModulePaths(\n diagnostics,\n configPath,\n \"wasm_modules\",\n rawConfig.wasm_modules\n ),\n text_blobs: normalizeAndValidateModulePaths(\n diagnostics,\n configPath,\n \"text_blobs\",\n rawConfig.text_blobs\n ),\n data_blobs: normalizeAndValidateModulePaths(\n diagnostics,\n configPath,\n \"data_blobs\",\n rawConfig.data_blobs\n )\n };\n validateBindingsHaveUniqueNames(diagnostics, config);\n validateAdditionalProperties(\n diagnostics,\n \"top-level\",\n Object.keys(rawConfig),\n [...Object.keys(config), \"env\", \"$schema\"]\n );\n applyPythonConfig(config, args);\n return { config, diagnostics };\n}\n__name(normalizeAndValidateConfig, \"normalizeAndValidateConfig\");\nfunction applyPythonConfig(config, args) {\n const mainModule = args.script ?? config.main;\n if (typeof mainModule === \"string\" && mainModule.endsWith(\".py\")) {\n config.no_bundle = true;\n if (!config.rules.some((rule) => rule.type === \"PythonModule\")) {\n config.rules.push({ type: \"PythonModule\", globs: [\"**/*.py\"] });\n }\n if (!config.compatibility_flags.includes(\"python_workers\")) {\n throw new UserError(\n \"The `python_workers` compatibility flag is required to use Python.\"\n );\n }\n }\n}\n__name(applyPythonConfig, \"applyPythonConfig\");\nfunction normalizeAndValidateBuild(diagnostics, rawEnv, rawBuild, configPath) {\n const { command, cwd, watch_dir = \"./src\", ...rest } = rawBuild;\n validateAdditionalProperties(diagnostics, \"build\", Object.keys(rest), []);\n validateOptionalProperty(diagnostics, \"build\", \"command\", command, \"string\");\n validateOptionalProperty(diagnostics, \"build\", \"cwd\", cwd, \"string\");\n if (Array.isArray(watch_dir)) {\n validateTypedArray(diagnostics, \"build.watch_dir\", watch_dir, \"string\");\n } else {\n validateOptionalProperty(\n diagnostics,\n \"build\",\n \"watch_dir\",\n watch_dir,\n \"string\"\n );\n }\n return {\n command,\n watch_dir: (\n // - `watch_dir` only matters when `command` is defined, so we apply\n // a default only when `command` is defined\n // - `configPath` will always be defined since `build` can only\n // be configured in the Wrangler configuration file, but who knows, that may\n // change in the future, so we do a check anyway\n command && configPath ? Array.isArray(watch_dir) ? watch_dir.map(\n (dir) => path3.relative(\n process.cwd(),\n path3.join(path3.dirname(configPath), `${dir}`)\n )\n ) : path3.relative(\n process.cwd(),\n path3.join(path3.dirname(configPath), `${watch_dir}`)\n ) : watch_dir\n ),\n cwd\n };\n}\n__name(normalizeAndValidateBuild, \"normalizeAndValidateBuild\");\nfunction normalizeAndValidateMainField(configPath, rawMain) {\n const configDir = path3.dirname(configPath ?? \"wrangler.toml\");\n if (rawMain !== void 0) {\n if (typeof rawMain === \"string\") {\n const directory = path3.resolve(configDir);\n return path3.resolve(directory, rawMain);\n } else {\n return rawMain;\n }\n } else {\n return;\n }\n}\n__name(normalizeAndValidateMainField, \"normalizeAndValidateMainField\");\nfunction normalizeAndValidateBaseDirField(configPath, rawDir) {\n const configDir = path3.dirname(configPath ?? \"wrangler.toml\");\n if (rawDir !== void 0) {\n if (typeof rawDir === \"string\") {\n const directory = path3.resolve(configDir);\n return path3.resolve(directory, rawDir);\n } else {\n return rawDir;\n }\n } else {\n return;\n }\n}\n__name(normalizeAndValidateBaseDirField, \"normalizeAndValidateBaseDirField\");\nfunction normalizeAndValidatePagesBuildOutputDir(configPath, rawPagesDir) {\n const configDir = path3.dirname(configPath ?? \"wrangler.toml\");\n if (rawPagesDir !== void 0) {\n if (typeof rawPagesDir === \"string\") {\n const directory = path3.resolve(configDir);\n return path3.resolve(directory, rawPagesDir);\n } else {\n return rawPagesDir;\n }\n } else {\n return;\n }\n}\n__name(normalizeAndValidatePagesBuildOutputDir, \"normalizeAndValidatePagesBuildOutputDir\");\nfunction normalizeAndValidateDev(diagnostics, rawDev, args) {\n assert(typeof args === \"object\" && args !== null && !Array.isArray(args));\n const {\n localProtocol: localProtocolArg,\n upstreamProtocol: upstreamProtocolArg,\n remote: remoteArg,\n enableContainers: enableContainersArg,\n generateTypes: generateTypesArg\n } = args;\n assert(\n localProtocolArg === void 0 || localProtocolArg === \"http\" || localProtocolArg === \"https\"\n );\n assert(\n upstreamProtocolArg === void 0 || upstreamProtocolArg === \"http\" || upstreamProtocolArg === \"https\"\n );\n assert(remoteArg === void 0 || typeof remoteArg === \"boolean\");\n assert(\n enableContainersArg === void 0 || typeof enableContainersArg === \"boolean\"\n );\n assert(\n generateTypesArg === void 0 || typeof generateTypesArg === \"boolean\"\n );\n const {\n // On Windows, when specifying `localhost` as the socket hostname, `workerd`\n // will only listen on the IPv4 loopback `127.0.0.1`, not the IPv6 `::1`:\n // https://github.com/cloudflare/workerd/issues/1408\n // On Node 17+, `fetch()` will only try to fetch the IPv6 address.\n // For now, on Windows, we default to listening on IPv4 only and using\n // `127.0.0.1` when sending control requests to `workerd` (e.g. with the\n // `ProxyController`).\n ip = process.platform === \"win32\" ? \"127.0.0.1\" : \"localhost\",\n port,\n inspector_port,\n inspector_ip,\n local_protocol = localProtocolArg ?? \"http\",\n // In remote mode upstream_protocol must be https, otherwise it defaults to local_protocol.\n upstream_protocol = upstreamProtocolArg ?? remoteArg ? \"https\" : local_protocol,\n host,\n enable_containers = enableContainersArg ?? true,\n container_engine,\n generate_types = generateTypesArg ?? false,\n ...rest\n } = rawDev;\n validateAdditionalProperties(diagnostics, \"dev\", Object.keys(rest), []);\n validateOptionalProperty(diagnostics, \"dev\", \"ip\", ip, \"string\");\n validateOptionalProperty(diagnostics, \"dev\", \"port\", port, \"number\");\n validateOptionalProperty(\n diagnostics,\n \"dev\",\n \"inspector_port\",\n inspector_port,\n \"number\"\n );\n validateOptionalProperty(\n diagnostics,\n \"dev\",\n \"inspector_ip\",\n inspector_ip,\n \"string\"\n );\n validateOptionalProperty(\n diagnostics,\n \"dev\",\n \"local_protocol\",\n local_protocol,\n \"string\",\n [\"http\", \"https\"]\n );\n validateOptionalProperty(\n diagnostics,\n \"dev\",\n \"upstream_protocol\",\n upstream_protocol,\n \"string\",\n [\"http\", \"https\"]\n );\n validateOptionalProperty(diagnostics, \"dev\", \"host\", host, \"string\");\n validateOptionalProperty(\n diagnostics,\n \"dev\",\n \"enable_containers\",\n enable_containers,\n \"boolean\"\n );\n validateOptionalProperty(\n diagnostics,\n \"dev\",\n \"container_engine\",\n container_engine,\n \"string\"\n );\n validateOptionalProperty(\n diagnostics,\n \"dev\",\n \"generate_types\",\n generate_types,\n \"boolean\"\n );\n return {\n ip,\n port,\n inspector_port,\n inspector_ip,\n local_protocol,\n upstream_protocol,\n host,\n enable_containers,\n container_engine,\n generate_types\n };\n}\n__name(normalizeAndValidateDev, \"normalizeAndValidateDev\");\nfunction normalizeAndValidateAssets(diagnostics, topLevelEnv, rawEnv) {\n return inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"assets\",\n validateAssetsConfig,\n void 0\n );\n}\n__name(normalizeAndValidateAssets, \"normalizeAndValidateAssets\");\nfunction normalizeAndValidateSite(diagnostics, configPath, rawConfig, mainEntryPoint) {\n if (rawConfig?.site !== void 0) {\n const { bucket, include = [], exclude = [], ...rest } = rawConfig.site;\n validateAdditionalProperties(diagnostics, \"site\", Object.keys(rest), [\n \"entry-point\"\n ]);\n validateRequiredProperty(diagnostics, \"site\", \"bucket\", bucket, \"string\");\n validateTypedArray(diagnostics, \"sites.include\", include, \"string\");\n validateTypedArray(diagnostics, \"sites.exclude\", exclude, \"string\");\n validateOptionalProperty(\n diagnostics,\n \"site\",\n \"entry-point\",\n rawConfig.site[\"entry-point\"],\n \"string\"\n );\n deprecated(\n diagnostics,\n rawConfig,\n `site.entry-point`,\n `Delete the \\`site.entry-point\\` field, then add the top level \\`main\\` field to your configuration file:\n\\`\\`\\`\nmain = \"${path3.join(\n String(rawConfig.site[\"entry-point\"]) || \"workers-site\",\n path3.extname(String(rawConfig.site[\"entry-point\"]) || \"workers-site\") ? \"\" : \"index.js\"\n )}\"\n\\`\\`\\``,\n false,\n void 0,\n \"warning\"\n );\n let siteEntryPoint = rawConfig.site[\"entry-point\"];\n if (!mainEntryPoint && !siteEntryPoint) {\n diagnostics.warnings.push(\n `Because you've defined a [site] configuration, we're defaulting to \"workers-site\" for the deprecated \\`site.entry-point\\`field.\nAdd the top level \\`main\\` field to your configuration file:\n\\`\\`\\`\nmain = \"workers-site/index.js\"\n\\`\\`\\``\n );\n siteEntryPoint = \"workers-site\";\n } else if (mainEntryPoint && siteEntryPoint) {\n diagnostics.errors.push(\n `Don't define both the \\`main\\` and \\`site.entry-point\\` fields in your configuration.\nThey serve the same purpose: to point to the entry-point of your worker.\nDelete the deprecated \\`site.entry-point\\` field from your config.`\n );\n }\n if (configPath && siteEntryPoint) {\n siteEntryPoint = path3.relative(\n process.cwd(),\n path3.join(path3.dirname(configPath), siteEntryPoint)\n );\n }\n return {\n bucket,\n \"entry-point\": siteEntryPoint,\n include,\n exclude\n };\n }\n return void 0;\n}\n__name(normalizeAndValidateSite, \"normalizeAndValidateSite\");\nfunction normalizeAndValidateAliases(diagnostics, configPath, rawConfig) {\n if (rawConfig?.alias === void 0) {\n return void 0;\n }\n if ([\"string\", \"boolean\", \"number\"].includes(typeof rawConfig?.alias) || typeof rawConfig?.alias !== \"object\") {\n diagnostics.errors.push(\n `Expected alias to be an object, but got ${typeof rawConfig?.alias}`\n );\n return void 0;\n }\n let isValid2 = true;\n for (const [key, value] of Object.entries(rawConfig?.alias)) {\n if (typeof value !== \"string\") {\n diagnostics.errors.push(\n `Expected alias[\"${key}\"] to be a string, but got ${typeof value}`\n );\n isValid2 = false;\n }\n }\n if (isValid2) {\n return rawConfig.alias;\n }\n return;\n}\n__name(normalizeAndValidateAliases, \"normalizeAndValidateAliases\");\nfunction normalizeAndValidateModulePaths(diagnostics, configPath, field, rawMapping) {\n if (rawMapping === void 0) {\n return void 0;\n }\n const mapping = {};\n for (const [name, filePath] of Object.entries(rawMapping)) {\n if (isString(diagnostics, `${field}['${name}']`, filePath, void 0)) {\n if (configPath) {\n mapping[name] = configPath ? path3.relative(\n process.cwd(),\n path3.join(path3.dirname(configPath), filePath)\n ) : filePath;\n }\n }\n }\n return mapping;\n}\n__name(normalizeAndValidateModulePaths, \"normalizeAndValidateModulePaths\");\nfunction isValidRouteValue(item) {\n if (!item) {\n return false;\n }\n if (typeof item === \"string\") {\n return true;\n }\n if (typeof item === \"object\") {\n if (!hasProperty(item, \"pattern\") || typeof item.pattern !== \"string\") {\n return false;\n }\n const otherKeys = Object.keys(item).length - 1;\n const hasZoneId = hasProperty(item, \"zone_id\") && typeof item.zone_id === \"string\";\n const hasZoneName = hasProperty(item, \"zone_name\") && typeof item.zone_name === \"string\";\n const hasCustomDomainFlag = hasProperty(item, \"custom_domain\") && typeof item.custom_domain === \"boolean\";\n if (otherKeys === 2 && hasCustomDomainFlag && (hasZoneId || hasZoneName)) {\n return true;\n } else if (otherKeys === 1 && (hasZoneId || hasZoneName || hasCustomDomainFlag)) {\n return true;\n }\n }\n return false;\n}\n__name(isValidRouteValue, \"isValidRouteValue\");\nfunction mutateEmptyStringAccountIDValue(diagnostics, rawEnv) {\n if (rawEnv.account_id === \"\") {\n diagnostics.warnings.push(\n `The \"account_id\" field in your configuration is an empty string and will be ignored.\nPlease remove the \"account_id\" field from your configuration.`\n );\n rawEnv.account_id = void 0;\n }\n return rawEnv;\n}\n__name(mutateEmptyStringAccountIDValue, \"mutateEmptyStringAccountIDValue\");\nfunction mutateEmptyStringRouteValue(diagnostics, rawEnv) {\n if (rawEnv[\"route\"] === \"\") {\n diagnostics.warnings.push(\n `The \"route\" field in your configuration is an empty string and will be ignored.\nPlease remove the \"route\" field from your configuration.`\n );\n rawEnv[\"route\"] = void 0;\n }\n return rawEnv;\n}\n__name(mutateEmptyStringRouteValue, \"mutateEmptyStringRouteValue\");\nvar isRoute = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (value !== void 0 && !isValidRouteValue(value)) {\n diagnostics.errors.push(\n `Expected \"${field}\" to be either a string, or an object with shape { pattern, custom_domain, zone_id | zone_name }, but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n return true;\n}, \"isRoute\");\nvar isRouteArray = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (value === void 0) {\n return true;\n }\n if (!Array.isArray(value)) {\n diagnostics.errors.push(\n `Expected \"${field}\" to be an array but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n const invalidRoutes = [];\n for (const item of value) {\n if (!isValidRouteValue(item)) {\n invalidRoutes.push(item);\n }\n }\n if (invalidRoutes.length > 0) {\n diagnostics.errors.push(\n `Expected \"${field}\" to be an array of either strings or objects with the shape { pattern, custom_domain, zone_id | zone_name }, but these weren't valid: ${JSON.stringify(\n invalidRoutes,\n null,\n 2\n )}.`\n );\n }\n return invalidRoutes.length === 0;\n}, \"isRouteArray\");\nfunction normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv) {\n return inheritable(\n diagnostics,\n topLevelEnv,\n mutateEmptyStringRouteValue(diagnostics, rawEnv),\n \"route\",\n isRoute,\n void 0\n );\n}\n__name(normalizeAndValidateRoute, \"normalizeAndValidateRoute\");\nfunction validateRoutes(diagnostics, topLevelEnv, rawEnv) {\n return inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"routes\",\n all(isRouteArray, isMutuallyExclusiveWith(rawEnv, \"route\")),\n void 0\n );\n}\n__name(validateRoutes, \"validateRoutes\");\nfunction normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv) {\n if (rawEnv.placement) {\n const placement = rawEnv.placement;\n const hasHint = \"hint\" in placement;\n const hasRegion = \"region\" in placement;\n const hasHost = \"host\" in placement;\n const hasHostname = \"hostname\" in placement;\n const hasTargetedFields = hasRegion || hasHost || hasHostname;\n if (hasHint && hasTargetedFields) {\n diagnostics.errors.push(\n `\"placement\" cannot have both \"hint\" (smart format) and \"region\"/\"host\"/\"hostname\" (targeted format) fields`\n );\n return inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"placement\",\n () => true,\n void 0\n );\n }\n if (hasHint) {\n validateRequiredProperty(\n diagnostics,\n \"placement\",\n \"mode\",\n placement.mode,\n \"string\",\n [\"off\", \"smart\"]\n );\n const mode = placement.mode;\n const hint = placement.hint;\n if (hint !== void 0 && typeof hint !== \"string\") {\n diagnostics.errors.push(\n `\"placement.hint\" must be a string when \"placement.mode\" is \"${mode}\"`\n );\n }\n if (hint && mode !== \"smart\") {\n diagnostics.errors.push(\n `\"placement.hint\" can only be set when \"placement.mode\" is \"smart\"`\n );\n }\n } else if (hasTargetedFields) {\n validateOptionalProperty(\n diagnostics,\n \"placement\",\n \"mode\",\n placement.mode,\n \"string\",\n [\"off\", \"targeted\"]\n );\n if (hasRegion) {\n validateOptionalProperty(\n diagnostics,\n \"placement\",\n \"region\",\n placement.region,\n \"string\"\n );\n }\n if (hasHost) {\n validateOptionalProperty(\n diagnostics,\n \"placement\",\n \"host\",\n placement.host,\n \"string\"\n );\n }\n if (hasHostname) {\n validateOptionalProperty(\n diagnostics,\n \"placement\",\n \"hostname\",\n placement.hostname,\n \"string\"\n );\n }\n const fieldsPresent = [hasRegion, hasHost, hasHostname].filter(Boolean);\n if (fieldsPresent.length > 1) {\n const presentFields = [];\n if (hasRegion) {\n presentFields.push(\"region\");\n }\n if (hasHost) {\n presentFields.push(\"host\");\n }\n if (hasHostname) {\n presentFields.push(\"hostname\");\n }\n diagnostics.errors.push(\n `\"placement\" fields ${presentFields.map((f) => `\"${f}\"`).join(\", \")} are mutually exclusive. Only one can be specified.`\n );\n }\n } else {\n validateRequiredProperty(\n diagnostics,\n \"placement\",\n \"mode\",\n placement.mode,\n \"string\",\n [\"off\", \"smart\", \"targeted\"]\n );\n }\n }\n return inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"placement\",\n () => true,\n void 0\n );\n}\n__name(normalizeAndValidatePlacement, \"normalizeAndValidatePlacement\");\nfunction validateTailConsumer(diagnostics, field, value) {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"${field}\" should be an object but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n let isValid2 = true;\n isValid2 = isValid2 && validateRequiredProperty(\n diagnostics,\n field,\n \"service\",\n value.service,\n \"string\"\n );\n isValid2 = isValid2 && validateOptionalProperty(\n diagnostics,\n field,\n \"environment\",\n value.environment,\n \"string\"\n );\n return isValid2;\n}\n__name(validateTailConsumer, \"validateTailConsumer\");\nvar validateTailConsumers = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (!value) {\n return true;\n }\n if (!Array.isArray(value)) {\n diagnostics.errors.push(\n `Expected \"${field}\" to be an array but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n let isValid2 = true;\n for (let i = 0; i < value.length; i++) {\n isValid2 = validateTailConsumer(diagnostics, `${field}[${i}]`, value[i]) && isValid2;\n }\n return isValid2;\n}, \"validateTailConsumers\");\nfunction validateStreamingTailConsumer(diagnostics, field, value) {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n diagnostics.errors.push(\n `\"${field}\" should be an object but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n return validateRequiredProperty(\n diagnostics,\n field,\n \"service\",\n value.service,\n \"string\"\n );\n}\n__name(validateStreamingTailConsumer, \"validateStreamingTailConsumer\");\nvar validateStreamingTailConsumers = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (!value) {\n return true;\n }\n if (!Array.isArray(value)) {\n diagnostics.errors.push(\n `Expected \"${field}\" to be an array but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n let isValid2 = true;\n for (let i = 0; i < value.length; i++) {\n isValid2 = validateStreamingTailConsumer(diagnostics, `${field}[${i}]`, value[i]) && isValid2;\n }\n return isValid2;\n}, \"validateStreamingTailConsumers\");\nfunction normalizeAndValidateEnvironment(diagnostics, configPath, rawEnv, isDispatchNamespace, preserveOriginalMain, envName = \"top level\", topLevelEnv, useServiceEnvironments, rawConfig) {\n deprecated(\n diagnostics,\n rawEnv,\n // @ts-expect-error Removed from the config type\n \"node_compat\",\n `The \"node_compat\" field is no longer supported as of Wrangler v4. Instead, use the \\`nodejs_compat\\` compatibility flag. This includes the functionality from legacy \\`node_compat\\` polyfills and natively implemented Node.js APIs. See https://developers.cloudflare.com/workers/runtime-apis/nodejs for more information.`,\n true,\n \"Removed\",\n \"error\"\n );\n experimental(diagnostics, rawEnv, \"unsafe\");\n experimental(diagnostics, rawEnv, \"secrets\");\n const route = normalizeAndValidateRoute(diagnostics, topLevelEnv, rawEnv);\n const account_id = inheritableInWranglerEnvironments(\n diagnostics,\n useServiceEnvironments,\n topLevelEnv,\n mutateEmptyStringAccountIDValue(diagnostics, rawEnv),\n \"account_id\",\n isString,\n void 0,\n void 0\n );\n const routes = validateRoutes(diagnostics, topLevelEnv, rawEnv);\n const workers_dev = inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"workers_dev\",\n isBoolean,\n void 0\n );\n const preview_urls = inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"preview_urls\",\n isBoolean,\n void 0\n );\n const build = normalizeAndValidateBuild(\n diagnostics,\n rawEnv,\n rawEnv.build ?? topLevelEnv?.build ?? {},\n configPath\n );\n const environment = {\n // Inherited fields\n account_id,\n compatibility_date: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"compatibility_date\",\n validateCompatibilityDate,\n void 0\n ),\n compatibility_flags: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"compatibility_flags\",\n isStringArray,\n []\n ),\n jsx_factory: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"jsx_factory\",\n isString,\n \"React.createElement\"\n ),\n jsx_fragment: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"jsx_fragment\",\n isString,\n \"React.Fragment\"\n ),\n tsconfig: validateAndNormalizeTsconfig(\n diagnostics,\n topLevelEnv,\n rawEnv,\n configPath\n ),\n rules: validateAndNormalizeRules(diagnostics, topLevelEnv, rawEnv, envName),\n name: inheritableInWranglerEnvironments(\n diagnostics,\n useServiceEnvironments,\n topLevelEnv,\n rawEnv,\n \"name\",\n isDispatchNamespace ? isString : isValidName,\n appendEnvName(envName),\n void 0\n ),\n main: preserveOriginalMain ? inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"main\",\n isString,\n void 0\n ) : normalizeAndValidateMainField(\n configPath,\n inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"main\",\n isString,\n void 0\n )\n ),\n find_additional_modules: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"find_additional_modules\",\n isBoolean,\n void 0\n ),\n preserve_file_names: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"preserve_file_names\",\n isBoolean,\n void 0\n ),\n base_dir: normalizeAndValidateBaseDirField(\n configPath,\n inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"base_dir\",\n isString,\n void 0\n )\n ),\n route,\n routes,\n triggers: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"triggers\",\n validateTriggers,\n { crons: void 0 }\n ),\n assets: normalizeAndValidateAssets(diagnostics, topLevelEnv, rawEnv),\n limits: normalizeAndValidateLimits(diagnostics, topLevelEnv, rawEnv),\n placement: normalizeAndValidatePlacement(diagnostics, topLevelEnv, rawEnv),\n build,\n workers_dev,\n preview_urls,\n // Not inherited fields\n vars: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"vars\",\n validateVars(envName),\n {}\n ),\n secrets: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"secrets\",\n validateSecrets(envName),\n void 0\n ),\n define: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"define\",\n validateDefines(envName),\n {}\n ),\n durable_objects: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"durable_objects\",\n validateBindingsProperty(envName, validateDurableObjectBinding),\n {\n bindings: []\n }\n ),\n workflows: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"workflows\",\n all(\n validateBindingArray(envName, validateWorkflowBinding),\n validateUniqueNameProperty\n ),\n []\n ),\n migrations: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"migrations\",\n validateMigrations,\n []\n ),\n kv_namespaces: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"kv_namespaces\",\n validateBindingArray(envName, validateKVBinding),\n []\n ),\n cloudchamber: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"cloudchamber\",\n validateCloudchamberConfig,\n {}\n ),\n containers: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"containers\",\n validateContainerApp(envName, rawEnv.name, configPath),\n void 0\n ),\n send_email: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"send_email\",\n validateBindingArray(envName, validateSendEmailBinding),\n []\n ),\n queues: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"queues\",\n validateQueues(envName),\n { producers: [], consumers: [] }\n ),\n r2_buckets: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"r2_buckets\",\n validateBindingArray(envName, validateR2Binding),\n []\n ),\n d1_databases: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"d1_databases\",\n validateBindingArray(envName, validateD1Binding),\n []\n ),\n vectorize: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"vectorize\",\n validateBindingArray(envName, validateVectorizeBinding),\n []\n ),\n ai_search_namespaces: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"ai_search_namespaces\",\n validateBindingArray(envName, validateAISearchNamespaceBinding),\n []\n ),\n ai_search: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"ai_search\",\n validateBindingArray(envName, validateAISearchBinding),\n []\n ),\n hyperdrive: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"hyperdrive\",\n validateBindingArray(envName, validateHyperdriveBinding),\n []\n ),\n services: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"services\",\n validateBindingArray(envName, validateServiceBinding),\n []\n ),\n analytics_engine_datasets: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"analytics_engine_datasets\",\n validateBindingArray(envName, validateAnalyticsEngineBinding),\n []\n ),\n dispatch_namespaces: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"dispatch_namespaces\",\n validateBindingArray(envName, validateWorkerNamespaceBinding),\n []\n ),\n mtls_certificates: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"mtls_certificates\",\n validateBindingArray(envName, validateMTlsCertificateBinding),\n []\n ),\n tail_consumers: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"tail_consumers\",\n validateTailConsumers,\n void 0\n ),\n streaming_tail_consumers: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"streaming_tail_consumers\",\n validateStreamingTailConsumers,\n void 0\n ),\n unsafe: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"unsafe\",\n validateUnsafeSettings(envName),\n {}\n ),\n browser: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"browser\",\n validateNamedSimpleBinding(envName),\n void 0\n ),\n ai: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"ai\",\n validateAIBinding(envName),\n void 0\n ),\n images: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"images\",\n validateNamedSimpleBinding(envName),\n void 0\n ),\n stream: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"stream\",\n validateNamedSimpleBinding(envName),\n void 0\n ),\n media: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"media\",\n validateNamedSimpleBinding(envName),\n void 0\n ),\n pipelines: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"pipelines\",\n validateBindingArray(envName, validatePipelineBinding),\n []\n ),\n secrets_store_secrets: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"secrets_store_secrets\",\n validateBindingArray(envName, validateSecretsStoreSecretBinding),\n []\n ),\n unsafe_hello_world: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"unsafe_hello_world\",\n validateBindingArray(envName, validateHelloWorldBinding),\n []\n ),\n worker_loaders: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"worker_loaders\",\n validateBindingArray(envName, validateWorkerLoaderBinding),\n []\n ),\n ratelimits: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"ratelimits\",\n validateBindingArray(envName, validateRateLimitBinding),\n []\n ),\n vpc_services: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"vpc_services\",\n validateBindingArray(envName, validateVpcServiceBinding),\n []\n ),\n vpc_networks: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"vpc_networks\",\n validateBindingArray(envName, validateVpcNetworkBinding),\n []\n ),\n version_metadata: notInheritable(\n diagnostics,\n topLevelEnv,\n rawConfig,\n rawEnv,\n envName,\n \"version_metadata\",\n validateVersionMetadataBinding(envName),\n void 0\n ),\n logfwdr: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"logfwdr\",\n validateCflogfwdrObject(envName),\n {\n bindings: []\n }\n ),\n no_bundle: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"no_bundle\",\n isBoolean,\n void 0\n ),\n minify: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"minify\",\n isBoolean,\n void 0\n ),\n keep_names: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"keep_names\",\n isBoolean,\n void 0\n ),\n first_party_worker: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"first_party_worker\",\n isBoolean,\n void 0\n ),\n logpush: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"logpush\",\n isBoolean,\n void 0\n ),\n upload_source_maps: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"upload_source_maps\",\n isBoolean,\n void 0\n ),\n observability: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"observability\",\n validateObservability,\n void 0\n ),\n cache: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"cache\",\n validateCache,\n void 0\n ),\n compliance_region: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"compliance_region\",\n isOneOf(\"public\", \"fedramp_high\"),\n void 0\n ),\n python_modules: inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"python_modules\",\n validatePythonModules,\n { exclude: [\"**/*.pyc\"] }\n )\n };\n warnIfDurableObjectsHaveNoMigrations(\n diagnostics,\n environment.durable_objects,\n environment.migrations,\n configPath\n );\n if (envName !== \"top level\") {\n validateAdditionalProperties(\n diagnostics,\n \"env.\" + envName,\n Object.keys(rawEnv),\n Object.keys(environment)\n );\n }\n return environment;\n}\n__name(normalizeAndValidateEnvironment, \"normalizeAndValidateEnvironment\");\nfunction validateAndNormalizeTsconfig(diagnostics, topLevelEnv, rawEnv, configPath) {\n const tsconfig = inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"tsconfig\",\n isString,\n void 0\n );\n return configPath && tsconfig ? path3.relative(\n process.cwd(),\n path3.join(path3.dirname(configPath), tsconfig)\n ) : tsconfig;\n}\n__name(validateAndNormalizeTsconfig, \"validateAndNormalizeTsconfig\");\nvar validateAndNormalizeRules = /* @__PURE__ */ __name((diagnostics, topLevelEnv, rawEnv, envName) => {\n return inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"rules\",\n validateRules(envName),\n []\n );\n}, \"validateAndNormalizeRules\");\nvar validateTriggers = /* @__PURE__ */ __name((diagnostics, triggersFieldName, triggersValue) => {\n if (triggersValue === void 0 || triggersValue === null) {\n return true;\n }\n if (typeof triggersValue !== \"object\") {\n diagnostics.errors.push(\n `Expected \"${triggersFieldName}\" to be of type object but got ${JSON.stringify(\n triggersValue\n )}.`\n );\n return false;\n }\n let isValid2 = true;\n if (\"crons\" in triggersValue && !Array.isArray(triggersValue.crons)) {\n diagnostics.errors.push(\n `Expected \"${triggersFieldName}.crons\" to be of type array, but got ${JSON.stringify(triggersValue)}.`\n );\n isValid2 = false;\n }\n isValid2 = validateAdditionalProperties(\n diagnostics,\n triggersFieldName,\n Object.keys(triggersValue),\n [\"crons\"]\n ) && isValid2;\n return isValid2;\n}, \"validateTriggers\");\nvar validateRules = /* @__PURE__ */ __name((envName) => (diagnostics, field, envValue, config) => {\n if (!envValue) {\n return true;\n }\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (!Array.isArray(envValue)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an array but got ${JSON.stringify(\n envValue\n )}.`\n );\n return false;\n }\n let isValid2 = true;\n for (let i = 0; i < envValue.length; i++) {\n isValid2 = validateRule(diagnostics, `${fieldPath}[${i}]`, envValue[i], config) && isValid2;\n }\n return isValid2;\n}, \"validateRules\");\nvar validateRule = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"${field}\" should be an object but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n let isValid2 = true;\n const rule = value;\n if (!isRequiredProperty(rule, \"type\", \"string\", [\n \"ESModule\",\n \"CommonJS\",\n \"CompiledWasm\",\n \"Text\",\n \"Data\"\n ])) {\n diagnostics.errors.push(\n `bindings should have a string \"type\" field, which contains one of \"ESModule\", \"CommonJS\", \"CompiledWasm\", \"Text\", or \"Data\".`\n );\n isValid2 = false;\n }\n isValid2 = validateTypedArray(diagnostics, `${field}.globs`, rule.globs, \"string\") && isValid2;\n if (!isOptionalProperty(rule, \"fallthrough\", \"boolean\")) {\n diagnostics.errors.push(\n `the field \"fallthrough\", when present, should be a boolean.`\n );\n isValid2 = false;\n }\n return isValid2;\n}, \"validateRule\");\nvar validateDefines = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {\n let isValid2 = true;\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (typeof value === \"object\" && value !== null) {\n for (const varName in value) {\n if (typeof value[varName] !== \"string\") {\n diagnostics.errors.push(\n `The field \"${fieldPath}.${varName}\" should be a string but got ${JSON.stringify(\n value[varName]\n )}.`\n );\n isValid2 = false;\n }\n }\n } else {\n if (value !== void 0) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an object but got ${JSON.stringify(\n value\n )}.\n`\n );\n isValid2 = false;\n }\n }\n const configDefines = Object.keys(config?.define ?? {});\n if (configDefines.length > 0) {\n if (typeof value === \"object\" && value !== null) {\n const configEnvDefines = config === void 0 ? [] : Object.keys(value);\n for (const varName of configDefines) {\n if (!(varName in value)) {\n diagnostics.warnings.push(\n `\"define.${varName}\" exists at the top level, but not on \"${fieldPath}\".\nThis is not what you probably want, since \"define\" configuration is not inherited by environments.\nPlease add \"define.${varName}\" to \"env.${envName}\".`\n );\n }\n }\n for (const varName of configEnvDefines) {\n if (!configDefines.includes(varName)) {\n diagnostics.warnings.push(\n `\"${varName}\" exists on \"env.${envName}\", but not on the top level.\nThis is not what you probably want, since \"define\" configuration within environments can only override existing top level \"define\" configuration\nPlease remove \"${fieldPath}.${varName}\", or add \"define.${varName}\".`\n );\n }\n }\n }\n }\n return isValid2;\n}, \"validateDefines\");\nvar validateVars = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {\n let isValid2 = true;\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (value !== void 0) {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an object but got ${JSON.stringify(\n value\n )}.\n`\n );\n isValid2 = false;\n } else {\n for (const [varName, varValue] of Object.entries(value)) {\n if (varValue instanceof Date) {\n diagnostics.errors.push(\n `The field \"${fieldPath}.${varName}\" is a TOML date, which is not supported. Please use a string instead, e.g. ${varName} = \"2025-12-19\".`\n );\n isValid2 = false;\n }\n }\n }\n }\n const configVars = Object.keys(config?.vars ?? {});\n if (configVars.length > 0) {\n if (typeof value === \"object\" && value !== null) {\n for (const varName of configVars) {\n if (!(varName in value)) {\n diagnostics.warnings.push(\n `\"vars.${varName}\" exists at the top level, but not on \"${fieldPath}\".\nThis is not what you probably want, since \"vars\" configuration is not inherited by environments.\nPlease add \"vars.${varName}\" to \"env.${envName}\".`\n );\n }\n }\n }\n }\n return isValid2;\n}, \"validateVars\");\nvar validateSecrets = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (value === void 0) {\n return true;\n }\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an object but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n let isValid2 = true;\n validateAdditionalProperties(diagnostics, fieldPath, Object.keys(value), [\n \"required\"\n ]);\n isValid2 = validateOptionalTypedArray(\n diagnostics,\n `${fieldPath}.required`,\n value.required,\n \"string\"\n ) && isValid2;\n return isValid2;\n}, \"validateSecrets\");\nvar validateBindingsProperty = /* @__PURE__ */ __name((envName, validateBinding) => (diagnostics, field, value, config) => {\n let isValid2 = true;\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (value !== void 0) {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an object but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n } else if (!hasProperty(value, \"bindings\")) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" is missing the required \"bindings\" property.`\n );\n isValid2 = false;\n } else if (!Array.isArray(value.bindings)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}.bindings\" should be an array but got ${JSON.stringify(\n value.bindings\n )}.`\n );\n isValid2 = false;\n } else {\n for (let i = 0; i < value.bindings.length; i++) {\n const binding = value.bindings[i];\n const bindingDiagnostics = new Diagnostics(\n `\"${fieldPath}.bindings[${i}]\": ${JSON.stringify(binding)}`\n );\n isValid2 = validateBinding(\n bindingDiagnostics,\n `${fieldPath}.bindings[${i}]`,\n binding,\n config\n ) && isValid2;\n diagnostics.addChild(bindingDiagnostics);\n }\n }\n const configBindingNames = getBindingNames(\n config?.[field]\n );\n if (isValid2 && configBindingNames.length > 0) {\n const envBindingNames = new Set(getBindingNames(value));\n const missingBindings = configBindingNames.filter(\n (name) => !envBindingNames.has(name)\n );\n if (missingBindings.length > 0) {\n diagnostics.warnings.push(\n `The following bindings are at the top level, but not on \"env.${envName}\".\nThis is not what you probably want, since \"${field}\" configuration is not inherited by environments.\nPlease add a binding for each to \"${fieldPath}.bindings\":\n` + missingBindings.map((name) => `- ${name}`).join(\"\\n\")\n );\n }\n }\n }\n return isValid2;\n}, \"validateBindingsProperty\");\nvar validateUnsafeSettings = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an object but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n if (hasProperty(value, \"bindings\") && value.bindings !== void 0) {\n const validateBindingsFn = validateBindingsProperty(\n envName,\n validateUnsafeBinding\n );\n const valid = validateBindingsFn(diagnostics, field, value, config);\n if (!valid) {\n return false;\n }\n }\n if (hasProperty(value, \"metadata\") && value.metadata !== void 0 && (typeof value.metadata !== \"object\" || value.metadata === null || Array.isArray(value.metadata))) {\n diagnostics.errors.push(\n `The field \"${fieldPath}.metadata\" should be an object but got ${JSON.stringify(\n value.metadata\n )}.`\n );\n return false;\n }\n if (hasProperty(value, \"capnp\") && value.capnp !== void 0) {\n if (typeof value.capnp !== \"object\" || value.capnp === null || Array.isArray(value.capnp)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}.capnp\" should be an object but got ${JSON.stringify(\n value.capnp\n )}.`\n );\n return false;\n }\n if (hasProperty(value.capnp, \"compiled_schema\")) {\n if (hasProperty(value.capnp, \"base_path\") || hasProperty(value.capnp, \"source_schemas\")) {\n diagnostics.errors.push(\n `The field \"${fieldPath}.capnp\" cannot contain both \"compiled_schema\" and one of \"base_path\" or \"source_schemas\".`\n );\n return false;\n }\n if (typeof value.capnp.compiled_schema !== \"string\") {\n diagnostics.errors.push(\n `The field \"${fieldPath}.capnp.compiled_schema\", when present, should be a string but got ${JSON.stringify(\n value.capnp.compiled_schema\n )}.`\n );\n return false;\n }\n } else {\n if (!isRequiredProperty(value.capnp, \"base_path\", \"string\")) {\n diagnostics.errors.push(\n `The field \"${fieldPath}.capnp.base_path\", when present, should be a string but got ${JSON.stringify(\n value.capnp.base_path\n )}`\n );\n }\n if (!validateTypedArray(\n diagnostics,\n `${fieldPath}.capnp.source_schemas`,\n value.capnp.source_schemas,\n \"string\"\n )) {\n return false;\n }\n }\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"bindings\",\n \"metadata\",\n \"capnp\"\n ]);\n return true;\n}, \"validateUnsafeSettings\");\nvar validateDurableObjectBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `Expected \"${field}\" to be an object but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"name\", \"string\")) {\n diagnostics.errors.push(`binding should have a string \"name\" field.`);\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"class_name\", \"string\")) {\n diagnostics.errors.push(`binding should have a string \"class_name\" field.`);\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"script_name\", \"string\")) {\n diagnostics.errors.push(\n `the field \"script_name\", when present, should be a string.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"environment\", \"string\")) {\n diagnostics.errors.push(\n `the field \"environment\", when present, should be a string.`\n );\n isValid2 = false;\n }\n if (\"environment\" in value && !(\"script_name\" in value)) {\n diagnostics.errors.push(\n `binding should have a \"script_name\" field if \"environment\" is present.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"class_name\",\n \"environment\",\n \"name\",\n \"script_name\"\n ]);\n return isValid2;\n}, \"validateDurableObjectBinding\");\nvar workflowNameFormatMessage = `Workflow names must be 1-64 characters long, start with a letter, number, or underscore, and may only contain letters, numbers, underscores, or hyphens.`;\nvar validateWorkflowBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"workflows\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"name\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"name\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n } else if (!isValidWorkflowName(value.name)) {\n diagnostics.errors.push(\n `\"${field}\" binding \"name\" field is invalid. ${workflowNameFormatMessage}`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"class_name\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"class_name\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"script_name\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a string \"script_name\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"remote\", \"boolean\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a boolean \"remote\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (hasProperty(value, \"limits\") && value.limits !== void 0) {\n if (typeof value.limits !== \"object\" || value.limits === null || Array.isArray(value.limits)) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have an object \"limits\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n } else {\n const limits = value.limits;\n if (limits.steps !== void 0) {\n if (typeof limits.steps !== \"number\" || !Number.isInteger(limits.steps) || limits.steps < 1) {\n diagnostics.errors.push(\n `\"${field}\" bindings \"limits.steps\" field must be a positive integer but got ${JSON.stringify(\n limits.steps\n )}.`\n );\n isValid2 = false;\n } else if (limits.steps > 25e3) {\n diagnostics.warnings.push(\n `\"${field}\" has a step limit of ${limits.steps}, which exceeds the production maximum of 25,000. This configuration may not work when deployed.`\n );\n }\n }\n validateAdditionalProperties(\n diagnostics,\n `${field}.limits`,\n Object.keys(limits),\n [\"steps\"]\n );\n }\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"name\",\n \"class_name\",\n \"script_name\",\n \"remote\",\n \"limits\"\n ]);\n return isValid2;\n}, \"validateWorkflowBinding\");\nvar validateCflogfwdrObject = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, topLevelEnv) => {\n const bindingsValidation = validateBindingsProperty(\n envName,\n validateCflogfwdrBinding\n );\n if (!bindingsValidation(diagnostics, field, value, topLevelEnv)) {\n return false;\n }\n const v = value;\n if (v?.schema !== void 0) {\n diagnostics.errors.push(\n `\"${field}\" binding \"schema\" property has been replaced with the \"unsafe.capnp\" object, which expects a \"base_path\" and an array of \"source_schemas\" to compile, or a \"compiled_schema\" property.`\n );\n return false;\n }\n return true;\n}, \"validateCflogfwdrObject\");\nvar validateCflogfwdrBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `Expected \"${field}\" to be an object but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"name\", \"string\")) {\n diagnostics.errors.push(`binding should have a string \"name\" field.`);\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"destination\", \"string\")) {\n diagnostics.errors.push(\n `binding should have a string \"destination\" field.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"destination\",\n \"name\"\n ]);\n return isValid2;\n}, \"validateCflogfwdrBinding\");\nvar validateAssetsConfig = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (value === void 0) {\n return true;\n }\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"${field}\" should be an object, but got value ${JSON.stringify(\n field\n )} of type ${typeof value}`\n );\n return false;\n }\n let isValid2 = true;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"directory\",\n value.directory,\n \"string\"\n ) && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"binding\",\n value.binding,\n \"string\"\n ) && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"html_handling\",\n value.html_handling,\n \"string\",\n [\n \"auto-trailing-slash\",\n \"force-trailing-slash\",\n \"drop-trailing-slash\",\n \"none\"\n ]\n ) && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"not_found_handling\",\n value.not_found_handling,\n \"string\",\n [\"single-page-application\", \"404-page\", \"none\"]\n ) && isValid2;\n if (value.run_worker_first !== void 0) {\n if (typeof value.run_worker_first === \"boolean\") {\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"run_worker_first\",\n value.run_worker_first,\n \"boolean\"\n ) && isValid2;\n } else if (Array.isArray(value.run_worker_first)) {\n isValid2 = validateOptionalTypedArray(\n diagnostics,\n \"assets.run_worker_first\",\n value.run_worker_first,\n \"string\"\n ) && isValid2;\n } else {\n diagnostics.errors.push(\n `The field \"${field}.run_worker_first\" should be an array of strings or a boolean, but got ${JSON.stringify(\n value.run_worker_first\n )}.`\n );\n isValid2 = false;\n }\n }\n isValid2 = validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"directory\",\n \"binding\",\n \"html_handling\",\n \"not_found_handling\",\n \"run_worker_first\"\n ]) && isValid2;\n return isValid2;\n}, \"validateAssetsConfig\");\nvar validateNamedSimpleBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an object but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(`binding should have a string \"binding\" field.`);\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateNamedSimpleBinding\");\nvar validateAIBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an object but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(`binding should have a string \"binding\" field.`);\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n return isValid2;\n}, \"validateAIBinding\");\nvar validateVersionMetadataBinding = /* @__PURE__ */ __name((envName) => (diagnostics, field, value, config) => {\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an object but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(`binding should have a string \"binding\" field.`);\n isValid2 = false;\n }\n return isValid2;\n}, \"validateVersionMetadataBinding\");\nvar validateUnsafeBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `Expected ${field} to be an object but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"name\", \"string\")) {\n diagnostics.errors.push(`binding should have a string \"name\" field.`);\n isValid2 = false;\n }\n if (isRequiredProperty(value, \"type\", \"string\")) {\n const safeBindings = [\n \"plain_text\",\n \"secret_text\",\n \"json\",\n \"wasm_module\",\n \"data_blob\",\n \"text_blob\",\n \"browser\",\n \"ai\",\n \"ai_search_namespace\",\n \"ai_search\",\n \"kv_namespace\",\n \"durable_object_namespace\",\n \"d1_database\",\n \"r2_bucket\",\n \"service\",\n \"logfwdr\",\n \"mtls_certificate\",\n \"pipeline\",\n \"worker_loader\",\n \"vpc_service\",\n \"vpc_network\",\n \"stream\",\n \"media\"\n ];\n if (safeBindings.includes(value.type)) {\n diagnostics.warnings.push(\n `The binding type \"${value.type}\" is directly supported by wrangler.\nConsider migrating this unsafe binding to a format for '${value.type}' bindings that is supported by wrangler for optimal support.\nFor more details, see https://developers.cloudflare.com/workers/cli-wrangler/configuration`\n );\n }\n if (value.type === \"metadata\" && isRequiredProperty(value, \"name\", \"string\")) {\n diagnostics.warnings.push(\n \"The deployment object in the metadata binding is now deprecated. Please switch using the version_metadata binding for access to version specific fields: https://developers.cloudflare.com/workers/runtime-apis/bindings/version-metadata\"\n );\n }\n } else {\n diagnostics.errors.push(`binding should have a string \"type\" field.`);\n isValid2 = false;\n }\n return isValid2;\n}, \"validateUnsafeBinding\");\nvar validateBindingArray = /* @__PURE__ */ __name((envName, validateBinding) => (diagnostics, field, envValue, config) => {\n if (envValue === void 0) {\n return true;\n }\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (!Array.isArray(envValue)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an array but got ${JSON.stringify(\n envValue\n )}.`\n );\n return false;\n }\n let isValid2 = true;\n for (let i = 0; i < envValue.length; i++) {\n isValid2 = validateBinding(\n diagnostics,\n `${fieldPath}[${i}]`,\n envValue[i],\n config\n ) && isValid2;\n }\n const configValue = config?.[field];\n if (Array.isArray(configValue)) {\n const configBindingNames = configValue.map((value) => value.binding);\n if (configBindingNames.length > 0) {\n const envBindingNames = new Set(envValue.map((value) => value.binding));\n for (const configBindingName of configBindingNames) {\n if (!envBindingNames.has(configBindingName)) {\n diagnostics.warnings.push(\n `There is a ${field} binding with name \"${configBindingName}\" at the top level, but not on \"env.${envName}\".\nThis is not what you probably want, since \"${field}\" configuration is not inherited by environments.\nPlease add a binding for \"${configBindingName}\" to \"env.${envName}.${field}.bindings\".`\n );\n }\n }\n }\n }\n return isValid2;\n}, \"validateBindingArray\");\nfunction validateContainerApp(envName, topLevelName, configPath) {\n return (diagnostics, field, value, config) => {\n if (!value) {\n return true;\n }\n if (!Array.isArray(value)) {\n diagnostics.errors.push(\n `\"containers\" field should be an array, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n for (const containerAppOptional of value) {\n if (!isOptionalProperty(value, \"name\", \"string\")) {\n diagnostics.errors.push(\n `Field \"name\", when present, should be a string, but got ${JSON.stringify(value)}`\n );\n }\n validateRequiredProperty(\n diagnostics,\n field,\n \"class_name\",\n containerAppOptional.class_name,\n \"string\"\n );\n validateOptionalProperty(\n diagnostics,\n field,\n \"name\",\n containerAppOptional.name,\n \"string\"\n );\n if (!containerAppOptional.name) {\n if (!topLevelName || !isOptionalProperty(containerAppOptional, \"class_name\", \"string\")) {\n diagnostics.errors.push(\n `Must have either a top level \"name\" and \"containers.class_name\" field defined, or have field \"containers.name\" defined.`\n );\n }\n let name = `${topLevelName}-${containerAppOptional.class_name}`;\n name += config === void 0 ? \"\" : `-${envName}`;\n containerAppOptional.name = name.toLowerCase().replace(/ /g, \"-\");\n }\n if (!containerAppOptional.configuration?.image && !containerAppOptional.image) {\n diagnostics.errors.push(\n `\"containers.image\" field must be defined for each container app. This should be the path to your Dockerfile or an image URI pointing to the Cloudflare registry.`\n );\n }\n if (\"configuration\" in containerAppOptional) {\n diagnostics.warnings.push(\n `\"containers.configuration\" is deprecated. Use top level \"containers\" fields instead. \"configuration.image\" should be \"image\", limits should be set via \"instance_type\".`\n );\n if (typeof containerAppOptional.configuration !== \"object\" || Array.isArray(containerAppOptional.configuration)) {\n diagnostics.errors.push(\n `\"containers.configuration\" should be an object`\n );\n }\n if (containerAppOptional.instance_type && (containerAppOptional.configuration.disk !== void 0 || containerAppOptional.configuration.vcpu !== void 0 || containerAppOptional.configuration.memory_mib !== void 0)) {\n diagnostics.errors.push(\n `Cannot set custom limits via \"containers.configuration\" and use preset \"instance_type\" limits at the same time.`\n );\n }\n }\n validateOptionalProperty(\n diagnostics,\n field,\n \"image_build_context\",\n containerAppOptional.image_build_context,\n \"string\"\n );\n let resolvedImage = containerAppOptional.image ?? containerAppOptional.configuration?.image;\n let resolvedBuildContextPath = void 0;\n try {\n if (isDockerfile(resolvedImage, configPath)) {\n const baseDir = configPath ? path3.dirname(configPath) : process.cwd();\n resolvedImage = path3.resolve(baseDir, resolvedImage);\n resolvedBuildContextPath = containerAppOptional.image_build_context ? path3.resolve(baseDir, containerAppOptional.image_build_context) : path3.dirname(resolvedImage);\n }\n } catch (err) {\n if (err instanceof Error && err.message) {\n diagnostics.errors.push(err.message);\n } else {\n throw err;\n }\n }\n containerAppOptional.image = resolvedImage;\n containerAppOptional.image_build_context = resolvedBuildContextPath;\n if (containerAppOptional.rollout_step_percentage !== void 0) {\n const rolloutStep = containerAppOptional.rollout_step_percentage;\n if (typeof rolloutStep === \"number\") {\n const allowedSingleValues = [5, 10, 20, 25, 50, 100];\n if (!allowedSingleValues.includes(rolloutStep)) {\n diagnostics.errors.push(\n `\"containers.rollout_step_percentage\" must be one of [5, 10, 20, 25, 50, 100], but got ${rolloutStep}`\n );\n }\n } else if (Array.isArray(rolloutStep)) {\n const nonNumber = [];\n const outOfRange = [];\n let index = 0;\n let ascending = true;\n for (const step of rolloutStep) {\n if (typeof step !== \"number\") {\n nonNumber.push(step);\n } else {\n if (step < 10 || step > 100) {\n outOfRange.push(step);\n }\n if (ascending && index > 0 && step < rolloutStep[index - 1]) {\n diagnostics.errors.push(\n `\"containers.rollout_step_percentage\" array elements must be in ascending order, but got \"${rolloutStep}\"`\n );\n ascending = false;\n }\n if (index === rolloutStep.length - 1 && step !== 100) {\n diagnostics.errors.push(\n `The final step in \"containers.rollout_step_percentage\" must be 100, but got \"${step}\"`\n );\n }\n index++;\n }\n }\n if (nonNumber.length) {\n diagnostics.errors.push(\n `\"containers.rollout_step_percentage\" array elements must be numbers, but got \"${nonNumber.join(\", \")}\"`\n );\n }\n if (outOfRange.length) {\n diagnostics.errors.push(\n `\"containers.rollout_step_percentage\" array elements must be between 10 and 100, but got \"${outOfRange.join(\", \")}\"`\n );\n }\n } else {\n diagnostics.errors.push(\n `\"containers.rollout_step_percentage\" must be a number or array of numbers, but got \"${rolloutStep}\"`\n );\n }\n }\n validateOptionalProperty(\n diagnostics,\n field,\n \"rollout_kind\",\n containerAppOptional.rollout_kind,\n \"string\",\n [\"full_auto\", \"full_manual\", \"none\"]\n );\n if (!isOptionalProperty(\n containerAppOptional,\n \"rollout_active_grace_period\",\n \"number\"\n ) || containerAppOptional.rollout_active_grace_period < 0) {\n diagnostics.errors.push(\n `\"containers.rollout_active_grace_period\" field should be a positive number but got \"${containerAppOptional.rollout_active_grace_period}\"`\n );\n }\n validateOptionalProperty(\n diagnostics,\n field,\n \"max_instances\",\n containerAppOptional.max_instances,\n \"number\"\n );\n if (containerAppOptional.max_instances !== void 0 && containerAppOptional.max_instances < 0) {\n diagnostics.errors.push(\n `\"containers.max_instances\" field should be a positive number, but got ${containerAppOptional.max_instances}`\n );\n }\n if (containerAppOptional.rollout_step_percentage !== void 0 && containerAppOptional.max_instances !== void 0 && Array.isArray(containerAppOptional.rollout_step_percentage)) {\n const rolloutStepsCount = containerAppOptional.rollout_step_percentage.length;\n if (rolloutStepsCount > containerAppOptional.max_instances) {\n diagnostics.errors.push(\n `\"containers.rollout_step_percentage\" cannot have more steps (${rolloutStepsCount}) than \"max_instances\" (${containerAppOptional.max_instances})`\n );\n }\n }\n validateOptionalProperty(\n diagnostics,\n field,\n \"image_vars\",\n containerAppOptional.image_vars,\n \"object\"\n );\n validateOptionalProperty(\n diagnostics,\n field,\n \"scheduling_policy\",\n containerAppOptional.scheduling_policy,\n \"string\",\n [\"regional\", \"moon\", \"default\"]\n );\n if (\"instances\" in containerAppOptional) {\n diagnostics.warnings.push(\n `\"containers.instances\" is deprecated. Use \"containers.max_instances\" instead.`\n );\n }\n if (\"durable_objects\" in containerAppOptional) {\n diagnostics.warnings.push(\n `\"containers.durable_objects\" is deprecated. Use the \"class_name\" field instead.`\n );\n }\n if (\"unsafe\" in containerAppOptional) {\n if (containerAppOptional.unsafe && typeof containerAppOptional.unsafe !== \"object\" || Array.isArray(containerAppOptional.unsafe)) {\n diagnostics.errors.push(\n `The field \"containers.unsafe\" should be an object but got ${JSON.stringify(\n typeof containerAppOptional.unsafe\n )}.`\n );\n }\n }\n validateAdditionalProperties(\n diagnostics,\n field,\n Object.keys(containerAppOptional),\n [\n \"name\",\n \"instances\",\n \"max_instances\",\n \"image\",\n \"image_build_context\",\n \"image_vars\",\n \"class_name\",\n \"scheduling_policy\",\n \"instance_type\",\n \"wrangler_ssh\",\n \"authorized_keys\",\n \"trusted_user_ca_keys\",\n \"configuration\",\n \"constraints\",\n \"affinities\",\n \"rollout_step_percentage\",\n \"rollout_kind\",\n \"durable_objects\",\n \"rollout_active_grace_period\",\n \"unsafe\"\n ]\n );\n if (\"configuration\" in containerAppOptional) {\n validateAdditionalProperties(\n diagnostics,\n `${field}.configuration`,\n Object.keys(containerAppOptional.configuration),\n [\"image\", \"secrets\", \"labels\", \"disk\", \"vcpu\", \"memory_mib\"]\n );\n }\n if (\"wrangler_ssh\" in containerAppOptional) {\n if (!isRequiredProperty(\n containerAppOptional.wrangler_ssh,\n \"enabled\",\n \"boolean\"\n )) {\n diagnostics.errors.push(\n `${field}.wrangler_ssh.enabled must be a boolean`\n );\n }\n if (!isOptionalProperty(\n containerAppOptional.wrangler_ssh,\n \"port\",\n \"number\"\n ) || containerAppOptional.wrangler_ssh.port < 1 || containerAppOptional.wrangler_ssh.port > 65535) {\n diagnostics.errors.push(\n `${field}.wrangler_ssh.port must be a number between 1 and 65535 inclusive`\n );\n }\n }\n if (\"authorized_keys\" in containerAppOptional) {\n if (!Array.isArray(containerAppOptional.authorized_keys)) {\n diagnostics.errors.push(`${field}.authorized_keys must be an array`);\n } else {\n for (const index in containerAppOptional.authorized_keys) {\n const fieldPath = `${field}.authorized_keys[${index}]`;\n const key = containerAppOptional.authorized_keys[index];\n if (!isRequiredProperty(key, \"name\", \"string\")) {\n diagnostics.errors.push(`${fieldPath}.name must be a string`);\n }\n if (!isRequiredProperty(key, \"public_key\", \"string\")) {\n diagnostics.errors.push(\n `${fieldPath}.public_key must be a string`\n );\n }\n if (!key.public_key.toLowerCase().startsWith(\"ssh-ed25519\")) {\n diagnostics.errors.push(\n `${fieldPath}.public_key is a unsupported key type. Please provide a ED25519 public key.`\n );\n }\n }\n }\n }\n if (\"trusted_user_ca_keys\" in containerAppOptional) {\n if (!Array.isArray(containerAppOptional.trusted_user_ca_keys)) {\n diagnostics.errors.push(\n `${field}.trusted_user_ca_keys must be an array`\n );\n } else {\n for (const index in containerAppOptional.trusted_user_ca_keys) {\n const fieldPath = `${field}.trusted_user_ca_keys[${index}]`;\n const key = containerAppOptional.trusted_user_ca_keys[index];\n if (!isOptionalProperty(key, \"name\", \"string\")) {\n diagnostics.errors.push(`${fieldPath}.name must be a string`);\n }\n if (!isRequiredProperty(key, \"public_key\", \"string\")) {\n diagnostics.errors.push(\n `${fieldPath}.public_key must be a string`\n );\n }\n if (!key.public_key.toLowerCase().startsWith(\"ssh-ed25519\")) {\n diagnostics.errors.push(\n `${fieldPath}.public_key is a unsupported key type. Please provide a ED25519 public key.`\n );\n }\n }\n }\n }\n if (validateOptionalProperty(\n diagnostics,\n field,\n \"constraints\",\n containerAppOptional.constraints,\n \"object\"\n ) && containerAppOptional.constraints) {\n const constraints = containerAppOptional.constraints;\n if (\"tier\" in constraints) {\n diagnostics.warnings.push(\n `\"constraints.tier\" has been deprecated in favor of \"constraints.tiers\". Please update your configuration to use \"constraints.tiers\" instead.`\n );\n if (\"tiers\" in constraints) {\n diagnostics.errors.push(\n `${field}.constraints.tier and ${field}.constraints.tiers cannot both be set`\n );\n }\n }\n validateOptionalTypedArray(\n diagnostics,\n `${field}.constraints.tiers`,\n constraints.tiers,\n \"number\"\n );\n }\n if (typeof containerAppOptional.instance_type === \"string\") {\n validateOptionalProperty(\n diagnostics,\n field,\n \"instance_type\",\n containerAppOptional.instance_type,\n \"string\",\n ALLOWED_INSTANCE_TYPES\n );\n if (containerAppOptional.instance_type === \"dev\") {\n diagnostics.warnings.push(\n `The \"dev\" instance_type has been renamed to \"lite\" and will be removed in a subsequent version. Please update your configuration to use \"lite\" instead.`\n );\n }\n if (containerAppOptional.instance_type === \"standard\") {\n diagnostics.warnings.push(\n `The \"standard\" instance_type has been renamed to \"standard-1\" and will be removed in a subsequent version. Please update your configuration to use \"standard-1\" instead.`\n );\n }\n } else if (validateOptionalProperty(\n diagnostics,\n field,\n \"instance_type\",\n containerAppOptional.instance_type,\n \"object\"\n ) && containerAppOptional.instance_type) {\n const instanceTypeProperties = [\"vcpu\", \"memory_mib\", \"disk_mb\"];\n instanceTypeProperties.forEach((key) => {\n if (!isOptionalProperty(\n containerAppOptional.instance_type,\n key,\n \"number\"\n )) {\n diagnostics.errors.push(\n `\"containers.instance_type.${key}\", when present, should be a number.`\n );\n }\n });\n validateAdditionalProperties(\n diagnostics,\n `${field}.instance_type`,\n Object.keys(containerAppOptional.instance_type),\n instanceTypeProperties\n );\n }\n }\n if (diagnostics.errors.length > 0) {\n return false;\n }\n return true;\n };\n}\n__name(validateContainerApp, \"validateContainerApp\");\nvar validateCloudchamberConfig = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n diagnostics.errors.push(\n `\"cloudchamber\" should be an object, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n const optionalAttrsByType = {\n string: [\"memory\", \"image\", \"location\"],\n boolean: [\"ipv4\"],\n number: [\"vcpu\"]\n };\n let isValid2 = true;\n Object.entries(optionalAttrsByType).forEach(([attrType, attrNames]) => {\n attrNames.forEach((key) => {\n if (!isOptionalProperty(value, key, attrType)) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a ${attrType} \"${key}\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n });\n });\n if (\"instance_type\" in value && value.instance_type !== void 0) {\n if (typeof value.instance_type !== \"string\" || !ALLOWED_INSTANCE_TYPES.includes(value.instance_type)) {\n diagnostics.errors.push(\n `\"instance_type\" should be one of 'lite', 'basic', 'standard-1', 'standard-2', 'standard-3', or 'standard-4', but got ${value.instance_type}`\n );\n }\n if (\"memory\" in value && value.memory !== void 0 || \"vcpu\" in value && value.vcpu !== void 0) {\n diagnostics.errors.push(\n `\"${field}\" configuration should not set either \"memory\" or \"vcpu\" with \"instance_type\"`\n );\n }\n }\n return isValid2;\n}, \"validateCloudchamberConfig\");\nvar validateKVBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"kv_namespaces\" bindings should be objects, but got ${JSON.stringify(\n value\n )}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"id\", \"string\") || value.id !== void 0 && value.id.length === 0) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"preview_id\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a string \"preview_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"id\",\n \"preview_id\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateKVBinding\");\nvar validateSendEmailBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"send_email\" bindings should be objects, but got ${JSON.stringify(\n value\n )}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"name\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"name\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"destination_address\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a string \"destination_address\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"allowed_destination_addresses\", \"object\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a []string \"allowed_destination_addresses\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"allowed_sender_addresses\", \"object\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a []string \"allowed_sender_addresses\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (\"destination_address\" in value && \"allowed_destination_addresses\" in value) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have either a \"destination_address\" or \"allowed_destination_addresses\" field, but not both.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"allowed_sender_addresses\",\n \"allowed_destination_addresses\",\n \"destination_address\",\n \"name\",\n \"binding\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateSendEmailBinding\");\nvar validateQueueBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"queue\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"queue\",\n \"delivery_delay\",\n \"remote\"\n ])) {\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"queue\", \"string\") || value.queue.length === 0) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"queue\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n const options = [{ key: \"delivery_delay\", type: \"number\" }];\n for (const optionalOpt of options) {\n if (!isOptionalProperty(value, optionalOpt.key, optionalOpt.type)) {\n diagnostics.errors.push(\n `\"${field}\" should, optionally, have a ${optionalOpt.type} \"${optionalOpt.key}\" field but got ${JSON.stringify(value)}.`\n );\n isValid2 = false;\n }\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n return isValid2;\n}, \"validateQueueBinding\");\nvar validateR2Binding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"r2_buckets\" bindings should be objects, but got ${JSON.stringify(\n value\n )}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"bucket_name\", \"string\") || value.bucket_name !== void 0 && value.bucket_name.length === 0) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"bucket_name\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (isValid2 && hasProperty(value, \"bucket_name\") && !isValidR2BucketName(value.bucket_name)) {\n diagnostics.errors.push(\n `${field}.bucket_name=${JSON.stringify(value.bucket_name)} is invalid. ${bucketFormatMessage}`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"preview_bucket_name\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a string \"preview_bucket_name\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (isValid2 && hasProperty(value, \"preview_bucket_name\") && !isValidR2BucketName(value.preview_bucket_name)) {\n diagnostics.errors.push(\n `${field}.preview_bucket_name= ${JSON.stringify(value.preview_bucket_name)} is invalid. ${bucketFormatMessage}`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"jurisdiction\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a string \"jurisdiction\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"bucket_name\",\n \"preview_bucket_name\",\n \"jurisdiction\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateR2Binding\");\nvar validateD1Binding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"d1_databases\" bindings should be objects, but got ${JSON.stringify(\n value\n )}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"database_id\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a \"database_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"preview_database_id\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a string \"preview_database_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"database_id\",\n \"database_internal_env\",\n \"database_name\",\n \"migrations_dir\",\n \"migrations_table\",\n \"preview_database_id\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateD1Binding\");\nvar validateVectorizeBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"vectorize\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"index_name\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have an \"index_name\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"index_name\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateVectorizeBinding\");\nvar validateAISearchNamespaceBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"ai_search_namespaces\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(value)}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"namespace\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a \"namespace\" field but got ${JSON.stringify(value)}.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"namespace\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateAISearchNamespaceBinding\");\nvar validateAISearchBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"ai_search\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(value)}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"instance_name\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have an \"instance_name\" field but got ${JSON.stringify(value)}.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"instance_name\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateAISearchBinding\");\nvar validateHyperdriveBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"hyperdrive\" bindings should be objects, but got ${JSON.stringify(\n value\n )}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"id\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a \"id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"id\",\n \"localConnectionString\"\n ]);\n return isValid2;\n}, \"validateHyperdriveBinding\");\nvar validateVpcServiceBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"vpc_services\" bindings should be objects, but got ${JSON.stringify(\n value\n )}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"service_id\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a \"service_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"service_id\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateVpcServiceBinding\");\nvar validateVpcNetworkBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"vpc_networks\" bindings should be objects, but got ${JSON.stringify(\n value\n )}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n const hasTunnelId = hasProperty(value, \"tunnel_id\");\n const hasNetworkId = hasProperty(value, \"network_id\");\n if (hasTunnelId && hasNetworkId) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have either a \"tunnel_id\" or \"network_id\", but not both.`\n );\n isValid2 = false;\n } else if (!hasTunnelId && !hasNetworkId) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have either a \"tunnel_id\" or \"network_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n } else if (hasTunnelId && typeof value.tunnel_id !== \"string\") {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"tunnel_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n } else if (hasNetworkId && typeof value.network_id !== \"string\") {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"network_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"tunnel_id\",\n \"network_id\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validateVpcNetworkBinding\");\nvar validateBindingsHaveUniqueNames = /* @__PURE__ */ __name((diagnostics, config) => {\n let hasDuplicates = false;\n const bindingNamesArray = Object.entries(friendlyBindingNames);\n const bindingsGroupedByType = Object.fromEntries(\n bindingNamesArray.map(([bindingType, binding]) => [\n binding,\n getBindingNames(\n bindingType === \"queues\" ? config[bindingType]?.producers : config[bindingType]\n )\n ])\n );\n bindingsGroupedByType[\"Secret\"] = config.secrets?.required ?? [];\n const bindingsGroupedByName = {};\n for (const bindingType in bindingsGroupedByType) {\n const bindingNames = bindingsGroupedByType[bindingType];\n for (const bindingName of bindingNames) {\n if (!(bindingName in bindingsGroupedByName)) {\n bindingsGroupedByName[bindingName] = [];\n }\n if (bindingName === \"ASSETS\" && isPagesConfig(config)) {\n diagnostics.errors.push(\n `The name 'ASSETS' is reserved in Pages projects. Please use a different name for your ${bindingType} binding.`\n );\n }\n bindingsGroupedByName[bindingName].push(bindingType);\n }\n }\n for (const bindingName in bindingsGroupedByName) {\n const bindingTypes = bindingsGroupedByName[bindingName];\n if (bindingTypes.length < 2) {\n continue;\n }\n hasDuplicates = true;\n const sameType = bindingTypes.filter((type, i) => bindingTypes.indexOf(type) !== i).filter(\n (type, i, duplicateBindingTypes) => duplicateBindingTypes.indexOf(type) === i\n );\n const differentTypes = bindingTypes.filter(\n (type, i) => bindingTypes.indexOf(type) === i\n );\n if (differentTypes.length > 1) {\n diagnostics.errors.push(\n `${bindingName} assigned to ${ENGLISH.format(differentTypes)} bindings.`\n );\n }\n sameType.forEach((bindingType) => {\n diagnostics.errors.push(\n `${bindingName} assigned to multiple ${bindingType} bindings.`\n );\n });\n }\n if (hasDuplicates) {\n const problem = \"Bindings must have unique names, so that they can all be referenced in the worker.\";\n const resolution = \"Please change your bindings to have unique names.\";\n diagnostics.errors.push(`${problem}\n${resolution}`);\n }\n return !hasDuplicates;\n}, \"validateBindingsHaveUniqueNames\");\nvar validateServiceBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"services\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"service\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"service\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"environment\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"environment\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"entrypoint\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"entrypoint\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n return isValid2;\n}, \"validateServiceBinding\");\nvar validateAnalyticsEngineBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"analytics_engine\" bindings should be objects, but got ${JSON.stringify(\n value\n )}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"dataset\", \"string\") || value.dataset?.length === 0) {\n diagnostics.errors.push(\n `\"${field}\" bindings should, optionally, have a string \"dataset\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"dataset\"\n ]);\n return isValid2;\n}, \"validateAnalyticsEngineBinding\");\nvar validateWorkerNamespaceBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"${field}\" binding should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"namespace\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" should have a string \"namespace\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (hasProperty(value, \"outbound\")) {\n if (!validateWorkerNamespaceOutbound(\n diagnostics,\n `${field}.outbound`,\n value.outbound ?? {}\n )) {\n diagnostics.errors.push(`\"${field}\" has an invalid outbound definition.`);\n isValid2 = false;\n }\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n return isValid2;\n}, \"validateWorkerNamespaceBinding\");\nfunction validateWorkerNamespaceOutbound(diagnostics, field, value) {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"${field}\" should be an object, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n isValid2 = isValid2 && validateRequiredProperty(\n diagnostics,\n field,\n \"service\",\n value.service,\n \"string\"\n );\n isValid2 = isValid2 && validateOptionalProperty(\n diagnostics,\n field,\n \"environment\",\n value.environment,\n \"string\"\n );\n isValid2 = isValid2 && validateOptionalTypedArray(\n diagnostics,\n `${field}.parameters`,\n value.parameters,\n \"string\"\n );\n return isValid2;\n}\n__name(validateWorkerNamespaceOutbound, \"validateWorkerNamespaceOutbound\");\nvar validateMTlsCertificateBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"mtls_certificates\" bindings should be objects, but got ${JSON.stringify(\n value\n )}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"certificate_id\", \"string\") || value.certificate_id.length === 0) {\n diagnostics.errors.push(\n `\"${field}\" bindings should have a string \"certificate_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"certificate_id\",\n \"remote\"\n ]);\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n return isValid2;\n}, \"validateMTlsCertificateBinding\");\nfunction validateQueues(envName) {\n return (diagnostics, field, value, config) => {\n const fieldPath = config === void 0 ? `${field}` : `env.${envName}.${field}`;\n if (typeof value !== \"object\" || Array.isArray(value) || value === null) {\n diagnostics.errors.push(\n `The field \"${fieldPath}\" should be an object but got ${JSON.stringify(\n value\n )}.`\n );\n return false;\n }\n let isValid2 = true;\n if (!validateAdditionalProperties(\n diagnostics,\n fieldPath,\n Object.keys(value),\n [\"consumers\", \"producers\"]\n )) {\n isValid2 = false;\n }\n if (hasProperty(value, \"consumers\")) {\n const consumers = value.consumers;\n if (!Array.isArray(consumers)) {\n diagnostics.errors.push(\n `The field \"${fieldPath}.consumers\" should be an array but got ${JSON.stringify(\n consumers\n )}.`\n );\n isValid2 = false;\n }\n for (let i = 0; i < consumers.length; i++) {\n const consumer = consumers[i];\n const consumerPath = `${fieldPath}.consumers[${i}]`;\n if (!validateConsumer(diagnostics, consumerPath, consumer, config)) {\n isValid2 = false;\n }\n }\n }\n if (hasProperty(value, \"producers\")) {\n if (!validateBindingArray(envName, validateQueueBinding)(\n diagnostics,\n `${field}.producers`,\n value.producers,\n config\n )) {\n isValid2 = false;\n }\n }\n return isValid2;\n };\n}\n__name(validateQueues, \"validateQueues\");\nvar validateConsumer = /* @__PURE__ */ __name((diagnostics, field, value, _config) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"${field}\" should be a objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"queue\",\n \"type\",\n \"max_batch_size\",\n \"max_batch_timeout\",\n \"max_retries\",\n \"dead_letter_queue\",\n \"max_concurrency\",\n \"visibility_timeout_ms\",\n \"retry_delay\"\n ])) {\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"queue\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" should have a string \"queue\" field but got ${JSON.stringify(\n value\n )}.`\n );\n }\n if (\"type\" in value && value.type !== void 0 && value.type !== \"worker\") {\n diagnostics.errors.push(\n `\"${field}.type\" has an invalid value \"${value.type}\". Only \"worker\" consumers can be configured in your Wrangler configuration.`\n );\n isValid2 = false;\n }\n const options = [\n { key: \"type\", type: \"string\" },\n { key: \"max_batch_size\", type: \"number\" },\n { key: \"max_batch_timeout\", type: \"number\" },\n { key: \"max_retries\", type: \"number\" },\n { key: \"dead_letter_queue\", type: \"string\" },\n { key: \"max_concurrency\", type: \"number\" },\n { key: \"visibility_timeout_ms\", type: \"number\" },\n { key: \"retry_delay\", type: \"number\" }\n ];\n for (const optionalOpt of options) {\n if (!isOptionalProperty(value, optionalOpt.key, optionalOpt.type)) {\n diagnostics.errors.push(\n `\"${field}\" should, optionally, have a ${optionalOpt.type} \"${optionalOpt.key}\" field but got ${JSON.stringify(value)}.`\n );\n isValid2 = false;\n }\n }\n return isValid2;\n}, \"validateConsumer\");\nvar validateCompatibilityDate = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (value === void 0) {\n return true;\n }\n if (typeof value !== \"string\") {\n diagnostics.errors.push(\n `Expected \"${field}\" to be of type string but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n return isValidDateTimeStringFormat(diagnostics, field, value);\n}, \"validateCompatibilityDate\");\nvar validatePipelineBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"pipeline\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"pipeline\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"pipeline\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRemoteValid(value, field, diagnostics)) {\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"pipeline\",\n \"remote\"\n ]);\n return isValid2;\n}, \"validatePipelineBinding\");\nvar validateSecretsStoreSecretBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"secrets_store_secrets\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"store_id\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"store_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"secret_name\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"secret_name\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"store_id\",\n \"secret_name\"\n ]);\n return isValid2;\n}, \"validateSecretsStoreSecretBinding\");\nvar validateHelloWorldBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"unsafe_hello_world\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isOptionalProperty(value, \"enable_timer\", \"boolean\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a boolean \"enable_timer\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\",\n \"enable_timer\"\n ]);\n return isValid2;\n}, \"validateHelloWorldBinding\");\nvar validateWorkerLoaderBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"worker_loader\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"binding\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"binding\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"binding\"\n ]);\n return isValid2;\n}, \"validateWorkerLoaderBinding\");\nvar validateRateLimitBinding = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"ratelimits\" bindings should be objects, but got ${JSON.stringify(value)}`\n );\n return false;\n }\n let isValid2 = true;\n if (!isRequiredProperty(value, \"name\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"name\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value, \"namespace_id\", \"string\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a string \"namespace_id\" field but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n }\n if (!hasProperty(value, \"simple\") || typeof value.simple !== \"object\" || value.simple === null) {\n diagnostics.errors.push(\n `\"${field}\" bindings must have a \"simple\" configuration object but got ${JSON.stringify(\n value\n )}.`\n );\n isValid2 = false;\n } else {\n if (!isRequiredProperty(value.simple, \"limit\", \"number\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings \"simple.limit\" must be a number but got ${JSON.stringify(\n value.simple\n )}.`\n );\n isValid2 = false;\n }\n if (!isRequiredProperty(value.simple, \"period\", \"number\")) {\n diagnostics.errors.push(\n `\"${field}\" bindings \"simple.period\" is required and must be a number but got ${JSON.stringify(\n value.simple\n )}.`\n );\n isValid2 = false;\n } else if (![10, 60].includes(value.simple.period)) {\n diagnostics.errors.push(\n `\"${field}\" bindings \"simple.period\" must be either 10 or 60 but got ${JSON.stringify(\n value.simple.period\n )}.`\n );\n isValid2 = false;\n }\n validateAdditionalProperties(\n diagnostics,\n `${field}.simple`,\n Object.keys(value.simple),\n [\"limit\", \"period\"]\n );\n }\n validateAdditionalProperties(diagnostics, field, Object.keys(value), [\n \"name\",\n \"namespace_id\",\n \"simple\"\n ]);\n return isValid2;\n}, \"validateRateLimitBinding\");\nfunction normalizeAndValidateLimits(diagnostics, topLevelEnv, rawEnv) {\n if (rawEnv.limits) {\n validateOptionalProperty(\n diagnostics,\n \"limits\",\n \"cpu_ms\",\n rawEnv.limits.cpu_ms,\n \"number\"\n );\n validateOptionalProperty(\n diagnostics,\n \"limits\",\n \"subrequests\",\n rawEnv.limits.subrequests,\n \"number\"\n );\n }\n return inheritable(\n diagnostics,\n topLevelEnv,\n rawEnv,\n \"limits\",\n () => true,\n void 0\n );\n}\n__name(normalizeAndValidateLimits, \"normalizeAndValidateLimits\");\nvar validateMigrations = /* @__PURE__ */ __name((diagnostics, field, value) => {\n const rawMigrations = value ?? [];\n if (!Array.isArray(rawMigrations)) {\n diagnostics.errors.push(\n `The optional \"${field}\" field should be an array, but got ${JSON.stringify(\n rawMigrations\n )}`\n );\n return false;\n }\n let valid = true;\n for (let i = 0; i < rawMigrations.length; i++) {\n const {\n tag,\n new_classes,\n new_sqlite_classes,\n renamed_classes,\n deleted_classes,\n transferred_classes,\n ...rest\n } = rawMigrations[i];\n valid = validateAdditionalProperties(\n diagnostics,\n \"migrations\",\n Object.keys(rest),\n []\n ) && valid;\n valid = validateRequiredProperty(\n diagnostics,\n `migrations[${i}]`,\n `tag`,\n tag,\n \"string\"\n ) && valid;\n valid = validateOptionalTypedArray(\n diagnostics,\n `migrations[${i}].new_classes`,\n new_classes,\n \"string\"\n ) && valid;\n valid = validateOptionalTypedArray(\n diagnostics,\n `migrations[${i}].new_sqlite_classes`,\n new_sqlite_classes,\n \"string\"\n ) && valid;\n if (renamed_classes !== void 0) {\n if (!Array.isArray(renamed_classes)) {\n diagnostics.errors.push(\n `Expected \"migrations[${i}].renamed_classes\" to be an array of \"{from: string, to: string}\" objects but got ${JSON.stringify(\n renamed_classes\n )}.`\n );\n valid = false;\n } else if (renamed_classes.some(\n (c) => typeof c !== \"object\" || !isRequiredProperty(c, \"from\", \"string\") || !isRequiredProperty(c, \"to\", \"string\")\n )) {\n diagnostics.errors.push(\n `Expected \"migrations[${i}].renamed_classes\" to be an array of \"{from: string, to: string}\" objects but got ${JSON.stringify(\n renamed_classes\n )}.`\n );\n valid = false;\n }\n }\n if (transferred_classes !== void 0) {\n if (!Array.isArray(transferred_classes)) {\n diagnostics.errors.push(\n `Expected \"migrations[${i}].transferred_classes\" to be an array of \"{from: string, from_script: string, to: string}\" objects but got ${JSON.stringify(\n transferred_classes\n )}.`\n );\n valid = false;\n } else if (transferred_classes.some(\n (c) => typeof c !== \"object\" || !isRequiredProperty(c, \"from\", \"string\") || !isRequiredProperty(c, \"from_script\", \"string\") || !isRequiredProperty(c, \"to\", \"string\")\n )) {\n diagnostics.errors.push(\n `Expected \"migrations[${i}].transferred_classes\" to be an array of \"{from: string, from_script: string, to: string}\" objects but got ${JSON.stringify(\n transferred_classes\n )}.`\n );\n valid = false;\n }\n }\n valid = validateOptionalTypedArray(\n diagnostics,\n `migrations[${i}].deleted_classes`,\n deleted_classes,\n \"string\"\n ) && valid;\n }\n return valid;\n}, \"validateMigrations\");\nvar validateObservability = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (value === void 0) {\n return true;\n }\n if (typeof value !== \"object\") {\n diagnostics.errors.push(\n `\"${field}\" should be an object but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n const val = value;\n let isValid2 = true;\n isValid2 = validateAtLeastOnePropertyRequired(diagnostics, field, [\n {\n key: \"enabled\",\n value: val.enabled,\n type: \"boolean\"\n },\n {\n key: \"logs.enabled\",\n value: val.logs?.enabled,\n type: \"boolean\"\n },\n {\n key: \"traces.enabled\",\n value: val.traces?.enabled,\n type: \"boolean\"\n }\n ]) && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"head_sampling_rate\",\n val.head_sampling_rate,\n \"number\"\n ) && isValid2;\n isValid2 = validateOptionalProperty(diagnostics, field, \"logs\", val.logs, \"object\") && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"traces\",\n val.traces,\n \"object\"\n ) && isValid2;\n isValid2 = validateAdditionalProperties(diagnostics, field, Object.keys(val), [\n \"enabled\",\n \"head_sampling_rate\",\n \"logs\",\n \"traces\"\n ]) && isValid2;\n if (typeof val.logs === \"object\") {\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"logs.enabled\",\n val.logs.enabled,\n \"boolean\"\n ) && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"logs.head_sampling_rate\",\n val.logs.head_sampling_rate,\n \"number\"\n ) && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"logs.invocation_logs\",\n val.logs.invocation_logs,\n \"boolean\"\n ) && isValid2;\n isValid2 = validateOptionalTypedArray(\n diagnostics,\n \"logs.destinations\",\n val.logs?.destinations,\n \"string\"\n ) && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"logs.persist\",\n val.logs.persist,\n \"boolean\"\n ) && isValid2;\n isValid2 = validateAdditionalProperties(diagnostics, field, Object.keys(val.logs), [\n \"enabled\",\n \"head_sampling_rate\",\n \"invocation_logs\",\n \"destinations\",\n \"persist\"\n ]) && isValid2;\n }\n if (typeof val.traces === \"object\") {\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"traces.enabled\",\n val.traces.enabled,\n \"boolean\"\n ) && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"traces.head_sampling_rate\",\n val.traces.head_sampling_rate,\n \"number\"\n ) && isValid2;\n isValid2 = validateOptionalTypedArray(\n diagnostics,\n \"traces.destinations\",\n val.traces?.destinations,\n \"string\"\n ) && isValid2;\n isValid2 = validateOptionalProperty(\n diagnostics,\n field,\n \"traces.persist\",\n val.traces.persist,\n \"boolean\"\n ) && isValid2;\n isValid2 = validateAdditionalProperties(\n diagnostics,\n field,\n Object.keys(val.traces),\n [\"enabled\", \"head_sampling_rate\", \"destinations\", \"persist\"]\n ) && isValid2;\n }\n const samplingRate = val?.head_sampling_rate;\n if (samplingRate && (samplingRate < 0 || samplingRate > 1)) {\n diagnostics.errors.push(\n `\"${field}.head_sampling_rate\" must be a value between 0 and 1.`\n );\n }\n return isValid2;\n}, \"validateObservability\");\nvar validateCache = /* @__PURE__ */ __name((diagnostics, field, value) => {\n if (value === void 0) {\n return true;\n }\n if (typeof value !== \"object\" || value === null) {\n diagnostics.errors.push(\n `\"${field}\" should be an object but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n const val = value;\n let isValid2 = true;\n isValid2 = validateRequiredProperty(\n diagnostics,\n field,\n \"enabled\",\n val.enabled,\n \"boolean\"\n ) && isValid2;\n isValid2 = validateAdditionalProperties(diagnostics, field, Object.keys(val), [\n \"enabled\"\n ]) && isValid2;\n return isValid2;\n}, \"validateCache\");\nfunction warnIfDurableObjectsHaveNoMigrations(diagnostics, durableObjects, migrations, configPath) {\n if (Array.isArray(durableObjects.bindings) && durableObjects.bindings.length > 0) {\n const exportedDurableObjects = (durableObjects.bindings || []).filter(\n (binding) => !binding.script_name\n );\n if (exportedDurableObjects.length > 0 && migrations.length === 0) {\n if (!exportedDurableObjects.some(\n (exportedDurableObject) => typeof exportedDurableObject.class_name !== \"string\"\n )) {\n const durableObjectClassnames = exportedDurableObjects.map(\n (durable) => durable.class_name\n );\n diagnostics.warnings.push(dedent`\n\t\t\t\tIn your ${configFileName(configPath)} file, you have configured \\`durable_objects\\` exported by this Worker (${durableObjectClassnames.join(\", \")}), but no \\`migrations\\` for them. This may not work as expected until you add a \\`migrations\\` section to your ${configFileName(configPath)} file. Add the following configuration:\n\n\t\t\t\t\\`\\`\\`\n\t\t\t\t${formatConfigSnippet(\n {\n migrations: [\n { tag: \"v1\", new_sqlite_classes: durableObjectClassnames }\n ]\n },\n configPath\n )}\n\t\t\t\t\\`\\`\\`\n\n\t\t\t\tRefer to https://developers.cloudflare.com/durable-objects/reference/durable-objects-migrations/ for more details.`);\n }\n }\n }\n}\n__name(warnIfDurableObjectsHaveNoMigrations, \"warnIfDurableObjectsHaveNoMigrations\");\nvar validatePythonModules = /* @__PURE__ */ __name((diagnostics, field, value, topLevelEnv) => {\n if (value === void 0) {\n return true;\n }\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n diagnostics.errors.push(\n `\"${field}\" should be an object but got ${JSON.stringify(value)}.`\n );\n return false;\n }\n const val = value;\n if (!(\"exclude\" in val)) {\n return false;\n }\n if (!isStringArray(diagnostics, `${field}.exclude`, val.exclude, topLevelEnv)) {\n return false;\n }\n return true;\n}, \"validatePythonModules\");\nfunction isRemoteValid(targetObject, fieldPath, diagnostics) {\n if (!isOptionalProperty(targetObject, \"remote\", \"boolean\")) {\n diagnostics.errors.push(\n `\"${fieldPath}\" should, optionally, have a boolean \"remote\" field but got ${JSON.stringify(\n targetObject\n )}.`\n );\n return false;\n }\n return true;\n}\n__name(isRemoteValid, \"isRemoteValid\");\nfunction isDockerfile(imagePath, configPath) {\n const baseDir = configPath ? path3.dirname(configPath) : process.cwd();\n const maybeDockerfile = path3.resolve(baseDir, imagePath);\n if (fs.existsSync(maybeDockerfile)) {\n if (isDirectory(maybeDockerfile)) {\n throw new UserError(\n `${imagePath} is a directory, you should specify a path to the Dockerfile`\n );\n }\n return true;\n }\n const errorPrefix = `The image \"${imagePath}\" does not appear to be a valid path to a Dockerfile, or a valid image registry path:\n`;\n try {\n new URL(`https://${imagePath}`);\n } catch (e2) {\n if (e2 instanceof Error) {\n throw new UserError(errorPrefix + e2.message);\n }\n throw e2;\n }\n const imageParts = imagePath.split(\"/\");\n if (!imageParts[imageParts.length - 1]?.includes(\":\")) {\n throw new UserError(\n errorPrefix + `If this is an image registry path, it needs to include at least a tag ':' (e.g: docker.io/httpd:1)`\n );\n }\n if (imagePath.includes(\"://\")) {\n throw new UserError(\n errorPrefix + `Image reference should not include the protocol part (e.g: docker.io/httpd:1, not https://docker.io/httpd:1)`\n );\n }\n return false;\n}\n__name(isDockerfile, \"isDockerfile\");\n\n// src/config/validation-pages.ts\nvar supportedPagesConfigFields = [\n \"pages_build_output_dir\",\n \"name\",\n \"compatibility_date\",\n \"compatibility_flags\",\n \"send_metrics\",\n \"no_bundle\",\n \"limits\",\n \"placement\",\n \"vars\",\n \"durable_objects\",\n \"kv_namespaces\",\n \"queues\",\n // `producers` ONLY\n \"r2_buckets\",\n \"d1_databases\",\n \"vectorize\",\n \"hyperdrive\",\n \"services\",\n \"analytics_engine_datasets\",\n \"ai\",\n \"version_metadata\",\n \"dev\",\n \"mtls_certificates\",\n \"browser\",\n \"upload_source_maps\",\n // normalizeAndValidateConfig() sets these values\n \"configPath\",\n \"userConfigPath\",\n \"topLevelName\",\n \"definedEnvironments\",\n \"targetEnvironment\"\n];\nfunction validatePagesConfig(config, envNames, projectName) {\n if (!config.pages_build_output_dir) {\n throw new FatalError(`Attempting to validate Pages configuration file, but \"pages_build_output_dir\" field was not found.\n\t\t\"pages_build_output_dir\" is required for Pages projects.`);\n }\n const diagnostics = new Diagnostics(\n `Running configuration file validation for Pages:`\n );\n validateMainField(config, diagnostics);\n validateProjectName(projectName, diagnostics);\n validatePagesEnvironmentNames(envNames, diagnostics);\n validateUnsupportedFields(config, diagnostics);\n validateDurableObjectBinding2(config, diagnostics);\n return diagnostics;\n}\n__name(validatePagesConfig, \"validatePagesConfig\");\nfunction validateMainField(config, diagnostics) {\n if (config.main !== void 0) {\n diagnostics.errors.push(\n `Configuration file cannot contain both both \"main\" and \"pages_build_output_dir\" configuration keys.\nPlease use \"main\" if you are deploying a Worker, or \"pages_build_output_dir\" if you are deploying a Pages project.`\n );\n }\n}\n__name(validateMainField, \"validateMainField\");\nfunction validateProjectName(name, diagnostics) {\n if (name === void 0 || name.trim() === \"\") {\n diagnostics.errors.push(\n `Missing top-level field \"name\" in configuration file.\nPages requires the name of your project to be configured at the top-level of your Wrangler configuration file. This is because, in Pages, environments target the same project.`\n );\n }\n}\n__name(validateProjectName, \"validateProjectName\");\nfunction validatePagesEnvironmentNames(envNames, diagnostics) {\n if (!envNames?.length) {\n return;\n }\n const unsupportedPagesEnvNames = envNames.filter(\n (name) => name !== \"preview\" && name !== \"production\"\n );\n if (unsupportedPagesEnvNames.length > 0) {\n diagnostics.errors.push(\n `Configuration file contains the following environment names that are not supported by Pages projects:\n${unsupportedPagesEnvNames.map((name) => `\"${name}\"`).join()}.\nThe supported named-environments for Pages are \"preview\" and \"production\".`\n );\n }\n}\n__name(validatePagesEnvironmentNames, \"validatePagesEnvironmentNames\");\nfunction validateUnsupportedFields(config, diagnostics) {\n const unsupportedFields = new Set(Object.keys(config));\n for (const field of supportedPagesConfigFields) {\n if (field === \"queues\" && config.queues?.consumers?.length) {\n continue;\n }\n unsupportedFields.delete(field);\n }\n for (const field of unsupportedFields) {\n if (config[field] === void 0 || JSON.stringify(config[field]) === JSON.stringify(defaultWranglerConfig[field])) {\n unsupportedFields.delete(field);\n }\n }\n if (unsupportedFields.size > 0) {\n const fields = Array.from(unsupportedFields.keys());\n fields.forEach((field) => {\n if (field === \"queues\" && config.queues?.consumers?.length) {\n diagnostics.errors.push(\n `Configuration file for Pages projects does not support \"queues.consumers\"`\n );\n } else {\n diagnostics.errors.push(\n `Configuration file for Pages projects does not support \"${field}\"`\n );\n }\n });\n }\n}\n__name(validateUnsupportedFields, \"validateUnsupportedFields\");\nfunction validateDurableObjectBinding2(config, diagnostics) {\n if (config.durable_objects.bindings.length > 0) {\n const invalidBindings = config.durable_objects.bindings.filter(\n (binding) => !isRequiredProperty(binding, \"script_name\", \"string\")\n );\n if (invalidBindings.length > 0) {\n diagnostics.errors.push(\n `Durable Objects bindings should specify a \"script_name\".\nPages requires Durable Object bindings to specify the name of the Worker where the Durable Object is defined.`\n );\n }\n }\n}\n__name(validateDurableObjectBinding2, \"validateDurableObjectBinding\");\n\nexport { COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, Diagnostics, PatchConfigError, bucketFormatMessage, defaultWranglerConfig, experimental_patchConfig, friendlyBindingNames, getBindingTypeFriendlyName, getBooleanEnvironmentVariableFactory, getBrowserRenderingHeadfulFromEnv, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getC3CommandFromEnv, getCIGeneratePreviewAlias, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCfFetchEnabledFromEnv, getCfFetchPathFromEnv, getCloudflareApiBaseUrl, getCloudflareApiEnvironmentFromEnv, getCloudflareComplianceRegion, getCloudflareEnv, getCloudflareIncludeProcessEnvFromEnv, getCloudflareLoadDevVarsFromDotEnv, getCloudflaredPathFromEnv, getComplianceRegionSubdomain, getD1ExtraLocationChoices, getDisableConfigWatching, getDockerPath, getEnvironmentVariableFactory, getGlobalWranglerConfigPath, getLocalExplorerEnabledFromEnv, getOpenNextDeployFromEnv, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getRegistryPath, getSanitizeLogs, getSubdomainMixedStateCheckDisabled, getTraceHeader, getWorkersCIBranchName, getWranglerCacheDirFromEnv, getWranglerHideBanner, getWranglerSendErrorReportsFromEnv, getWranglerSendMetricsFromEnv, hasProperty, isDockerfile, isOptionalProperty, isPagesConfig, isRequiredProperty, isValidR2BucketName, normalizeAndValidateConfig, validatePagesConfig };\n","/** @type {Record<string, string>} */\nexport const escaped = {\n\t'<': '\\\\u003C',\n\t'\\\\': '\\\\\\\\',\n\t'\\b': '\\\\b',\n\t'\\f': '\\\\f',\n\t'\\n': '\\\\n',\n\t'\\r': '\\\\r',\n\t'\\t': '\\\\t',\n\t'\\u2028': '\\\\u2028',\n\t'\\u2029': '\\\\u2029'\n};\n\nexport class DevalueError extends Error {\n\t/**\n\t * @param {string} message\n\t * @param {string[]} keys\n\t * @param {any} [value] - The value that failed to be serialized\n\t * @param {any} [root] - The root value being serialized\n\t */\n\tconstructor(message, keys, value, root) {\n\t\tsuper(message);\n\t\tthis.name = 'DevalueError';\n\t\tthis.path = keys.join('');\n\t\tthis.value = value;\n\t\tthis.root = root;\n\t}\n}\n\n/** @param {any} thing */\nexport function is_primitive(thing) {\n\treturn Object(thing) !== thing;\n}\n\nconst object_proto_names = /* @__PURE__ */ Object.getOwnPropertyNames(\n\tObject.prototype\n)\n\t.sort()\n\t.join('\\0');\n\n/** @param {any} thing */\nexport function is_plain_object(thing) {\n\tconst proto = Object.getPrototypeOf(thing);\n\n\treturn (\n\t\tproto === Object.prototype ||\n\t\tproto === null ||\n\t\tObject.getPrototypeOf(proto) === null ||\n\t\tObject.getOwnPropertyNames(proto).sort().join('\\0') === object_proto_names\n\t);\n}\n\n/** @param {any} thing */\nexport function get_type(thing) {\n\treturn Object.prototype.toString.call(thing).slice(8, -1);\n}\n\n/** @param {string} char */\nfunction get_escaped_char(char) {\n\tswitch (char) {\n\t\tcase '\"':\n\t\t\treturn '\\\\\"';\n\t\tcase '<':\n\t\t\treturn '\\\\u003C';\n\t\tcase '\\\\':\n\t\t\treturn '\\\\\\\\';\n\t\tcase '\\n':\n\t\t\treturn '\\\\n';\n\t\tcase '\\r':\n\t\t\treturn '\\\\r';\n\t\tcase '\\t':\n\t\t\treturn '\\\\t';\n\t\tcase '\\b':\n\t\t\treturn '\\\\b';\n\t\tcase '\\f':\n\t\t\treturn '\\\\f';\n\t\tcase '\\u2028':\n\t\t\treturn '\\\\u2028';\n\t\tcase '\\u2029':\n\t\t\treturn '\\\\u2029';\n\t\tdefault:\n\t\t\treturn char < ' '\n\t\t\t\t? `\\\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`\n\t\t\t\t: '';\n\t}\n}\n\n/** @param {string} str */\nexport function stringify_string(str) {\n\tlet result = '';\n\tlet last_pos = 0;\n\tconst len = str.length;\n\n\tfor (let i = 0; i < len; i += 1) {\n\t\tconst char = str[i];\n\t\tconst replacement = get_escaped_char(char);\n\t\tif (replacement) {\n\t\t\tresult += str.slice(last_pos, i) + replacement;\n\t\t\tlast_pos = i + 1;\n\t\t}\n\t}\n\n\treturn `\"${last_pos === 0 ? str : result + str.slice(last_pos)}\"`;\n}\n\n/** @param {Record<string | symbol, any>} object */\nexport function enumerable_symbols(object) {\n\treturn Object.getOwnPropertySymbols(object).filter(\n\t\t(symbol) => Object.getOwnPropertyDescriptor(object, symbol).enumerable\n\t);\n}\n\nconst is_identifier = /^[a-zA-Z_$][a-zA-Z_$0-9]*$/;\n\n/** @param {string} key */\nexport function stringify_key(key) {\n\treturn is_identifier.test(key) ? '.' + key : '[' + JSON.stringify(key) + ']';\n}\n\n/** @param {string} s */\nfunction is_valid_array_index(s) {\n\tif (s.length === 0) return false;\n\tif (s.length > 1 && s.charCodeAt(0) === 48) return false; // leading zero\n\tfor (let i = 0; i < s.length; i++) {\n\t\tconst c = s.charCodeAt(i);\n\t\tif (c < 48 || c > 57) return false;\n\t}\n\t// by this point we know it's a string of digits, but it has to be within the range of valid array indices\n\tconst n = +s;\n\tif (n >= 2 ** 32 - 1) return false;\n\tif (n < 0) return false;\n\treturn true;\n}\n\n/**\n * Finds the populated indices of an array.\n * @param {unknown[]} array\n */\nexport function valid_array_indices(array) {\n\tconst keys = Object.keys(array);\n\tfor (var i = keys.length - 1; i >= 0; i--) {\n\t\tif (is_valid_array_index(keys[i])) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tkeys.length = i + 1;\n\treturn keys;\n}\n","/**\n * Base64 Encodes an arraybuffer\n * @param {ArrayBuffer} arraybuffer\n * @returns {string}\n */\nexport function encode64(arraybuffer) {\n const dv = new DataView(arraybuffer);\n let binaryString = \"\";\n\n for (let i = 0; i < arraybuffer.byteLength; i++) {\n binaryString += String.fromCharCode(dv.getUint8(i));\n }\n\n return binaryToAscii(binaryString);\n}\n\n/**\n * Decodes a base64 string into an arraybuffer\n * @param {string} string\n * @returns {ArrayBuffer}\n */\nexport function decode64(string) {\n const binaryString = asciiToBinary(string);\n const arraybuffer = new ArrayBuffer(binaryString.length);\n const dv = new DataView(arraybuffer);\n\n for (let i = 0; i < arraybuffer.byteLength; i++) {\n dv.setUint8(i, binaryString.charCodeAt(i));\n }\n\n return arraybuffer;\n}\n\nconst KEY_STRING =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n\n/**\n * Substitute for atob since it's deprecated in node.\n * Does not do any input validation.\n *\n * @see https://github.com/jsdom/abab/blob/master/lib/atob.js\n *\n * @param {string} data\n * @returns {string}\n */\nfunction asciiToBinary(data) {\n if (data.length % 4 === 0) {\n data = data.replace(/==?$/, \"\");\n }\n\n let output = \"\";\n let buffer = 0;\n let accumulatedBits = 0;\n\n for (let i = 0; i < data.length; i++) {\n buffer <<= 6;\n buffer |= KEY_STRING.indexOf(data[i]);\n accumulatedBits += 6;\n if (accumulatedBits === 24) {\n output += String.fromCharCode((buffer & 0xff0000) >> 16);\n output += String.fromCharCode((buffer & 0xff00) >> 8);\n output += String.fromCharCode(buffer & 0xff);\n buffer = accumulatedBits = 0;\n }\n }\n if (accumulatedBits === 12) {\n buffer >>= 4;\n output += String.fromCharCode(buffer);\n } else if (accumulatedBits === 18) {\n buffer >>= 2;\n output += String.fromCharCode((buffer & 0xff00) >> 8);\n output += String.fromCharCode(buffer & 0xff);\n }\n return output;\n}\n\n/**\n * Substitute for btoa since it's deprecated in node.\n * Does not do any input validation.\n *\n * @see https://github.com/jsdom/abab/blob/master/lib/btoa.js\n *\n * @param {string} str\n * @returns {string}\n */\nfunction binaryToAscii(str) {\n let out = \"\";\n for (let i = 0; i < str.length; i += 3) {\n /** @type {[number, number, number, number]} */\n const groupsOfSix = [undefined, undefined, undefined, undefined];\n groupsOfSix[0] = str.charCodeAt(i) >> 2;\n groupsOfSix[1] = (str.charCodeAt(i) & 0x03) << 4;\n if (str.length > i + 1) {\n groupsOfSix[1] |= str.charCodeAt(i + 1) >> 4;\n groupsOfSix[2] = (str.charCodeAt(i + 1) & 0x0f) << 2;\n }\n if (str.length > i + 2) {\n groupsOfSix[2] |= str.charCodeAt(i + 2) >> 6;\n groupsOfSix[3] = str.charCodeAt(i + 2) & 0x3f;\n }\n for (let j = 0; j < groupsOfSix.length; j++) {\n if (typeof groupsOfSix[j] === \"undefined\") {\n out += \"=\";\n } else {\n out += KEY_STRING[groupsOfSix[j]];\n }\n }\n }\n return out;\n}\n","export const UNDEFINED = -1;\nexport const HOLE = -2;\nexport const NAN = -3;\nexport const POSITIVE_INFINITY = -4;\nexport const NEGATIVE_INFINITY = -5;\nexport const NEGATIVE_ZERO = -6;\nexport const SPARSE = -7;\n","import { decode64 } from './base64.js';\nimport {\n\tHOLE,\n\tNAN,\n\tNEGATIVE_INFINITY,\n\tNEGATIVE_ZERO,\n\tPOSITIVE_INFINITY,\n\tSPARSE,\n\tUNDEFINED\n} from './constants.js';\n\n/**\n * Revive a value serialized with `devalue.stringify`\n * @param {string} serialized\n * @param {Record<string, (value: any) => any>} [revivers]\n */\nexport function parse(serialized, revivers) {\n\treturn unflatten(JSON.parse(serialized), revivers);\n}\n\n/**\n * Revive a value flattened with `devalue.stringify`\n * @param {number | any[]} parsed\n * @param {Record<string, (value: any) => any>} [revivers]\n */\nexport function unflatten(parsed, revivers) {\n\tif (typeof parsed === 'number') return hydrate(parsed, true);\n\n\tif (!Array.isArray(parsed) || parsed.length === 0) {\n\t\tthrow new Error('Invalid input');\n\t}\n\n\tconst values = /** @type {any[]} */ (parsed);\n\n\tconst hydrated = Array(values.length);\n\n\t/**\n\t * A set of values currently being hydrated with custom revivers,\n\t * used to detect invalid cyclical dependencies\n\t * @type {Set<number> | null}\n\t */\n\tlet hydrating = null;\n\n\t/**\n\t * @param {number} index\n\t * @returns {any}\n\t */\n\tfunction hydrate(index, standalone = false) {\n\t\tif (index === UNDEFINED) return undefined;\n\t\tif (index === NAN) return NaN;\n\t\tif (index === POSITIVE_INFINITY) return Infinity;\n\t\tif (index === NEGATIVE_INFINITY) return -Infinity;\n\t\tif (index === NEGATIVE_ZERO) return -0;\n\n\t\tif (standalone || typeof index !== 'number') {\n\t\t\tthrow new Error(`Invalid input`);\n\t\t}\n\n\t\tif (index in hydrated) return hydrated[index];\n\n\t\tconst value = values[index];\n\n\t\tif (!value || typeof value !== 'object') {\n\t\t\thydrated[index] = value;\n\t\t} else if (Array.isArray(value)) {\n\t\t\tif (typeof value[0] === 'string') {\n\t\t\t\tconst type = value[0];\n\n\t\t\t\tconst reviver =\n\t\t\t\t\trevivers && Object.hasOwn(revivers, type)\n\t\t\t\t\t\t? revivers[type]\n\t\t\t\t\t\t: undefined;\n\n\t\t\t\tif (reviver) {\n\t\t\t\t\tlet i = value[1];\n\t\t\t\t\tif (typeof i !== 'number') {\n\t\t\t\t\t\t// if it's not a number, it was serialized by a builtin reviver\n\t\t\t\t\t\t// so we need to munge it into the format expected by a custom reviver\n\t\t\t\t\t\ti = values.push(value[1]) - 1;\n\t\t\t\t\t}\n\n\t\t\t\t\thydrating ??= new Set();\n\n\t\t\t\t\tif (hydrating.has(i)) {\n\t\t\t\t\t\tthrow new Error('Invalid circular reference');\n\t\t\t\t\t}\n\n\t\t\t\t\thydrating.add(i);\n\t\t\t\t\thydrated[index] = reviver(hydrate(i));\n\t\t\t\t\thydrating.delete(i);\n\n\t\t\t\t\treturn hydrated[index];\n\t\t\t\t}\n\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase 'Date':\n\t\t\t\t\t\thydrated[index] = new Date(value[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Set':\n\t\t\t\t\t\tconst set = new Set();\n\t\t\t\t\t\thydrated[index] = set;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 1) {\n\t\t\t\t\t\t\tset.add(hydrate(value[i]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Map':\n\t\t\t\t\t\tconst map = new Map();\n\t\t\t\t\t\thydrated[index] = map;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 2) {\n\t\t\t\t\t\t\tmap.set(hydrate(value[i]), hydrate(value[i + 1]));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'RegExp':\n\t\t\t\t\t\thydrated[index] = new RegExp(value[1], value[2]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Object':\n\t\t\t\t\t\thydrated[index] = Object(value[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'BigInt':\n\t\t\t\t\t\thydrated[index] = BigInt(value[1]);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'null':\n\t\t\t\t\t\tconst obj = Object.create(null);\n\t\t\t\t\t\thydrated[index] = obj;\n\t\t\t\t\t\tfor (let i = 1; i < value.length; i += 2) {\n\t\t\t\t\t\t\tobj[value[i]] = hydrate(value[i + 1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'Int8Array':\n\t\t\t\t\tcase 'Uint8Array':\n\t\t\t\t\tcase 'Uint8ClampedArray':\n\t\t\t\t\tcase 'Int16Array':\n\t\t\t\t\tcase 'Uint16Array':\n\t\t\t\t\tcase 'Int32Array':\n\t\t\t\t\tcase 'Uint32Array':\n\t\t\t\t\tcase 'Float32Array':\n\t\t\t\t\tcase 'Float64Array':\n\t\t\t\t\tcase 'BigInt64Array':\n\t\t\t\t\tcase 'BigUint64Array': {\n\t\t\t\t\t\tif (values[value[1]][0] !== 'ArrayBuffer') {\n\t\t\t\t\t\t\t// without this, if we receive malformed input we could\n\t\t\t\t\t\t\t// end up trying to hydrate in a circle or allocate\n\t\t\t\t\t\t\t// huge amounts of memory when we call `new TypedArrayConstructor(buffer)`\n\t\t\t\t\t\t\tthrow new Error('Invalid data');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst TypedArrayConstructor = globalThis[type];\n\t\t\t\t\t\tconst buffer = hydrate(value[1]);\n\t\t\t\t\t\tconst typedArray = new TypedArrayConstructor(buffer);\n\n\t\t\t\t\t\thydrated[index] =\n\t\t\t\t\t\t\tvalue[2] !== undefined\n\t\t\t\t\t\t\t\t? typedArray.subarray(value[2], value[3])\n\t\t\t\t\t\t\t\t: typedArray;\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'ArrayBuffer': {\n\t\t\t\t\t\tconst base64 = value[1];\n\t\t\t\t\t\tif (typeof base64 !== 'string') {\n\t\t\t\t\t\t\tthrow new Error('Invalid ArrayBuffer encoding');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst arraybuffer = decode64(base64);\n\t\t\t\t\t\thydrated[index] = arraybuffer;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'Temporal.Duration':\n\t\t\t\t\tcase 'Temporal.Instant':\n\t\t\t\t\tcase 'Temporal.PlainDate':\n\t\t\t\t\tcase 'Temporal.PlainTime':\n\t\t\t\t\tcase 'Temporal.PlainDateTime':\n\t\t\t\t\tcase 'Temporal.PlainMonthDay':\n\t\t\t\t\tcase 'Temporal.PlainYearMonth':\n\t\t\t\t\tcase 'Temporal.ZonedDateTime': {\n\t\t\t\t\t\tconst temporalName = type.slice(9);\n\t\t\t\t\t\t// @ts-expect-error TS doesn't know about Temporal yet\n\t\t\t\t\t\thydrated[index] = Temporal[temporalName].from(value[1]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'URL': {\n\t\t\t\t\t\tconst url = new URL(value[1]);\n\t\t\t\t\t\thydrated[index] = url;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tcase 'URLSearchParams': {\n\t\t\t\t\t\tconst url = new URLSearchParams(value[1]);\n\t\t\t\t\t\thydrated[index] = url;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error(`Unknown type ${type}`);\n\t\t\t\t}\n\t\t\t} else if (value[0] === SPARSE) {\n\t\t\t\t// Sparse array encoding: [SPARSE, length, idx, val, idx, val, ...]\n\t\t\t\tconst len = value[1];\n\n\t\t\t\tconst array = new Array(len);\n\t\t\t\thydrated[index] = array;\n\n\t\t\t\tfor (let i = 2; i < value.length; i += 2) {\n\t\t\t\t\tconst idx = value[i];\n\t\t\t\t\tarray[idx] = hydrate(value[i + 1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst array = new Array(value.length);\n\t\t\t\thydrated[index] = array;\n\n\t\t\t\tfor (let i = 0; i < value.length; i += 1) {\n\t\t\t\t\tconst n = value[i];\n\t\t\t\t\tif (n === HOLE) continue;\n\n\t\t\t\t\tarray[i] = hydrate(n);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t/** @type {Record<string, any>} */\n\t\t\tconst object = {};\n\t\t\thydrated[index] = object;\n\n\t\t\tfor (const key of Object.keys(value)) {\n\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\tthrow new Error('Cannot parse an object with a `__proto__` property');\n\t\t\t\t}\n\n\t\t\t\tconst n = value[key];\n\t\t\t\tobject[key] = hydrate(n);\n\t\t\t}\n\t\t}\n\n\t\treturn hydrated[index];\n\t}\n\n\treturn hydrate(0);\n}\n","import {\n\tDevalueError,\n\tenumerable_symbols,\n\tget_type,\n\tis_plain_object,\n\tis_primitive,\n\tstringify_key,\n\tstringify_string,\n\tvalid_array_indices\n} from './utils.js';\nimport {\n\tHOLE,\n\tNAN,\n\tNEGATIVE_INFINITY,\n\tNEGATIVE_ZERO,\n\tPOSITIVE_INFINITY,\n\tSPARSE,\n\tUNDEFINED\n} from './constants.js';\nimport { encode64 } from './base64.js';\n\n/**\n * Turn a value into a JSON string that can be parsed with `devalue.parse`\n * @param {any} value\n * @param {Record<string, (value: any) => any>} [reducers]\n */\nexport function stringify(value, reducers) {\n\t/** @type {any[]} */\n\tconst stringified = [];\n\n\t/** @type {Map<any, number>} */\n\tconst indexes = new Map();\n\n\t/** @type {Array<{ key: string, fn: (value: any) => any }>} */\n\tconst custom = [];\n\tif (reducers) {\n\t\tfor (const key of Object.getOwnPropertyNames(reducers)) {\n\t\t\tcustom.push({ key, fn: reducers[key] });\n\t\t}\n\t}\n\n\t/** @type {string[]} */\n\tconst keys = [];\n\n\tlet p = 0;\n\n\t/** @param {any} thing */\n\tfunction flatten(thing) {\n\t\tif (thing === undefined) return UNDEFINED;\n\t\tif (Number.isNaN(thing)) return NAN;\n\t\tif (thing === Infinity) return POSITIVE_INFINITY;\n\t\tif (thing === -Infinity) return NEGATIVE_INFINITY;\n\t\tif (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO;\n\n\t\tif (indexes.has(thing)) return indexes.get(thing);\n\n\t\tconst index = p++;\n\t\tindexes.set(thing, index);\n\n\t\tfor (const { key, fn } of custom) {\n\t\t\tconst value = fn(thing);\n\t\t\tif (value) {\n\t\t\t\tstringified[index] = `[\"${key}\",${flatten(value)}]`;\n\t\t\t\treturn index;\n\t\t\t}\n\t\t}\n\n\t\tif (typeof thing === 'function') {\n\t\t\tthrow new DevalueError(`Cannot stringify a function`, keys, thing, value);\n\t\t}\n\n\t\tlet str = '';\n\n\t\tif (is_primitive(thing)) {\n\t\t\tstr = stringify_primitive(thing);\n\t\t} else {\n\t\t\tconst type = get_type(thing);\n\n\t\t\tswitch (type) {\n\t\t\t\tcase 'Number':\n\t\t\t\tcase 'String':\n\t\t\t\tcase 'Boolean':\n\t\t\t\t\tstr = `[\"Object\",${stringify_primitive(thing)}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'BigInt':\n\t\t\t\t\tstr = `[\"BigInt\",${thing}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Date':\n\t\t\t\t\tconst valid = !isNaN(thing.getDate());\n\t\t\t\t\tstr = `[\"Date\",\"${valid ? thing.toISOString() : ''}\"]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'URL':\n\t\t\t\t\tstr = `[\"URL\",${stringify_string(thing.toString())}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'URLSearchParams':\n\t\t\t\t\tstr = `[\"URLSearchParams\",${stringify_string(thing.toString())}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'RegExp':\n\t\t\t\t\tconst { source, flags } = thing;\n\t\t\t\t\tstr = flags\n\t\t\t\t\t\t? `[\"RegExp\",${stringify_string(source)},\"${flags}\"]`\n\t\t\t\t\t\t: `[\"RegExp\",${stringify_string(source)}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Array': {\n\t\t\t\t\t// For dense arrays (no holes), we iterate normally.\n\t\t\t\t\t// When we encounter the first hole, we call Object.keys\n\t\t\t\t\t// to determine the sparseness, then decide between:\n\t\t\t\t\t// - HOLE encoding: [-2, val, -2, ...] (default)\n\t\t\t\t\t// - Sparse encoding: [-7, length, idx, val, ...] (for very sparse arrays)\n\t\t\t\t\t// Only the sparse path avoids iterating every slot, which\n\t\t\t\t\t// is what protects against the DoS of e.g. `arr[1000000] = 1`.\n\t\t\t\t\tlet mostly_dense = false;\n\n\t\t\t\t\tstr = '[';\n\n\t\t\t\t\tfor (let i = 0; i < thing.length; i += 1) {\n\t\t\t\t\t\tif (i > 0) str += ',';\n\n\t\t\t\t\t\tif (Object.hasOwn(thing, i)) {\n\t\t\t\t\t\t\tkeys.push(`[${i}]`);\n\t\t\t\t\t\t\tstr += flatten(thing[i]);\n\t\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t\t} else if (mostly_dense) {\n\t\t\t\t\t\t\t// Use dense encoding. The heuristic guarantees the\n\t\t\t\t\t\t\t// array is only mildly sparse, so iterating over every\n\t\t\t\t\t\t\t// slot is fine.\n\t\t\t\t\t\t\tstr += HOLE;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Decide between HOLE encoding and sparse encoding.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// HOLE encoding: each hole is serialized as the HOLE\n\t\t\t\t\t\t\t// sentinel (-2). For example, [, \"a\", ,] becomes\n\t\t\t\t\t\t\t// [-2, 0, -2]. Each hole costs 3 chars (\"-2\" + comma).\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Sparse encoding: lists only populated indices.\n\t\t\t\t\t\t\t// For example, [, \"a\", ,] becomes [-7, 3, 1, 0] — the\n\t\t\t\t\t\t\t// -7 sentinel, the array length (3), then index-value\n\t\t\t\t\t\t\t// pairs. This avoids paying per-hole, but each element\n\t\t\t\t\t\t\t// costs extra chars to write its index.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// The values are the same size either way, so the\n\t\t\t\t\t\t\t// choice comes down to structural overhead:\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// HOLE overhead:\n\t\t\t\t\t\t\t// 3 chars per hole (\"-2\" + comma)\n\t\t\t\t\t\t\t// = (L - P) * 3\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Sparse overhead:\n\t\t\t\t\t\t\t// \"-7,\" — 3 chars (sparse sentinel + comma)\n\t\t\t\t\t\t\t// + length + \",\" — (d + 1) chars (array length + comma)\n\t\t\t\t\t\t\t// + per element: index + \",\" — (d + 1) chars\n\t\t\t\t\t\t\t// = (4 + d) + P * (d + 1)\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// where L is the array length, P is the number of\n\t\t\t\t\t\t\t// populated elements, and d is the number of digits\n\t\t\t\t\t\t\t// in L (an upper bound on the digits in any index).\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// Sparse encoding is cheaper when:\n\t\t\t\t\t\t\t// (4 + d) + P * (d + 1) < (L - P) * 3\n\t\t\t\t\t\t\tconst populated_keys = valid_array_indices(/** @type {any[]} */ (thing));\n\t\t\t\t\t\t\tconst population = populated_keys.length;\n\t\t\t\t\t\t\tconst d = String(thing.length).length;\n\n\t\t\t\t\t\t\tconst hole_cost = (thing.length - population) * 3;\n\t\t\t\t\t\t\tconst sparse_cost = 4 + d + population * (d + 1);\n\n\t\t\t\t\t\t\tif (hole_cost > sparse_cost) {\n\t\t\t\t\t\t\t\tstr = '[' + SPARSE + ',' + thing.length;\n\t\t\t\t\t\t\t\tfor (let j = 0; j < populated_keys.length; j++) {\n\t\t\t\t\t\t\t\t\tconst key = populated_keys[j];\n\t\t\t\t\t\t\t\t\tkeys.push(`[${key}]`);\n\t\t\t\t\t\t\t\t\tstr += ',' + key + ',' + flatten(thing[key]);\n\t\t\t\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tmostly_dense = true;\n\t\t\t\t\t\t\t\tstr += HOLE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tstr += ']';\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'Set':\n\t\t\t\t\tstr = '[\"Set\"';\n\n\t\t\t\t\tfor (const value of thing) {\n\t\t\t\t\t\tstr += `,${flatten(value)}`;\n\t\t\t\t\t}\n\n\t\t\t\t\tstr += ']';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Map':\n\t\t\t\t\tstr = '[\"Map\"';\n\n\t\t\t\t\tfor (const [key, value] of thing) {\n\t\t\t\t\t\tkeys.push(\n\t\t\t\t\t\t\t`.get(${is_primitive(key) ? stringify_primitive(key) : '...'})`\n\t\t\t\t\t\t);\n\t\t\t\t\t\tstr += `,${flatten(key)},${flatten(value)}`;\n\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t}\n\n\t\t\t\t\tstr += ']';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Int8Array':\n\t\t\t\tcase 'Uint8Array':\n\t\t\t\tcase 'Uint8ClampedArray':\n\t\t\t\tcase 'Int16Array':\n\t\t\t\tcase 'Uint16Array':\n\t\t\t\tcase 'Int32Array':\n\t\t\t\tcase 'Uint32Array':\n\t\t\t\tcase 'Float32Array':\n\t\t\t\tcase 'Float64Array':\n\t\t\t\tcase 'BigInt64Array':\n\t\t\t\tcase 'BigUint64Array': {\n\t\t\t\t\t/** @type {import(\"./types.js\").TypedArray} */\n\t\t\t\t\tconst typedArray = thing;\n\t\t\t\t\tstr = '[\"' + type + '\",' + flatten(typedArray.buffer);\n\n\t\t\t\t\tconst a = thing.byteOffset;\n\t\t\t\t\tconst b = a + thing.byteLength;\n\n\t\t\t\t\t// handle subarrays\n\t\t\t\t\tif (a > 0 || b !== typedArray.buffer.byteLength) {\n\t\t\t\t\t\tconst m = +/(\\d+)/.exec(type)[1] / 8;\n\t\t\t\t\t\tstr += `,${a / m},${b / m}`;\n\t\t\t\t\t}\n\n\t\t\t\t\tstr += ']';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'ArrayBuffer': {\n\t\t\t\t\t/** @type {ArrayBuffer} */\n\t\t\t\t\tconst arraybuffer = thing;\n\t\t\t\t\tconst base64 = encode64(arraybuffer);\n\n\t\t\t\t\tstr = `[\"ArrayBuffer\",\"${base64}\"]`;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'Temporal.Duration':\n\t\t\t\tcase 'Temporal.Instant':\n\t\t\t\tcase 'Temporal.PlainDate':\n\t\t\t\tcase 'Temporal.PlainTime':\n\t\t\t\tcase 'Temporal.PlainDateTime':\n\t\t\t\tcase 'Temporal.PlainMonthDay':\n\t\t\t\tcase 'Temporal.PlainYearMonth':\n\t\t\t\tcase 'Temporal.ZonedDateTime':\n\t\t\t\t\tstr = `[\"${type}\",${stringify_string(thing.toString())}]`;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tif (!is_plain_object(thing)) {\n\t\t\t\t\t\tthrow new DevalueError(\n\t\t\t\t\t\t\t`Cannot stringify arbitrary non-POJOs`,\n\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\tthing,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (enumerable_symbols(thing).length > 0) {\n\t\t\t\t\t\tthrow new DevalueError(\n\t\t\t\t\t\t\t`Cannot stringify POJOs with symbolic keys`,\n\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\tthing,\n\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (Object.getPrototypeOf(thing) === null) {\n\t\t\t\t\t\tstr = '[\"null\"';\n\t\t\t\t\t\tfor (const key of Object.keys(thing)) {\n\t\t\t\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\t\t\t\tthrow new DevalueError(\n\t\t\t\t\t\t\t\t\t`Cannot stringify objects with __proto__ keys`,\n\t\t\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\t\t\tthing,\n\t\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tkeys.push(stringify_key(key));\n\t\t\t\t\t\t\tstr += `,${stringify_string(key)},${flatten(thing[key])}`;\n\t\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstr += ']';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstr = '{';\n\t\t\t\t\t\tlet started = false;\n\t\t\t\t\t\tfor (const key of Object.keys(thing)) {\n\t\t\t\t\t\t\tif (key === '__proto__') {\n\t\t\t\t\t\t\t\tthrow new DevalueError(\n\t\t\t\t\t\t\t\t\t`Cannot stringify objects with __proto__ keys`,\n\t\t\t\t\t\t\t\t\tkeys,\n\t\t\t\t\t\t\t\t\tthing,\n\t\t\t\t\t\t\t\t\tvalue\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (started) str += ',';\n\t\t\t\t\t\t\tstarted = true;\n\t\t\t\t\t\t\tkeys.push(stringify_key(key));\n\t\t\t\t\t\t\tstr += `${stringify_string(key)}:${flatten(thing[key])}`;\n\t\t\t\t\t\t\tkeys.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstr += '}';\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstringified[index] = str;\n\t\treturn index;\n\t}\n\n\tconst index = flatten(value);\n\n\t// special case — value is represented as a negative index\n\tif (index < 0) return `${index}`;\n\n\treturn `[${stringified.join(',')}]`;\n}\n\n/**\n * @param {any} thing\n * @returns {string}\n */\nfunction stringify_primitive(thing) {\n\tconst type = typeof thing;\n\tif (type === 'string') return stringify_string(thing);\n\tif (thing instanceof String) return stringify_string(thing.toString());\n\tif (thing === void 0) return UNDEFINED.toString();\n\tif (thing === 0 && 1 / thing < 0) return NEGATIVE_ZERO.toString();\n\tif (type === 'bigint') return `[\"BigInt\",\"${thing}\"]`;\n\treturn String(thing);\n}\n","import net from 'node:net';\nimport os from 'node:os';\n\nclass Locked extends Error {\n\tconstructor(port) {\n\t\tsuper(`${port} is locked`);\n\t}\n}\n\nconst lockedPorts = {\n\told: new Set(),\n\tyoung: new Set(),\n};\n\n// On this interval, the old locked ports are discarded,\n// the young locked ports are moved to old locked ports,\n// and a new young set for locked ports are created.\nconst releaseOldLockedPortsIntervalMs = 1000 * 15;\n\nconst minPort = 1024;\nconst maxPort = 65_535;\n\n// Lazily create timeout on first use\nlet timeout;\n\nconst getLocalHosts = () => {\n\tconst interfaces = os.networkInterfaces();\n\n\t// Add undefined value for createServer function to use default host,\n\t// and default IPv4 host in case createServer defaults to IPv6.\n\tconst results = new Set([undefined, '0.0.0.0']);\n\n\tfor (const _interface of Object.values(interfaces)) {\n\t\tfor (const config of _interface) {\n\t\t\tresults.add(config.address);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nconst checkAvailablePort = options =>\n\tnew Promise((resolve, reject) => {\n\t\tconst server = net.createServer();\n\t\tserver.unref();\n\t\tserver.on('error', reject);\n\n\t\tserver.listen(options, () => {\n\t\t\tconst {port} = server.address();\n\t\t\tserver.close(() => {\n\t\t\t\tresolve(port);\n\t\t\t});\n\t\t});\n\t});\n\nconst getAvailablePort = async (options, hosts) => {\n\tif (options.host || options.port === 0) {\n\t\treturn checkAvailablePort(options);\n\t}\n\n\tfor (const host of hosts) {\n\t\ttry {\n\t\t\tawait checkAvailablePort({port: options.port, host}); // eslint-disable-line no-await-in-loop\n\t\t} catch (error) {\n\t\t\tif (!['EADDRNOTAVAIL', 'EINVAL'].includes(error.code)) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn options.port;\n};\n\nconst portCheckSequence = function * (ports) {\n\tif (ports) {\n\t\tyield * ports;\n\t}\n\n\tyield 0; // Fall back to 0 if anything else failed\n};\n\nexport default async function getPorts(options) {\n\tlet ports;\n\tlet exclude = new Set();\n\n\tif (options) {\n\t\tif (options.port) {\n\t\t\tports = typeof options.port === 'number' ? [options.port] : options.port;\n\t\t}\n\n\t\tif (options.exclude) {\n\t\t\tconst excludeIterable = options.exclude;\n\n\t\t\tif (typeof excludeIterable[Symbol.iterator] !== 'function') {\n\t\t\t\tthrow new TypeError('The `exclude` option must be an iterable.');\n\t\t\t}\n\n\t\t\tfor (const element of excludeIterable) {\n\t\t\t\tif (typeof element !== 'number') {\n\t\t\t\t\tthrow new TypeError('Each item in the `exclude` option must be a number corresponding to the port you want excluded.');\n\t\t\t\t}\n\n\t\t\t\tif (!Number.isSafeInteger(element)) {\n\t\t\t\t\tthrow new TypeError(`Number ${element} in the exclude option is not a safe integer and can't be used`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\texclude = new Set(excludeIterable);\n\t\t}\n\t}\n\n\tif (timeout === undefined) {\n\t\ttimeout = setTimeout(() => {\n\t\t\ttimeout = undefined;\n\n\t\t\tlockedPorts.old = lockedPorts.young;\n\t\t\tlockedPorts.young = new Set();\n\t\t}, releaseOldLockedPortsIntervalMs);\n\n\t\t// Does not exist in some environments (Electron, Jest jsdom env, browser, etc).\n\t\tif (timeout.unref) {\n\t\t\ttimeout.unref();\n\t\t}\n\t}\n\n\tconst hosts = getLocalHosts();\n\n\tfor (const port of portCheckSequence(ports)) {\n\t\ttry {\n\t\t\tif (exclude.has(port)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tlet availablePort = await getAvailablePort({...options, port}, hosts); // eslint-disable-line no-await-in-loop\n\t\t\twhile (lockedPorts.old.has(availablePort) || lockedPorts.young.has(availablePort)) {\n\t\t\t\tif (port !== 0) {\n\t\t\t\t\tthrow new Locked(port);\n\t\t\t\t}\n\n\t\t\t\tavailablePort = await getAvailablePort({...options, port}, hosts); // eslint-disable-line no-await-in-loop\n\t\t\t}\n\n\t\t\tlockedPorts.young.add(availablePort);\n\n\t\t\treturn availablePort;\n\t\t} catch (error) {\n\t\t\tif (!['EADDRINUSE', 'EACCES'].includes(error.code) && !(error instanceof Locked)) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t}\n\t}\n\n\tthrow new Error('No available ports found');\n}\n\nexport function portNumbers(from, to) {\n\tif (!Number.isInteger(from) || !Number.isInteger(to)) {\n\t\tthrow new TypeError('`from` and `to` must be integer numbers');\n\t}\n\n\tif (from < minPort || from > maxPort) {\n\t\tthrow new RangeError(`'from' must be between ${minPort} and ${maxPort}`);\n\t}\n\n\tif (to < minPort || to > maxPort) {\n\t\tthrow new RangeError(`'to' must be between ${minPort} and ${maxPort}`);\n\t}\n\n\tif (from > to) {\n\t\tthrow new RangeError('`to` must be greater than or equal to `from`');\n\t}\n\n\tconst generator = function * (from, to) {\n\t\tfor (let port = from; port <= to; port++) {\n\t\t\tyield port;\n\t\t}\n\t};\n\n\treturn generator(from, to);\n}\n\nexport function clearLockedPorts() {\n\tlockedPorts.old.clear();\n\tlockedPorts.young.clear();\n}\n","class LRUCache {\n constructor () {\n this.max = 1000\n this.map = new Map()\n }\n\n get (key) {\n const value = this.map.get(key)\n if (value === undefined) {\n return undefined\n } else {\n // Remove the key from the map and add it to the end\n this.map.delete(key)\n this.map.set(key, value)\n return value\n }\n }\n\n delete (key) {\n return this.map.delete(key)\n }\n\n set (key, value) {\n const deleted = this.delete(key)\n\n if (!deleted && value !== undefined) {\n // If cache is full, delete the least recently used item\n if (this.map.size >= this.max) {\n const firstKey = this.map.keys().next().value\n this.delete(firstKey)\n }\n\n this.map.set(key, value)\n }\n\n return this\n }\n}\n\nmodule.exports = LRUCache\n","// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst safeSrc = exports.safeSrc = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n safeSrc[index] = safe\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCEPLAIN', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)\ncreateToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\\\d])`)\ncreateToken('COERCEFULL', src[t.COERCEPLAIN] +\n `(?:${src[t.PRERELEASE]})?` +\n `(?:${src[t.BUILD]})?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\ncreateToken('COERCERTLFULL', src[t.COERCEFULL], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, safeSrc: src, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('build compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n if (release.startsWith('pre')) {\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n // Avoid an invalid semver results\n if (identifier) {\n const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`)\n const match = `-${identifier}`.match(r)\n if (!match || match[1] !== identifier) {\n throw new Error(`invalid identifier: ${identifier}`)\n }\n }\n }\n\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n case 'release':\n if (this.prerelease.length === 0) {\n throw new Error(`version ${this.raw} is not a prerelease`)\n }\n this.prerelease.length = 0\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","const SPACE_CHARACTERS = /\\s+/g\n\n// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.formatted = undefined\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.formatted = undefined\n }\n\n get range () {\n if (this.formatted === undefined) {\n this.formatted = ''\n for (let i = 0; i < this.set.length; i++) {\n if (i > 0) {\n this.formatted += '||'\n }\n const comps = this.set[i]\n for (let k = 0; k < comps.length; k++) {\n if (k > 0) {\n this.formatted += ' '\n }\n this.formatted += comps[k].toString().trim()\n }\n }\n }\n return this.formatted\n }\n\n format () {\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('../internal/lrucache')\nconst cache = new LRU()\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\n// TODO build?\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","/**\n * The `CompatibilityFlagAssertions` class provides methods to validate compatibility flags and dates\n * within a project's configuration. It ensures that specific flags are either present\n * or absent and that compatibility dates meet the required criteria.\n */\nexport class CompatibilityFlagAssertions {\n\t#compatibilityDate?: string;\n\t#compatibilityFlags: string[];\n\t#optionsPath: string;\n\t#relativeProjectPath: string;\n\t#relativeWranglerConfigPath?: string;\n\n\tconstructor(options: CommonOptions) {\n\t\tthis.#compatibilityDate = options.compatibilityDate;\n\t\tthis.#compatibilityFlags = options.compatibilityFlags;\n\t\tthis.#optionsPath = options.optionsPath;\n\t\tthis.#relativeProjectPath = options.relativeProjectPath;\n\t\tthis.#relativeWranglerConfigPath = options.relativeWranglerConfigPath;\n\t}\n\n\t/**\n\t * Checks if a specific flag is present in the compatibilityFlags array.\n\t */\n\t#flagExists(flag: string): boolean {\n\t\treturn this.#compatibilityFlags.includes(flag);\n\t}\n\n\t/**\n\t * Constructs the base of the error message.\n\t *\n\t * @example\n\t * In project /path/to/project\n\t *\n\t * @example\n\t * In project /path/to/project's configuration file wrangler.toml\n\t */\n\t#buildErrorMessageBase(): string {\n\t\tlet message = `In project ${this.#relativeProjectPath}`;\n\t\tif (this.#relativeWranglerConfigPath) {\n\t\t\tmessage += `'s configuration file ${this.#relativeWranglerConfigPath}`;\n\t\t}\n\t\treturn message;\n\t}\n\n\t/**\n\t * Constructs the configuration path part of the error message.\n\t */\n\t#buildConfigPath(setting: string): string {\n\t\tif (this.#relativeWranglerConfigPath) {\n\t\t\treturn `\\`${setting}\\``;\n\t\t}\n\n\t\tconst camelCaseSetting = setting.replace(/_(\\w)/g, (_, letter) =>\n\t\t\tletter.toUpperCase()\n\t\t);\n\n\t\treturn `\\`${this.#optionsPath}.${camelCaseSetting}\\``;\n\t}\n\n\tisEnabled(\n\t\tenableFlag: string,\n\t\tdisableFlag: string,\n\t\tdefaultOnDate?: string\n\t): boolean {\n\t\tif (this.#flagExists(disableFlag)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn (\n\t\t\tthis.#flagExists(enableFlag) ||\n\t\t\tisDateSufficient(this.#compatibilityDate, defaultOnDate)\n\t\t);\n\t}\n\n\t/**\n\t * Ensures that a specific enable flag is present or that the compatibility date meets the required date.\n\t */\n\tassertIsEnabled({\n\t\tenableFlag,\n\t\tdisableFlag,\n\t\tdefaultOnDate,\n\t}: {\n\t\tenableFlag: string;\n\t\tdisableFlag: string;\n\t\tdefaultOnDate?: string;\n\t}): AssertionResult {\n\t\t// If it's disabled by this flag, we can return early.\n\t\tif (this.#flagExists(disableFlag)) {\n\t\t\tconst errorMessage = `${this.#buildErrorMessageBase()}, ${this.#buildConfigPath(\n\t\t\t\t\"compatibility_flags\"\n\t\t\t)} must not contain \"${disableFlag}\".\\nThis flag is incompatible with \\`@cloudflare/vitest-pool-workers\\`.`;\n\t\t\treturn { isValid: false, errorMessage };\n\t\t}\n\n\t\tconst enableFlagPresent = this.#flagExists(enableFlag);\n\t\tconst dateSufficient = isDateSufficient(\n\t\t\tthis.#compatibilityDate,\n\t\t\tdefaultOnDate\n\t\t);\n\n\t\tif (!enableFlagPresent && !dateSufficient) {\n\t\t\tlet errorMessage = `${this.#buildErrorMessageBase()}, ${this.#buildConfigPath(\n\t\t\t\t\"compatibility_flags\"\n\t\t\t)} must contain \"${enableFlag}\"`;\n\n\t\t\tif (defaultOnDate) {\n\t\t\t\terrorMessage += `, or ${this.#buildConfigPath(\n\t\t\t\t\t\"compatibility_date\"\n\t\t\t\t)} must be >= \"${defaultOnDate}\".`;\n\t\t\t}\n\n\t\t\terrorMessage += `\\nThis flag is required to use \\`@cloudflare/vitest-pool-workers\\`.`;\n\n\t\t\treturn { isValid: false, errorMessage };\n\t\t}\n\n\t\treturn { isValid: true };\n\t}\n\n\t/**\n\t * Ensures that a any one of a given set of flags is present in the compatibility_flags array.\n\t */\n\tassertAtLeastOneFlagExists(flags: string[]): AssertionResult {\n\t\tif (flags.length === 0 || flags.some((flag) => this.#flagExists(flag))) {\n\t\t\treturn { isValid: true };\n\t\t}\n\n\t\tconst errorMessage = `${this.#buildErrorMessageBase()}, ${this.#buildConfigPath(\n\t\t\t\"compatibility_flags\"\n\t\t)} must contain one of ${flags.map((flag) => `\"${flag}\"`).join(\"/\")}.\\nEither one of these flags is required to use \\`@cloudflare/vitest-pool-workers\\`.`;\n\n\t\treturn { isValid: false, errorMessage };\n\t}\n}\n\n/**\n * Common options used across all assertion methods.\n */\ninterface CommonOptions {\n\tcompatibilityDate?: string;\n\tcompatibilityFlags: string[];\n\toptionsPath: string;\n\trelativeProjectPath: string;\n\trelativeWranglerConfigPath?: string;\n}\n\n/**\n * Result of an assertion method.\n */\ninterface AssertionResult {\n\tisValid: boolean;\n\terrorMessage?: string;\n}\n\n/**\n * Parses a date string into a Date object.\n */\nfunction parseDate(dateStr: string): Date {\n\tconst date = new Date(dateStr);\n\tif (isNaN(date.getTime())) {\n\t\tthrow new Error(`Invalid date format: \"${dateStr}\"`);\n\t}\n\treturn date;\n}\n\n/**\n * Checks if the compatibility date meets or exceeds the required date.\n */\nfunction isDateSufficient(\n\tcompatibilityDate?: string,\n\tdefaultOnDate?: string\n): boolean {\n\tif (!compatibilityDate || !defaultOnDate) {\n\t\treturn false;\n\t}\n\tconst compDate = parseDate(compatibilityDate);\n\tconst reqDate = parseDate(defaultOnDate);\n\treturn compDate >= reqDate;\n}\n","import path from \"node:path\";\nimport { build } from \"esbuild\";\n\nexport type ExportMap = Map<\n\tstring,\n\t\"WorkerEntrypoint\" | \"DurableObject\" | \"WorkflowEntrypoint\" | null\n>;\n\n/**\n * Guesses the exports of the main Worker.\n *\n * We do this by running a lightweight esbuild of the main script, and looking at the meta-file generated by esbuild.\n *\n * - This doesn't support Python Workers, but then neither does Vitest.\n * - Workers that need to be built with Vite plugins (e.g. containing wildcard re-exported virtual imports)\n * may not work with esbuild and so we won't be able to find the exports. But in these cases, the user can\n * always manually specify the exports in the Wrangler config via Service bindings, Workflows, or Durable Object migrations.\n *\n * @param entryFile The entry file of the Worker.\n * @param additionalExports Additional exports to include in the export map.\n *\n * @returns A map of export names to their types (WorkerEntrypoint, DurableObject, WorkflowEntrypoint), or null if unknown.\n */\nexport async function guessWorkerExports(\n\tentryFile: string | undefined,\n\tadditionalExports: {\n\t\t[exportName: string]:\n\t\t\t| \"WorkerEntrypoint\"\n\t\t\t| \"DurableObject\"\n\t\t\t| \"WorkflowEntrypoint\";\n\t} = {}\n): Promise<ExportMap> {\n\tconst exportMap: ExportMap = new Map(Object.entries(additionalExports));\n\tif (entryFile === undefined) {\n\t\treturn exportMap;\n\t}\n\n\tif (path.extname(entryFile) == \".py\") {\n\t\t// We don't support Python Workers here.\n\t\treturn exportMap;\n\t}\n\n\tconst result = await build({\n\t\ttarget: \"es2024\",\n\t\tloader: { \".js\": \"jsx\", \".mjs\": \"jsx\", \".cjs\": \"jsx\" },\n\t\tentryPoints: [path.resolve(entryFile)],\n\t\tmetafile: true,\n\t\tbundle: false,\n\t\twrite: false,\n\t\tlogLevel: \"silent\",\n\t});\n\n\tconst entryPoints = Object.values(result.metafile.outputs).filter(\n\t\t(output) => output.entryPoint !== undefined\n\t);\n\tif (entryPoints.length === 0) {\n\t\tthrow new Error(\n\t\t\t`Cannot find entry-point \"${entryFile}\" in generated bundle.`\n\t\t);\n\t}\n\tif (entryPoints.length > 1) {\n\t\tthrow new Error(\n\t\t\t\"More than one entry-point found for generated bundle.\\n\" +\n\t\t\t\tentryPoints.map((output) => ` - ${output.entryPoint}`).join(\"\\n\")\n\t\t);\n\t}\n\n\tfor (const exportName of entryPoints[0].exports) {\n\t\t// For now we have no way to guess the type..\n\t\tif (!exportMap.has(exportName)) {\n\t\t\texportMap.set(exportName, null);\n\t\t}\n\t}\n\n\treturn exportMap;\n}\n","import path from \"node:path\";\nimport type { TestProject } from \"vitest/node\";\n\n// User worker names must not start with this\nexport const WORKER_NAME_PREFIX = \"vitest-pool-workers-\";\n\nexport function isFileNotFoundError(e: unknown): boolean {\n\treturn (\n\t\ttypeof e === \"object\" && e !== null && \"code\" in e && e.code === \"ENOENT\"\n\t);\n}\n\nexport function getProjectPath(project: TestProject): string {\n\treturn project.config.root;\n}\n\nexport function getRelativeProjectPath(project: TestProject): string {\n\tconst projectPath = getProjectPath(project);\n\treturn path.relative(\"\", projectPath);\n}\n\nexport function getRelativeProjectConfigPath(project: TestProject): string {\n\treturn project.config.config\n\t\t? path.relative(\"\", project.config.config)\n\t\t: getRelativeProjectPath(project);\n}\n","import assert from \"node:assert\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { Response } from \"miniflare\";\nimport { isFileNotFoundError } from \"./helpers\";\nimport type { Awaitable, Miniflare, Request } from \"miniflare\";\n\n// Based on https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/snapshot/src/env/node.ts\nasync function handleSnapshotRequest(\n\trequest: Request,\n\turl: URL\n): Promise<Response> {\n\tconst filePath = url.searchParams.get(\"path\");\n\tif (filePath === null) {\n\t\treturn new Response(null, { status: 400 });\n\t}\n\n\tif (request.method === \"POST\" /* prepareDirectory */) {\n\t\tawait fs.mkdir(filePath, { recursive: true });\n\t\treturn new Response(null, { status: 204 });\n\t}\n\n\tif (request.method === \"PUT\" /* saveSnapshotFile */) {\n\t\tconst snapshot = await request.arrayBuffer();\n\t\tawait fs.mkdir(path.dirname(filePath), { recursive: true });\n\t\tawait fs.writeFile(filePath, new Uint8Array(snapshot));\n\t\treturn new Response(null, { status: 204 });\n\t}\n\n\tif (request.method === \"GET\" /* readSnapshotFile */) {\n\t\ttry {\n\t\t\treturn new Response(await fs.readFile(filePath));\n\t\t} catch (e) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\treturn new Response(null, { status: 404 });\n\t\t}\n\t}\n\n\tif (request.method === \"DELETE\" /* removeSnapshotFile */) {\n\t\ttry {\n\t\t\tawait fs.unlink(filePath);\n\t\t} catch (e) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t\treturn new Response(null, { status: 204 });\n\t}\n\n\treturn new Response(null, { status: 405 });\n}\n\nexport async function listDurableObjectIds(\n\trequest: Request,\n\tmf: Miniflare,\n\turl: URL\n): Promise<Response> {\n\tif (request.method !== \"GET\") {\n\t\treturn new Response(null, { status: 405 });\n\t}\n\tconst persistPaths = mf.unsafeGetPersistPaths();\n\tconst durableObjectPersistPath = persistPaths.get(\"do\");\n\tassert(\n\t\tdurableObjectPersistPath !== undefined,\n\t\t\"Expected Durable Object persist path\"\n\t);\n\n\tconst uniqueKey = url.searchParams.get(\"unique_key\");\n\tif (uniqueKey === null) {\n\t\treturn new Response(null, { status: 400 });\n\t}\n\tconst namespacePath = path.join(durableObjectPersistPath, uniqueKey);\n\n\tconst ids: string[] = [];\n\ttry {\n\t\tconst names = await fs.readdir(namespacePath);\n\t\tfor (const name of names) {\n\t\t\t// Exclude metadata.sqlite, added by newer workerd versions for\n\t\t\t// per-namespace metadata. Only include files whose stem is a\n\t\t\t// valid 64-hex-digit Durable Object ID.\n\t\t\tif (name.endsWith(\".sqlite\") && name !== \"metadata.sqlite\") {\n\t\t\t\tids.push(name.substring(0, name.length - 7 /* \".sqlite\".length */));\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tif (!isFileNotFoundError(e)) {\n\t\t\tthrow e;\n\t\t}\n\t}\n\treturn Response.json(ids);\n}\n\nexport function handleLoopbackRequest(\n\trequest: Request,\n\tmf: Miniflare\n): Awaitable<Response> {\n\tconst url = new URL(request.url);\n\tif (url.pathname === \"/snapshot\") {\n\t\treturn handleSnapshotRequest(request, url);\n\t}\n\tif (url.pathname === \"/durable-objects\") {\n\t\treturn listDurableObjectIds(request, mf, url);\n\t}\n\treturn new Response(null, { status: 404 });\n}\n","// Node.js built-in modules provided by `workerd`\nexport const workerdBuiltinModules = new Set([\n\t...VITEST_POOL_WORKERS_DEFINE_BUILTIN_MODULES,\n\t\"__STATIC_CONTENT_MANIFEST\",\n]);\n","import assert from \"node:assert\";\nimport fs from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport platformPath from \"node:path\";\nimport posixPath from \"node:path/posix\";\nimport { fileURLToPath, pathToFileURL } from \"node:url\";\nimport util from \"node:util\";\nimport * as cjsModuleLexer from \"cjs-module-lexer\";\nimport { ModuleRuleTypeSchema, Response } from \"miniflare\";\nimport { workerdBuiltinModules } from \"../shared/builtin-modules\";\nimport { isFileNotFoundError } from \"./helpers\";\nimport type { ModuleRuleType, Request, Worker_Module } from \"miniflare\";\nimport type { Vite } from \"vitest/node\";\n\nlet debuglog: util.DebugLoggerFunction = util.debuglog(\n\t\"vitest-pool-workers:module-fallback\",\n\t(log) => (debuglog = log)\n);\n\nconst isWindows = process.platform === \"win32\";\n\n// Ensures `filePath` uses forward-slashes. Note this doesn't prepend a\n// forward-slash in front of Windows paths, so they can still be passed to Node\n// `fs` functions.\nexport function ensurePosixLikePath(filePath: string) {\n\treturn isWindows ? filePath.replaceAll(\"\\\\\", \"/\") : filePath;\n}\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = platformPath.dirname(__filename);\nconst require = createRequire(__filename);\n\nconst distPath = ensurePosixLikePath(platformPath.resolve(__dirname, \"..\"));\nconst libPath = posixPath.join(distPath, \"worker\", \"lib\");\nconst emptyLibPath = posixPath.join(libPath, \"cloudflare/empty-internal.cjs\");\n\n// File path suffix to disable CJS to ESM-with-named-exports shimming\nconst disableCjsEsmShimSuffix = \"?mf_vitest_no_cjs_esm_shim\";\nfunction trimSuffix(suffix: string, value: string) {\n\tassert(value.endsWith(suffix));\n\treturn value.substring(0, value.length - suffix.length);\n}\n\n/**\n * When pre-bundling is enabled, Vite will add a hash to the end of the file path\n * e.g. `/node_modules/.vite/deps/my-dep.js?v=f3sf2ebd`\n *\n * @see https://vite.dev/guide/features.html#npm-dependency-resolving-and-pre-bundling\n * @see https://github.com/cloudflare/workers-sdk/pull/5673\n */\nconst versionHashRegExp = /\\?v=[0-9a-f]+$/;\n\nfunction trimViteVersionHash(filePath: string) {\n\treturn filePath.replace(versionHashRegExp, \"\");\n}\n\n// RegExp for path suffix to force loading module as specific type.\n// (e.g. `/path/to/module.wasm?mf_vitest_force=CompiledWasm`)\n// This suffix will be added by the pool when fetching a module that matches a\n// module rule. In this case, the module will be marked as external with this\n// suffix, causing the fallback service to return a module with the correct\n// type. Note we can't easily implement rules with a Vite plugin, as they:\n// - Depend on `miniflare`/`wrangler` configuration, and we can't modify the\n// Vite config in the pool\n// - Would require use of an `UnsafeEval` binding to build `WebAssembly.Module`s\nconst forceModuleTypeRegexp = new RegExp(\n\t`\\\\?mf_vitest_force=(${ModuleRuleTypeSchema.options.join(\"|\")})$`\n);\n\nfunction isFile(filePath: string): boolean {\n\treturn fs.statSync(filePath, { throwIfNoEntry: false })?.isFile() ?? false;\n}\n\nfunction isDirectory(filePath: string): boolean {\n\treturn (\n\t\tfs.statSync(filePath, { throwIfNoEntry: false })?.isDirectory() ?? false\n\t);\n}\n\nfunction getParentPaths(filePath: string): string[] {\n\tconst parentPaths: string[] = [];\n\n\twhile (true) {\n\t\tconst parentPath = posixPath.dirname(filePath);\n\t\tif (parentPath === filePath) {\n\t\t\treturn parentPaths;\n\t\t}\n\t\tparentPaths.push(parentPath);\n\t\tfilePath = parentPath;\n\t}\n}\n\nconst dirPathTypeModuleCache = new Map<string, boolean>();\nfunction isWithinTypeModuleContext(filePath: string): boolean {\n\tconst parentPaths = getParentPaths(filePath);\n\n\tfor (const parentPath of parentPaths) {\n\t\tconst cache = dirPathTypeModuleCache.get(parentPath);\n\t\tif (cache !== undefined) {\n\t\t\treturn cache;\n\t\t}\n\t}\n\n\tfor (const parentPath of parentPaths) {\n\t\ttry {\n\t\t\tconst pkgPath = posixPath.join(parentPath, \"package.json\");\n\t\t\tconst pkgJson = fs.readFileSync(pkgPath, \"utf8\");\n\t\t\tconst pkg = JSON.parse(pkgJson);\n\t\t\tconst maybeModulePath = pkg.module\n\t\t\t\t? posixPath.join(parentPath, pkg.module)\n\t\t\t\t: \"\";\n\t\t\tconst cache = pkg.type === \"module\" || maybeModulePath === filePath;\n\t\t\tdirPathTypeModuleCache.set(parentPath, cache);\n\t\t\treturn cache;\n\t\t} catch (e: unknown) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false;\n}\n\nawait cjsModuleLexer.init();\n/**\n * Gets \"named\" exports from a CommonJS module. Normally, CommonJS modules can\n * only be default-imported, but Node performs additional static analysis to\n * allow named-imports too (https://nodejs.org/api/esm.html#interoperability-with-commonjs).\n * This function returns the named-exports we should add to our ESM-CJS shim,\n * using the same package as Node.\n */\nasync function getCjsNamedExports(\n\tvite: Vite.ViteDevServer,\n\tfilePath: string,\n\tcontents: string,\n\tseen = new Set()\n): Promise<Set<string>> {\n\tconst { exports, reexports } = cjsModuleLexer.parse(contents);\n\tconst result = new Set(exports);\n\tfor (const reexport of reexports) {\n\t\tconst resolved = await viteResolve(\n\t\t\tvite,\n\t\t\treexport,\n\t\t\tfilePath,\n\t\t\t/* isRequire */ true\n\t\t);\n\t\tif (seen.has(resolved)) {\n\t\t\tcontinue;\n\t\t}\n\t\ttry {\n\t\t\tconst resolvedContents = fs.readFileSync(resolved, \"utf8\");\n\t\t\tseen.add(resolved);\n\t\t\tconst resolvedNames = await getCjsNamedExports(\n\t\t\t\tvite,\n\t\t\t\tresolved,\n\t\t\t\tresolvedContents,\n\t\t\t\tseen\n\t\t\t);\n\t\t\tfor (const name of resolvedNames) {\n\t\t\t\tresult.add(name);\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n\tresult.delete(\"default\");\n\tresult.delete(\"__esModule\");\n\treturn result;\n}\n\nfunction withSourceUrl(contents: string, url: string | URL): string {\n\t// If we've already got a `//# sourceURL` comment, return `script` as is\n\t// (searching from the end as that's where we'd expect it)\n\tif (contents.lastIndexOf(\"//# sourceURL=\") !== -1) {\n\t\treturn contents;\n\t}\n\t// Make sure `//# sourceURL` comment is on its own line\n\tconst sourceURL = `\\n//# sourceURL=${url.toString()}\\n`;\n\treturn contents + sourceURL;\n}\n\nfunction withImportMetaUrl(contents: string, url: string | URL): string {\n\t// TODO(soon): this isn't perfect, ideally need `workerd` support\n\treturn contents.replaceAll(\"import.meta.url\", JSON.stringify(url.toString()));\n}\n\n// Extensions that Node's `require()` probes automatically but `workerd` won't.\n// ESM `import` requires explicit extensions; Vite's resolver handles those.\nconst requireExtensions = [\".js\", \".mjs\", \".cjs\", \".json\"];\nfunction maybeGetTargetFilePath(\n\ttarget: string,\n\tisRequire: boolean\n): string | undefined {\n\t// Can't use `fs.existsSync()` here as `target` could be a directory\n\t// (e.g. `node:fs` and `node:fs/promises`)\n\tif (isFile(target)) {\n\t\treturn target;\n\t}\n\tif (isRequire) {\n\t\tfor (const extension of requireExtensions) {\n\t\t\tconst targetWithExtension = target + extension;\n\t\t\tif (fs.existsSync(targetWithExtension)) {\n\t\t\t\treturn targetWithExtension;\n\t\t\t}\n\t\t}\n\t}\n\tif (target.endsWith(disableCjsEsmShimSuffix)) {\n\t\treturn target;\n\t}\n\tif (isDirectory(target)) {\n\t\treturn maybeGetTargetFilePath(target + \"/index\", isRequire);\n\t}\n}\n\n/**\n * `target` is the path to the \"file\" `workerd` is trying to load,\n * `referrer` is the path to the file that imported/required the `target`,\n * `referrerDir` is the dirname of `referrer`\n *\n * For example, if the `referrer` is \"/a/b/c/index.mjs\":\n *\n * | Import Statement | `target` | Return |\n * |-----------------------------|--------------------|--------------------|\n * | import \"./dep.mjs\" | /a/b/c/dep.mjs | dep.mjs |\n * | import \"../dep.mjs\" | /a/b/dep.mjs | ../dep.mjs |\n * | import \"pkg\" | /a/b/c/pkg | pkg |\n * | import \"@org/pkg\" | /a/b/c/@org/pkg | @org/pkg |\n * | import \"node:assert\" | node:assert | node:assert |\n * | import \"cloudflare:sockets\" | cloudflare:sockets | cloudflare:sockets |\n * | import \"workerd:rtti\" | workerd:rtti | workerd:rtti |\n * | import \"random:pkg\" | /a/b/c/random:pkg | random:pkg |\n *\n * Note that we return `dep.mjs` for `import \"./dep.mjs\"`. This would fail\n * ES module resolution, so must be handled by `maybeGetTargetFilePath()`.\n */\nfunction getApproximateSpecifier(target: string, referrerDir: string): string {\n\tif (/^(node|cloudflare|workerd):/.test(target)) {\n\t\treturn target;\n\t}\n\treturn posixPath.relative(referrerDir, target);\n}\n\nasync function viteResolve(\n\tvite: Vite.ViteDevServer,\n\tspecifier: string,\n\treferrer: string,\n\tisRequire: boolean\n): Promise<string> {\n\tconst resolved = await vite.pluginContainer.resolveId(specifier, referrer, {\n\t\tssr: true,\n\t\t// https://github.com/vitejs/vite/blob/v5.1.4/packages/vite/src/node/plugins/resolve.ts#L178-L179\n\t\tcustom: { \"node-resolve\": { isRequire } },\n\t});\n\tif (resolved === null) {\n\t\t// Vite's resolution algorithm doesn't apply Node resolution to specifiers\n\t\t// starting with a dot. Unfortunately, the `@prisma/client` package includes\n\t\t// `require(\".prisma/client/wasm\")` which needs to resolve to something in\n\t\t// `node_modules/.prisma/client`. Since Prisma officially supports Workers,\n\t\t// it's quite likely users will want to use it with the Vitest pool. To fix\n\t\t// this, we fall back to Node's resolution algorithm in this case.\n\t\tif (isRequire && specifier[0] === \".\") {\n\t\t\treturn require.resolve(specifier, { paths: [referrer] });\n\t\t}\n\t\tthrow new Error(\"Not found\");\n\t}\n\t// Handle case where `package.json` `browser` field stubs out built-in with an\n\t// empty module (e.g. `{ \"browser\": { \"fs\": false } }`).\n\tif (resolved.id === \"__vite-browser-external\") {\n\t\treturn emptyLibPath;\n\t}\n\tif (resolved.external) {\n\t\t// Handle case where `node:*` built-in resolved from import map\n\t\t// (e.g. https://github.com/sindresorhus/p-limit/blob/f53bdb5f464ae112b2859e834fdebedc0745199b/package.json#L20)\n\t\tlet { id } = resolved;\n\t\tif (workerdBuiltinModules.has(id)) {\n\t\t\treturn `/${id}`;\n\t\t}\n\t\tif (id.startsWith(\"node:\")) {\n\t\t\tthrow new Error(\"Not found\");\n\t\t}\n\n\t\tid = `node:${id}`;\n\t\tif (workerdBuiltinModules.has(id)) {\n\t\t\treturn `/${id}`;\n\t\t}\n\n\t\t// If we get this far, we have something that:\n\t\t// - looks like a built-in node module but wasn't imported with a `node:` prefix\n\t\t// - and isn't provided by workerd natively\n\t\t// In that case, _try_ and load the identifier with a `node:` prefix.\n\t\t// This will potentially load one of the Node.js polyfills provided by `vitest-pool-workers`\n\t\t// Note: User imports should never get here! This is only meant to cater for Vitest internals\n\t\t// (Specifically, the \"tinyrainbow\" module imports `node:tty` as `tty`)\n\t\treturn id;\n\t}\n\n\treturn trimViteVersionHash(resolved.id);\n}\n\ntype ResolveMethod = \"import\" | \"require\";\nasync function resolve(\n\tvite: Vite.ViteDevServer,\n\tmethod: ResolveMethod,\n\ttarget: string,\n\tspecifier: string,\n\treferrer: string\n): Promise<string /* filePath */> {\n\tconst referrerDir = posixPath.dirname(referrer);\n\n\tconst isRequire = method === \"require\";\n\tlet filePath = maybeGetTargetFilePath(target, isRequire);\n\tif (filePath !== undefined) {\n\t\treturn filePath;\n\t}\n\n\t// `workerd` will always try to resolve modules relative to the referencing\n\t// dir first. Built-in `node:*`/`cloudflare:*` imports only exist at the root.\n\t// We need to ensure we only load a single copy of these modules, therefore,\n\t// we return a redirect to the root here. Note `workerd` will automatically\n\t// look in the root if we return 404 from the fallback service when\n\t// *import*ing `node:*`/`cloudflare:*` modules, but not when *require()*ing\n\t// them. For the sake of consistency (and a nice return type on this function)\n\t// we return a redirect for `import`s too.\n\tif (referrerDir !== \"/\" && workerdBuiltinModules.has(specifier)) {\n\t\treturn `/${specifier}`;\n\t}\n\n\tconst specifierLibPath = posixPath.join(\n\t\tlibPath,\n\t\tspecifier.replaceAll(\":\", \"/\")\n\t);\n\t// Always probe extensions for pool-internal lib modules\n\tfilePath = maybeGetTargetFilePath(specifierLibPath, /* isRequire */ true);\n\tif (filePath !== undefined) {\n\t\treturn filePath;\n\t}\n\n\treturn viteResolve(vite, specifier, referrer, method === \"require\");\n}\n\nfunction buildRedirectResponse(filePath: string) {\n\t// `workerd` expects an absolute POSIX-style path (starting with a slash) for\n\t// redirects. `filePath` is a platform absolute path with forward slashes.\n\t// On Windows, this won't start with a `/`, so we add one to produce paths\n\t// like `/C:/a/b/c`.\n\tif (isWindows && filePath[0] !== \"/\") {\n\t\tfilePath = `/${filePath}`;\n\t}\n\treturn new Response(null, { status: 301, headers: { Location: filePath } });\n}\n\n// `Omit<Worker_Module, \"name\">` gives type `{}` which isn't very helpful, so\n// we have to do something like this instead.\ntype DistributeWorkerModuleForContents<T> = T extends unknown\n\t? { [P in Exclude<keyof T, \"name\">]: NonNullable<T[P]> }\n\t: never;\ntype ModuleContents = DistributeWorkerModuleForContents<Worker_Module>;\n\n// Refer to docs on `forceModuleTypeRegexp` for more details\nfunction maybeGetForceTypeModuleContents(\n\tfilePath: string\n): ModuleContents | undefined {\n\tconst match = forceModuleTypeRegexp.exec(filePath);\n\tif (match === null) {\n\t\treturn;\n\t}\n\n\tfilePath = trimSuffix(match[0], filePath);\n\tconst type = match[1] as ModuleRuleType;\n\tconst contents = fs.readFileSync(filePath);\n\tswitch (type) {\n\t\tcase \"ESModule\":\n\t\t\treturn { esModule: contents.toString() };\n\t\tcase \"CommonJS\":\n\t\t\treturn { commonJsModule: contents.toString() };\n\t\tcase \"Text\":\n\t\t\treturn { text: contents.toString() };\n\t\tcase \"Data\":\n\t\t\treturn { data: contents };\n\t\tcase \"CompiledWasm\":\n\t\t\treturn { wasm: contents };\n\t\tcase \"PythonModule\":\n\t\t\treturn { pythonModule: contents.toString() };\n\t\tcase \"PythonRequirement\":\n\t\t\treturn { pythonRequirement: contents.toString() };\n\t\tdefault: {\n\t\t\t// `type` should've been validated against `ModuleRuleType`\n\t\t\tconst exhaustive: never = type;\n\t\t\tassert.fail(`Unreachable: ${exhaustive} modules are unsupported`);\n\t\t}\n\t}\n}\nfunction buildModuleResponse(target: string, contents: ModuleContents) {\n\tlet name = target;\n\tif (!isWindows) {\n\t\tname = posixPath.relative(\"/\", target);\n\t}\n\tassert(name[0] !== \"/\");\n\tconst result: Record<string, unknown> = { name };\n\tfor (const key in contents) {\n\t\tconst value = (contents as Record<string, unknown>)[key];\n\t\t// Cap'n Proto expects byte arrays for `:Data` typed fields from JSON\n\t\tresult[key] = value instanceof Uint8Array ? Array.from(value) : value;\n\t}\n\treturn Response.json(result);\n}\n\nasync function load(\n\tvite: Vite.ViteDevServer,\n\tlogBase: string,\n\tmethod: ResolveMethod,\n\ttarget: string,\n\tspecifier: string,\n\tfilePath: string\n): Promise<Response> {\n\tif (target !== filePath) {\n\t\t// We might `import` and `require` the same CommonJS package. In this case,\n\t\t// we want to respond with an ES module shim for the `import`, and the\n\t\t// module as is otherwise. If we're `require()`ing a package, make sure we\n\t\t// redirect to the module disabling the ES module shim.\n\t\tif (method === \"require\" && !specifier.startsWith(\"node:\")) {\n\t\t\tfilePath += disableCjsEsmShimSuffix;\n\t\t}\n\t\tdebuglog(logBase, \"redirect:\", filePath);\n\t\treturn buildRedirectResponse(filePath);\n\t}\n\n\t// If this is a WebAssembly module, force load it as one. This ensures we\n\t// support `.wasm` files inside `node_modules` (e.g. Prisma's client).\n\t// It seems unlikely a package would want to do anything else with a `.wasm`\n\t// file. Note if a module rule was applied to `.wasm` files, this path will\n\t// have a `?mf_vitest_force` suffix already, so this line won't do anything.\n\tif (filePath.endsWith(\".wasm\")) {\n\t\tfilePath += `?mf_vitest_force=CompiledWasm`;\n\t}\n\n\t// If we're importing with a forced module type, load the file as that type\n\tconst maybeContents = maybeGetForceTypeModuleContents(filePath);\n\tif (maybeContents !== undefined) {\n\t\tdebuglog(logBase, \"forced:\", filePath);\n\t\treturn buildModuleResponse(target, maybeContents);\n\t}\n\n\t// If we're importing from a shim module, don't shim again\n\tconst disableCjsEsmShim = filePath.endsWith(disableCjsEsmShimSuffix);\n\tif (disableCjsEsmShim) {\n\t\tfilePath = trimSuffix(disableCjsEsmShimSuffix, filePath);\n\t}\n\n\tconst isEsm =\n\t\tfilePath.endsWith(\".mjs\") ||\n\t\t(filePath.endsWith(\".js\") && isWithinTypeModuleContext(filePath));\n\n\t// JSON modules: CommonJS `require(\"./data.json\")` is common in many widely\n\t// used packages (e.g. mime-types). If we return raw JSON as a `commonJsModule`,\n\t// `workerd` will try to parse it as JavaScript and fail with\n\t// `SyntaxError: Unexpected token ':'`.\n\tif (filePath.endsWith(\".json\")) {\n\t\tconst json = fs.readFileSync(filePath, \"utf8\");\n\t\tdebuglog(logBase, \"json:\", filePath);\n\t\treturn buildModuleResponse(target, { json });\n\t}\n\n\tlet contents = fs.readFileSync(filePath, \"utf8\");\n\tconst targetUrl = pathToFileURL(target);\n\tcontents = withSourceUrl(contents, targetUrl);\n\n\tif (isEsm) {\n\t\t// Respond with ES module\n\t\tcontents = withImportMetaUrl(contents, targetUrl);\n\t\tdebuglog(logBase, \"esm:\", filePath);\n\t\treturn buildModuleResponse(target, { esModule: contents });\n\t}\n\n\t// Respond with CommonJS module\n\n\t// If we're `import`ing a CommonJS module, or we're `require`ing a `node:*`\n\t// module from a CommonJS, return an ES module shim. Note\n\t// CommonJS can `require` ES modules, using the default export.\n\tconst insertCjsEsmShim = method === \"import\" || specifier.startsWith(\"node:\");\n\tif (insertCjsEsmShim && !disableCjsEsmShim) {\n\t\tconst fileName = posixPath.basename(filePath);\n\t\tconst disableShimSpecifier = `./${fileName}${disableCjsEsmShimSuffix}`;\n\t\tconst quotedDisableShimSpecifier = JSON.stringify(disableShimSpecifier);\n\t\tlet esModule = `import mod from ${quotedDisableShimSpecifier}; export default mod;`;\n\t\tfor (const name of await getCjsNamedExports(vite, filePath, contents)) {\n\t\t\tesModule += ` export const ${name} = mod.${name};`;\n\t\t}\n\t\tdebuglog(logBase, \"cjs-esm-shim:\", filePath);\n\t\treturn buildModuleResponse(target, { esModule });\n\t}\n\n\t// Otherwise, if we're `require`ing a non-`node:*` module, just return a\n\t// CommonJS\n\tdebuglog(logBase, \"cjs:\", filePath);\n\treturn buildModuleResponse(target, { commonJsModule: contents });\n}\n\nexport async function handleModuleFallbackRequest(\n\tvite: Vite.ViteDevServer,\n\trequest: Request\n): Promise<Response> {\n\tconst method = request.headers.get(\"X-Resolve-Method\");\n\tassert(method === \"import\" || method === \"require\");\n\tconst url = new URL(request.url);\n\tlet target = url.searchParams.get(\"specifier\");\n\tlet referrer = url.searchParams.get(\"referrer\");\n\tassert(target !== null, \"Expected specifier search param\");\n\tassert(referrer !== null, \"Expected referrer search param\");\n\tconst referrerDir = posixPath.dirname(referrer);\n\tlet specifier = getApproximateSpecifier(target, referrerDir);\n\n\t// Convert specifiers like `file:/a/index.mjs` to `/a/index.mjs`. `workerd`\n\t// currently passes `import(\"file:///a/index.mjs\")` through like this.\n\t// TODO(soon): remove this code once the new modules refactor lands\n\tif (specifier.startsWith(\"file:\")) {\n\t\tspecifier = fileURLToPath(specifier);\n\t}\n\n\tif (isWindows) {\n\t\t// Convert paths like `/C:/a/index.mjs` to `C:/a/index.mjs` so they can be\n\t\t// passed to Node `fs` functions.\n\t\tif (target[0] === \"/\") {\n\t\t\ttarget = target.substring(1);\n\t\t}\n\t\tif (referrer[0] === \"/\") {\n\t\t\treferrer = referrer.substring(1);\n\t\t}\n\t}\n\n\tconst quotedTarget = JSON.stringify(target);\n\tconst logBase = `${method}(${quotedTarget}) relative to ${referrer}:`;\n\n\ttry {\n\t\tconst filePath = await resolve(vite, method, target, specifier, referrer);\n\n\t\treturn await load(vite, logBase, method, target, specifier, filePath);\n\t} catch (e) {\n\t\tdebuglog(logBase, \"error:\", e);\n\t\tconsole.error(\n\t\t\t`[vitest-pool-workers] Failed to ${method} ${JSON.stringify(target)} from ${JSON.stringify(referrer)}.`,\n\t\t\t\"To resolve this, try bundling the relevant dependency with Vite.\",\n\t\t\t\"For more details, refer to https://developers.cloudflare.com/workers/testing/vitest-integration/known-issues/#module-resolution\"\n\t\t);\n\t}\n\n\treturn new Response(null, { status: 404 });\n}\n","import path from \"node:path\";\nimport {\n\tformatZodError,\n\tgetRootPath,\n\tLog,\n\tLogLevel,\n\tmergeWorkerOptions,\n\tparseWithRootPath,\n\tPLUGINS,\n} from \"miniflare\";\nimport { z } from \"zod\";\nimport {\n\tgetProjectPath,\n\tgetRelativeProjectConfigPath,\n\tgetRelativeProjectPath,\n} from \"./helpers\";\nimport type { ModuleRule, WorkerOptions } from \"miniflare\";\nimport type { TestProject } from \"vitest/node\";\nimport type { Binding, RemoteProxySession } from \"wrangler\";\nimport type { ParseParams, ZodError } from \"zod\";\n\nexport interface WorkersConfigPluginAPI {\n\tsetMain(newMain?: string): void;\n}\n\nconst PLUGIN_VALUES = Object.values(PLUGINS);\n\nconst WorkersPoolOptionsSchema = z.object({\n\t/**\n\t * Entrypoint to Worker run in the same isolate/context as tests. This is\n\t * required to use `import { exports } from \"cloudflare:workers\"`, or Durable\n\t * Objects without an explicit `scriptName`. Note this goes through Vite\n\t * transforms and can be a TypeScript file. Note also\n\t * `import module from \"<path-to-main>\"` inside tests gives exactly the same\n\t * `module` instance as is used internally for the `SELF` and Durable Object\n\t * bindings.\n\t */\n\tmain: z.ostring(),\n\t/**\n\t * Enables remote bindings to access remote resources configured\n\t * with `remote: true` in the wrangler configuration file.\n\t */\n\tremoteBindings: z.boolean().default(true),\n\t/**\n\t * Additional exports.\n\t * A map of module exports to be made available on the `ctx.exports`\n\t * that cannot be automatically inferred by analyzing the Worker source code.\n\t *\n\t * This is useful for exports that are re-exported implicitly, for example\n\t * through wildcard (`export * from \"...\"`) re-exports from virtual modules.\n\t */\n\tadditionalExports: z\n\t\t.record(\n\t\t\tz.string(),\n\t\t\tz.union([\n\t\t\t\tz.literal(\"WorkerEntrypoint\"),\n\t\t\t\tz.literal(\"DurableObject\"),\n\t\t\t\tz.literal(\"WorkflowEntrypoint\"),\n\t\t\t])\n\t\t)\n\t\t.default({}),\n\tminiflare: z\n\t\t.object({\n\t\t\tworkers: z.array(z.object({}).passthrough()).optional(),\n\t\t})\n\t\t.passthrough()\n\t\t.optional(),\n\twrangler: z\n\t\t.object({ configPath: z.ostring(), environment: z.ostring() })\n\t\t.optional(),\n});\n\nexport type SourcelessWorkerOptions = Omit<\n\tWorkerOptions,\n\t\"script\" | \"scriptPath\" | \"modules\" | \"modulesRoot\"\n> & {\n\t// `modulesRules` is not included in all members of the `SourceOptions` type\n\t// from which `WorkerOptions` is derived. Therefore, we manually include it.\n\tmodulesRules?: ModuleRule[];\n};\n\nexport type WorkersPoolOptions = z.input<typeof WorkersPoolOptionsSchema> & {\n\tminiflare?: SourcelessWorkerOptions & {\n\t\tworkers?: WorkerOptions[];\n\t};\n};\n\nexport type WorkersPoolOptionsWithDefines = WorkersPoolOptions & {\n\tdefines?: Record<string, string>;\n};\n\ntype PathParseParams = Pick<ParseParams, \"path\">;\n\nfunction isZodErrorLike(value: unknown): value is ZodError {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"issues\" in value &&\n\t\tArray.isArray(value.issues)\n\t);\n}\n\ntype ZodErrorRef = { value?: ZodError };\nfunction coalesceZodErrors(ref: ZodErrorRef, thrown: unknown) {\n\tif (!isZodErrorLike(thrown)) {\n\t\tthrow thrown;\n\t}\n\tif (ref.value === undefined) {\n\t\tref.value = thrown;\n\t} else {\n\t\tref.value.issues.push(...thrown.issues);\n\t}\n}\n\nfunction parseWorkerOptions(\n\trootPath: string,\n\tvalue: Record<string, unknown>,\n\twithoutScript: boolean,\n\topts: PathParseParams\n): WorkerOptions {\n\t// If this worker shouldn't have a configurable script, remove all script data\n\t// and replace it with an empty `script` that will pass validation\n\tif (withoutScript) {\n\t\tvalue[\"script\"] = \"\";\n\t\tdelete value[\"scriptPath\"];\n\t\tdelete value[\"modules\"];\n\t\tdelete value[\"modulesRoot\"];\n\t}\n\n\tconst result = {} as WorkerOptions;\n\tconst errorRef: ZodErrorRef = {};\n\tfor (const plugin of PLUGIN_VALUES) {\n\t\ttry {\n\t\t\t// This `parse()` may throw a different `ZodError` than what we `import`\n\t\t\tconst parsed = parseWithRootPath(rootPath, plugin.options, value, opts);\n\t\t\tObject.assign(result, parsed);\n\t\t} catch (e) {\n\t\t\tcoalesceZodErrors(errorRef, e);\n\t\t}\n\t}\n\tif (errorRef.value !== undefined) {\n\t\tthrow errorRef.value;\n\t}\n\n\t// Remove the placeholder script added if any\n\tif (withoutScript) {\n\t\tdelete value[\"script\"];\n\t}\n\treturn result;\n}\n\nconst log = new Log(LogLevel.WARN, { prefix: \"vpw\" });\n\nfunction filterTails(\n\ttails: WorkerOptions[\"tails\"],\n\tuserWorkers?: { name?: string }[]\n) {\n\t// Only connect the tail consumers that represent Workers that are defined in the Vitest config. Warn that a tail will be omitted otherwise\n\t// This _differs from service bindings_ because tail consumers are \"optional\" in a sense, and shouldn't affect the runtime behaviour of a Worker\n\treturn tails?.filter((tailService) => {\n\t\tlet name: string;\n\t\tif (typeof tailService === \"string\") {\n\t\t\tname = tailService;\n\t\t} else if (\n\t\t\ttypeof tailService === \"object\" &&\n\t\t\t\"name\" in tailService &&\n\t\t\ttypeof tailService.name === \"string\"\n\t\t) {\n\t\t\tname = tailService.name;\n\t\t} else {\n\t\t\t// Don't interfere with network-based tail connections (e.g. via the dev registry), or kCurrentWorker\n\t\t\treturn true;\n\t\t}\n\t\tconst found = userWorkers?.some((w) => w.name === name);\n\n\t\tif (!found) {\n\t\t\tlog.warn(\n\t\t\t\t`Tail consumer \"${name}\" was not found in your config. Make sure you add it if you'd like to simulate receiving tail events locally.`\n\t\t\t);\n\t\t}\n\n\t\treturn found;\n\t});\n}\n\n/** Map that maps worker configPaths to their existing remote proxy session data (if any) */\nexport const remoteProxySessionsDataMap = new Map<\n\tstring,\n\t{\n\t\tsession: RemoteProxySession;\n\t\tremoteBindings: Record<string, Binding>;\n\t} | null\n>();\n\nasync function parseCustomPoolOptions(\n\trootPath: string,\n\tvalue: unknown\n): Promise<WorkersPoolOptionsWithDefines> {\n\t// Try to parse pool specific options\n\tconst options = WorkersPoolOptionsSchema.parse(\n\t\tvalue\n\t) as WorkersPoolOptionsWithDefines;\n\toptions.miniflare ??= {};\n\n\t// Try to parse runner worker options, coalescing all errors\n\tconst errorRef: ZodErrorRef = {};\n\tconst workers = options.miniflare?.workers;\n\tconst rootPathOption = getRootPath(options.miniflare);\n\trootPath = path.resolve(rootPath, rootPathOption);\n\ttry {\n\t\toptions.miniflare = parseWorkerOptions(\n\t\t\trootPath,\n\t\t\toptions.miniflare,\n\t\t\t/* withoutScript */ true, // (script provided by runner)\n\t\t\t{ path: [\"miniflare\"] }\n\t\t);\n\t} catch (e) {\n\t\tcoalesceZodErrors(errorRef, e);\n\t}\n\n\toptions.miniflare.workers = [];\n\t// Try to parse auxiliary worker options\n\tif (workers !== undefined) {\n\t\toptions.miniflare.workers = workers.map((worker, i) => {\n\t\t\ttry {\n\t\t\t\tconst workerRootPathOption = getRootPath(worker);\n\t\t\t\tconst workerRootPath = path.resolve(rootPath, workerRootPathOption);\n\t\t\t\treturn parseWorkerOptions(\n\t\t\t\t\tworkerRootPath,\n\t\t\t\t\tworker,\n\t\t\t\t\t/* withoutScript */ false,\n\t\t\t\t\t{\n\t\t\t\t\t\tpath: [\"miniflare\", \"workers\", i],\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\tcoalesceZodErrors(errorRef, e);\n\t\t\t\treturn { script: \"\" }; // (ignored as we'll be throwing)\n\t\t\t}\n\t\t});\n\t}\n\n\tif (errorRef.value !== undefined) {\n\t\tthrow errorRef.value;\n\t}\n\n\t// Try to parse Wrangler config if any\n\tif (options.wrangler?.configPath !== undefined) {\n\t\tconst configPath = path.resolve(rootPath, options.wrangler.configPath);\n\t\t// Make sure future accesses to `configPath` see a fully-resolved path\n\t\t// (e.g. for getting accurate relative paths in error messages)\n\t\toptions.wrangler.configPath = configPath;\n\n\t\t// Lazily import `wrangler` if and when we need it\n\t\tconst wrangler = await import(\"wrangler\");\n\n\t\tconst preExistingRemoteProxySessionData = options.wrangler?.configPath\n\t\t\t? remoteProxySessionsDataMap.get(options.wrangler.configPath)\n\t\t\t: undefined;\n\n\t\tconst remoteProxySessionData = options.remoteBindings\n\t\t\t? await wrangler.maybeStartOrUpdateRemoteProxySession(\n\t\t\t\t\t{\n\t\t\t\t\t\tpath: options.wrangler.configPath,\n\t\t\t\t\t\tenvironment: options.wrangler.environment,\n\t\t\t\t\t},\n\t\t\t\t\tpreExistingRemoteProxySessionData ?? null\n\t\t\t\t)\n\t\t\t: null;\n\n\t\tif (options.wrangler?.configPath && remoteProxySessionData) {\n\t\t\tremoteProxySessionsDataMap.set(\n\t\t\t\toptions.wrangler.configPath,\n\t\t\t\tremoteProxySessionData\n\t\t\t);\n\t\t}\n\n\t\tconst { workerOptions, externalWorkers, define, main } =\n\t\t\twrangler.unstable_getMiniflareWorkerOptions(\n\t\t\t\tconfigPath,\n\t\t\t\toptions.wrangler.environment,\n\t\t\t\t{\n\t\t\t\t\toverrides: {\n\t\t\t\t\t\tassets: options.miniflare.assets,\n\t\t\t\t\t\t// doesn't work with containers yet so let's just disable it\n\t\t\t\t\t\tenableContainers: false,\n\t\t\t\t\t},\n\t\t\t\t\tremoteProxyConnectionString:\n\t\t\t\t\t\tremoteProxySessionData?.session?.remoteProxyConnectionString,\n\t\t\t\t}\n\t\t\t);\n\n\t\t// If `main` wasn't explicitly configured, fall back to Wrangler config's\n\t\toptions.main ??= main;\n\n\t\toptions.miniflare.workers = [\n\t\t\t...options.miniflare.workers,\n\t\t\t...externalWorkers,\n\t\t];\n\n\t\t// Merge generated Miniflare options from Wrangler with specified overrides\n\t\toptions.miniflare = mergeWorkerOptions(\n\t\t\tworkerOptions,\n\t\t\toptions.miniflare as SourcelessWorkerOptions\n\t\t);\n\n\t\toptions.miniflare = {\n\t\t\t...options.miniflare,\n\t\t\ttails: filterTails(workerOptions.tails, options.miniflare.workers),\n\t\t};\n\n\t\t// Record any Wrangler `define`s\n\t\toptions.defines = define;\n\t}\n\n\t// Some assets plumbing that should be hidden from the end user\n\tif (options.miniflare?.assets) {\n\t\t// (Used to set the SELF binding to point to the router worker instead)\n\t\toptions.miniflare.hasAssetsAndIsVitest = true;\n\t\toptions.miniflare.assets.routerConfig ??= {};\n\t\toptions.miniflare.assets.routerConfig.has_user_worker = Boolean(\n\t\t\toptions.main\n\t\t);\n\t}\n\n\treturn options;\n}\n\nexport async function parseProjectOptions(\n\tproject: TestProject,\n\tpoolOptions: unknown\n): Promise<WorkersPoolOptionsWithDefines> {\n\t// Make sure the user hasn't specified a custom environment. This was how\n\t// users enabled Miniflare 2's Vitest environment, so it's likely users will\n\t// hit this case.\n\tconst environment = project.config.environment;\n\tif (environment !== undefined && environment !== \"node\") {\n\t\tconst quotedEnvironment = JSON.stringify(environment);\n\n\t\tlet migrationGuide = \".\";\n\t\tif (environment === \"miniflare\") {\n\t\t\tmigrationGuide =\n\t\t\t\t\", and refer to the migration guide if upgrading from `vitest-environment-miniflare`:\\nhttps://developers.cloudflare.com/workers/testing/vitest-integration/get-started/migrate-from-miniflare-2/\";\n\t\t}\n\n\t\tconst relativePath = getRelativeProjectPath(project);\n\t\tconst message = [\n\t\t\t`Unexpected custom \\`environment\\` ${quotedEnvironment} in project ${relativePath}.`,\n\t\t\t\"The Workers pool always runs your tests inside of an environment providing Workers runtime APIs.\",\n\t\t\t`Please remove the \\`environment\\` configuration${migrationGuide}`,\n\t\t].join(\"\\n\");\n\t\tthrow new TypeError(message);\n\t}\n\n\tconst projectPath = getProjectPath(project);\n\n\ttry {\n\t\treturn await parseCustomPoolOptions(projectPath, poolOptions);\n\t} catch (e) {\n\t\tif (!isZodErrorLike(e)) {\n\t\t\tthrow e;\n\t\t}\n\t\tlet formatted: string;\n\t\ttry {\n\t\t\tformatted = formatZodError(e, poolOptions);\n\t\t} catch {\n\t\t\tthrow e;\n\t\t}\n\t\tconst relativePath = getRelativeProjectConfigPath(project);\n\t\tthrow new TypeError(\n\t\t\t`Unexpected options in project ${relativePath}:\\n${formatted}`\n\t\t);\n\t}\n}\n","import type { Request, Response } from \"miniflare\";\nimport type { Unstable_ASSETSBindingsOptions } from \"wrangler\";\n\n// Track all AbortControllers created by buildPagesASSETSBinding so they can\n// be cleaned up when the last pool worker stops. This is necessary because\n// vitest evaluates all project configs at startup (to discover the workspace),\n// even for projects that won't run — so the watchers are created before any\n// pool worker exists, and the creating project's pool worker may never start.\nconst registeredControllers = new Set<AbortController>();\n\n// Reference count of active pool workers. Watchers are only closed when the\n// last worker stops, so that early-finishing workers don't kill watchers that\n// later workers (or other projects in the workspace) still need.\nlet activeWorkers = 0;\n\nexport function poolWorkerStarted(): void {\n\tactiveWorkers++;\n}\n\nexport function poolWorkerStopped(): void {\n\tactiveWorkers--;\n\tif (activeWorkers <= 0) {\n\t\tactiveWorkers = 0;\n\t\tfor (const ac of registeredControllers) {\n\t\t\tac.abort();\n\t\t}\n\t\tregisteredControllers.clear();\n\t}\n}\n\nexport async function buildPagesASSETSBinding(\n\tassetsPath: string\n): Promise<(request: Request) => Promise<Response>> {\n\t// noinspection SuspiciousTypeOfGuard\n\tif (typeof assetsPath !== \"string\") {\n\t\tthrow new TypeError(\n\t\t\t\"Failed to execute 'buildPagesASSETSBinding': parameter 1 is not of type 'string'.\"\n\t\t);\n\t}\n\n\tconst { unstable_generateASSETSBinding } = await import(\"wrangler\"); // (lazy)\n\n\t// Create the AbortController after the import succeeds so we don't leak\n\t// a registered controller if the import throws.\n\tconst ac = new AbortController();\n\tregisteredControllers.add(ac);\n\n\tconst log = {\n\t\t...console,\n\t\tdebugWithSanitization: console.debug,\n\t\tloggerLevel: \"info\",\n\t\tcolumns: process.stdout.columns,\n\t} as unknown as Unstable_ASSETSBindingsOptions[\"log\"];\n\treturn unstable_generateASSETSBinding({\n\t\tlog,\n\t\tdirectory: assetsPath,\n\t\tsignal: ac.signal,\n\t});\n}\n","import assert from \"node:assert\";\nimport path from \"node:path\";\nimport { compileModuleRules, testRegExps } from \"miniflare\";\nimport { type ProvidedContext } from \"vitest\";\nimport { workerdBuiltinModules } from \"../shared/builtin-modules\";\nimport { parseProjectOptions, remoteProxySessionsDataMap } from \"./config\";\nimport { poolWorkerStarted, poolWorkerStopped } from \"./pages\";\nimport { type WorkerPoolOptionsContext } from \"./plugin\";\nimport {\n\tassertCompatibleVitestVersion,\n\tconnectToMiniflareSocket,\n\tgetDurableObjectDesignators,\n\tgetProjectMiniflare,\n\tgetRunnerName,\n\tmaybeGetResolvedMainPath,\n\tstructuredSerializableParse,\n\tstructuredSerializableStringify,\n} from \".\";\nimport type {\n\tWorkersConfigPluginAPI,\n\tWorkersPoolOptions,\n\tWorkersPoolOptionsWithDefines,\n} from \"./config\";\nimport type {\n\tMiniflare,\n\tMessageEvent as MiniflareMessageEvent,\n\tWebSocket,\n} from \"miniflare\";\nimport type {\n\tPoolOptions,\n\tPoolWorker,\n\tWorkerRequest,\n\tWorkerResponse,\n} from \"vitest/node\";\n\nexport class CloudflarePoolWorker implements PoolWorker {\n\tname = \"cloudflare-pool\";\n\tprivate mf: Miniflare | undefined;\n\tprivate socket: WebSocket | undefined;\n\tprivate parsedPoolOptions: WorkersPoolOptionsWithDefines | undefined;\n\tprivate main: string | undefined;\n\t// Store wrapped listeners so off() can remove them correctly.\n\t// Vitest registers at most one listener per event type.\n\tprivate messageListener?: (event: MiniflareMessageEvent) => void;\n\tprivate errorListener?: (event: Event) => void;\n\tprivate closeListener?: () => void;\n\n\tconstructor(\n\t\tprivate options: PoolOptions,\n\t\tprivate poolOptions:\n\t\t\t| WorkersPoolOptions\n\t\t\t| ((\n\t\t\t\t\tctx: WorkerPoolOptionsContext\n\t\t\t ) => Promise<WorkersPoolOptions> | WorkersPoolOptions)\n\t) {\n\t\tassertCompatibleVitestVersion(options.project.vitest);\n\t}\n\n\tasync start(): Promise<void> {\n\t\tpoolWorkerStarted();\n\n\t\tlet resolvedPoolOptions: WorkersPoolOptions;\n\t\tif (typeof this.poolOptions === \"function\") {\n\t\t\t// https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/vitest/src/integrations/inject.ts\n\t\t\tconst inject = <K extends keyof ProvidedContext>(\n\t\t\t\tkey: K\n\t\t\t): ProvidedContext[K] => {\n\t\t\t\treturn this.options.project.getProvidedContext()[key];\n\t\t\t};\n\t\t\tresolvedPoolOptions = await this.poolOptions({ inject });\n\t\t} else {\n\t\t\tresolvedPoolOptions = this.poolOptions;\n\t\t}\n\n\t\tthis.parsedPoolOptions = await parseProjectOptions(\n\t\t\tthis.options.project,\n\t\t\tresolvedPoolOptions\n\t\t);\n\t\tthis.main = maybeGetResolvedMainPath(\n\t\t\tthis.options.project,\n\t\t\tthis.parsedPoolOptions\n\t\t);\n\n\t\t// Find the vitest-pool-workers plugin and give it the path to the main file.\n\t\t// This allows that plugin to inject a virtual dependency on main so that vitest\n\t\t// will automatically re-run tests when that gets updated, avoiding the user having\n\t\t// to manually add such an import in their tests.\n\t\tconst configPlugin = this.options.project.vite.config.plugins.find(\n\t\t\t({ name }) => name === \"@cloudflare/vitest-pool-workers\"\n\t\t);\n\t\tif (configPlugin !== undefined) {\n\t\t\tconst api = configPlugin.api as WorkersConfigPluginAPI;\n\t\t\tapi.setMain(this.main);\n\t\t}\n\n\t\tthis.mf = await getProjectMiniflare(\n\t\t\tthis.options.project.vitest,\n\t\t\tthis.options.project,\n\t\t\tthis.parsedPoolOptions,\n\t\t\tthis.main\n\t\t);\n\n\t\tthis.socket = await connectToMiniflareSocket(\n\t\t\tthis.mf,\n\t\t\tgetRunnerName(this.options.project)\n\t\t);\n\t}\n\n\tasync stop(): Promise<void> {\n\t\tthis.socket?.close();\n\t\tthis.socket = undefined;\n\t\tawait this.mf?.dispose();\n\t\tthis.mf = undefined;\n\n\t\tif (this.parsedPoolOptions?.wrangler?.configPath) {\n\t\t\tawait remoteProxySessionsDataMap\n\t\t\t\t.get(this.parsedPoolOptions?.wrangler?.configPath)\n\t\t\t\t?.session?.dispose?.();\n\t\t}\n\n\t\t// Decrement the active worker count. When the last worker stops, this\n\t\t// closes file watchers created by buildPagesASSETSBinding() during config\n\t\t// evaluation — they're registered globally because vitest evaluates all\n\t\t// project configs at startup, even for projects that won't run.\n\t\tpoolWorkerStopped();\n\t}\n\n\tsend(message: WorkerRequest): void {\n\t\t// Vitest will always call `start()` before calling `send()`\n\t\tassert(this.socket, \"Message sent to Worker before initialisation\");\n\t\tassert(\n\t\t\tthis.parsedPoolOptions,\n\t\t\t\"Message sent to Worker before initialisation\"\n\t\t);\n\n\t\t// Avoid mutating Vitest's message objects — shallow-copy the parts we modify\n\t\tlet toSend: WorkerRequest = message;\n\t\tif (message.type === \"start\") {\n\t\t\t// Users can write `vitest --inspect` to start an inspector connection for their tests\n\t\t\t// We intercept that option and use it to enable inspection of the Workers running in workerd\n\t\t\t// We need to stop it passing through into Vitest's in-Worker code, or Vitest will try and import\n\t\t\t// and run `inspector.open()` from `node:inspector`\n\t\t\ttoSend = {\n\t\t\t\t...message,\n\t\t\t\tcontext: {\n\t\t\t\t\t...message.context,\n\t\t\t\t\tconfig: {\n\t\t\t\t\t\t...message.context.config,\n\t\t\t\t\t\tinspector: {\n\t\t\t\t\t\t\t...message.context.config.inspector,\n\t\t\t\t\t\t\tenabled: false,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t} else if (message.type === \"run\") {\n\t\t\t// For some reason providing this using the Vitest `project.provide` API\n\t\t\t// doesn't work in Vitest Projects, and so we just provide the context directly\n\t\t\ttoSend = {\n\t\t\t\t...message,\n\t\t\t\tcontext: {\n\t\t\t\t\t...message.context,\n\t\t\t\t\tprovidedContext: {\n\t\t\t\t\t\t...message.context.providedContext,\n\t\t\t\t\t\tcloudflarePoolOptions: JSON.stringify({\n\t\t\t\t\t\t\t// Include resolved `main` if defined\n\t\t\t\t\t\t\tmain: this.main,\n\t\t\t\t\t\t\t// Include designators of all Durable Object namespaces bound in the\n\t\t\t\t\t\t\t// runner worker. We'll use this to list IDs in a namespace. We'll\n\t\t\t\t\t\t\t// also use this to check Durable Object test runner helpers are\n\t\t\t\t\t\t\t// only used with classes defined in the current worker, as these\n\t\t\t\t\t\t\t// helpers rely on wrapping the object.\n\t\t\t\t\t\t\tdurableObjectBindingDesignators: [\n\t\t\t\t\t\t\t\t...getDurableObjectDesignators(\n\t\t\t\t\t\t\t\t\tthis.parsedPoolOptions\n\t\t\t\t\t\t\t\t).entries(),\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\tselfName: getRunnerName(this.options.project),\n\t\t\t\t\t\t}),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\t\tthis.socket.send(structuredSerializableStringify(toSend));\n\t}\n\n\ton(\n\t\tevent: string,\n\t\tcallback:\n\t\t\t| ((maybeError: unknown) => void)\n\t\t\t| (() => void)\n\t\t\t| ((response: WorkerResponse) => void)\n\t): void {\n\t\t// Vitest will always call `start()` before calling `on()`\n\t\tassert(this.socket, \"Message received from Worker before initialisation\");\n\t\tassert(\n\t\t\tthis.parsedPoolOptions,\n\t\t\t\"Message received from Worker before initialisation\"\n\t\t);\n\n\t\tconst rules = this.parsedPoolOptions.miniflare?.modulesRules;\n\t\tconst compiledRules = compileModuleRules(rules ?? []);\n\n\t\tif (event === \"message\") {\n\t\t\tconst messageWrapper = (m: { data: string | ArrayBuffer }) => {\n\t\t\t\tconst d = structuredSerializableParse(\n\t\t\t\t\tm.data as string\n\t\t\t\t) as WorkerResponse;\n\n\t\t\t\t// This is a birpc serialised message before it's been parsed, which is why the properties are so unintelligible\n\t\t\t\t// We're looking for a `fetch()` RPC call: https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/vitest/src/types/rpc.ts#L8\n\t\t\t\tif (\n\t\t\t\t\td &&\n\t\t\t\t\ttypeof d === \"object\" &&\n\t\t\t\t\t\"m\" in d &&\n\t\t\t\t\t\"a\" in d &&\n\t\t\t\t\t\"i\" in d &&\n\t\t\t\t\tArray.isArray(d.a) &&\n\t\t\t\t\td.m === \"fetch\"\n\t\t\t\t) {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tthis.socket,\n\t\t\t\t\t\t\"Message received from Worker before initialisation\"\n\t\t\t\t\t);\n\t\t\t\t\tconst specifier = d.a[0];\n\n\t\t\t\t\tif (\n\t\t\t\t\t\t// `cloudflare:test` imports are handled by the `@cloudflare/vitest-pool-workers` plugin, and so should be ignored here\n\t\t\t\t\t\tspecifier !== \"cloudflare:test\" &&\n\t\t\t\t\t\t(/^(cloudflare|workerd):/.test(specifier) ||\n\t\t\t\t\t\t\tworkerdBuiltinModules.has(specifier))\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn this.socket.send(\n\t\t\t\t\t\t\t// Tell Vitest to treat this module as \"external\" and load it using a workerd module import\n\t\t\t\t\t\t\tstructuredSerializableStringify({\n\t\t\t\t\t\t\t\tt: \"s\",\n\t\t\t\t\t\t\t\ti: d.i,\n\t\t\t\t\t\t\t\tr: { externalize: specifier },\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst maybeRule = compiledRules.find((rule) =>\n\t\t\t\t\t\ttestRegExps(rule.include, specifier)\n\t\t\t\t\t);\n\t\t\t\t\t// Skip if specifier already has query params (e.g. `?raw`), letting Vite handle it.\n\t\t\t\t\tif (maybeRule !== undefined && !specifier.includes(\"?\")) {\n\t\t\t\t\t\tconst externalize =\n\t\t\t\t\t\t\tpath.join(this.options.project.config.root, specifier) +\n\t\t\t\t\t\t\t`?mf_vitest_force=${maybeRule.type}`;\n\n\t\t\t\t\t\treturn this.socket.send(\n\t\t\t\t\t\t\tstructuredSerializableStringify({\n\t\t\t\t\t\t\t\tt: \"s\",\n\t\t\t\t\t\t\t\ti: d.i,\n\t\t\t\t\t\t\t\tr: { externalize },\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t(callback as (response: WorkerResponse) => void)(d);\n\t\t\t};\n\t\t\tthis.messageListener = messageWrapper as (\n\t\t\t\tevent: MiniflareMessageEvent\n\t\t\t) => void;\n\t\t\tthis.socket.addEventListener(\"message\", this.messageListener);\n\t\t} else if (event === \"error\") {\n\t\t\tthis.errorListener = (e: Event) => {\n\t\t\t\t(callback as (maybeError: unknown) => void)(\"error\" in e ? e.error : e);\n\t\t\t};\n\t\t\tthis.socket.addEventListener(\"error\", this.errorListener);\n\t\t} else if (event === \"exit\") {\n\t\t\tthis.closeListener = callback as () => void;\n\t\t\tthis.socket.addEventListener(\"close\", this.closeListener);\n\t\t}\n\t}\n\n\toff(event: string, _callback: (_arg: unknown) => void): void {\n\t\tif (event === \"message\" && this.messageListener) {\n\t\t\tthis.socket?.removeEventListener(\"message\", this.messageListener);\n\t\t\tthis.messageListener = undefined;\n\t\t} else if (event === \"error\" && this.errorListener) {\n\t\t\tthis.socket?.removeEventListener(\"error\", this.errorListener);\n\t\t\tthis.errorListener = undefined;\n\t\t} else if (event === \"exit\" && this.closeListener) {\n\t\t\tthis.socket?.removeEventListener(\"close\", this.closeListener);\n\t\t\tthis.closeListener = undefined;\n\t\t}\n\t}\n\n\t// Vitest does not have a corresponding `serialize()` option, so we can't actually use this for serialisation\n\t// Instead, we serialize/deserialize in the `send()` and `on()` methods.\n\tdeserialize(data: unknown) {\n\t\treturn data;\n\t}\n}\n","import { CloudflarePoolWorker } from \"./cloudflare-pool-worker\";\nimport type { WorkersPoolOptions } from \"./config\";\nimport type { WorkerPoolOptionsContext } from \"./plugin\";\nimport type { PoolRunnerInitializer } from \"vitest/node\";\n\nexport function cloudflarePool(\n\tpoolOptions:\n\t\t| WorkersPoolOptions\n\t\t| ((\n\t\t\t\tctx: WorkerPoolOptionsContext\n\t\t ) => Promise<WorkersPoolOptions> | WorkersPoolOptions)\n): PoolRunnerInitializer {\n\treturn {\n\t\tname: \"cloudflare-pool\",\n\t\tcreatePoolWorker: (options) =>\n\t\t\tnew CloudflarePoolWorker(options, poolOptions),\n\t};\n}\n","import crypto from \"node:crypto\";\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { cloudflarePool } from \"./pool\";\nimport type { WorkersPoolOptions } from \"./config\";\nimport type { inject } from \"vitest\";\nimport type { Vite, VitestPluginContext } from \"vitest/node\";\n\nconst cloudflareTestPath = path.resolve(\n\timport.meta.dirname,\n\t\"../worker/lib/cloudflare/test.mjs\"\n);\n\nexport interface WorkerPoolOptionsContext {\n\t// For accessing values from `globalSetup()` (e.g. ports servers started on)\n\t// in Miniflare options (e.g. bindings, upstream, hyperdrives, ...)\n\tinject: typeof inject;\n}\n\nfunction ensureArrayIncludes<T>(array: T[], items: T[]) {\n\tfor (const item of items) {\n\t\tif (!array.includes(item)) {\n\t\t\tarray.push(item);\n\t\t}\n\t}\n}\n\nfunction ensureArrayExcludes<T>(array: T[], items: T[]) {\n\tfor (let i = 0; i < array.length; i++) {\n\t\tif (items.includes(array[i])) {\n\t\t\tarray.splice(i, 1);\n\t\t\ti--;\n\t\t}\n\t}\n}\n\nconst requiredConditions = [\"workerd\", \"worker\", \"module\", \"browser\"];\nconst requiredMainFields = [\"browser\", \"module\", \"jsnext:main\", \"jsnext\"];\n\nexport function cloudflareTest(\n\toptions:\n\t\t| WorkersPoolOptions\n\t\t| ((\n\t\t\t\tctx: WorkerPoolOptionsContext\n\t\t ) => Promise<WorkersPoolOptions> | WorkersPoolOptions)\n): Vite.Plugin {\n\t// Use a unique ID for each `cloudflare:test` module so updates in one `main`\n\t// don't trigger re-runs in all other projects, just the one that changed.\n\tconst uuid = crypto.randomUUID();\n\tlet main: string | undefined;\n\treturn {\n\t\tname: \"@cloudflare/vitest-pool-workers\",\n\t\tapi: {\n\t\t\tsetMain(newMain: string) {\n\t\t\t\tmain = newMain;\n\t\t\t},\n\t\t},\n\t\tconfigureVitest(context: VitestPluginContext) {\n\t\t\tcontext.project.config.poolRunner = cloudflarePool(options);\n\t\t\tcontext.project.config.pool = \"cloudflare-pool\";\n\t\t\tcontext.project.config.snapshotEnvironment = \"cloudflare:snapshot\";\n\t\t},\n\t\t// Run after `vitest:project` plugin:\n\t\t// https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/vitest/src/node/plugins/workspace.ts#L122\n\t\tconfig(config) {\n\t\t\tconfig.resolve ??= {};\n\t\t\tconfig.resolve.conditions ??= [];\n\t\t\tconfig.resolve.mainFields ??= [];\n\t\t\tconfig.ssr ??= {};\n\n\t\t\tconfig.test ??= {};\n\t\t\tconfig.test.server ??= {};\n\t\t\tconfig.test.server.deps ??= {};\n\t\t\t// See https://vitest.dev/config/server.html#inline\n\t\t\t// Without this Vitest delegates to native import() for external deps in node_modules\n\t\t\tconfig.test.server.deps.inline = true;\n\n\t\t\t// Remove \"node\" condition added by the `vitest:project` plugin. We're\n\t\t\t// running tests inside `workerd`, not Node.js, so \"node\" isn't needed.\n\t\t\tensureArrayExcludes(config.resolve.conditions, [\"node\"]);\n\n\t\t\t// Use the same resolve conditions as `wrangler`, minus \"import\" as this\n\t\t\t// breaks Vite's `require()` resolve\n\t\t\tensureArrayIncludes(config.resolve.conditions, requiredConditions);\n\n\t\t\t// Vitest sets this to an empty array if unset, so restore Vite defaults:\n\t\t\t// https://github.com/vitest-dev/vitest/blob/v4.0.18/packages/vitest/src/node/plugins/utils.ts#L121\n\t\t\tensureArrayIncludes(config.resolve.mainFields, requiredMainFields);\n\n\t\t\t// Apply `package.json` `browser` field remapping in SSR mode:\n\t\t\t// https://github.com/vitejs/vite/blob/v5.1.4/packages/vite/src/node/plugins/resolve.ts#L175\n\t\t\tconfig.ssr.target = \"webworker\";\n\t\t},\n\t\tresolveId(id) {\n\t\t\tif (id === \"cloudflare:test\") {\n\t\t\t\treturn `\\0cloudflare:test-${uuid}`;\n\t\t\t}\n\t\t},\n\t\tasync load(id) {\n\t\t\tif (id === `\\0cloudflare:test-${uuid}`) {\n\t\t\t\tlet contents = await fs.readFile(cloudflareTestPath, \"utf8\");\n\n\t\t\t\tif (main !== undefined) {\n\t\t\t\t\t// Inject a side-effect only import of the main entry-point into the test so that Vitest\n\t\t\t\t\t// knows to re-run tests when the Worker is modified.\n\t\t\t\t\tcontents += `import ${JSON.stringify(main)};`;\n\t\t\t\t}\n\t\t\t\treturn contents;\n\t\t\t}\n\t\t\tif (id.endsWith(\"msw/lib/node/index.mjs\")) {\n\t\t\t\t// HACK: This is a temporary solution while MSW works on some changes to better support the Workers\n\t\t\t\t// environment. In the meantime, this replaces the `msw/node` entrypoint with the `msw/native`\n\t\t\t\t// entrypoint (which is designed for React Native and does work in Workers). Users can't use\n\t\t\t\t// `msw/native` themselves directly as the export conditions are not compatible with the Vitest Pool\n\t\t\t\t// export conditions.\n\t\t\t\t//\n\t\t\t\t// This is tracked by https://github.com/mswjs/msw/issues/2637\n\t\t\t\treturn `export * from \"../native/index.mjs\"`;\n\t\t\t}\n\t\t},\n\t};\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { D1Migration } from \"../shared/d1\";\n\n/**\n * Reads all migrations in `migrationsPath`, ordered by migration number.\n * Each migration will have its contents split into an array of SQL queries.\n */\nexport async function readD1Migrations(\n\tmigrationsPath: string\n): Promise<D1Migration[]> {\n\t// noinspection SuspiciousTypeOfGuard\n\tif (typeof migrationsPath !== \"string\") {\n\t\tthrow new TypeError(\n\t\t\t\"Failed to execute 'readD1Migrations': parameter 1 is not of type 'string'.\"\n\t\t);\n\t}\n\n\tconst { unstable_splitSqlQuery } = await import(\"wrangler\"); // (lazy)\n\tconst names = fs\n\t\t.readdirSync(migrationsPath)\n\t\t.filter((name) => name.endsWith(\".sql\"));\n\tnames.sort((a, b) => {\n\t\tconst aNumber = parseInt(a.split(\"_\")[0]);\n\t\tconst bNumber = parseInt(b.split(\"_\")[0]);\n\t\treturn aNumber - bNumber;\n\t});\n\treturn names.map((name) => {\n\t\tconst migrationPath = path.join(migrationsPath, name);\n\t\tconst migration = fs.readFileSync(migrationPath, \"utf8\");\n\t\tconst queries = unstable_splitSqlQuery(migration);\n\t\treturn { name, queries };\n\t});\n}\n\nexport type { D1Migration };\n","import assert from \"node:assert\";\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { getTodaysCompatDate } from \"@cloudflare/workers-utils\";\nimport * as devalue from \"devalue\";\nimport getPort, { portNumbers } from \"get-port\";\nimport {\n\tgetNodeCompat,\n\tkCurrentWorker,\n\tkUnsafeEphemeralUniqueKey,\n\tLog,\n\tLogLevel,\n\tmaybeApply,\n\tMiniflare,\n\tstructuredSerializableReducers,\n\tstructuredSerializableRevivers,\n} from \"miniflare\";\nimport semverSatisfies from \"semver/functions/satisfies.js\";\nimport { experimental_readRawConfig } from \"wrangler\";\nimport { CompatibilityFlagAssertions } from \"./compatibility-flag-assertions\";\nimport { guessWorkerExports } from \"./guess-exports\";\nimport {\n\tgetProjectPath,\n\tgetRelativeProjectPath,\n\tisFileNotFoundError,\n\tWORKER_NAME_PREFIX,\n} from \"./helpers\";\nimport { handleLoopbackRequest } from \"./loopback\";\nimport { handleModuleFallbackRequest } from \"./module-fallback\";\nimport type {\n\tSourcelessWorkerOptions,\n\tWorkersPoolOptions,\n\tWorkersPoolOptionsWithDefines,\n} from \"./config\";\nimport type {\n\tMiniflareOptions,\n\tSharedOptions,\n\tWorkerOptions,\n\tWorkerdStructuredLog,\n} from \"miniflare\";\nimport type { TestProject, Vitest } from \"vitest/node\";\n\nexport function structuredSerializableStringify(value: unknown): string {\n\t// Vitest v2+ sends a sourcemap to its runner, which we can't serialise currently.\n\t// Stripping it doesn't seem to cause any problems, and error stack traces etc.\n\t// still seem to work.\n\t// TODO: Figure out how to serialise SourceMap instances\n\tif (\n\t\tvalue &&\n\t\ttypeof value === \"object\" &&\n\t\t\"r\" in value &&\n\t\tvalue.r &&\n\t\ttypeof value.r === \"object\" &&\n\t\t\"map\" in value.r &&\n\t\tvalue.r.map\n\t) {\n\t\t// Shallow-copy to avoid mutating the caller's object\n\t\tvalue = { ...value, r: { ...value.r, map: undefined } };\n\t}\n\treturn devalue.stringify(value, structuredSerializableReducers);\n}\n\nexport function structuredSerializableParse(value: string): unknown {\n\treturn devalue.parse(value, structuredSerializableRevivers);\n}\n\n// Log for informational pool messages\nconst log = new Log(LogLevel.VERBOSE, { prefix: \"vpw\" });\n// Log for Miniflare instances, used for user code warnings/errors\nconst mfLog = new Log(LogLevel.WARN);\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = path.dirname(__filename);\nconst DIST_PATH = path.resolve(__dirname, \"..\");\nconst POOL_WORKER_PATH = path.join(DIST_PATH, \"worker/index.mjs\");\n\nconst symbolizerWarning =\n\t\"warning: Not symbolizing stack traces because $LLVM_SYMBOLIZER is not set.\";\nconst ignoreMessages = [\n\tsymbolizerWarning,\n\t// Not user actionable\n\t// TODO(someday): this is normal operation and really shouldn't error\n\t\"disconnected: operation canceled\",\n\t\"disconnected: worker_do_not_log; Request failed due to internal error\",\n\t\"disconnected: WebSocket was aborted\",\n\t\"CODE_MOVED for unknown code block\",\n\t\"broken.outputGateBroken; jsg.Error: Instance dispose\",\n];\nfunction handleStructuredLogs({ level, message }: WorkerdStructuredLog): void {\n\tif (ignoreMessages.some((ignore) => message.includes(ignore))) {\n\t\treturn;\n\t}\n\n\tswitch (level) {\n\t\tcase \"error\":\n\t\tcase \"warn\":\n\t\t\tprocess.stderr.write(`${message}\\n`);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tprocess.stdout.write(`${message}\\n`);\n\t\t\tbreak;\n\t}\n}\n\nexport function getRunnerName(project: TestProject, testFile?: string) {\n\tconst name = `${WORKER_NAME_PREFIX}runner-${project.name.replace(\n\t\t/[^a-z0-9-]/gi,\n\t\t\"_\"\n\t)}`;\n\tif (testFile === undefined) {\n\t\treturn name;\n\t}\n\tconst testFileHash = crypto.createHash(\"sha1\").update(testFile).digest(\"hex\");\n\ttestFile = testFile.replace(/[^a-z0-9-]/gi, \"_\");\n\treturn `${name}-${testFileHash}-${testFile}`;\n}\n\nfunction isDurableObjectDesignatorToSelf(\n\tvalue: unknown\n): value is string | { className: string } {\n\t// Either this is a simple `string` designator to the current worker...\n\tif (typeof value === \"string\") {\n\t\treturn true;\n\t}\n\t// ...or it's an object designator without a `scriptName`. We're assuming the\n\t// user isn't able to guess the current worker name, so if a `scriptName` is\n\t// set, the designator is definitely for another worker.\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"className\" in value &&\n\t\ttypeof value.className === \"string\" &&\n\t\t(!(\"scriptName\" in value) || value.scriptName === undefined)\n\t);\n}\n\nfunction isWorkflowDesignatorToSelf(\n\tvalue: unknown,\n\tcurrentScriptName: string | undefined\n): value is { className: string } {\n\treturn (\n\t\ttypeof value === \"object\" &&\n\t\tvalue !== null &&\n\t\t\"className\" in value &&\n\t\ttypeof value.className === \"string\" &&\n\t\t(!(\"scriptName\" in value) ||\n\t\t\tvalue.scriptName === undefined ||\n\t\t\tvalue.scriptName === currentScriptName)\n\t);\n}\n\ninterface DurableObjectDesignator {\n\tclassName: string;\n\tscriptName?: string;\n\tunsafeUniqueKey?: string;\n}\n/**\n * Returns a map of Durable Objects bindings' bound names to the designators of\n * the objects they point to.\n */\nexport function getDurableObjectDesignators(\n\toptions: WorkersPoolOptions\n): Map<string /* bound name */, DurableObjectDesignator> {\n\tconst result = new Map<string, DurableObjectDesignator>();\n\tconst durableObjects = options.miniflare?.durableObjects ?? {};\n\tfor (const [key, designator] of Object.entries(durableObjects)) {\n\t\tif (typeof designator === \"string\") {\n\t\t\tresult.set(key, { className: designator });\n\t\t} else if (typeof designator.unsafeUniqueKey !== \"symbol\") {\n\t\t\tresult.set(key, {\n\t\t\t\tclassName: designator.className,\n\t\t\t\tscriptName: designator.scriptName,\n\t\t\t\tunsafeUniqueKey: designator.unsafeUniqueKey,\n\t\t\t});\n\t\t}\n\t}\n\n\tfor (const unboundDurableObject of options.miniflare\n\t\t?.additionalUnboundDurableObjects ?? []) {\n\t\tif (typeof unboundDurableObject.unsafeUniqueKey !== \"symbol\") {\n\t\t\tresult.set(unboundDurableObject.className, {\n\t\t\t\tclassName: unboundDurableObject.className,\n\t\t\t\tscriptName: unboundDurableObject.scriptName,\n\t\t\t\tunsafeUniqueKey: unboundDurableObject.unsafeUniqueKey,\n\t\t\t});\n\t\t}\n\t}\n\treturn result;\n}\n\n/**\n * Gets a set of Durable Object class names for the SELF Worker.\n *\n * This is calculated from the Durable Object bindings that point to SELF as well as the\n * unbound Durable Objects that only have migrations defined.\n */\nfunction getDurableObjectClasses(worker: SourcelessWorkerOptions): Set<string> {\n\t// TODO(someday): may need to extend this to take into account other workers\n\t// if doing multi-worker tests across workspace projects\n\t// TODO(someday): may want to validate class names are valid identifiers?\n\tconst result = new Set<string>();\n\n\t// Get all the Durable Object class names from bindings to the SELF Worker.\n\tfor (const designator of Object.values(worker.durableObjects ?? {})) {\n\t\tif (isDurableObjectDesignatorToSelf(designator)) {\n\t\t\tresult.add(\n\t\t\t\ttypeof designator === \"string\" ? designator : designator.className\n\t\t\t);\n\t\t}\n\t}\n\n\t// And all the Durable Object class names that may not have bindings but have migrations.\n\tfor (const designator of worker.additionalUnboundDurableObjects ?? []) {\n\t\tresult.add(designator.className);\n\t}\n\n\treturn result;\n}\n\nfunction getWranglerWorkerName(\n\trelativeWranglerConfigPath?: string\n): string | undefined {\n\tif (!relativeWranglerConfigPath) {\n\t\treturn undefined;\n\t}\n\tconst wranglerConfigObject = experimental_readRawConfig({\n\t\tconfig: relativeWranglerConfigPath,\n\t});\n\treturn wranglerConfigObject.rawConfig.name;\n}\n\n/**\n * Gets a set of class names for Workflows defined in the SELF Worker.\n */\nfunction getWorkflowClasses(\n\tworker: SourcelessWorkerOptions,\n\trelativeWranglerConfigPath: string | undefined\n): Set<string> {\n\t// TODO(someday): may need to extend this to take into account other workers\n\t// if doing multi-worker tests across workspace projects\n\t// TODO(someday): may want to validate class names are valid identifiers?\n\tconst result = new Set<string>();\n\tif (worker.workflows === undefined) {\n\t\treturn result;\n\t}\n\tfor (const key of Object.keys(worker.workflows)) {\n\t\tconst designator = worker.workflows[key];\n\n\t\tlet workerName: string | undefined;\n\t\t// If the designator's scriptName matches its own Worker name,\n\t\t// use that as the worker name, otherwise use the vitest worker's name\n\t\tconst wranglerWorkerName = getWranglerWorkerName(\n\t\t\trelativeWranglerConfigPath\n\t\t);\n\t\tif (wranglerWorkerName && designator.scriptName === wranglerWorkerName) {\n\t\t\tworkerName = wranglerWorkerName;\n\t\t} else {\n\t\t\tworkerName = worker.name;\n\t\t}\n\n\t\t// `designator` hasn't been validated at this point\n\t\tif (isWorkflowDesignatorToSelf(designator, workerName)) {\n\t\t\tresult.add(designator.className);\n\t\t\t// Shallow clone to avoid mutating config\n\t\t\tworker.workflows[key] = { ...designator };\n\t\t}\n\t}\n\treturn result;\n}\n\ntype ProjectWorkers = [\n\trunnerWorker: WorkerOptions,\n\t...auxiliaryWorkers: WorkerOptions[],\n];\n\nconst SELF_SERVICE_BINDING = \"__VITEST_POOL_WORKERS_SELF_SERVICE\";\nconst LOOPBACK_SERVICE_BINDING = \"__VITEST_POOL_WORKERS_LOOPBACK_SERVICE\";\nconst RUNNER_OBJECT_BINDING = \"__VITEST_POOL_WORKERS_RUNNER_OBJECT\";\n\nasync function buildProjectWorkerOptions(\n\tproject: TestProject,\n\tcustomOptions: WorkersPoolOptionsWithDefines,\n\tmain: string | undefined\n): Promise<ProjectWorkers> {\n\tconst relativeWranglerConfigPath = maybeApply(\n\t\t(v) => path.relative(\"\", v),\n\t\tcustomOptions.wrangler?.configPath\n\t);\n\tconst runnerWorker = customOptions.miniflare ?? {};\n\n\trunnerWorker.name = getRunnerName(project);\n\n\t// Make sure the worker has the `nodejs_compat` and `export_commonjs_default`\n\t// compatibility flags enabled. Vitest makes heavy use of Node APIs, and many\n\t// of the libraries it depends on expect `require()` to return\n\t// `module.exports` directly, rather than `{ default: module.exports }`.\n\trunnerWorker.compatibilityFlags ??= [];\n\n\t// By default, workerd tracks which request context a promise was created in\n\t// and rejects promises that resolve in a different request context. This is a\n\t// safety feature for production Workers to prevent data leaking between\n\t// requests. However, vitest-pool-workers runs all test files within the same\n\t// Durable Object, so promise resolution regularly crosses request boundaries\n\t// (e.g. a setup promise created for one test file resolving during another).\n\t// Without this flag, those promises get rejected and tests break.\n\trunnerWorker.compatibilityFlags.push(\n\t\t\"no_handle_cross_request_promise_resolution\"\n\t);\n\n\tif (runnerWorker.compatibilityDate === undefined) {\n\t\t// No compatibility date was provided, so use today's date\n\t\trunnerWorker.compatibilityDate = getTodaysCompatDate();\n\t\tlog.info(\n\t\t\t`No compatibility date was provided for project ${getRelativeProjectPath(\n\t\t\t\tproject\n\t\t\t)}, defaulting to today's date ${runnerWorker.compatibilityDate}.`\n\t\t);\n\t}\n\n\tconst flagAssertions = new CompatibilityFlagAssertions({\n\t\tcompatibilityDate: runnerWorker.compatibilityDate,\n\t\tcompatibilityFlags: runnerWorker.compatibilityFlags,\n\t\toptionsPath: `miniflare`,\n\t\trelativeProjectPath: getRelativeProjectPath(project),\n\t\trelativeWranglerConfigPath,\n\t});\n\n\tconst assertions = [\n\t\t() =>\n\t\t\tflagAssertions.assertIsEnabled({\n\t\t\t\tenableFlag: \"export_commonjs_default\",\n\t\t\t\tdisableFlag: \"export_commonjs_namespace\",\n\t\t\t\tdefaultOnDate: \"2022-10-31\",\n\t\t\t}),\n\t];\n\n\tfor (const assertion of assertions) {\n\t\tconst result = assertion();\n\t\tif (!result.isValid) {\n\t\t\tthrow new Error(result.errorMessage);\n\t\t}\n\t}\n\n\tconst { hasNoNodejsCompatV2Flag, mode } = getNodeCompat(\n\t\trunnerWorker.compatibilityDate,\n\t\trunnerWorker.compatibilityFlags\n\t);\n\n\t// Force nodejs_compat_v2 flag, even if it is disabled by the user, since we require this native stuff for Vitest to work properly\n\tif (mode !== \"v2\") {\n\t\tif (hasNoNodejsCompatV2Flag) {\n\t\t\trunnerWorker.compatibilityFlags.splice(\n\t\t\t\trunnerWorker.compatibilityFlags.indexOf(\"no_nodejs_compat_v2\"),\n\t\t\t\t1\n\t\t\t);\n\t\t}\n\t\trunnerWorker.compatibilityFlags.push(\"nodejs_compat_v2\");\n\t}\n\n\t// Required for `workerd:unsafe` module. We don't require this flag to be set\n\t// as it's experimental, so couldn't be deployed by users.\n\tif (!runnerWorker.compatibilityFlags.includes(\"unsafe_module\")) {\n\t\trunnerWorker.compatibilityFlags.push(\"unsafe_module\");\n\t}\n\n\t// The following nodejs compat flags enable features required for Vitest to work properly\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_tty_module\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_fs_module\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_http_modules\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_perf_hooks_module\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_v8_module\");\n\tensureFeature(runnerWorker.compatibilityFlags, \"nodejs_process_v2\");\n\n\t// Make sure we define an unsafe eval binding and enable the fallback service\n\trunnerWorker.unsafeEvalBinding = \"__VITEST_POOL_WORKERS_UNSAFE_EVAL\";\n\trunnerWorker.unsafeUseModuleFallbackService = true;\n\n\t// Make sure we define our self/loopback service bindings for helpers\n\trunnerWorker.serviceBindings ??= {};\n\trunnerWorker.serviceBindings[SELF_SERVICE_BINDING] = kCurrentWorker;\n\trunnerWorker.serviceBindings[LOOPBACK_SERVICE_BINDING] =\n\t\thandleLoopbackRequest;\n\n\t// Build wrappers for entrypoints and Durable Objects defined in this worker\n\trunnerWorker.durableObjects ??= {};\n\tconst durableObjectClassNames = getDurableObjectClasses(runnerWorker);\n\n\tconst workflowClassNames = getWorkflowClasses(\n\t\trunnerWorker,\n\t\trelativeWranglerConfigPath\n\t);\n\n\tconst selfWorkerExports: string[] = [];\n\tif (\n\t\tflagAssertions.isEnabled(\n\t\t\t\"enable_ctx_exports\",\n\t\t\t\"disable_ctx_exports\",\n\t\t\t\"2025-11-17\"\n\t\t)\n\t) {\n\t\ttry {\n\t\t\tconst guessedExports = await guessWorkerExports(\n\t\t\t\tmain,\n\t\t\t\tcustomOptions.additionalExports\n\t\t\t);\n\t\t\tfor (const [exportName, exportType] of guessedExports) {\n\t\t\t\tswitch (exportType) {\n\t\t\t\t\tcase \"DurableObject\":\n\t\t\t\t\t\tdurableObjectClassNames.add(exportName);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"WorkflowEntrypoint\":\n\t\t\t\t\t\tworkflowClassNames.add(exportName);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"WorkerEntrypoint\":\n\t\t\t\t\tcase null:\n\t\t\t\t\t\tselfWorkerExports.push(exportName);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tconst message = `Failed to statically analyze the exports of the main Worker entry-point \"${customOptions.main}\"\\nMore details: ${e}`;\n\t\t\tfor (const line of message.split(\"\\n\")) {\n\t\t\t\tlog.warn(line);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst workerEntrypointExports = selfWorkerExports.filter(\n\t\t(name) =>\n\t\t\tname !== \"default\" &&\n\t\t\tname !== \"__esModule\" &&\n\t\t\t!durableObjectClassNames.has(name) &&\n\t\t\t!workflowClassNames.has(name)\n\t);\n\n\tconst wrappers = [\n\t\t'import { createWorkerEntrypointWrapper, createDurableObjectWrapper, createWorkflowEntrypointWrapper } from \"cloudflare:test-internal\";',\n\t];\n\n\tfor (const entrypointName of workerEntrypointExports.sort()) {\n\t\tconst quotedEntrypointName = JSON.stringify(entrypointName);\n\t\tconst wrapper = `export const ${entrypointName} = createWorkerEntrypointWrapper(${quotedEntrypointName});`;\n\t\twrappers.push(wrapper);\n\t}\n\tfor (const className of Array.from(durableObjectClassNames).sort()) {\n\t\tconst quotedClassName = JSON.stringify(className);\n\t\tconst wrapper = `export const ${className} = createDurableObjectWrapper(${quotedClassName});`;\n\t\twrappers.push(wrapper);\n\t}\n\n\tfor (const className of Array.from(workflowClassNames).sort()) {\n\t\tconst quotedClassName = JSON.stringify(className);\n\t\tconst wrapper = `export const ${className} = createWorkflowEntrypointWrapper(${quotedClassName});`;\n\t\twrappers.push(wrapper);\n\t}\n\n\t// Make sure we define the `__VITEST_POOL_WORKERS_RUNNER_DURABLE_OBJECT__` Durable Object,\n\t// which is the singleton host for running tests. It's ephemeral (in-memory)\n\t// because the runner doesn't need persistent state, and all disk-backed DOs\n\t// hit a workerd bug on Windows where SQLite paths use Unix-style forward\n\t// slashes (cloudflare/workerd#6110).\n\trunnerWorker.durableObjects[RUNNER_OBJECT_BINDING] = {\n\t\tclassName: \"__VITEST_POOL_WORKERS_RUNNER_DURABLE_OBJECT__\",\n\t\tunsafePreventEviction: true,\n\t\tunsafeUniqueKey: kUnsafeEphemeralUniqueKey,\n\t};\n\n\t// Vite has its own define mechanism, but we can't control it from custom\n\t// pools. Our defines come from `wrangler.toml` files which are only parsed\n\t// with the rest of the pool configuration. Instead, we implement our own\n\t// define script similar to Vite's. When defines change, Miniflare will be\n\t// restarted as the input options will be different.\n\tconst defines = `export default {\n\t\t${Object.entries(customOptions.defines ?? {})\n\t\t\t.map(([key, value]) => `${JSON.stringify(key)}: ${value}`)\n\t\t\t.join(\",\\n\")}\n\t};\n\t`;\n\n\t// Make sure we define the runner script, including object wrappers & defines\n\tif (\"script\" in runnerWorker) {\n\t\tdelete runnerWorker.script;\n\t}\n\tif (\"scriptPath\" in runnerWorker) {\n\t\tdelete runnerWorker.scriptPath;\n\t}\n\n\t// We want module names to be their absolute path without the leading\tslash\n\t// (i.e. the modules root should be the root directory). On Windows, we'd\n\t// like paths to include the drive letter (i.e. `/C:/a/b/c/index.mjs`).\n\t// Internally, Miniflare uses `path.relative(modulesRoot, path)` to compute\n\t// module names. Setting `modulesRoot` to a drive letter and prepending this\n\t// to paths ensures correct names. This requires us to specify `contents`\n\t// with module definitions though, as the new paths don't exist.\n\t// TODO: add source URL comments to injected modules for better stack traces\n\tconst modulesRoot = process.platform === \"win32\" ? \"Z:\\\\\" : \"/\";\n\trunnerWorker.modulesRoot = modulesRoot;\n\n\trunnerWorker.modules = [\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"index.mjs\"),\n\t\t\tcontents: fs.readFileSync(POOL_WORKER_PATH),\n\t\t},\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"__VITEST_POOL_WORKERS_USER_OBJECT\"),\n\t\t\tcontents: wrappers.join(\"\\n\"),\n\t\t},\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"__VITEST_POOL_WORKERS_DEFINES\"),\n\t\t\tcontents: defines,\n\t\t},\n\t\t// The native workerd provided nodejs modules don't always support everything Vitest needs.\n\t\t// As a short-term fix, inject polyfills into the worker bundle that override the native modules.\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"node:console\"),\n\t\t\tcontents: fs.readFileSync(\n\t\t\t\tpath.join(DIST_PATH, `worker/node/console.mjs`)\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\ttype: \"ESModule\",\n\t\t\tpath: path.join(modulesRoot, \"node:vm\"),\n\t\t\tcontents: fs.readFileSync(path.join(DIST_PATH, `worker/node/vm.mjs`)),\n\t\t},\n\t];\n\n\t// Build array of workers contributed by the workspace\n\tconst workers: ProjectWorkers = [runnerWorker as WorkerOptions];\n\tif (runnerWorker.workers !== undefined) {\n\t\t// Try to add workers defined by the user\n\t\tfor (let i = 0; i < runnerWorker.workers.length; i++) {\n\t\t\tconst worker: unknown = runnerWorker.workers[i];\n\t\t\t// Make sure the worker has a non-empty name...\n\t\t\tif (\n\t\t\t\ttypeof worker !== \"object\" ||\n\t\t\t\tworker === null ||\n\t\t\t\t!(\"name\" in worker) ||\n\t\t\t\ttypeof worker.name !== \"string\" ||\n\t\t\t\tworker.name === \"\"\n\t\t\t) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`In project ${getRelativeProjectPath(\n\t\t\t\t\t\tproject\n\t\t\t\t\t)}, \\`miniflare.workers[${i}].name\\` must be non-empty`\n\t\t\t\t);\n\t\t\t}\n\t\t\t// ...that doesn't start with our reserved prefix\n\t\t\tif (worker.name.startsWith(WORKER_NAME_PREFIX)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`In project ${getRelativeProjectPath(\n\t\t\t\t\t\tproject\n\t\t\t\t\t)}, \\`miniflare.workers[${i}].name\\` must not start with \"${WORKER_NAME_PREFIX}\", got ${\n\t\t\t\t\t\tworker.name\n\t\t\t\t\t}`\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Miniflare will validate these options\n\t\t\tworkers.push(worker as WorkerOptions);\n\t\t}\n\t\tdelete runnerWorker.workers;\n\t}\n\n\treturn workers;\n}\n\nconst SHARED_MINIFLARE_OPTIONS: SharedOptions = {\n\tlog: mfLog,\n\tverbose: true,\n\thandleStructuredLogs,\n\tunsafeStickyBlobs: true,\n} satisfies Partial<MiniflareOptions>;\n\nconst DEFAULT_INSPECTOR_PORT = 9229;\n\nfunction getFirstAvailablePort(start: number): Promise<number> {\n\treturn getPort({ port: portNumbers(start, 65535) });\n}\n\ntype ModuleFallbackService = NonNullable<\n\tMiniflareOptions[\"unsafeModuleFallbackService\"]\n>;\n// Reuse the same bound module fallback service when constructing Miniflare\n// options, so deep equality checks succeed\nconst moduleFallbackServices = new WeakMap<Vitest, ModuleFallbackService>();\nfunction getModuleFallbackService(ctx: Vitest): ModuleFallbackService {\n\tlet service = moduleFallbackServices.get(ctx);\n\tif (service !== undefined) {\n\t\treturn service;\n\t}\n\tservice = handleModuleFallbackRequest.bind(undefined, ctx.vite);\n\tmoduleFallbackServices.set(ctx, service);\n\treturn service;\n}\n\n/**\n * Builds options for the Miniflare instance running tests for the given Vitest\n * project.\n */\nasync function buildProjectMiniflareOptions(\n\tctx: Vitest,\n\tproject: TestProject,\n\tcustomOptions: WorkersPoolOptions,\n\tmain: string | undefined\n): Promise<MiniflareOptions> {\n\tconst moduleFallbackService = getModuleFallbackService(ctx);\n\tconst [runnerWorker, ...auxiliaryWorkers] = await buildProjectWorkerOptions(\n\t\tproject,\n\t\tcustomOptions,\n\t\tmain\n\t);\n\n\tassert(runnerWorker.name !== undefined);\n\tassert(runnerWorker.name.startsWith(WORKER_NAME_PREFIX));\n\n\tlet inspectorPort: number | undefined;\n\tif (ctx.config.inspector.enabled) {\n\t\tconst userSpecifiedPort = ctx.config.inspector.port;\n\t\tif (userSpecifiedPort !== undefined) {\n\t\t\tconst availablePort = await getFirstAvailablePort(userSpecifiedPort);\n\t\t\tif (availablePort !== userSpecifiedPort) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Inspector port ${userSpecifiedPort} is not available. ` +\n\t\t\t\t\t\t`Either free up the port or remove the inspector port configuration to use an automatically assigned port.`\n\t\t\t\t);\n\t\t\t}\n\t\t\tinspectorPort = userSpecifiedPort;\n\t\t} else {\n\t\t\tinspectorPort = await getFirstAvailablePort(DEFAULT_INSPECTOR_PORT);\n\t\t\tif (inspectorPort !== DEFAULT_INSPECTOR_PORT) {\n\t\t\t\tlog.warn(\n\t\t\t\t\t`Default inspector port ${DEFAULT_INSPECTOR_PORT} not available, using ${inspectorPort} instead.`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\t...SHARED_MINIFLARE_OPTIONS,\n\t\tinspectorPort,\n\t\tunsafeModuleFallbackService: moduleFallbackService,\n\t\tworkers: [runnerWorker, ...auxiliaryWorkers],\n\t};\n}\nexport async function getProjectMiniflare(\n\tctx: Vitest,\n\tproject: TestProject,\n\tpoolOptions: WorkersPoolOptionsWithDefines,\n\tmain: string | undefined\n): Promise<Miniflare> {\n\tconst mfOptions = await buildProjectMiniflareOptions(\n\t\tctx,\n\t\tproject,\n\t\tpoolOptions,\n\t\tmain\n\t);\n\tlog.info(\n\t\t`Starting runtime for ${getRelativeProjectPath(project)}` +\n\t\t\t`${\n\t\t\t\tmfOptions.inspectorPort !== undefined\n\t\t\t\t\t? ` with inspector on port ${mfOptions.inspectorPort}`\n\t\t\t\t\t: \"\"\n\t\t\t}` +\n\t\t\t`...`\n\t);\n\tconst mf = new Miniflare(mfOptions);\n\tawait mf.ready;\n\treturn mf;\n}\n\nexport function maybeGetResolvedMainPath(\n\tproject: TestProject,\n\toptions: WorkersPoolOptionsWithDefines\n): string | undefined {\n\tconst projectPath = getProjectPath(project);\n\tconst main = options.main;\n\tif (main === undefined) {\n\t\treturn;\n\t}\n\tif (typeof projectPath === \"string\") {\n\t\treturn path.resolve(projectPath, main);\n\t} else {\n\t\treturn path.resolve(main);\n\t}\n}\n\nexport async function connectToMiniflareSocket(\n\tmf: Miniflare,\n\tworkerName: string\n) {\n\tconst ns = await mf.getDurableObjectNamespace(\n\t\tRUNNER_OBJECT_BINDING,\n\t\tworkerName\n\t);\n\n\t// @ts-expect-error `ColoLocalActorNamespace`s are not included in types\n\tconst stub = ns.get(\"singleton\");\n\n\tconst res = await stub.fetch(\"http://placeholder\", {\n\t\theaders: {\n\t\t\tUpgrade: \"websocket\",\n\t\t\t\"MF-Vitest-Worker-Data\": structuredSerializableStringify({\n\t\t\t\tcwd: process.cwd(),\n\t\t\t}),\n\t\t},\n\t});\n\n\tconst webSocket = res.webSocket;\n\tif (webSocket === null) {\n\t\tconst body = await res.text().catch(() => \"\");\n\t\tthrow new Error(\n\t\t\t`Failed to establish WebSocket to runner (status ${res.status}): ${body}`\n\t\t);\n\t}\n\n\twebSocket.accept();\n\n\treturn webSocket;\n}\n\ninterface PackageJson {\n\tname?: string;\n\tversion?: string;\n\tpeerDependencies?: Record<string, string | undefined>;\n\tbundledVersions?: Record<string, string | undefined>;\n}\nfunction getPackageJson(dirPath: string): PackageJson | undefined {\n\twhile (true) {\n\t\tconst pkgJsonPath = path.join(dirPath, \"package.json\");\n\t\ttry {\n\t\t\tconst contents = fs.readFileSync(pkgJsonPath, \"utf8\");\n\t\t\treturn JSON.parse(contents);\n\t\t} catch (e) {\n\t\t\tif (!isFileNotFoundError(e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t\tconst nextDirPath = path.dirname(dirPath);\n\t\t// `path.dirname()` of the root directory is the root directory\n\t\tif (nextDirPath === dirPath) {\n\t\t\treturn;\n\t\t}\n\t\tdirPath = nextDirPath;\n\t}\n}\n\n/**\n * Extract the upstream vitest version from an alternative distribution's\n * package.json. Distributions like `@voidzero-dev/vite-plus-test` declare\n * the bundled vitest version in `bundledVersions.vitest`.\n */\nfunction getUpstreamVitestVersion(pkgJson: PackageJson): string | undefined {\n\treturn pkgJson.bundledVersions?.vitest;\n}\n\nexport function assertCompatibleVitestVersion(ctx: Vitest) {\n\t// Some package managers don't enforce `peerDependencies` requirements,\n\t// so add a runtime sanity check to ensure things don't break in strange ways.\n\tconst poolPkgJson = getPackageJson(__dirname);\n\tconst vitestPkgJson = getPackageJson(ctx.distPath);\n\tassert(\n\t\tpoolPkgJson !== undefined,\n\t\t\"Expected to find `package.json` for `@cloudflare/vitest-pool-workers`\"\n\t);\n\tassert(\n\t\tvitestPkgJson !== undefined,\n\t\t\"Expected to find `package.json` for `vitest`\"\n\t);\n\n\tconst expectedVitestVersion = poolPkgJson.peerDependencies?.vitest;\n\tassert(\n\t\texpectedVitestVersion !== undefined,\n\t\t\"Expected to find `@cloudflare/vitest-pool-workers`'s `vitest` version constraint\"\n\t);\n\n\tconst actualVitestVersion =\n\t\tvitestPkgJson.name === \"vitest\"\n\t\t\t? vitestPkgJson.version\n\t\t\t: (getUpstreamVitestVersion(vitestPkgJson) ?? vitestPkgJson.version);\n\tassert(\n\t\tactualVitestVersion !== undefined,\n\t\t\"Expected to find `vitest`'s version\"\n\t);\n\n\t// Hard error on Vitest v3, which definitely won't work\n\tif (semverSatisfies(actualVitestVersion, \"3.x\")) {\n\t\tconst message = `You're running \\`vitest@${actualVitestVersion}\\`, but this version of \\`@cloudflare/vitest-pool-workers\\` only supports \\`vitest ${expectedVitestVersion}\\`.`;\n\t\tthrow new Error(message);\n\t}\n\n\tif (!semverSatisfies(actualVitestVersion, expectedVitestVersion)) {\n\t\tconst message = [\n\t\t\t`You're running \\`vitest@${actualVitestVersion}\\`, but this version of \\`@cloudflare/vitest-pool-workers\\` only officially supports \\`vitest ${expectedVitestVersion}\\`.`,\n\t\t\t\"`@cloudflare/vitest-pool-workers` currently depends on internal Vitest APIs that are not protected by semantic-versioning guarantees.\",\n\t\t\t`Your tests may work without issue, but we can not guarantee compatibility outside of the above version range.`,\n\t\t].join(\"\\n\");\n\t\tlog.warn(message);\n\t}\n}\n\n/**\n * Ensures that the specified compatibility feature is enabled for Vitest to work.\n * @param compatibilityFlags The list of current compatibility flags.\n * @param feature The name of the feature to enable.\n */\nfunction ensureFeature(compatibilityFlags: string[], feature: string) {\n\tconst flagToEnable = `enable_${feature}`;\n\tconst flagToDisable = `disable_${feature}`;\n\tif (!compatibilityFlags.includes(flagToEnable)) {\n\t\tlog.debug(\n\t\t\t`Adding \\`${flagToEnable}\\` compatibility flag during tests as this feature is needed to support the Vitest runner.`\n\t\t);\n\t\tcompatibilityFlags.push(flagToEnable);\n\t}\n\tif (compatibilityFlags.includes(flagToDisable)) {\n\t\tlog.info(\n\t\t\t`Removing \\`${flagToDisable}\\` compatibility flag during tests as that feature is needed to support the Vitest runner.`\n\t\t);\n\t\tcompatibilityFlags.splice(compatibilityFlags.indexOf(flagToDisable), 1);\n\t}\n}\n\nexport { cloudflarePool } from \"./pool\";\nexport {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,OAAO;EAAE,GAAG;EAAK,QAAQ;EAAM,CAAC,EAAE,OAAO;CACxF;AACD,IAAI,QAAQ;AACZ,IAAIC,MAAoB,uBAAO,OAAO;CACpC,WAAW;CACX,iBAAiB;CACjB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,IAAI,OAAO;AACT,SAAOD;;CAET,IAAI,aAAa;AACf,SAAO;;CAET;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,gBAAgB;CAChB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,QAAQ;CACR,WAAW;CACX;CACA,IAAI,wBAAwB;AAC1B,SAAO;;CAET;CACA,KAAK;CACL,OAAO;CACP,QAAQ;CACR,SAAS;CACT,MAAM;CACN,oBAAoB;CACpB,QAAQ;CACR,QAAQ;CACR,YAAY;CACZ,cAAc;CACd,cAAc;CACd,MAAM;CACN,SAAS;CACT,KAAK;CACL,KAAK;CACL,YAAY;CACZ,OAAO;CACP,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,QAAQ;CACR;CACA;CACA,UAAU;CACV;CACA,UAAU;CACV,YAAY;CACZ,SAAS;CACT,QAAQ;CACR,KAAK;CACL,cAAc;CACd,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,OAAO;CACP,aAAa;CACb,OAAO;CACP,SAAS;CACT,QAAQ;CACR;CACA;CACA;CACA;CACD,CAAC;AAGF,IAAI,2BAA2B;AAK/B,IAAI,8BAHqC,IAAI,OADb,+BAG/B;AAED,SAAS,oBAAoB,MAAM;AACjC,KAAI,OAAO,SAAS,SAClB,QAAO;AAET,KAAI,KAAK,SAAS,yBAChB,QAAO;AAET,QAAO,4BAA4B,KAAK,KAAK;;AAE/C,OAAO,qBAAqB,sBAAsB;AAClDC,IAAE,OAA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,gCAAgC,aAAa,OAAO,EACpD,cACA,UACA,KAAK,GACL,KAAK,EACN;CACD,MAAM,SAAS,eAAe,aAAa,aAAa,OAAO;CAC/D,MAAM,cAAc,YAClB,aACA,aACA,QACA,eACA,WACA,KAAK,EACN;CACD,MAAM,eAAe,YACnB,aACA,aACA,QACA,gBACA,WACA,KAAK,EACN;CACD,MAAME,UAAQ,0BACZ,aACA,QACA,OAAO,SAAS,aAAa,SAAS,EAAE,EACxC,WACD;CACD,MAAM,cAAc;EAElB;EACA,oBAAoB,YAClB,aACA,aACA,QACA,sBACA,2BACA,KAAK,EACN;EACD,qBAAqB,YACnB,aACA,aACA,QACA,uBACA,eACA,EAAE,CACH;EACD,aAAa,YACX,aACA,aACA,QACA,eACA,UACA,sBACD;EACD,cAAc,YACZ,aACA,aACA,QACA,gBACA,UACA,iBACD;EACD,UAAU,6BACR,aACA,aACA,QACA,WACD;EACD,OAAO,0BAA0B,aAAa,aAAa,QAAQ,QAAQ;EAC3E,MAAM,kCACJ,aACA,wBACA,aACA,QACA,QACA,sBAAsB,WAAW,aACjC,cAAc,QAAQ,EACtB,KAAK,EACN;EACD,MAAM,uBAAuB,YAC3B,aACA,aACA,QACA,QACA,UACA,KAAK,EACN,GAAG,8BACF,YACA,YACE,aACA,aACA,QACA,QACA,UACA,KAAK,EACN,CACF;EACD,yBAAyB,YACvB,aACA,aACA,QACA,2BACA,WACA,KAAK,EACN;EACD,qBAAqB,YACnB,aACA,aACA,QACA,uBACA,WACA,KAAK,EACN;EACD,UAAU,iCACR,YACA,YACE,aACA,aACA,QACA,YACA,UACA,KAAK,EACN,CACF;EACD;EACA;EACA,UAAU,YACR,aACA,aACA,QACA,YACA,kBACA,EAAE,OAAO,KAAK,GAAG,CAClB;EACD,QAAQ,2BAA2B,aAAa,aAAa,OAAO;EACpE,QAAQ,2BAA2B,aAAa,aAAa,OAAO;EACpE,WAAW,8BAA8B,aAAa,aAAa,OAAO;EAC1E;EACA;EACA;EAEA,MAAM,eACJ,aACA,aACA,WACA,QACA,SACA,QACA,aAAa,QAAQ,EACrB,EAAE,CACH;EACD,SAAS,eACP,aACA,aACA,WACA,QACA,SACA,WACA,gBAAgB,QAAQ,EACxB,KAAK,EACN;EACD,QAAQ,eACN,aACA,aACA,WACA,QACA,SACA,UACA,gBAAgB,QAAQ,EACxB,EAAE,CACH;EACD,iBAAiB,eACf,aACA,aACA,WACA,QACA,SACA,mBACA,yBAAyB,SAAS,6BAA6B,EAC/D,EACE,UAAU,EAAE,EACb,CACF;EACD,WAAW,eACT,aACA,aACA,WACA,QACA,SACA,aACA,IACE,qBAAqB,SAAS,wBAAwB,EACtD,2BACD,EACD,EAAE,CACH;EACD,YAAY,YACV,aACA,aACA,QACA,cACA,oBACA,EAAE,CACH;EACD,eAAe,eACb,aACA,aACA,WACA,QACA,SACA,iBACA,qBAAqB,SAAS,kBAAkB,EAChD,EAAE,CACH;EACD,cAAc,eACZ,aACA,aACA,WACA,QACA,SACA,gBACA,4BACA,EAAE,CACH;EACD,YAAY,eACV,aACA,aACA,WACA,QACA,SACA,cACA,qBAAqB,SAAS,OAAO,MAAM,WAAW,EACtD,KAAK,EACN;EACD,YAAY,eACV,aACA,aACA,WACA,QACA,SACA,cACA,qBAAqB,SAAS,yBAAyB,EACvD,EAAE,CACH;EACD,QAAQ,eACN,aACA,aACA,WACA,QACA,SACA,UACA,eAAe,QAAQ,EACvB;GAAE,WAAW,EAAE;GAAE,WAAW,EAAE;GAAE,CACjC;EACD,YAAY,eACV,aACA,aACA,WACA,QACA,SACA,cACA,qBAAqB,SAAS,kBAAkB,EAChD,EAAE,CACH;EACD,cAAc,eACZ,aACA,aACA,WACA,QACA,SACA,gBACA,qBAAqB,SAAS,kBAAkB,EAChD,EAAE,CACH;EACD,WAAW,eACT,aACA,aACA,WACA,QACA,SACA,aACA,qBAAqB,SAAS,yBAAyB,EACvD,EAAE,CACH;EACD,sBAAsB,eACpB,aACA,aACA,WACA,QACA,SACA,wBACA,qBAAqB,SAAS,iCAAiC,EAC/D,EAAE,CACH;EACD,WAAW,eACT,aACA,aACA,WACA,QACA,SACA,aACA,qBAAqB,SAAS,wBAAwB,EACtD,EAAE,CACH;EACD,YAAY,eACV,aACA,aACA,WACA,QACA,SACA,cACA,qBAAqB,SAAS,0BAA0B,EACxD,EAAE,CACH;EACD,UAAU,eACR,aACA,aACA,WACA,QACA,SACA,YACA,qBAAqB,SAAS,uBAAuB,EACrD,EAAE,CACH;EACD,2BAA2B,eACzB,aACA,aACA,WACA,QACA,SACA,6BACA,qBAAqB,SAAS,+BAA+B,EAC7D,EAAE,CACH;EACD,qBAAqB,eACnB,aACA,aACA,WACA,QACA,SACA,uBACA,qBAAqB,SAAS,+BAA+B,EAC7D,EAAE,CACH;EACD,mBAAmB,eACjB,aACA,aACA,WACA,QACA,SACA,qBACA,qBAAqB,SAAS,+BAA+B,EAC7D,EAAE,CACH;EACD,gBAAgB,eACd,aACA,aACA,WACA,QACA,SACA,kBACA,uBACA,KAAK,EACN;EACD,0BAA0B,eACxB,aACA,aACA,WACA,QACA,SACA,4BACA,gCACA,KAAK,EACN;EACD,QAAQ,eACN,aACA,aACA,WACA,QACA,SACA,UACA,uBAAuB,QAAQ,EAC/B,EAAE,CACH;EACD,SAAS,eACP,aACA,aACA,WACA,QACA,SACA,WACA,2BAA2B,QAAQ,EACnC,KAAK,EACN;EACD,IAAI,eACF,aACA,aACA,WACA,QACA,SACA,MACA,kBAAkB,QAAQ,EAC1B,KAAK,EACN;EACD,QAAQ,eACN,aACA,aACA,WACA,QACA,SACA,UACA,2BAA2B,QAAQ,EACnC,KAAK,EACN;EACD,QAAQ,eACN,aACA,aACA,WACA,QACA,SACA,UACA,2BAA2B,QAAQ,EACnC,KAAK,EACN;EACD,OAAO,eACL,aACA,aACA,WACA,QACA,SACA,SACA,2BAA2B,QAAQ,EACnC,KAAK,EACN;EACD,WAAW,eACT,aACA,aACA,WACA,QACA,SACA,aACA,qBAAqB,SAAS,wBAAwB,EACtD,EAAE,CACH;EACD,uBAAuB,eACrB,aACA,aACA,WACA,QACA,SACA,yBACA,qBAAqB,SAAS,kCAAkC,EAChE,EAAE,CACH;EACD,oBAAoB,eAClB,aACA,aACA,WACA,QACA,SACA,sBACA,qBAAqB,SAAS,0BAA0B,EACxD,EAAE,CACH;EACD,gBAAgB,eACd,aACA,aACA,WACA,QACA,SACA,kBACA,qBAAqB,SAAS,4BAA4B,EAC1D,EAAE,CACH;EACD,YAAY,eACV,aACA,aACA,WACA,QACA,SACA,cACA,qBAAqB,SAAS,yBAAyB,EACvD,EAAE,CACH;EACD,cAAc,eACZ,aACA,aACA,WACA,QACA,SACA,gBACA,qBAAqB,SAAS,0BAA0B,EACxD,EAAE,CACH;EACD,cAAc,eACZ,aACA,aACA,WACA,QACA,SACA,gBACA,qBAAqB,SAAS,0BAA0B,EACxD,EAAE,CACH;EACD,kBAAkB,eAChB,aACA,aACA,WACA,QACA,SACA,oBACA,+BAA+B,QAAQ,EACvC,KAAK,EACN;EACD,SAAS,YACP,aACA,aACA,QACA,WACA,wBAAwB,QAAQ,EAChC,EACE,UAAU,EAAE,EACb,CACF;EACD,WAAW,YACT,aACA,aACA,QACA,aACA,WACA,KAAK,EACN;EACD,QAAQ,YACN,aACA,aACA,QACA,UACA,WACA,KAAK,EACN;EACD,YAAY,YACV,aACA,aACA,QACA,cACA,WACA,KAAK,EACN;EACD,oBAAoB,YAClB,aACA,aACA,QACA,sBACA,WACA,KAAK,EACN;EACD,SAAS,YACP,aACA,aACA,QACA,WACA,WACA,KAAK,EACN;EACD,oBAAoB,YAClB,aACA,aACA,QACA,sBACA,WACA,KAAK,EACN;EACD,eAAe,YACb,aACA,aACA,QACA,iBACA,uBACA,KAAK,EACN;EACD,OAAO,YACL,aACA,aACA,QACA,SACA,eACA,KAAK,EACN;EACD,mBAAmB,YACjB,aACA,aACA,QACA,qBACA,QAAQ,UAAU,eAAe,EACjC,KAAK,EACN;EACD,gBAAgB,YACd,aACA,aACA,QACA,kBACA,uBACA,EAAE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