"use strict";
var __create2 = Object.create;
var __defProp2 = Object.defineProperty;
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
var __getOwnPropNames2 = Object.getOwnPropertyNames;
var __getProtoOf2 = Object.getPrototypeOf;
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export2 = (target, all) => {
  for (var name in all)
    __defProp2(target, name, { get: all[name], enumerable: true });
};
var __copyProps2 = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames2(from))
      if (!__hasOwnProp2.call(to, key) && key !== except)
        __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);

// ../primitives/dist/console.js.text.js
var require_console_js_text = __commonJS({
  "../primitives/dist/console.js.text.js"(exports2, module2) {
    "use strict";
    module2.exports = '"use strict";\nvar __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 __esm = (fn, res) => function __init() {\n  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\nvar __commonJS = (cb, mod) => function __require() {\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 __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));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\n\n// <define:process>\nvar init_define_process = __esm({\n  "<define:process>"() {\n  }\n});\n\n// ../format/dist/index.js\nvar require_dist = __commonJS({\n  "../format/dist/index.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var __defProp2 = Object.defineProperty;\n    var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;\n    var __getOwnPropNames2 = Object.getOwnPropertyNames;\n    var __hasOwnProp2 = Object.prototype.hasOwnProperty;\n    var __export2 = /* @__PURE__ */ __name((target, all) => {\n      for (var name in all)\n        __defProp2(target, name, { get: all[name], enumerable: true });\n    }, "__export");\n    var __copyProps2 = /* @__PURE__ */ __name((to, from, except, desc) => {\n      if (from && typeof from === "object" || typeof from === "function") {\n        for (let key of __getOwnPropNames2(from))\n          if (!__hasOwnProp2.call(to, key) && key !== except)\n            __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable });\n      }\n      return to;\n    }, "__copyProps");\n    var __toCommonJS2 = /* @__PURE__ */ __name((mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod), "__toCommonJS");\n    var src_exports = {};\n    __export2(src_exports, {\n      createFormat: () => createFormat2\n    });\n    module2.exports = __toCommonJS2(src_exports);\n    var ReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor;\n    function GetOwnGetter(target, key) {\n      const descriptor = ReflectGetOwnPropertyDescriptor(target, key);\n      return descriptor ? descriptor.get : void 0;\n    }\n    __name(GetOwnGetter, "GetOwnGetter");\n    var ReflectGetPrototypeOf = Reflect.getPrototypeOf;\n    var TypedArray = ReflectGetPrototypeOf(Uint8Array);\n    var ArrayPrototypeFilter = Array.prototype.filter;\n    var ArrayPrototypePush = Array.prototype.push;\n    var DatePrototypeGetTime = Date.prototype.getTime;\n    var DatePrototypeToISOString = Date.prototype.toISOString;\n    var ObjectGetOwnPropertyDescriptors = Object.getOwnPropertyDescriptors;\n    var ObjectGetOwnPropertyNames = Object.getOwnPropertyNames;\n    var ObjectGetOwnPropertySymbols = Object.getOwnPropertySymbols;\n    var ObjectKeys = Object.keys;\n    var ObjectPrototypePropertyIsEnumerable = Object.prototype.propertyIsEnumerable;\n    var ObjectPrototypeToString = Object.prototype.toString;\n    var MapPrototypeGetSize = GetOwnGetter(Map.prototype, "size");\n    var SetPrototypeGetSize = GetOwnGetter(Set.prototype, "size");\n    var StringPrototypeIncludes = String.prototype.includes;\n    var SymbolIterator = Symbol.iterator;\n    var SymbolPrototypeToString = Symbol.prototype.toString;\n    var TypedArrayPrototypeGetLength = GetOwnGetter(\n      TypedArray.prototype,\n      "length"\n    );\n    var typedArrayStrings = /* @__PURE__ */ new Set([\n      "[object BigInt64Array]",\n      "[object BigUint64Array]",\n      "[object Float32Array]",\n      "[object Float64Array]",\n      "[object Int8Array]",\n      "[object Int16Array]",\n      "[object Int32Array]",\n      "[object Uint8Array]",\n      "[object Uint8ClampedArray]",\n      "[object Uint16Array]",\n      "[object Uint32Array]"\n    ]);\n    function getOwnNonIndexProperties(object, filter) {\n      const indexes = Array.isArray(object) || isTypedArray(object) ? new Set([...object.keys()].map((v) => v.toString())) : void 0;\n      return Object.entries(ObjectGetOwnPropertyDescriptors(object)).filter(([key, desc]) => {\n        if (indexes && indexes.has(key)) {\n          return false;\n        }\n        if (filter === 1 && !desc.enumerable) {\n          return false;\n        }\n        return true;\n      }).map(([key]) => key);\n    }\n    __name(getOwnNonIndexProperties, "getOwnNonIndexProperties");\n    var isTypedArray = /* @__PURE__ */ __name((value) => kind(value, "object") && typedArrayStrings.has(ObjectPrototypeToString.call(value)), "isTypedArray");\n    function kind(value, type) {\n      return typeof value === type;\n    }\n    __name(kind, "kind");\n    var getConstructorName = /* @__PURE__ */ __name((object) => {\n      var _a;\n      return (_a = object.constructor) == null ? void 0 : _a.name;\n    }, "getConstructorName");\n    var getPrefix = /* @__PURE__ */ __name((constructor = "", size = "") => `${constructor}${size} `, "getPrefix");\n    function createFormat2(opts = {}) {\n      if (opts.customInspectSymbol === void 0) {\n        opts.customInspectSymbol = Symbol.for("edge-runtime.inspect.custom");\n      }\n      if (opts.formatError === void 0) {\n        opts.formatError = (error2) => `[${Error.prototype.toString.call(error2)}]`;\n      }\n      const { formatError, customInspectSymbol } = opts;\n      function format2(...args) {\n        const [firstArg] = args;\n        if (!kind(firstArg, "string")) {\n          if (hasCustomSymbol(firstArg, customInspectSymbol)) {\n            return format2(firstArg[customInspectSymbol]({ format: format2 }));\n          } else {\n            return args.map((item) => inspect(item, { customInspectSymbol })).join(" ");\n          }\n        }\n        let index = 1;\n        let str = String(firstArg).replace(/%[sjdOoif%]/g, (token) => {\n          if (token === "%%")\n            return "%";\n          if (index >= args.length)\n            return token;\n          switch (token) {\n            case "%s": {\n              const arg = args[index++];\n              if (hasCustomSymbol(arg, customInspectSymbol)) {\n                return format2(arg[customInspectSymbol]({ format: format2 }));\n              } else if (isDate(arg) || isError(arg) || kind(arg, "bigint")) {\n                return format2(arg);\n              } else {\n                return String(arg);\n              }\n            }\n            case "%j":\n              return safeStringify(args[index++]);\n            case "%d": {\n              const arg = args[index++];\n              if (kind(arg, "bigint")) {\n                return format2(arg);\n              } else {\n                return String(Number(arg));\n              }\n            }\n            case "%O":\n              return inspect(args[index++], { customInspectSymbol });\n            case "%o":\n              return inspect(args[index++], {\n                customInspectSymbol,\n                showHidden: true,\n                depth: 4\n              });\n            case "%i": {\n              const arg = args[index++];\n              if (kind(arg, "bigint")) {\n                return format2(arg);\n              } else {\n                return String(parseInt(arg, 10));\n              }\n            }\n            case "%f":\n              return String(parseFloat(args[index++]));\n            default:\n              return token;\n          }\n        });\n        for (let arg = args[index]; index < args.length; arg = args[++index]) {\n          if (arg === null || !kind(arg, "object")) {\n            str += " " + arg;\n          } else {\n            str += " " + inspect(arg);\n          }\n        }\n        return str;\n      }\n      __name(format2, "format");\n      function formatValue(ctx, value, recurseTimes) {\n        if (hasCustomSymbol(value, customInspectSymbol)) {\n          return format2(value[customInspectSymbol]({ format: format2 }));\n        }\n        const formattedPrimitive = formatPrimitive(value);\n        if (formattedPrimitive !== void 0) {\n          return formattedPrimitive;\n        }\n        if (ctx.seen.includes(value)) {\n          let index = 1;\n          if (ctx.circular === void 0) {\n            ctx.circular = /* @__PURE__ */ new Map();\n            ctx.circular.set(value, index);\n          } else {\n            index = ctx.circular.get(value);\n            if (index === void 0) {\n              index = ctx.circular.size + 1;\n              ctx.circular.set(value, index);\n            }\n          }\n          return `[Circular *${index}]`;\n        }\n        return formatRaw(ctx, value, recurseTimes);\n      }\n      __name(formatValue, "formatValue");\n      function formatRaw(ctx, value, recurseTimes) {\n        let keys = [];\n        const constructor = getConstructorName(value);\n        let base = "";\n        let formatter = /* @__PURE__ */ __name(() => [], "formatter");\n        let braces = ["", ""];\n        let noIterator = true;\n        const filter = ctx.showHidden ? 0 : 1;\n        if (SymbolIterator in value) {\n          noIterator = false;\n          if (Array.isArray(value)) {\n            const prefix = constructor !== "Array" ? getPrefix(constructor, `(${value.length})`) : "";\n            keys = getOwnNonIndexProperties(value, filter);\n            braces = [`${prefix}[`, "]"];\n            if (value.length === 0 && keys.length === 0) {\n              return `${braces[0]}]`;\n            }\n            formatter = formatArray;\n          } else if (isSet(value)) {\n            const size = SetPrototypeGetSize.call(value);\n            const prefix = getPrefix(constructor, `(${size})`);\n            keys = getKeys(value, ctx.showHidden);\n            formatter = formatSet;\n            if (size === 0 && keys.length === 0) {\n              return `${prefix}{}`;\n            }\n            braces = [`${prefix}{`, "}"];\n          } else if (isMap(value)) {\n            const size = MapPrototypeGetSize.call(value);\n            const prefix = getPrefix(constructor, `(${size})`);\n            keys = getKeys(value, ctx.showHidden);\n            formatter = formatMap;\n            if (size === 0 && keys.length === 0) {\n              return `${prefix}{}`;\n            }\n            braces = [`${prefix}{`, "}"];\n          } else if (isTypedArray(value)) {\n            keys = getOwnNonIndexProperties(value, filter);\n            const size = TypedArrayPrototypeGetLength.call(value);\n            const prefix = getPrefix(constructor, `(${size})`);\n            braces = [`${prefix}[`, "]"];\n            if (value.length === 0 && keys.length === 0)\n              return `${braces[0]}]`;\n            formatter = formatTypedArray.bind(null, size);\n          } else {\n            noIterator = true;\n          }\n        }\n        if (noIterator) {\n          keys = getKeys(value, ctx.showHidden);\n          braces = ["{", "}"];\n          if (constructor === void 0) {\n            if (keys.length === 0) {\n              return `[Object: null prototype] {}`;\n            }\n          } else if (constructor === "Object") {\n            if (keys.length === 0) {\n              return `{}`;\n            }\n          } else if (kind(value, "function")) {\n            base = `[Function${value.name ? ": " + value.name : ""}]`;\n            if (keys.length === 0) {\n              return base;\n            }\n          } else if (isRegExp(value)) {\n            base = RegExp.prototype.toString.call(value);\n            if (keys.length === 0) {\n              return base;\n            }\n            base = " " + base;\n          } else if (isDate(value)) {\n            base = Number.isNaN(DatePrototypeGetTime.call(value)) ? Date.prototype.toString.call(value) : DatePrototypeToISOString.call(value);\n            if (keys.length === 0) {\n              return base;\n            }\n            base = " " + base;\n          } else if (isError(value)) {\n            base = formatError(value);\n            if (keys.length === 0) {\n              return base;\n            }\n            base = " " + base;\n          } else if (hasCustomSymbol(value, ctx.customInspectSymbol)) {\n            base = format2(value[ctx.customInspectSymbol]({ format: format2 }));\n            if (keys.length === 0) {\n              return base;\n            }\n            base = " " + base;\n          } else {\n            braces[0] = `${getPrefix(constructor)}{`;\n          }\n        }\n        if (recurseTimes && recurseTimes < 0) {\n          return isRegExp(value) ? RegExp.prototype.toString.call(value) : "[Object]";\n        }\n        ctx.seen.push(value);\n        const visibleKeys = new Set(keys);\n        const output = formatter(ctx, value, recurseTimes, visibleKeys, keys);\n        for (let i = 0; i < keys.length; i++) {\n          output.push(\n            formatProperty(\n              ctx,\n              value,\n              recurseTimes,\n              visibleKeys,\n              keys[i],\n              false\n            )\n          );\n        }\n        if (ctx.circular !== void 0) {\n          const index = ctx.circular.get(value);\n          if (index !== void 0) {\n            const reference = `<ref *${index}>`;\n            base = base === "" ? reference : `${reference} ${base}`;\n          }\n        }\n        ctx.seen.pop();\n        return reduceToSingleString(output, base, braces);\n      }\n      __name(formatRaw, "formatRaw");\n      function inspect(value, opts2) {\n        opts2 = Object.assign({ seen: [], depth: 2 }, opts2);\n        return formatValue(opts2, value, opts2.depth);\n      }\n      __name(inspect, "inspect");\n      function formatProperty(ctx, value, recurseTimes, visibleKeys, key, isArray) {\n        let name;\n        let str;\n        const desc = Object.getOwnPropertyDescriptor(value, key) || {\n          value: value[key]\n        };\n        if (desc.value !== void 0) {\n          str = formatValue(ctx, desc.value, recurseTimes);\n        } else if (desc.get) {\n          str = desc.set ? "[Getter/Setter]" : "[Getter]";\n        } else if (desc.set) {\n          str = "[Setter]";\n        } else {\n          str = "undefined";\n        }\n        if (isArray) {\n          return str;\n        }\n        if (kind(key, "symbol")) {\n          name = `[${SymbolPrototypeToString.call(key)}]`;\n        } else if (!visibleKeys.has(key)) {\n          name = "[" + key + "]";\n        } else {\n          name = key;\n        }\n        return `${name}: ${str}`;\n      }\n      __name(formatProperty, "formatProperty");\n      function formatArray(ctx, value, recurseTimes, visibleKeys) {\n        const output = [];\n        for (let index = 0; index < value.length; ++index) {\n          if (Object.prototype.hasOwnProperty.call(value, String(index))) {\n            output.push(\n              formatProperty(\n                ctx,\n                value,\n                recurseTimes,\n                visibleKeys,\n                String(index),\n                true\n              )\n            );\n          } else {\n            output.push("");\n          }\n        }\n        return output;\n      }\n      __name(formatArray, "formatArray");\n      function formatTypedArray(length, ctx, value, recurseTimes) {\n        const output = new Array(length);\n        for (let i = 0; i < length; ++i) {\n          output[i] = value.length > 0 && kind(value[0], "number") ? String(value[i]) : formatBigInt(value[i]);\n        }\n        if (ctx.showHidden) {\n          for (const key of [\n            "BYTES_PER_ELEMENT",\n            "length",\n            "byteLength",\n            "byteOffset",\n            "buffer"\n          ]) {\n            const str = formatValue(ctx, value[key], recurseTimes);\n            ArrayPrototypePush.call(output, `[${String(key)}]: ${str}`);\n          }\n        }\n        return output;\n      }\n      __name(formatTypedArray, "formatTypedArray");\n      function formatSet(ctx, value, recurseTimes) {\n        const output = [];\n        for (const v of value) {\n          ArrayPrototypePush.call(output, formatValue(ctx, v, recurseTimes));\n        }\n        return output;\n      }\n      __name(formatSet, "formatSet");\n      function formatMap(ctx, value, recurseTimes) {\n        const output = [];\n        for (const { 0: k, 1: v } of value) {\n          output.push(\n            `${formatValue(ctx, k, recurseTimes)} => ${formatValue(\n              ctx,\n              v,\n              recurseTimes\n            )}`\n          );\n        }\n        return output;\n      }\n      __name(formatMap, "formatMap");\n      return format2;\n    }\n    __name(createFormat2, "createFormat");\n    var formatBigInt = /* @__PURE__ */ __name((bigint) => `${bigint}n`, "formatBigInt");\n    function formatPrimitive(value) {\n      if (value === null)\n        return "null";\n      if (value === void 0)\n        return "undefined";\n      if (kind(value, "string")) {\n        return `\'${JSON.stringify(value).replace(/^"|"$/g, "").replace(/\'/g, "\\\\\'").replace(/\\\\"/g, \'"\')}\'`;\n      }\n      if (kind(value, "boolean"))\n        return "" + value;\n      if (kind(value, "number"))\n        return "" + value;\n      if (kind(value, "bigint"))\n        return formatBigInt(value);\n      if (kind(value, "symbol"))\n        return value.toString();\n    }\n    __name(formatPrimitive, "formatPrimitive");\n    function hasCustomSymbol(value, customInspectSymbol) {\n      return value !== null && kind(value, "object") && customInspectSymbol in value && kind(value[customInspectSymbol], "function");\n    }\n    __name(hasCustomSymbol, "hasCustomSymbol");\n    function isRegExp(value) {\n      return kind(value, "object") && Object.prototype.toString.call(value) === "[object RegExp]";\n    }\n    __name(isRegExp, "isRegExp");\n    function isDate(value) {\n      return kind(value, "object") && Object.prototype.toString.call(value) === "[object Date]";\n    }\n    __name(isDate, "isDate");\n    function isError(value) {\n      return kind(value, "object") && (Object.prototype.toString.call(value) === "[object Error]" || value instanceof Error);\n    }\n    __name(isError, "isError");\n    function isMap(value) {\n      return kind(value, "object") && Object.prototype.toString.call(value) === "[object Map]";\n    }\n    __name(isMap, "isMap");\n    function isSet(value) {\n      return kind(value, "object") && Object.prototype.toString.call(value) === "[object Set]";\n    }\n    __name(isSet, "isSet");\n    function isBelowBreakLength(output, start, base) {\n      const breakLength = 80;\n      let totalLength = output.length + start;\n      if (totalLength + output.length > breakLength) {\n        return false;\n      }\n      for (let i = 0; i < output.length; i++) {\n        totalLength += output[i].length;\n        if (totalLength > breakLength) {\n          return false;\n        }\n      }\n      return base === "" || !StringPrototypeIncludes.call(base, "\\n");\n    }\n    __name(isBelowBreakLength, "isBelowBreakLength");\n    function reduceToSingleString(output, base, braces) {\n      const start = output.length + braces[0].length + base.length + 10;\n      if (!isBelowBreakLength(output, start, base)) {\n        return (base ? base + " " : "") + braces[0] + "\\n  " + output.join(",\\n  ") + "\\n" + braces[1];\n      }\n      return ((base ? base + " " : "") + braces[0] + " " + output.join(", ") + " " + braces[1]).trim();\n    }\n    __name(reduceToSingleString, "reduceToSingleString");\n    function safeStringify(input) {\n      if (Array.isArray(input)) {\n        input = input.map(\n          (element) => JSON.parse(JSON.stringify(element, makeCircularReplacer()))\n        );\n      }\n      return JSON.stringify(input, makeCircularReplacer());\n    }\n    __name(safeStringify, "safeStringify");\n    function makeCircularReplacer() {\n      const seen = /* @__PURE__ */ new WeakSet();\n      return (key, value) => {\n        if (value !== null && kind(value, "object")) {\n          if (seen.has(value))\n            return "[Circular]";\n          seen.add(value);\n        }\n        return value;\n      };\n    }\n    __name(makeCircularReplacer, "makeCircularReplacer");\n    function getKeys(value, showHidden = false) {\n      let keys;\n      const symbols = ObjectGetOwnPropertySymbols(value);\n      if (showHidden) {\n        keys = ObjectGetOwnPropertyNames(value);\n        if (symbols.length !== 0)\n          ArrayPrototypePush.apply(keys, symbols);\n      } else {\n        try {\n          keys = ObjectKeys(value);\n        } catch (err) {\n          keys = ObjectGetOwnPropertyNames(value);\n        }\n        if (symbols.length !== 0) {\n          const filter = /* @__PURE__ */ __name((key) => ObjectPrototypePropertyIsEnumerable.call(value, key), "filter");\n          ArrayPrototypePush.apply(keys, ArrayPrototypeFilter.call(symbols, filter));\n        }\n      }\n      return keys;\n    }\n    __name(getKeys, "getKeys");\n  }\n});\n\n// src/primitives/console.js\nvar console_exports = {};\n__export(console_exports, {\n  console: () => konsole\n});\nmodule.exports = __toCommonJS(console_exports);\ninit_define_process();\nvar import_format = __toESM(require_dist());\nvar format = (0, import_format.createFormat)();\nvar bareError = console.error.bind(console);\nvar bareLog = console.log.bind(console);\nvar assert = console.assert.bind(console);\nvar time = console.time.bind(console);\nvar timeEnd = console.timeEnd.bind(console);\nvar timeLog = console.timeLog.bind(console);\nvar trace = console.trace.bind(console);\nvar error = /* @__PURE__ */ __name((...args) => bareError(format(...args)), "error");\nvar log = /* @__PURE__ */ __name((...args) => bareLog(format(...args)), "log");\nvar konsole = {\n  assert: (assertion, ...args) => assert(assertion, format(...args)),\n  count: console.count.bind(console),\n  debug: log,\n  dir: console.dir.bind(console),\n  error,\n  info: log,\n  log,\n  time: (...args) => time(format(...args)),\n  timeEnd: (...args) => timeEnd(format(...args)),\n  timeLog,\n  trace,\n  warn: error\n};\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  console\n});\n';
  }
});

// ../primitives/dist/timers.js.text.js
var require_timers_js_text = __commonJS({
  "../primitives/dist/timers.js.text.js"(exports2, module2) {
    "use strict";
    module2.exports = '"use strict";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\n\n// src/primitives/timers.js\nvar timers_exports = {};\n__export(timers_exports, {\n  setInterval: () => setIntervalProxy,\n  setTimeout: () => setTimeoutProxy\n});\nmodule.exports = __toCommonJS(timers_exports);\nvar setTimeoutProxy = new Proxy(setTimeout, {\n  apply: (target, thisArg, args) => {\n    const timeout = Reflect.apply(target, thisArg, args);\n    return timeout[Symbol.toPrimitive]();\n  }\n});\nvar setIntervalProxy = new Proxy(setInterval, {\n  apply: (target, thisArg, args) => {\n    const timeout = Reflect.apply(target, thisArg, args);\n    return timeout[Symbol.toPrimitive]();\n  }\n});\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  setInterval,\n  setTimeout\n});\n';
  }
});

// ../primitives/dist/events.js.text.js
var require_events_js_text = __commonJS({
  "../primitives/dist/events.js.text.js"(exports2, module2) {
    "use strict";
    module2.exports = '"use strict";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, "name", { value, configurable: true });\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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\n\n// src/primitives/events.js\nvar events_exports = {};\n__export(events_exports, {\n  FetchEvent: () => FetchEvent,\n  PromiseRejectionEvent: () => PromiseRejectionEvent\n});\nmodule.exports = __toCommonJS(events_exports);\nvar _FetchEvent = class _FetchEvent extends Event {\n  constructor(request) {\n    super("fetch");\n    this.request = request;\n    this.response = null;\n    this.awaiting = /* @__PURE__ */ new Set();\n  }\n  respondWith = (response) => {\n    this.response = response;\n  };\n  waitUntil = (promise) => {\n    this.awaiting.add(promise);\n    promise.finally(() => this.awaiting.delete(promise));\n  };\n};\n__name(_FetchEvent, "FetchEvent");\nvar FetchEvent = _FetchEvent;\nvar _PromiseRejectionEvent = class _PromiseRejectionEvent extends Event {\n  constructor(type, init) {\n    super(type, { cancelable: true });\n    this.promise = init.promise;\n    this.reason = init.reason;\n  }\n};\n__name(_PromiseRejectionEvent, "PromiseRejectionEvent");\nvar PromiseRejectionEvent = _PromiseRejectionEvent;\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  FetchEvent,\n  PromiseRejectionEvent\n});\n';
  }
});

// ../primitives/dist/abort-controller.js.text.js
var require_abort_controller_js_text = __commonJS({
  "../primitives/dist/abort-controller.js.text.js"(exports2, module2) {
    "use strict";
    module2.exports = '"use strict";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, "name", { value, configurable: true });\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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\n\n// src/primitives/abort-controller.js\nvar abort_controller_exports = {};\n__export(abort_controller_exports, {\n  AbortController: () => AbortController,\n  AbortSignal: () => AbortSignal,\n  DOMException: () => DOMException\n});\nmodule.exports = __toCommonJS(abort_controller_exports);\nvar kSignal = Symbol("kSignal");\nvar kAborted = Symbol("kAborted");\nvar kReason = Symbol("kReason");\nvar kName = Symbol("kName");\nvar kOnabort = Symbol("kOnabort");\nvar _DOMException = class _DOMException extends Error {\n  constructor(message, name) {\n    super(message);\n    this[kName] = name;\n  }\n  get name() {\n    return this[kName];\n  }\n};\n__name(_DOMException, "DOMException");\nvar DOMException = _DOMException;\nfunction createAbortSignal() {\n  const signal = new EventTarget();\n  Object.setPrototypeOf(signal, AbortSignal.prototype);\n  signal[kAborted] = false;\n  signal[kReason] = void 0;\n  signal[kOnabort] = void 0;\n  return signal;\n}\n__name(createAbortSignal, "createAbortSignal");\nfunction abortSignalAbort(signal, reason) {\n  if (typeof reason === "undefined") {\n    reason = new DOMException("This operation was aborted", "AbortError");\n  }\n  if (signal.aborted) {\n    return;\n  }\n  signal[kReason] = reason;\n  signal[kAborted] = true;\n  signal.dispatchEvent(new Event("abort"));\n}\n__name(abortSignalAbort, "abortSignalAbort");\nvar _AbortController = class _AbortController {\n  constructor() {\n    this[kSignal] = createAbortSignal();\n  }\n  get signal() {\n    return this[kSignal];\n  }\n  abort(reason) {\n    abortSignalAbort(this.signal, reason);\n  }\n};\n__name(_AbortController, "AbortController");\nvar AbortController = _AbortController;\nvar _AbortSignal = class _AbortSignal extends EventTarget {\n  constructor() {\n    throw new TypeError("Illegal constructor");\n  }\n  get aborted() {\n    return this[kAborted];\n  }\n  get reason() {\n    return this[kReason];\n  }\n  get onabort() {\n    return this[kOnabort];\n  }\n  set onabort(value) {\n    if (this[kOnabort]) {\n      this.removeEventListener("abort", this[kOnabort]);\n    }\n    if (value) {\n      this[kOnabort] = value;\n      this.addEventListener("abort", this[kOnabort]);\n    }\n  }\n  throwIfAborted() {\n    if (this[kAborted]) {\n      throw this[kReason];\n    }\n  }\n  static abort(reason) {\n    const signal = createAbortSignal();\n    abortSignalAbort(signal, reason);\n    return signal;\n  }\n  static timeout(milliseconds) {\n    const signal = createAbortSignal();\n    setTimeout(() => {\n      abortSignalAbort(\n        signal,\n        new DOMException(\n          "The operation was aborted due to timeout",\n          "TimeoutError"\n        )\n      );\n    }, milliseconds);\n    return signal;\n  }\n};\n__name(_AbortSignal, "AbortSignal");\nvar AbortSignal = _AbortSignal;\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  AbortController,\n  AbortSignal,\n  DOMException\n});\n';
  }
});

// ../primitives/dist/url.js.text.js
var require_url_js_text = __commonJS({
  "../primitives/dist/url.js.text.js"(exports2, module2) {
    "use strict";
    module2.exports = '"use strict";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, "name", { value, configurable: true });\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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\nvar __accessCheck = (obj, member, msg) => {\n  if (!member.has(obj))\n    throw TypeError("Cannot " + msg);\n};\nvar __privateGet = (obj, member, getter) => {\n  __accessCheck(obj, member, "read from private field");\n  return getter ? getter.call(obj) : member.get(obj);\n};\nvar __privateAdd = (obj, member, value) => {\n  if (member.has(obj))\n    throw TypeError("Cannot add the same private member more than once");\n  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n};\nvar __privateSet = (obj, member, value, setter) => {\n  __accessCheck(obj, member, "write to private field");\n  setter ? setter.call(obj, value) : member.set(obj, value);\n  return value;\n};\nvar __privateMethod = (obj, member, method) => {\n  __accessCheck(obj, member, "access private method");\n  return method;\n};\n\n// src/primitives/url.js\nvar url_exports = {};\n__export(url_exports, {\n  URLPattern: () => me\n});\nmodule.exports = __toCommonJS(url_exports);\n\n// ../../node_modules/.pnpm/urlpattern-polyfill@10.0.0/node_modules/urlpattern-polyfill/dist/urlpattern.js\nvar _a;\nvar R = (_a = class {\n  type = 3;\n  name = "";\n  prefix = "";\n  value = "";\n  suffix = "";\n  modifier = 3;\n  constructor(t, r, n, o, c, l) {\n    this.type = t, this.name = r, this.prefix = n, this.value = o, this.suffix = c, this.modifier = l;\n  }\n  hasCustomName() {\n    return this.name !== "" && typeof this.name != "number";\n  }\n}, __name(_a, "R"), _a);\nvar be = /[$_\\p{ID_Start}]/u;\nvar Pe = /[$_\\u200C\\u200D\\p{ID_Continue}]/u;\nvar M = ".*";\nfunction Re(e, t) {\n  return (t ? /^[\\x00-\\xFF]*$/ : /^[\\x00-\\x7F]*$/).test(e);\n}\n__name(Re, "Re");\nfunction v(e, t = false) {\n  let r = [], n = 0;\n  for (; n < e.length; ) {\n    let o = e[n], c = /* @__PURE__ */ __name(function(l) {\n      if (!t)\n        throw new TypeError(l);\n      r.push({ type: "INVALID_CHAR", index: n, value: e[n++] });\n    }, "c");\n    if (o === "*") {\n      r.push({ type: "ASTERISK", index: n, value: e[n++] });\n      continue;\n    }\n    if (o === "+" || o === "?") {\n      r.push({ type: "OTHER_MODIFIER", index: n, value: e[n++] });\n      continue;\n    }\n    if (o === "\\\\") {\n      r.push({ type: "ESCAPED_CHAR", index: n++, value: e[n++] });\n      continue;\n    }\n    if (o === "{") {\n      r.push({ type: "OPEN", index: n, value: e[n++] });\n      continue;\n    }\n    if (o === "}") {\n      r.push({ type: "CLOSE", index: n, value: e[n++] });\n      continue;\n    }\n    if (o === ":") {\n      let l = "", s = n + 1;\n      for (; s < e.length; ) {\n        let i = e.substr(s, 1);\n        if (s === n + 1 && be.test(i) || s !== n + 1 && Pe.test(i)) {\n          l += e[s++];\n          continue;\n        }\n        break;\n      }\n      if (!l) {\n        c(`Missing parameter name at ${n}`);\n        continue;\n      }\n      r.push({ type: "NAME", index: n, value: l }), n = s;\n      continue;\n    }\n    if (o === "(") {\n      let l = 1, s = "", i = n + 1, a = false;\n      if (e[i] === "?") {\n        c(`Pattern cannot start with "?" at ${i}`);\n        continue;\n      }\n      for (; i < e.length; ) {\n        if (!Re(e[i], false)) {\n          c(`Invalid character \'${e[i]}\' at ${i}.`), a = true;\n          break;\n        }\n        if (e[i] === "\\\\") {\n          s += e[i++] + e[i++];\n          continue;\n        }\n        if (e[i] === ")") {\n          if (l--, l === 0) {\n            i++;\n            break;\n          }\n        } else if (e[i] === "(" && (l++, e[i + 1] !== "?")) {\n          c(`Capturing groups are not allowed at ${i}`), a = true;\n          break;\n        }\n        s += e[i++];\n      }\n      if (a)\n        continue;\n      if (l) {\n        c(`Unbalanced pattern at ${n}`);\n        continue;\n      }\n      if (!s) {\n        c(`Missing pattern at ${n}`);\n        continue;\n      }\n      r.push({ type: "REGEX", index: n, value: s }), n = i;\n      continue;\n    }\n    r.push({ type: "CHAR", index: n, value: e[n++] });\n  }\n  return r.push({ type: "END", index: n, value: "" }), r;\n}\n__name(v, "v");\nfunction D(e, t = {}) {\n  let r = v(e);\n  t.delimiter ??= "/#?", t.prefixes ??= "./";\n  let n = `[^${S(t.delimiter)}]+?`, o = [], c = 0, l = 0, s = "", i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ __name((h) => {\n    if (l < r.length && r[l].type === h)\n      return r[l++].value;\n  }, "a"), f = /* @__PURE__ */ __name(() => a("OTHER_MODIFIER") ?? a("ASTERISK"), "f"), d = /* @__PURE__ */ __name((h) => {\n    let u = a(h);\n    if (u !== void 0)\n      return u;\n    let { type: p, index: A } = r[l];\n    throw new TypeError(`Unexpected ${p} at ${A}, expected ${h}`);\n  }, "d"), T = /* @__PURE__ */ __name(() => {\n    let h = "", u;\n    for (; u = a("CHAR") ?? a("ESCAPED_CHAR"); )\n      h += u;\n    return h;\n  }, "T"), Se = /* @__PURE__ */ __name((h) => h, "Se"), L = t.encodePart || Se, I = "", U = /* @__PURE__ */ __name((h) => {\n    I += h;\n  }, "U"), $ = /* @__PURE__ */ __name(() => {\n    I.length && (o.push(new R(3, "", "", L(I), "", 3)), I = "");\n  }, "$"), V = /* @__PURE__ */ __name((h, u, p, A, Y) => {\n    let g = 3;\n    switch (Y) {\n      case "?":\n        g = 1;\n        break;\n      case "*":\n        g = 0;\n        break;\n      case "+":\n        g = 2;\n        break;\n    }\n    if (!u && !p && g === 3) {\n      U(h);\n      return;\n    }\n    if ($(), !u && !p) {\n      if (!h)\n        return;\n      o.push(new R(3, "", "", L(h), "", g));\n      return;\n    }\n    let m;\n    p ? p === "*" ? m = M : m = p : m = n;\n    let O = 2;\n    m === n ? (O = 1, m = "") : m === M && (O = 0, m = "");\n    let P;\n    if (u ? P = u : p && (P = c++), i.has(P))\n      throw new TypeError(`Duplicate name \'${P}\'.`);\n    i.add(P), o.push(new R(O, P, L(h), m, L(A), g));\n  }, "V");\n  for (; l < r.length; ) {\n    let h = a("CHAR"), u = a("NAME"), p = a("REGEX");\n    if (!u && !p && (p = a("ASTERISK")), u || p) {\n      let g = h ?? "";\n      t.prefixes.indexOf(g) === -1 && (U(g), g = ""), $();\n      let m = f();\n      V(g, u, p, "", m);\n      continue;\n    }\n    let A = h ?? a("ESCAPED_CHAR");\n    if (A) {\n      U(A);\n      continue;\n    }\n    if (a("OPEN")) {\n      let g = T(), m = a("NAME"), O = a("REGEX");\n      !m && !O && (O = a("ASTERISK"));\n      let P = T();\n      d("CLOSE");\n      let xe = f();\n      V(g, m, O, P, xe);\n      continue;\n    }\n    $(), d("END");\n  }\n  return o;\n}\n__name(D, "D");\nfunction S(e) {\n  return e.replace(/([.+*?^${}()[\\]|/\\\\])/g, "\\\\$1");\n}\n__name(S, "S");\nfunction X(e) {\n  return e && e.ignoreCase ? "ui" : "u";\n}\n__name(X, "X");\nfunction Z(e, t, r) {\n  return F(D(e, r), t, r);\n}\n__name(Z, "Z");\nfunction k(e) {\n  switch (e) {\n    case 0:\n      return "*";\n    case 1:\n      return "?";\n    case 2:\n      return "+";\n    case 3:\n      return "";\n  }\n}\n__name(k, "k");\nfunction F(e, t, r = {}) {\n  r.delimiter ??= "/#?", r.prefixes ??= "./", r.sensitive ??= false, r.strict ??= false, r.end ??= true, r.start ??= true, r.endsWith = "";\n  let n = r.start ? "^" : "";\n  for (let s of e) {\n    if (s.type === 3) {\n      s.modifier === 3 ? n += S(s.value) : n += `(?:${S(s.value)})${k(s.modifier)}`;\n      continue;\n    }\n    t && t.push(s.name);\n    let i = `[^${S(r.delimiter)}]+?`, a = s.value;\n    if (s.type === 1 ? a = i : s.type === 0 && (a = M), !s.prefix.length && !s.suffix.length) {\n      s.modifier === 3 || s.modifier === 1 ? n += `(${a})${k(s.modifier)}` : n += `((?:${a})${k(s.modifier)})`;\n      continue;\n    }\n    if (s.modifier === 3 || s.modifier === 1) {\n      n += `(?:${S(s.prefix)}(${a})${S(s.suffix)})`, n += k(s.modifier);\n      continue;\n    }\n    n += `(?:${S(s.prefix)}`, n += `((?:${a})(?:`, n += S(s.suffix), n += S(s.prefix), n += `(?:${a}))*)${S(s.suffix)})`, s.modifier === 0 && (n += "?");\n  }\n  let o = `[${S(r.endsWith)}]|$`, c = `[${S(r.delimiter)}]`;\n  if (r.end)\n    return r.strict || (n += `${c}?`), r.endsWith.length ? n += `(?=${o})` : n += "$", new RegExp(n, X(r));\n  r.strict || (n += `(?:${c}(?=${o}))?`);\n  let l = false;\n  if (e.length) {\n    let s = e[e.length - 1];\n    s.type === 3 && s.modifier === 3 && (l = r.delimiter.indexOf(s) > -1);\n  }\n  return l || (n += `(?=${c}|${o})`), new RegExp(n, X(r));\n}\n__name(F, "F");\nvar x = { delimiter: "", prefixes: "", sensitive: true, strict: true };\nvar B = { delimiter: ".", prefixes: "", sensitive: true, strict: true };\nvar q = { delimiter: "/", prefixes: "/", sensitive: true, strict: true };\nfunction J(e, t) {\n  return e.length ? e[0] === "/" ? true : !t || e.length < 2 ? false : (e[0] == "\\\\" || e[0] == "{") && e[1] == "/" : false;\n}\n__name(J, "J");\nfunction Q(e, t) {\n  return e.startsWith(t) ? e.substring(t.length, e.length) : e;\n}\n__name(Q, "Q");\nfunction Ee(e, t) {\n  return e.endsWith(t) ? e.substr(0, e.length - t.length) : e;\n}\n__name(Ee, "Ee");\nfunction W(e) {\n  return !e || e.length < 2 ? false : e[0] === "[" || (e[0] === "\\\\" || e[0] === "{") && e[1] === "[";\n}\n__name(W, "W");\nvar ee = ["ftp", "file", "http", "https", "ws", "wss"];\nfunction N(e) {\n  if (!e)\n    return true;\n  for (let t of ee)\n    if (e.test(t))\n      return true;\n  return false;\n}\n__name(N, "N");\nfunction te(e, t) {\n  if (e = Q(e, "#"), t || e === "")\n    return e;\n  let r = new URL("https://example.com");\n  return r.hash = e, r.hash ? r.hash.substring(1, r.hash.length) : "";\n}\n__name(te, "te");\nfunction re(e, t) {\n  if (e = Q(e, "?"), t || e === "")\n    return e;\n  let r = new URL("https://example.com");\n  return r.search = e, r.search ? r.search.substring(1, r.search.length) : "";\n}\n__name(re, "re");\nfunction ne(e, t) {\n  return t || e === "" ? e : W(e) ? j(e) : z(e);\n}\n__name(ne, "ne");\nfunction se(e, t) {\n  if (t || e === "")\n    return e;\n  let r = new URL("https://example.com");\n  return r.password = e, r.password;\n}\n__name(se, "se");\nfunction ie(e, t) {\n  if (t || e === "")\n    return e;\n  let r = new URL("https://example.com");\n  return r.username = e, r.username;\n}\n__name(ie, "ie");\nfunction ae(e, t, r) {\n  if (r || e === "")\n    return e;\n  if (t && !ee.includes(t))\n    return new URL(`${t}:${e}`).pathname;\n  let n = e[0] == "/";\n  return e = new URL(n ? e : "/-" + e, "https://example.com").pathname, n || (e = e.substring(2, e.length)), e;\n}\n__name(ae, "ae");\nfunction oe(e, t, r) {\n  return _(t) === e && (e = ""), r || e === "" ? e : K(e);\n}\n__name(oe, "oe");\nfunction ce(e, t) {\n  return e = Ee(e, ":"), t || e === "" ? e : y(e);\n}\n__name(ce, "ce");\nfunction _(e) {\n  switch (e) {\n    case "ws":\n    case "http":\n      return "80";\n    case "wws":\n    case "https":\n      return "443";\n    case "ftp":\n      return "21";\n    default:\n      return "";\n  }\n}\n__name(_, "_");\nfunction y(e) {\n  if (e === "")\n    return e;\n  if (/^[-+.A-Za-z0-9]*$/.test(e))\n    return e.toLowerCase();\n  throw new TypeError(`Invalid protocol \'${e}\'.`);\n}\n__name(y, "y");\nfunction le(e) {\n  if (e === "")\n    return e;\n  let t = new URL("https://example.com");\n  return t.username = e, t.username;\n}\n__name(le, "le");\nfunction fe(e) {\n  if (e === "")\n    return e;\n  let t = new URL("https://example.com");\n  return t.password = e, t.password;\n}\n__name(fe, "fe");\nfunction z(e) {\n  if (e === "")\n    return e;\n  if (/[\\t\\n\\r #%/:<>?@[\\]^\\\\|]/g.test(e))\n    throw new TypeError(`Invalid hostname \'${e}\'`);\n  let t = new URL("https://example.com");\n  return t.hostname = e, t.hostname;\n}\n__name(z, "z");\nfunction j(e) {\n  if (e === "")\n    return e;\n  if (/[^0-9a-fA-F[\\]:]/g.test(e))\n    throw new TypeError(`Invalid IPv6 hostname \'${e}\'`);\n  return e.toLowerCase();\n}\n__name(j, "j");\nfunction K(e) {\n  if (e === "" || /^[0-9]*$/.test(e) && parseInt(e) <= 65535)\n    return e;\n  throw new TypeError(`Invalid port \'${e}\'.`);\n}\n__name(K, "K");\nfunction he(e) {\n  if (e === "")\n    return e;\n  let t = new URL("https://example.com");\n  return t.pathname = e[0] !== "/" ? "/-" + e : e, e[0] !== "/" ? t.pathname.substring(2, t.pathname.length) : t.pathname;\n}\n__name(he, "he");\nfunction ue(e) {\n  return e === "" ? e : new URL(`data:${e}`).pathname;\n}\n__name(ue, "ue");\nfunction de(e) {\n  if (e === "")\n    return e;\n  let t = new URL("https://example.com");\n  return t.search = e, t.search.substring(1, t.search.length);\n}\n__name(de, "de");\nfunction pe(e) {\n  if (e === "")\n    return e;\n  let t = new URL("https://example.com");\n  return t.hash = e, t.hash.substring(1, t.hash.length);\n}\n__name(pe, "pe");\nvar _i, _n, _t, _e, _s, _l, _o, _d, _p, _g, _r, r_fn, _R, R_fn, _b, b_fn, _u, u_fn, _m, m_fn, _a2, a_fn, _P, P_fn, _E, E_fn, _S, S_fn, _O, O_fn, _k, k_fn, _x, x_fn, _h, h_fn, _f, f_fn, _T, T_fn, _A, A_fn, _y, y_fn, _w, w_fn, _c, c_fn, _C, C_fn, _a3;\nvar H = (_a3 = class {\n  constructor(t) {\n    __privateAdd(this, _r);\n    __privateAdd(this, _R);\n    __privateAdd(this, _b);\n    __privateAdd(this, _u);\n    __privateAdd(this, _m);\n    __privateAdd(this, _a2);\n    __privateAdd(this, _P);\n    __privateAdd(this, _E);\n    __privateAdd(this, _S);\n    __privateAdd(this, _O);\n    __privateAdd(this, _k);\n    __privateAdd(this, _x);\n    __privateAdd(this, _h);\n    __privateAdd(this, _f);\n    __privateAdd(this, _T);\n    __privateAdd(this, _A);\n    __privateAdd(this, _y);\n    __privateAdd(this, _w);\n    __privateAdd(this, _c);\n    __privateAdd(this, _C);\n    __privateAdd(this, _i, void 0);\n    __privateAdd(this, _n, []);\n    __privateAdd(this, _t, {});\n    __privateAdd(this, _e, 0);\n    __privateAdd(this, _s, 1);\n    __privateAdd(this, _l, 0);\n    __privateAdd(this, _o, 0);\n    __privateAdd(this, _d, 0);\n    __privateAdd(this, _p, 0);\n    __privateAdd(this, _g, false);\n    __privateSet(this, _i, t);\n  }\n  get result() {\n    return __privateGet(this, _t);\n  }\n  parse() {\n    for (__privateSet(this, _n, v(__privateGet(this, _i), true)); __privateGet(this, _e) < __privateGet(this, _n).length; __privateSet(this, _e, __privateGet(this, _e) + __privateGet(this, _s))) {\n      if (__privateSet(this, _s, 1), __privateGet(this, _n)[__privateGet(this, _e)].type === "END") {\n        if (__privateGet(this, _o) === 0) {\n          __privateMethod(this, _b, b_fn).call(this), __privateMethod(this, _f, f_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 9, 1) : __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _r, r_fn).call(this, 7, 0);\n          continue;\n        } else if (__privateGet(this, _o) === 2) {\n          __privateMethod(this, _u, u_fn).call(this, 5);\n          continue;\n        }\n        __privateMethod(this, _r, r_fn).call(this, 10, 0);\n        break;\n      }\n      if (__privateGet(this, _d) > 0)\n        if (__privateMethod(this, _A, A_fn).call(this))\n          __privateSet(this, _d, __privateGet(this, _d) - 1);\n        else\n          continue;\n      if (__privateMethod(this, _T, T_fn).call(this)) {\n        __privateSet(this, _d, __privateGet(this, _d) + 1);\n        continue;\n      }\n      switch (__privateGet(this, _o)) {\n        case 0:\n          __privateMethod(this, _P, P_fn).call(this) && __privateMethod(this, _u, u_fn).call(this, 1);\n          break;\n        case 1:\n          if (__privateMethod(this, _P, P_fn).call(this)) {\n            __privateMethod(this, _C, C_fn).call(this);\n            let t = 7, r = 1;\n            __privateMethod(this, _E, E_fn).call(this) ? (t = 2, r = 3) : __privateGet(this, _g) && (t = 2), __privateMethod(this, _r, r_fn).call(this, t, r);\n          }\n          break;\n        case 2:\n          __privateMethod(this, _S, S_fn).call(this) ? __privateMethod(this, _u, u_fn).call(this, 3) : (__privateMethod(this, _x, x_fn).call(this) || __privateMethod(this, _h, h_fn).call(this) || __privateMethod(this, _f, f_fn).call(this)) && __privateMethod(this, _u, u_fn).call(this, 5);\n          break;\n        case 3:\n          __privateMethod(this, _O, O_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 4, 1) : __privateMethod(this, _S, S_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 5, 1);\n          break;\n        case 4:\n          __privateMethod(this, _S, S_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 5, 1);\n          break;\n        case 5:\n          __privateMethod(this, _y, y_fn).call(this) ? __privateSet(this, _p, __privateGet(this, _p) + 1) : __privateMethod(this, _w, w_fn).call(this) && __privateSet(this, _p, __privateGet(this, _p) - 1), __privateMethod(this, _k, k_fn).call(this) && !__privateGet(this, _p) ? __privateMethod(this, _r, r_fn).call(this, 6, 1) : __privateMethod(this, _x, x_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 7, 0) : __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _f, f_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n          break;\n        case 6:\n          __privateMethod(this, _x, x_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 7, 0) : __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _f, f_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n          break;\n        case 7:\n          __privateMethod(this, _h, h_fn).call(this) ? __privateMethod(this, _r, r_fn).call(this, 8, 1) : __privateMethod(this, _f, f_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n          break;\n        case 8:\n          __privateMethod(this, _f, f_fn).call(this) && __privateMethod(this, _r, r_fn).call(this, 9, 1);\n          break;\n        case 9:\n          break;\n        case 10:\n          break;\n      }\n    }\n    __privateGet(this, _t).hostname !== void 0 && __privateGet(this, _t).port === void 0 && (__privateGet(this, _t).port = "");\n  }\n}, _i = new WeakMap(), _n = new WeakMap(), _t = new WeakMap(), _e = new WeakMap(), _s = new WeakMap(), _l = new WeakMap(), _o = new WeakMap(), _d = new WeakMap(), _p = new WeakMap(), _g = new WeakMap(), _r = new WeakSet(), r_fn = /* @__PURE__ */ __name(function(t, r) {\n  switch (__privateGet(this, _o)) {\n    case 0:\n      break;\n    case 1:\n      __privateGet(this, _t).protocol = __privateMethod(this, _c, c_fn).call(this);\n      break;\n    case 2:\n      break;\n    case 3:\n      __privateGet(this, _t).username = __privateMethod(this, _c, c_fn).call(this);\n      break;\n    case 4:\n      __privateGet(this, _t).password = __privateMethod(this, _c, c_fn).call(this);\n      break;\n    case 5:\n      __privateGet(this, _t).hostname = __privateMethod(this, _c, c_fn).call(this);\n      break;\n    case 6:\n      __privateGet(this, _t).port = __privateMethod(this, _c, c_fn).call(this);\n      break;\n    case 7:\n      __privateGet(this, _t).pathname = __privateMethod(this, _c, c_fn).call(this);\n      break;\n    case 8:\n      __privateGet(this, _t).search = __privateMethod(this, _c, c_fn).call(this);\n      break;\n    case 9:\n      __privateGet(this, _t).hash = __privateMethod(this, _c, c_fn).call(this);\n      break;\n    case 10:\n      break;\n  }\n  __privateGet(this, _o) !== 0 && t !== 10 && ([1, 2, 3, 4].includes(__privateGet(this, _o)) && [6, 7, 8, 9].includes(t) && (__privateGet(this, _t).hostname ??= ""), [1, 2, 3, 4, 5, 6].includes(__privateGet(this, _o)) && [8, 9].includes(t) && (__privateGet(this, _t).pathname ??= __privateGet(this, _g) ? "/" : ""), [1, 2, 3, 4, 5, 6, 7].includes(__privateGet(this, _o)) && t === 9 && (__privateGet(this, _t).search ??= "")), __privateMethod(this, _R, R_fn).call(this, t, r);\n}, "#r"), _R = new WeakSet(), R_fn = /* @__PURE__ */ __name(function(t, r) {\n  __privateSet(this, _o, t), __privateSet(this, _l, __privateGet(this, _e) + r), __privateSet(this, _e, __privateGet(this, _e) + r), __privateSet(this, _s, 0);\n}, "#R"), _b = new WeakSet(), b_fn = /* @__PURE__ */ __name(function() {\n  __privateSet(this, _e, __privateGet(this, _l)), __privateSet(this, _s, 0);\n}, "#b"), _u = new WeakSet(), u_fn = /* @__PURE__ */ __name(function(t) {\n  __privateMethod(this, _b, b_fn).call(this), __privateSet(this, _o, t);\n}, "#u"), _m = new WeakSet(), m_fn = /* @__PURE__ */ __name(function(t) {\n  return t < 0 && (t = __privateGet(this, _n).length - t), t < __privateGet(this, _n).length ? __privateGet(this, _n)[t] : __privateGet(this, _n)[__privateGet(this, _n).length - 1];\n}, "#m"), _a2 = new WeakSet(), a_fn = /* @__PURE__ */ __name(function(t, r) {\n  let n = __privateMethod(this, _m, m_fn).call(this, t);\n  return n.value === r && (n.type === "CHAR" || n.type === "ESCAPED_CHAR" || n.type === "INVALID_CHAR");\n}, "#a"), _P = new WeakSet(), P_fn = /* @__PURE__ */ __name(function() {\n  return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), ":");\n}, "#P"), _E = new WeakSet(), E_fn = /* @__PURE__ */ __name(function() {\n  return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e) + 1, "/") && __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e) + 2, "/");\n}, "#E"), _S = new WeakSet(), S_fn = /* @__PURE__ */ __name(function() {\n  return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), "@");\n}, "#S"), _O = new WeakSet(), O_fn = /* @__PURE__ */ __name(function() {\n  return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), ":");\n}, "#O"), _k = new WeakSet(), k_fn = /* @__PURE__ */ __name(function() {\n  return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), ":");\n}, "#k"), _x = new WeakSet(), x_fn = /* @__PURE__ */ __name(function() {\n  return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), "/");\n}, "#x"), _h = new WeakSet(), h_fn = /* @__PURE__ */ __name(function() {\n  if (__privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), "?"))\n    return true;\n  if (__privateGet(this, _n)[__privateGet(this, _e)].value !== "?")\n    return false;\n  let t = __privateMethod(this, _m, m_fn).call(this, __privateGet(this, _e) - 1);\n  return t.type !== "NAME" && t.type !== "REGEX" && t.type !== "CLOSE" && t.type !== "ASTERISK";\n}, "#h"), _f = new WeakSet(), f_fn = /* @__PURE__ */ __name(function() {\n  return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), "#");\n}, "#f"), _T = new WeakSet(), T_fn = /* @__PURE__ */ __name(function() {\n  return __privateGet(this, _n)[__privateGet(this, _e)].type == "OPEN";\n}, "#T"), _A = new WeakSet(), A_fn = /* @__PURE__ */ __name(function() {\n  return __privateGet(this, _n)[__privateGet(this, _e)].type == "CLOSE";\n}, "#A"), _y = new WeakSet(), y_fn = /* @__PURE__ */ __name(function() {\n  return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), "[");\n}, "#y"), _w = new WeakSet(), w_fn = /* @__PURE__ */ __name(function() {\n  return __privateMethod(this, _a2, a_fn).call(this, __privateGet(this, _e), "]");\n}, "#w"), _c = new WeakSet(), c_fn = /* @__PURE__ */ __name(function() {\n  let t = __privateGet(this, _n)[__privateGet(this, _e)], r = __privateMethod(this, _m, m_fn).call(this, __privateGet(this, _l)).index;\n  return __privateGet(this, _i).substring(r, t.index);\n}, "#c"), _C = new WeakSet(), C_fn = /* @__PURE__ */ __name(function() {\n  let t = {};\n  Object.assign(t, x), t.encodePart = y;\n  let r = Z(__privateMethod(this, _c, c_fn).call(this), void 0, t);\n  __privateSet(this, _g, N(r));\n}, "#C"), __name(_a3, "H"), _a3);\nvar G = ["protocol", "username", "password", "hostname", "port", "pathname", "search", "hash"];\nvar E = "*";\nfunction ge(e, t) {\n  if (typeof e != "string")\n    throw new TypeError("parameter 1 is not of type \'string\'.");\n  let r = new URL(e, t);\n  return { protocol: r.protocol.substring(0, r.protocol.length - 1), username: r.username, password: r.password, hostname: r.hostname, port: r.port, pathname: r.pathname, search: r.search !== "" ? r.search.substring(1, r.search.length) : void 0, hash: r.hash !== "" ? r.hash.substring(1, r.hash.length) : void 0 };\n}\n__name(ge, "ge");\nfunction b(e, t) {\n  return t ? C(e) : e;\n}\n__name(b, "b");\nfunction w(e, t, r) {\n  let n;\n  if (typeof t.baseURL == "string")\n    try {\n      n = new URL(t.baseURL), t.protocol === void 0 && (e.protocol = b(n.protocol.substring(0, n.protocol.length - 1), r)), !r && t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.username === void 0 && (e.username = b(n.username, r)), !r && t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.username === void 0 && t.password === void 0 && (e.password = b(n.password, r)), t.protocol === void 0 && t.hostname === void 0 && (e.hostname = b(n.hostname, r)), t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && (e.port = b(n.port, r)), t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.pathname === void 0 && (e.pathname = b(n.pathname, r)), t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.pathname === void 0 && t.search === void 0 && (e.search = b(n.search.substring(1, n.search.length), r)), t.protocol === void 0 && t.hostname === void 0 && t.port === void 0 && t.pathname === void 0 && t.search === void 0 && t.hash === void 0 && (e.hash = b(n.hash.substring(1, n.hash.length), r));\n    } catch {\n      throw new TypeError(`invalid baseURL \'${t.baseURL}\'.`);\n    }\n  if (typeof t.protocol == "string" && (e.protocol = ce(t.protocol, r)), typeof t.username == "string" && (e.username = ie(t.username, r)), typeof t.password == "string" && (e.password = se(t.password, r)), typeof t.hostname == "string" && (e.hostname = ne(t.hostname, r)), typeof t.port == "string" && (e.port = oe(t.port, e.protocol, r)), typeof t.pathname == "string") {\n    if (e.pathname = t.pathname, n && !J(e.pathname, r)) {\n      let o = n.pathname.lastIndexOf("/");\n      o >= 0 && (e.pathname = b(n.pathname.substring(0, o + 1), r) + e.pathname);\n    }\n    e.pathname = ae(e.pathname, e.protocol, r);\n  }\n  return typeof t.search == "string" && (e.search = re(t.search, r)), typeof t.hash == "string" && (e.hash = te(t.hash, r)), e;\n}\n__name(w, "w");\nfunction C(e) {\n  return e.replace(/([+*?:{}()\\\\])/g, "\\\\$1");\n}\n__name(C, "C");\nfunction Oe(e) {\n  return e.replace(/([.+*?^${}()[\\]|/\\\\])/g, "\\\\$1");\n}\n__name(Oe, "Oe");\nfunction ke(e, t) {\n  t.delimiter ??= "/#?", t.prefixes ??= "./", t.sensitive ??= false, t.strict ??= false, t.end ??= true, t.start ??= true, t.endsWith = "";\n  let r = ".*", n = `[^${Oe(t.delimiter)}]+?`, o = /[$_\\u200C\\u200D\\p{ID_Continue}]/u, c = "";\n  for (let l = 0; l < e.length; ++l) {\n    let s = e[l];\n    if (s.type === 3) {\n      if (s.modifier === 3) {\n        c += C(s.value);\n        continue;\n      }\n      c += `{${C(s.value)}}${k(s.modifier)}`;\n      continue;\n    }\n    let i = s.hasCustomName(), a = !!s.suffix.length || !!s.prefix.length && (s.prefix.length !== 1 || !t.prefixes.includes(s.prefix)), f = l > 0 ? e[l - 1] : null, d = l < e.length - 1 ? e[l + 1] : null;\n    if (!a && i && s.type === 1 && s.modifier === 3 && d && !d.prefix.length && !d.suffix.length)\n      if (d.type === 3) {\n        let T = d.value.length > 0 ? d.value[0] : "";\n        a = o.test(T);\n      } else\n        a = !d.hasCustomName();\n    if (!a && !s.prefix.length && f && f.type === 3) {\n      let T = f.value[f.value.length - 1];\n      a = t.prefixes.includes(T);\n    }\n    a && (c += "{"), c += C(s.prefix), i && (c += `:${s.name}`), s.type === 2 ? c += `(${s.value})` : s.type === 1 ? i || (c += `(${n})`) : s.type === 0 && (!i && (!f || f.type === 3 || f.modifier !== 3 || a || s.prefix !== "") ? c += "*" : c += `(${r})`), s.type === 1 && i && s.suffix.length && o.test(s.suffix[0]) && (c += "\\\\"), c += C(s.suffix), a && (c += "}"), s.modifier !== 3 && (c += k(s.modifier));\n  }\n  return c;\n}\n__name(ke, "ke");\nvar _i2, _n2, _t2, _e2, _s2, _l2, _a4;\nvar me = (_a4 = class {\n  constructor(t = {}, r, n) {\n    __privateAdd(this, _i2, void 0);\n    __privateAdd(this, _n2, {});\n    __privateAdd(this, _t2, {});\n    __privateAdd(this, _e2, {});\n    __privateAdd(this, _s2, {});\n    __privateAdd(this, _l2, false);\n    try {\n      let o;\n      if (typeof r == "string" ? o = r : n = r, typeof t == "string") {\n        let i = new H(t);\n        if (i.parse(), t = i.result, o === void 0 && typeof t.protocol != "string")\n          throw new TypeError("A base URL must be provided for a relative constructor string.");\n        t.baseURL = o;\n      } else {\n        if (!t || typeof t != "object")\n          throw new TypeError("parameter 1 is not of type \'string\' and cannot convert to dictionary.");\n        if (o)\n          throw new TypeError("parameter 1 is not of type \'string\'.");\n      }\n      typeof n > "u" && (n = { ignoreCase: false });\n      let c = { ignoreCase: n.ignoreCase === true }, l = { pathname: E, protocol: E, username: E, password: E, hostname: E, port: E, search: E, hash: E };\n      __privateSet(this, _i2, w(l, t, true)), _(__privateGet(this, _i2).protocol) === __privateGet(this, _i2).port && (__privateGet(this, _i2).port = "");\n      let s;\n      for (s of G) {\n        if (!(s in __privateGet(this, _i2)))\n          continue;\n        let i = {}, a = __privateGet(this, _i2)[s];\n        switch (__privateGet(this, _t2)[s] = [], s) {\n          case "protocol":\n            Object.assign(i, x), i.encodePart = y;\n            break;\n          case "username":\n            Object.assign(i, x), i.encodePart = le;\n            break;\n          case "password":\n            Object.assign(i, x), i.encodePart = fe;\n            break;\n          case "hostname":\n            Object.assign(i, B), W(a) ? i.encodePart = j : i.encodePart = z;\n            break;\n          case "port":\n            Object.assign(i, x), i.encodePart = K;\n            break;\n          case "pathname":\n            N(__privateGet(this, _n2).protocol) ? (Object.assign(i, q, c), i.encodePart = he) : (Object.assign(i, x, c), i.encodePart = ue);\n            break;\n          case "search":\n            Object.assign(i, x, c), i.encodePart = de;\n            break;\n          case "hash":\n            Object.assign(i, x, c), i.encodePart = pe;\n            break;\n        }\n        try {\n          __privateGet(this, _s2)[s] = D(a, i), __privateGet(this, _n2)[s] = F(__privateGet(this, _s2)[s], __privateGet(this, _t2)[s], i), __privateGet(this, _e2)[s] = ke(__privateGet(this, _s2)[s], i), __privateSet(this, _l2, __privateGet(this, _l2) || __privateGet(this, _s2)[s].some((f) => f.type === 2));\n        } catch {\n          throw new TypeError(`invalid ${s} pattern \'${__privateGet(this, _i2)[s]}\'.`);\n        }\n      }\n    } catch (o) {\n      throw new TypeError(`Failed to construct \'URLPattern\': ${o.message}`);\n    }\n  }\n  test(t = {}, r) {\n    let n = { pathname: "", protocol: "", username: "", password: "", hostname: "", port: "", search: "", hash: "" };\n    if (typeof t != "string" && r)\n      throw new TypeError("parameter 1 is not of type \'string\'.");\n    if (typeof t > "u")\n      return false;\n    try {\n      typeof t == "object" ? n = w(n, t, false) : n = w(n, ge(t, r), false);\n    } catch {\n      return false;\n    }\n    let o;\n    for (o of G)\n      if (!__privateGet(this, _n2)[o].exec(n[o]))\n        return false;\n    return true;\n  }\n  exec(t = {}, r) {\n    let n = { pathname: "", protocol: "", username: "", password: "", hostname: "", port: "", search: "", hash: "" };\n    if (typeof t != "string" && r)\n      throw new TypeError("parameter 1 is not of type \'string\'.");\n    if (typeof t > "u")\n      return;\n    try {\n      typeof t == "object" ? n = w(n, t, false) : n = w(n, ge(t, r), false);\n    } catch {\n      return null;\n    }\n    let o = {};\n    r ? o.inputs = [t, r] : o.inputs = [t];\n    let c;\n    for (c of G) {\n      let l = __privateGet(this, _n2)[c].exec(n[c]);\n      if (!l)\n        return null;\n      let s = {};\n      for (let [i, a] of __privateGet(this, _t2)[c].entries())\n        if (typeof a == "string" || typeof a == "number") {\n          let f = l[i + 1];\n          s[a] = f;\n        }\n      o[c] = { input: n[c] ?? "", groups: s };\n    }\n    return o;\n  }\n  static compareComponent(t, r, n) {\n    let o = /* @__PURE__ */ __name((i, a) => {\n      for (let f of ["type", "modifier", "prefix", "value", "suffix"]) {\n        if (i[f] < a[f])\n          return -1;\n        if (i[f] === a[f])\n          continue;\n        return 1;\n      }\n      return 0;\n    }, "o"), c = new R(3, "", "", "", "", 3), l = new R(0, "", "", "", "", 3), s = /* @__PURE__ */ __name((i, a) => {\n      let f = 0;\n      for (; f < Math.min(i.length, a.length); ++f) {\n        let d = o(i[f], a[f]);\n        if (d)\n          return d;\n      }\n      return i.length === a.length ? 0 : o(i[f] ?? c, a[f] ?? c);\n    }, "s");\n    return !__privateGet(r, _e2)[t] && !__privateGet(n, _e2)[t] ? 0 : __privateGet(r, _e2)[t] && !__privateGet(n, _e2)[t] ? s(__privateGet(r, _s2)[t], [l]) : !__privateGet(r, _e2)[t] && __privateGet(n, _e2)[t] ? s([l], __privateGet(n, _s2)[t]) : s(__privateGet(r, _s2)[t], __privateGet(n, _s2)[t]);\n  }\n  get protocol() {\n    return __privateGet(this, _e2).protocol;\n  }\n  get username() {\n    return __privateGet(this, _e2).username;\n  }\n  get password() {\n    return __privateGet(this, _e2).password;\n  }\n  get hostname() {\n    return __privateGet(this, _e2).hostname;\n  }\n  get port() {\n    return __privateGet(this, _e2).port;\n  }\n  get pathname() {\n    return __privateGet(this, _e2).pathname;\n  }\n  get search() {\n    return __privateGet(this, _e2).search;\n  }\n  get hash() {\n    return __privateGet(this, _e2).hash;\n  }\n  get hasRegExpGroups() {\n    return __privateGet(this, _l2);\n  }\n}, _i2 = new WeakMap(), _n2 = new WeakMap(), _t2 = new WeakMap(), _e2 = new WeakMap(), _s2 = new WeakMap(), _l2 = new WeakMap(), __name(_a4, "me"), _a4);\n\n// ../../node_modules/.pnpm/urlpattern-polyfill@10.0.0/node_modules/urlpattern-polyfill/index.js\nif (!globalThis.URLPattern) {\n  globalThis.URLPattern = me;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  URLPattern\n});\n';
  }
});

// ../primitives/dist/blob.js.text.js
var require_blob_js_text = __commonJS({
  "../primitives/dist/blob.js.text.js"(exports2, module2) {
    "use strict";
    module2.exports = `"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
var __esm = (fn, res) => function __init() {
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// <define:process>
var init_define_process = __esm({
  "<define:process>"() {
  }
});

// ../../node_modules/.pnpm/blob-polyfill@7.0.20220408/node_modules/blob-polyfill/Blob.js
var require_Blob = __commonJS({
  "../../node_modules/.pnpm/blob-polyfill@7.0.20220408/node_modules/blob-polyfill/Blob.js"(exports2) {
    "use strict";
    init_define_process();
    (function(global2) {
      (function(factory) {
        if (typeof define === "function" && define.amd) {
          define(["exports"], factory);
        } else if (typeof exports2 === "object" && typeof exports2.nodeName !== "string") {
          factory(exports2);
        } else {
          factory(global2);
        }
      })(function(exports3) {
        "use strict";
        var BlobBuilder = global2.BlobBuilder || global2.WebKitBlobBuilder || global2.MSBlobBuilder || global2.MozBlobBuilder;
        var URL = global2.URL || global2.webkitURL || function(href, a) {
          a = document.createElement("a");
          a.href = href;
          return a;
        };
        var origBlob = global2.Blob;
        var createObjectURL = URL.createObjectURL;
        var revokeObjectURL = URL.revokeObjectURL;
        var strTag = global2.Symbol && global2.Symbol.toStringTag;
        var blobSupported = false;
        var blobSupportsArrayBufferView = false;
        var blobBuilderSupported = BlobBuilder && BlobBuilder.prototype.append && BlobBuilder.prototype.getBlob;
        try {
          blobSupported = new Blob(["\\xE4"]).size === 2;
          blobSupportsArrayBufferView = new Blob([new Uint8Array([1, 2])]).size === 2;
        } catch (e) {
        }
        function mapArrayBufferViews(ary) {
          return ary.map(function(chunk) {
            if (chunk.buffer instanceof ArrayBuffer) {
              var buf = chunk.buffer;
              if (chunk.byteLength !== buf.byteLength) {
                var copy = new Uint8Array(chunk.byteLength);
                copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
                buf = copy.buffer;
              }
              return buf;
            }
            return chunk;
          });
        }
        __name(mapArrayBufferViews, "mapArrayBufferViews");
        function BlobBuilderConstructor(ary, options) {
          options = options || {};
          var bb = new BlobBuilder();
          mapArrayBufferViews(ary).forEach(function(part) {
            bb.append(part);
          });
          return options.type ? bb.getBlob(options.type) : bb.getBlob();
        }
        __name(BlobBuilderConstructor, "BlobBuilderConstructor");
        function BlobConstructor(ary, options) {
          return new origBlob(mapArrayBufferViews(ary), options || {});
        }
        __name(BlobConstructor, "BlobConstructor");
        if (global2.Blob) {
          BlobBuilderConstructor.prototype = Blob.prototype;
          BlobConstructor.prototype = Blob.prototype;
        }
        function stringEncode(string) {
          var pos = 0;
          var len = string.length;
          var Arr = global2.Uint8Array || Array;
          var at = 0;
          var tlen = Math.max(32, len + (len >> 1) + 7);
          var target = new Arr(tlen >> 3 << 3);
          while (pos < len) {
            var value = string.charCodeAt(pos++);
            if (value >= 55296 && value <= 56319) {
              if (pos < len) {
                var extra = string.charCodeAt(pos);
                if ((extra & 64512) === 56320) {
                  ++pos;
                  value = ((value & 1023) << 10) + (extra & 1023) + 65536;
                }
              }
              if (value >= 55296 && value <= 56319) {
                continue;
              }
            }
            if (at + 4 > target.length) {
              tlen += 8;
              tlen *= 1 + pos / string.length * 2;
              tlen = tlen >> 3 << 3;
              var update = new Uint8Array(tlen);
              update.set(target);
              target = update;
            }
            if ((value & 4294967168) === 0) {
              target[at++] = value;
              continue;
            } else if ((value & 4294965248) === 0) {
              target[at++] = value >> 6 & 31 | 192;
            } else if ((value & 4294901760) === 0) {
              target[at++] = value >> 12 & 15 | 224;
              target[at++] = value >> 6 & 63 | 128;
            } else if ((value & 4292870144) === 0) {
              target[at++] = value >> 18 & 7 | 240;
              target[at++] = value >> 12 & 63 | 128;
              target[at++] = value >> 6 & 63 | 128;
            } else {
              continue;
            }
            target[at++] = value & 63 | 128;
          }
          return target.slice(0, at);
        }
        __name(stringEncode, "stringEncode");
        function stringDecode(buf) {
          var end = buf.length;
          var res = [];
          var i = 0;
          while (i < end) {
            var firstByte = buf[i];
            var codePoint = null;
            var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
            if (i + bytesPerSequence <= end) {
              var secondByte, thirdByte, fourthByte, tempCodePoint;
              switch (bytesPerSequence) {
                case 1:
                  if (firstByte < 128) {
                    codePoint = firstByte;
                  }
                  break;
                case 2:
                  secondByte = buf[i + 1];
                  if ((secondByte & 192) === 128) {
                    tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
                    if (tempCodePoint > 127) {
                      codePoint = tempCodePoint;
                    }
                  }
                  break;
                case 3:
                  secondByte = buf[i + 1];
                  thirdByte = buf[i + 2];
                  if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
                    tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
                    if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
                      codePoint = tempCodePoint;
                    }
                  }
                  break;
                case 4:
                  secondByte = buf[i + 1];
                  thirdByte = buf[i + 2];
                  fourthByte = buf[i + 3];
                  if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
                    tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
                    if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
                      codePoint = tempCodePoint;
                    }
                  }
              }
            }
            if (codePoint === null) {
              codePoint = 65533;
              bytesPerSequence = 1;
            } else if (codePoint > 65535) {
              codePoint -= 65536;
              res.push(codePoint >>> 10 & 1023 | 55296);
              codePoint = 56320 | codePoint & 1023;
            }
            res.push(codePoint);
            i += bytesPerSequence;
          }
          var len = res.length;
          var str = "";
          var j = 0;
          while (j < len) {
            str += String.fromCharCode.apply(String, res.slice(j, j += 4096));
          }
          return str;
        }
        __name(stringDecode, "stringDecode");
        var textEncode = typeof TextEncoder === "function" ? TextEncoder.prototype.encode.bind(new TextEncoder()) : stringEncode;
        var textDecode = typeof TextDecoder === "function" ? TextDecoder.prototype.decode.bind(new TextDecoder()) : stringDecode;
        function FakeBlobBuilder() {
          function bufferClone(buf) {
            var view = new Array(buf.byteLength);
            var array = new Uint8Array(buf);
            var i = view.length;
            while (i--) {
              view[i] = array[i];
            }
            return view;
          }
          __name(bufferClone, "bufferClone");
          function array2base64(input) {
            var byteToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
            var output = [];
            for (var i = 0; i < input.length; i += 3) {
              var byte1 = input[i];
              var haveByte2 = i + 1 < input.length;
              var byte2 = haveByte2 ? input[i + 1] : 0;
              var haveByte3 = i + 2 < input.length;
              var byte3 = haveByte3 ? input[i + 2] : 0;
              var outByte1 = byte1 >> 2;
              var outByte2 = (byte1 & 3) << 4 | byte2 >> 4;
              var outByte3 = (byte2 & 15) << 2 | byte3 >> 6;
              var outByte4 = byte3 & 63;
              if (!haveByte3) {
                outByte4 = 64;
                if (!haveByte2) {
                  outByte3 = 64;
                }
              }
              output.push(
                byteToCharMap[outByte1],
                byteToCharMap[outByte2],
                byteToCharMap[outByte3],
                byteToCharMap[outByte4]
              );
            }
            return output.join("");
          }
          __name(array2base64, "array2base64");
          var create = Object.create || function(a) {
            function c() {
            }
            __name(c, "c");
            c.prototype = a;
            return new c();
          };
          function getObjectTypeName(o) {
            return Object.prototype.toString.call(o).slice(8, -1);
          }
          __name(getObjectTypeName, "getObjectTypeName");
          function isPrototypeOf(c, o) {
            return typeof c === "object" && Object.prototype.isPrototypeOf.call(c.prototype, o);
          }
          __name(isPrototypeOf, "isPrototypeOf");
          function isDataView(o) {
            return getObjectTypeName(o) === "DataView" || isPrototypeOf(global2.DataView, o);
          }
          __name(isDataView, "isDataView");
          var arrayBufferClassNames = [
            "Int8Array",
            "Uint8Array",
            "Uint8ClampedArray",
            "Int16Array",
            "Uint16Array",
            "Int32Array",
            "Uint32Array",
            "Float32Array",
            "Float64Array",
            "ArrayBuffer"
          ];
          function includes(a, v) {
            return a.indexOf(v) !== -1;
          }
          __name(includes, "includes");
          function isArrayBuffer(o) {
            return includes(arrayBufferClassNames, getObjectTypeName(o)) || isPrototypeOf(global2.ArrayBuffer, o);
          }
          __name(isArrayBuffer, "isArrayBuffer");
          function concatTypedarrays(chunks) {
            var size = 0;
            var j = chunks.length;
            while (j--) {
              size += chunks[j].length;
            }
            var b = new Uint8Array(size);
            var offset = 0;
            for (var i = 0; i < chunks.length; i++) {
              var chunk = chunks[i];
              b.set(chunk, offset);
              offset += chunk.byteLength || chunk.length;
            }
            return b;
          }
          __name(concatTypedarrays, "concatTypedarrays");
          function Blob3(chunks, opts) {
            chunks = chunks ? chunks.slice() : [];
            opts = opts == null ? {} : opts;
            for (var i = 0, len = chunks.length; i < len; i++) {
              var chunk = chunks[i];
              if (chunk instanceof Blob3) {
                chunks[i] = chunk._buffer;
              } else if (typeof chunk === "string") {
                chunks[i] = textEncode(chunk);
              } else if (isDataView(chunk)) {
                chunks[i] = bufferClone(chunk.buffer);
              } else if (isArrayBuffer(chunk)) {
                chunks[i] = bufferClone(chunk);
              } else {
                chunks[i] = textEncode(String(chunk));
              }
            }
            this._buffer = global2.Uint8Array ? concatTypedarrays(chunks) : [].concat.apply([], chunks);
            this.size = this._buffer.length;
            this.type = opts.type || "";
            if (/[^\\u0020-\\u007E]/.test(this.type)) {
              this.type = "";
            } else {
              this.type = this.type.toLowerCase();
            }
          }
          __name(Blob3, "Blob");
          Blob3.prototype.arrayBuffer = function() {
            return Promise.resolve(this._buffer.buffer || this._buffer);
          };
          Blob3.prototype.text = function() {
            return Promise.resolve(textDecode(this._buffer));
          };
          Blob3.prototype.slice = function(start, end, type) {
            var slice = this._buffer.slice(start || 0, end || this._buffer.length);
            return new Blob3([slice], { type });
          };
          Blob3.prototype.toString = function() {
            return "[object Blob]";
          };
          function File2(chunks, name, opts) {
            opts = opts || {};
            var a = Blob3.call(this, chunks, opts) || this;
            a.name = name.replace(/\\//g, ":");
            a.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : /* @__PURE__ */ new Date();
            a.lastModified = +a.lastModifiedDate;
            return a;
          }
          __name(File2, "File");
          File2.prototype = create(Blob3.prototype);
          File2.prototype.constructor = File2;
          if (Object.setPrototypeOf) {
            Object.setPrototypeOf(File2, Blob3);
          } else {
            try {
              File2.__proto__ = Blob3;
            } catch (e) {
            }
          }
          File2.prototype.toString = function() {
            return "[object File]";
          };
          function FileReader2() {
            if (!(this instanceof FileReader2)) {
              throw new TypeError("Failed to construct 'FileReader': Please use the 'new' operator, this DOM object constructor cannot be called as a function.");
            }
            var delegate = document.createDocumentFragment();
            this.addEventListener = delegate.addEventListener;
            this.dispatchEvent = function(evt) {
              var local = this["on" + evt.type];
              if (typeof local === "function")
                local(evt);
              delegate.dispatchEvent(evt);
            };
            this.removeEventListener = delegate.removeEventListener;
          }
          __name(FileReader2, "FileReader");
          function _read(fr, blob2, kind) {
            if (!(blob2 instanceof Blob3)) {
              throw new TypeError("Failed to execute '" + kind + "' on 'FileReader': parameter 1 is not of type 'Blob'.");
            }
            fr.result = "";
            setTimeout(function() {
              this.readyState = FileReader2.LOADING;
              fr.dispatchEvent(new Event("load"));
              fr.dispatchEvent(new Event("loadend"));
            });
          }
          __name(_read, "_read");
          FileReader2.EMPTY = 0;
          FileReader2.LOADING = 1;
          FileReader2.DONE = 2;
          FileReader2.prototype.error = null;
          FileReader2.prototype.onabort = null;
          FileReader2.prototype.onerror = null;
          FileReader2.prototype.onload = null;
          FileReader2.prototype.onloadend = null;
          FileReader2.prototype.onloadstart = null;
          FileReader2.prototype.onprogress = null;
          FileReader2.prototype.readAsDataURL = function(blob2) {
            _read(this, blob2, "readAsDataURL");
            this.result = "data:" + blob2.type + ";base64," + array2base64(blob2._buffer);
          };
          FileReader2.prototype.readAsText = function(blob2) {
            _read(this, blob2, "readAsText");
            this.result = textDecode(blob2._buffer);
          };
          FileReader2.prototype.readAsArrayBuffer = function(blob2) {
            _read(this, blob2, "readAsText");
            this.result = (blob2._buffer.buffer || blob2._buffer).slice();
          };
          FileReader2.prototype.abort = function() {
          };
          URL.createObjectURL = function(blob2) {
            return blob2 instanceof Blob3 ? "data:" + blob2.type + ";base64," + array2base64(blob2._buffer) : createObjectURL.call(URL, blob2);
          };
          URL.revokeObjectURL = function(url) {
            revokeObjectURL && revokeObjectURL.call(URL, url);
          };
          var _send = global2.XMLHttpRequest && global2.XMLHttpRequest.prototype.send;
          if (_send) {
            XMLHttpRequest.prototype.send = function(data) {
              if (data instanceof Blob3) {
                this.setRequestHeader("Content-Type", data.type);
                _send.call(this, textDecode(data._buffer));
              } else {
                _send.call(this, data);
              }
            };
          }
          exports3.Blob = Blob3;
          exports3.File = File2;
          exports3.FileReader = FileReader2;
          exports3.URL = URL;
        }
        __name(FakeBlobBuilder, "FakeBlobBuilder");
        function fixFileAndXHR() {
          var isIE = !!global2.ActiveXObject || "-ms-scroll-limit" in document.documentElement.style && "-ms-ime-align" in document.documentElement.style;
          var _send = global2.XMLHttpRequest && global2.XMLHttpRequest.prototype.send;
          if (isIE && _send) {
            XMLHttpRequest.prototype.send = function(data) {
              if (data instanceof Blob) {
                this.setRequestHeader("Content-Type", data.type);
                _send.call(this, data);
              } else {
                _send.call(this, data);
              }
            };
          }
          try {
            new File([], "");
            exports3.File = global2.File;
            exports3.FileReader = global2.FileReader;
          } catch (e) {
            try {
              exports3.File = new Function(
                'class File extends Blob {constructor(chunks, name, opts) {opts = opts || {};super(chunks, opts || {});this.name = name.replace(/\\\\//g, ":");this.lastModifiedDate = opts.lastModified ? new Date(opts.lastModified) : new Date();this.lastModified = +this.lastModifiedDate;}};return new File([], ""), File'
              )();
            } catch (e2) {
              exports3.File = function(b, d, c) {
                var blob2 = new Blob(b, c);
                var t = c && void 0 !== c.lastModified ? new Date(c.lastModified) : /* @__PURE__ */ new Date();
                blob2.name = d.replace(/\\//g, ":");
                blob2.lastModifiedDate = t;
                blob2.lastModified = +t;
                blob2.toString = function() {
                  return "[object File]";
                };
                if (strTag) {
                  blob2[strTag] = "File";
                }
                return blob2;
              };
            }
          }
        }
        __name(fixFileAndXHR, "fixFileAndXHR");
        if (blobSupported) {
          fixFileAndXHR();
          exports3.Blob = blobSupportsArrayBufferView ? global2.Blob : BlobConstructor;
        } else if (blobBuilderSupported) {
          fixFileAndXHR();
          exports3.Blob = BlobBuilderConstructor;
        } else {
          FakeBlobBuilder();
        }
        if (strTag) {
          if (!exports3.File.prototype[strTag])
            exports3.File.prototype[strTag] = "File";
          if (!exports3.Blob.prototype[strTag])
            exports3.Blob.prototype[strTag] = "Blob";
          if (!exports3.FileReader.prototype[strTag])
            exports3.FileReader.prototype[strTag] = "FileReader";
        }
        var blob = exports3.Blob.prototype;
        var stream;
        try {
          new ReadableStream({ type: "bytes" });
          stream = /* @__PURE__ */ __name(function stream2() {
            var position = 0;
            var blob2 = this;
            return new ReadableStream({
              type: "bytes",
              autoAllocateChunkSize: 524288,
              pull: function(controller) {
                var v = controller.byobRequest.view;
                var chunk = blob2.slice(position, position + v.byteLength);
                return chunk.arrayBuffer().then(function(buffer) {
                  var uint8array = new Uint8Array(buffer);
                  var bytesRead = uint8array.byteLength;
                  position += bytesRead;
                  v.set(uint8array);
                  controller.byobRequest.respond(bytesRead);
                  if (position >= blob2.size)
                    controller.close();
                });
              }
            });
          }, "stream");
        } catch (e) {
          try {
            new ReadableStream({});
            stream = /* @__PURE__ */ __name(function stream2(blob2) {
              var position = 0;
              return new ReadableStream({
                pull: function(controller) {
                  var chunk = blob2.slice(position, position + 524288);
                  return chunk.arrayBuffer().then(function(buffer) {
                    position += buffer.byteLength;
                    var uint8array = new Uint8Array(buffer);
                    controller.enqueue(uint8array);
                    if (position == blob2.size)
                      controller.close();
                  });
                }
              });
            }, "stream");
          } catch (e2) {
            try {
              new Response("").body.getReader().read();
              stream = /* @__PURE__ */ __name(function stream2() {
                return new Response(this).body;
              }, "stream");
            } catch (e3) {
              stream = /* @__PURE__ */ __name(function stream2() {
                throw new Error("Include https://github.com/MattiasBuelens/web-streams-polyfill");
              }, "stream");
            }
          }
        }
        function promisify(obj) {
          return new Promise(function(resolve, reject) {
            obj.onload = obj.onerror = function(evt) {
              obj.onload = obj.onerror = null;
              evt.type === "load" ? resolve(obj.result || obj) : reject(new Error("Failed to read the blob/file"));
            };
          });
        }
        __name(promisify, "promisify");
        if (!blob.arrayBuffer) {
          blob.arrayBuffer = /* @__PURE__ */ __name(function arrayBuffer() {
            var fr = new FileReader();
            fr.readAsArrayBuffer(this);
            return promisify(fr);
          }, "arrayBuffer");
        }
        if (!blob.text) {
          blob.text = /* @__PURE__ */ __name(function text() {
            var fr = new FileReader();
            fr.readAsText(this);
            return promisify(fr);
          }, "text");
        }
        if (!blob.stream) {
          blob.stream = stream;
        }
      });
    })(
      typeof self !== "undefined" && self || typeof window !== "undefined" && window || typeof global !== "undefined" && global || exports2
    );
  }
});

// src/primitives/blob.js
var blob_exports = {};
__export(blob_exports, {
  Blob: () => import_blob_polyfill.Blob
});
module.exports = __toCommonJS(blob_exports);
init_define_process();
var import_blob_polyfill = __toESM(require_Blob());
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Blob
});
`;
  }
});

// ../primitives/dist/structured-clone.js.text.js
var require_structured_clone_js_text = __commonJS({
  "../primitives/dist/structured-clone.js.text.js"(exports2, module2) {
    "use strict";
    module2.exports = '"use strict";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, "name", { value, configurable: true });\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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\n\n// src/primitives/structured-clone.js\nvar structured_clone_exports = {};\n__export(structured_clone_exports, {\n  structuredClone: () => structuredClone2\n});\nmodule.exports = __toCommonJS(structured_clone_exports);\n\n// ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/types.js\nvar VOID = -1;\nvar PRIMITIVE = 0;\nvar ARRAY = 1;\nvar OBJECT = 2;\nvar DATE = 3;\nvar REGEXP = 4;\nvar MAP = 5;\nvar SET = 6;\nvar ERROR = 7;\nvar BIGINT = 8;\n\n// ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/deserialize.js\nvar env = typeof self === "object" ? self : globalThis;\nvar deserializer = /* @__PURE__ */ __name(($, _) => {\n  const as = /* @__PURE__ */ __name((out, index) => {\n    $.set(index, out);\n    return out;\n  }, "as");\n  const unpair = /* @__PURE__ */ __name((index) => {\n    if ($.has(index))\n      return $.get(index);\n    const [type, value] = _[index];\n    switch (type) {\n      case PRIMITIVE:\n      case VOID:\n        return as(value, index);\n      case ARRAY: {\n        const arr = as([], index);\n        for (const index2 of value)\n          arr.push(unpair(index2));\n        return arr;\n      }\n      case OBJECT: {\n        const object = as({}, index);\n        for (const [key, index2] of value)\n          object[unpair(key)] = unpair(index2);\n        return object;\n      }\n      case DATE:\n        return as(new Date(value), index);\n      case REGEXP: {\n        const { source, flags } = value;\n        return as(new RegExp(source, flags), index);\n      }\n      case MAP: {\n        const map = as(/* @__PURE__ */ new Map(), index);\n        for (const [key, index2] of value)\n          map.set(unpair(key), unpair(index2));\n        return map;\n      }\n      case SET: {\n        const set = as(/* @__PURE__ */ new Set(), index);\n        for (const index2 of value)\n          set.add(unpair(index2));\n        return set;\n      }\n      case ERROR: {\n        const { name, message } = value;\n        return as(new env[name](message), index);\n      }\n      case BIGINT:\n        return as(BigInt(value), index);\n      case "BigInt":\n        return as(Object(BigInt(value)), index);\n    }\n    return as(new env[type](value), index);\n  }, "unpair");\n  return unpair;\n}, "deserializer");\nvar deserialize = /* @__PURE__ */ __name((serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0), "deserialize");\n\n// ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/serialize.js\nvar EMPTY = "";\nvar { toString } = {};\nvar { keys } = Object;\nvar typeOf = /* @__PURE__ */ __name((value) => {\n  const type = typeof value;\n  if (type !== "object" || !value)\n    return [PRIMITIVE, type];\n  const asString = toString.call(value).slice(8, -1);\n  switch (asString) {\n    case "Array":\n      return [ARRAY, EMPTY];\n    case "Object":\n      return [OBJECT, EMPTY];\n    case "Date":\n      return [DATE, EMPTY];\n    case "RegExp":\n      return [REGEXP, EMPTY];\n    case "Map":\n      return [MAP, EMPTY];\n    case "Set":\n      return [SET, EMPTY];\n  }\n  if (asString.includes("Array"))\n    return [ARRAY, asString];\n  if (asString.includes("Error"))\n    return [ERROR, asString];\n  return [OBJECT, asString];\n}, "typeOf");\nvar shouldSkip = /* @__PURE__ */ __name(([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol"), "shouldSkip");\nvar serializer = /* @__PURE__ */ __name((strict, json, $, _) => {\n  const as = /* @__PURE__ */ __name((out, value) => {\n    const index = _.push(out) - 1;\n    $.set(value, index);\n    return index;\n  }, "as");\n  const pair = /* @__PURE__ */ __name((value) => {\n    if ($.has(value))\n      return $.get(value);\n    let [TYPE, type] = typeOf(value);\n    switch (TYPE) {\n      case PRIMITIVE: {\n        let entry = value;\n        switch (type) {\n          case "bigint":\n            TYPE = BIGINT;\n            entry = value.toString();\n            break;\n          case "function":\n          case "symbol":\n            if (strict)\n              throw new TypeError("unable to serialize " + type);\n            entry = null;\n            break;\n          case "undefined":\n            return as([VOID], value);\n        }\n        return as([TYPE, entry], value);\n      }\n      case ARRAY: {\n        if (type)\n          return as([type, [...value]], value);\n        const arr = [];\n        const index = as([TYPE, arr], value);\n        for (const entry of value)\n          arr.push(pair(entry));\n        return index;\n      }\n      case OBJECT: {\n        if (type) {\n          switch (type) {\n            case "BigInt":\n              return as([type, value.toString()], value);\n            case "Boolean":\n            case "Number":\n            case "String":\n              return as([type, value.valueOf()], value);\n          }\n        }\n        if (json && "toJSON" in value)\n          return pair(value.toJSON());\n        const entries = [];\n        const index = as([TYPE, entries], value);\n        for (const key of keys(value)) {\n          if (strict || !shouldSkip(typeOf(value[key])))\n            entries.push([pair(key), pair(value[key])]);\n        }\n        return index;\n      }\n      case DATE:\n        return as([TYPE, value.toISOString()], value);\n      case REGEXP: {\n        const { source, flags } = value;\n        return as([TYPE, { source, flags }], value);\n      }\n      case MAP: {\n        const entries = [];\n        const index = as([TYPE, entries], value);\n        for (const [key, entry] of value) {\n          if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))\n            entries.push([pair(key), pair(entry)]);\n        }\n        return index;\n      }\n      case SET: {\n        const entries = [];\n        const index = as([TYPE, entries], value);\n        for (const entry of value) {\n          if (strict || !shouldSkip(typeOf(entry)))\n            entries.push(pair(entry));\n        }\n        return index;\n      }\n    }\n    const { message } = value;\n    return as([TYPE, { name: type, message }], value);\n  }, "pair");\n  return pair;\n}, "serializer");\nvar serialize = /* @__PURE__ */ __name((value, { json, lossy } = {}) => {\n  const _ = [];\n  return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;\n}, "serialize");\n\n// ../../node_modules/.pnpm/@ungap+structured-clone@1.2.0/node_modules/@ungap/structured-clone/esm/index.js\nvar esm_default = typeof structuredClone === "function" ? (\n  /* c8 ignore start */\n  (any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any)\n) : (any, options) => deserialize(serialize(any, options));\n\n// src/primitives/structured-clone.js\nfunction structuredClone2(value, options) {\n  if (value instanceof ReadableStream) {\n    const transform = new TransformStream({});\n    value.pipeTo(transform.writable);\n    return transform.readable;\n  }\n  return esm_default(value, options);\n}\n__name(structuredClone2, "structuredClone");\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  structuredClone\n});\n';
  }
});

// ../primitives/dist/fetch.js.text.js
var require_fetch_js_text = __commonJS({
  "../primitives/dist/fetch.js.text.js"(exports2, module2) {
    "use strict";
    module2.exports = '"use strict";\nvar __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 __esm = (fn, res) => function __init() {\n  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;\n};\nvar __commonJS = (cb, mod) => function __require() {\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 __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));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\nvar __accessCheck = (obj, member, msg) => {\n  if (!member.has(obj))\n    throw TypeError("Cannot " + msg);\n};\nvar __privateGet = (obj, member, getter) => {\n  __accessCheck(obj, member, "read from private field");\n  return getter ? getter.call(obj) : member.get(obj);\n};\nvar __privateAdd = (obj, member, value) => {\n  if (member.has(obj))\n    throw TypeError("Cannot add the same private member more than once");\n  member instanceof WeakSet ? member.add(obj) : member.set(obj, value);\n};\nvar __privateSet = (obj, member, value, setter) => {\n  __accessCheck(obj, member, "write to private field");\n  setter ? setter.call(obj, value) : member.set(obj, value);\n  return value;\n};\nvar __privateMethod = (obj, member, method) => {\n  __accessCheck(obj, member, "access private method");\n  return method;\n};\n\n// <define:process>\nvar define_process_default;\nvar init_define_process = __esm({\n  "<define:process>"() {\n    define_process_default = { env: {}, versions: { node: "16.6.0" } };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/symbols.js\nvar require_symbols = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/symbols.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    module2.exports = {\n      kUrl: Symbol("url"),\n      kHeaders: Symbol("headers"),\n      kSignal: Symbol("signal"),\n      kState: Symbol("state"),\n      kGuard: Symbol("guard"),\n      kRealm: Symbol("realm")\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/core/symbols.js\nvar require_symbols2 = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/core/symbols.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    module2.exports = {\n      kClose: Symbol("close"),\n      kDestroy: Symbol("destroy"),\n      kDispatch: Symbol("dispatch"),\n      kUrl: Symbol("url"),\n      kWriting: Symbol("writing"),\n      kResuming: Symbol("resuming"),\n      kQueue: Symbol("queue"),\n      kConnect: Symbol("connect"),\n      kConnecting: Symbol("connecting"),\n      kHeadersList: Symbol("headers list"),\n      kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"),\n      kKeepAliveMaxTimeout: Symbol("max keep alive timeout"),\n      kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"),\n      kKeepAliveTimeoutValue: Symbol("keep alive timeout"),\n      kKeepAlive: Symbol("keep alive"),\n      kHeadersTimeout: Symbol("headers timeout"),\n      kBodyTimeout: Symbol("body timeout"),\n      kServerName: Symbol("server name"),\n      kLocalAddress: Symbol("local address"),\n      kHost: Symbol("host"),\n      kNoRef: Symbol("no ref"),\n      kBodyUsed: Symbol("used"),\n      kRunning: Symbol("running"),\n      kBlocking: Symbol("blocking"),\n      kPending: Symbol("pending"),\n      kSize: Symbol("size"),\n      kBusy: Symbol("busy"),\n      kQueued: Symbol("queued"),\n      kFree: Symbol("free"),\n      kConnected: Symbol("connected"),\n      kClosed: Symbol("closed"),\n      kNeedDrain: Symbol("need drain"),\n      kReset: Symbol("reset"),\n      kDestroyed: Symbol.for("nodejs.stream.destroyed"),\n      kMaxHeadersSize: Symbol("max headers size"),\n      kRunningIdx: Symbol("running index"),\n      kPendingIdx: Symbol("pending index"),\n      kError: Symbol("error"),\n      kClients: Symbol("clients"),\n      kClient: Symbol("client"),\n      kParser: Symbol("parser"),\n      kOnDestroyed: Symbol("destroy callbacks"),\n      kPipelining: Symbol("pipelining"),\n      kSocket: Symbol("socket"),\n      kHostHeader: Symbol("host header"),\n      kConnector: Symbol("connector"),\n      kStrictContentLength: Symbol("strict content length"),\n      kMaxRedirections: Symbol("maxRedirections"),\n      kMaxRequests: Symbol("maxRequestsPerClient"),\n      kProxy: Symbol("proxy agent options"),\n      kCounter: Symbol("socket request counter"),\n      kInterceptors: Symbol("dispatch interceptors"),\n      kMaxResponseSize: Symbol("max response size")\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/core/errors.js\nvar require_errors = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/core/errors.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var _UndiciError = class _UndiciError extends Error {\n      constructor(message) {\n        super(message);\n        this.name = "UndiciError";\n        this.code = "UND_ERR";\n      }\n    };\n    __name(_UndiciError, "UndiciError");\n    var UndiciError = _UndiciError;\n    var _ConnectTimeoutError = class _ConnectTimeoutError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _ConnectTimeoutError);\n        this.name = "ConnectTimeoutError";\n        this.message = message || "Connect Timeout Error";\n        this.code = "UND_ERR_CONNECT_TIMEOUT";\n      }\n    };\n    __name(_ConnectTimeoutError, "ConnectTimeoutError");\n    var ConnectTimeoutError = _ConnectTimeoutError;\n    var _HeadersTimeoutError = class _HeadersTimeoutError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _HeadersTimeoutError);\n        this.name = "HeadersTimeoutError";\n        this.message = message || "Headers Timeout Error";\n        this.code = "UND_ERR_HEADERS_TIMEOUT";\n      }\n    };\n    __name(_HeadersTimeoutError, "HeadersTimeoutError");\n    var HeadersTimeoutError = _HeadersTimeoutError;\n    var _HeadersOverflowError = class _HeadersOverflowError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _HeadersOverflowError);\n        this.name = "HeadersOverflowError";\n        this.message = message || "Headers Overflow Error";\n        this.code = "UND_ERR_HEADERS_OVERFLOW";\n      }\n    };\n    __name(_HeadersOverflowError, "HeadersOverflowError");\n    var HeadersOverflowError = _HeadersOverflowError;\n    var _BodyTimeoutError = class _BodyTimeoutError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _BodyTimeoutError);\n        this.name = "BodyTimeoutError";\n        this.message = message || "Body Timeout Error";\n        this.code = "UND_ERR_BODY_TIMEOUT";\n      }\n    };\n    __name(_BodyTimeoutError, "BodyTimeoutError");\n    var BodyTimeoutError = _BodyTimeoutError;\n    var _ResponseStatusCodeError = class _ResponseStatusCodeError extends UndiciError {\n      constructor(message, statusCode, headers, body) {\n        super(message);\n        Error.captureStackTrace(this, _ResponseStatusCodeError);\n        this.name = "ResponseStatusCodeError";\n        this.message = message || "Response Status Code Error";\n        this.code = "UND_ERR_RESPONSE_STATUS_CODE";\n        this.body = body;\n        this.status = statusCode;\n        this.statusCode = statusCode;\n        this.headers = headers;\n      }\n    };\n    __name(_ResponseStatusCodeError, "ResponseStatusCodeError");\n    var ResponseStatusCodeError = _ResponseStatusCodeError;\n    var _InvalidArgumentError = class _InvalidArgumentError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _InvalidArgumentError);\n        this.name = "InvalidArgumentError";\n        this.message = message || "Invalid Argument Error";\n        this.code = "UND_ERR_INVALID_ARG";\n      }\n    };\n    __name(_InvalidArgumentError, "InvalidArgumentError");\n    var InvalidArgumentError2 = _InvalidArgumentError;\n    var _InvalidReturnValueError = class _InvalidReturnValueError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _InvalidReturnValueError);\n        this.name = "InvalidReturnValueError";\n        this.message = message || "Invalid Return Value Error";\n        this.code = "UND_ERR_INVALID_RETURN_VALUE";\n      }\n    };\n    __name(_InvalidReturnValueError, "InvalidReturnValueError");\n    var InvalidReturnValueError = _InvalidReturnValueError;\n    var _RequestAbortedError = class _RequestAbortedError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _RequestAbortedError);\n        this.name = "AbortError";\n        this.message = message || "Request aborted";\n        this.code = "UND_ERR_ABORTED";\n      }\n    };\n    __name(_RequestAbortedError, "RequestAbortedError");\n    var RequestAbortedError = _RequestAbortedError;\n    var _InformationalError = class _InformationalError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _InformationalError);\n        this.name = "InformationalError";\n        this.message = message || "Request information";\n        this.code = "UND_ERR_INFO";\n      }\n    };\n    __name(_InformationalError, "InformationalError");\n    var InformationalError = _InformationalError;\n    var _RequestContentLengthMismatchError = class _RequestContentLengthMismatchError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _RequestContentLengthMismatchError);\n        this.name = "RequestContentLengthMismatchError";\n        this.message = message || "Request body length does not match content-length header";\n        this.code = "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH";\n      }\n    };\n    __name(_RequestContentLengthMismatchError, "RequestContentLengthMismatchError");\n    var RequestContentLengthMismatchError = _RequestContentLengthMismatchError;\n    var _ResponseContentLengthMismatchError = class _ResponseContentLengthMismatchError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _ResponseContentLengthMismatchError);\n        this.name = "ResponseContentLengthMismatchError";\n        this.message = message || "Response body length does not match content-length header";\n        this.code = "UND_ERR_RES_CONTENT_LENGTH_MISMATCH";\n      }\n    };\n    __name(_ResponseContentLengthMismatchError, "ResponseContentLengthMismatchError");\n    var ResponseContentLengthMismatchError = _ResponseContentLengthMismatchError;\n    var _ClientDestroyedError = class _ClientDestroyedError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _ClientDestroyedError);\n        this.name = "ClientDestroyedError";\n        this.message = message || "The client is destroyed";\n        this.code = "UND_ERR_DESTROYED";\n      }\n    };\n    __name(_ClientDestroyedError, "ClientDestroyedError");\n    var ClientDestroyedError = _ClientDestroyedError;\n    var _ClientClosedError = class _ClientClosedError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _ClientClosedError);\n        this.name = "ClientClosedError";\n        this.message = message || "The client is closed";\n        this.code = "UND_ERR_CLOSED";\n      }\n    };\n    __name(_ClientClosedError, "ClientClosedError");\n    var ClientClosedError = _ClientClosedError;\n    var _SocketError = class _SocketError extends UndiciError {\n      constructor(message, socket) {\n        super(message);\n        Error.captureStackTrace(this, _SocketError);\n        this.name = "SocketError";\n        this.message = message || "Socket error";\n        this.code = "UND_ERR_SOCKET";\n        this.socket = socket;\n      }\n    };\n    __name(_SocketError, "SocketError");\n    var SocketError = _SocketError;\n    var _NotSupportedError = class _NotSupportedError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _NotSupportedError);\n        this.name = "NotSupportedError";\n        this.message = message || "Not supported error";\n        this.code = "UND_ERR_NOT_SUPPORTED";\n      }\n    };\n    __name(_NotSupportedError, "NotSupportedError");\n    var NotSupportedError = _NotSupportedError;\n    var _BalancedPoolMissingUpstreamError = class _BalancedPoolMissingUpstreamError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, NotSupportedError);\n        this.name = "MissingUpstreamError";\n        this.message = message || "No upstream has been added to the BalancedPool";\n        this.code = "UND_ERR_BPL_MISSING_UPSTREAM";\n      }\n    };\n    __name(_BalancedPoolMissingUpstreamError, "BalancedPoolMissingUpstreamError");\n    var BalancedPoolMissingUpstreamError = _BalancedPoolMissingUpstreamError;\n    var _HTTPParserError = class _HTTPParserError extends Error {\n      constructor(message, code, data) {\n        super(message);\n        Error.captureStackTrace(this, _HTTPParserError);\n        this.name = "HTTPParserError";\n        this.code = code ? `HPE_${code}` : void 0;\n        this.data = data ? data.toString() : void 0;\n      }\n    };\n    __name(_HTTPParserError, "HTTPParserError");\n    var HTTPParserError = _HTTPParserError;\n    var _ResponseExceededMaxSizeError = class _ResponseExceededMaxSizeError extends UndiciError {\n      constructor(message) {\n        super(message);\n        Error.captureStackTrace(this, _ResponseExceededMaxSizeError);\n        this.name = "ResponseExceededMaxSizeError";\n        this.message = message || "Response content exceeded max size";\n        this.code = "UND_ERR_RES_EXCEEDED_MAX_SIZE";\n      }\n    };\n    __name(_ResponseExceededMaxSizeError, "ResponseExceededMaxSizeError");\n    var ResponseExceededMaxSizeError = _ResponseExceededMaxSizeError;\n    module2.exports = {\n      HTTPParserError,\n      UndiciError,\n      HeadersTimeoutError,\n      HeadersOverflowError,\n      BodyTimeoutError,\n      RequestContentLengthMismatchError,\n      ConnectTimeoutError,\n      ResponseStatusCodeError,\n      InvalidArgumentError: InvalidArgumentError2,\n      InvalidReturnValueError,\n      RequestAbortedError,\n      ClientDestroyedError,\n      ClientClosedError,\n      InformationalError,\n      SocketError,\n      NotSupportedError,\n      ResponseContentLengthMismatchError,\n      BalancedPoolMissingUpstreamError,\n      ResponseExceededMaxSizeError\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/core/util.js\nvar require_util = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/core/util.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var assert = require("assert");\n    var { kDestroyed, kBodyUsed } = require_symbols2();\n    var { IncomingMessage } = require("http");\n    var stream = require("stream");\n    var net = require("net");\n    var { InvalidArgumentError: InvalidArgumentError2 } = require_errors();\n    var { Blob: Blob2 } = require("buffer");\n    var nodeUtil = require("util");\n    var { stringify } = require("querystring");\n    var [nodeMajor, nodeMinor] = define_process_default.versions.node.split(".").map((v) => Number(v));\n    function nop() {\n    }\n    __name(nop, "nop");\n    function isStream(obj) {\n      return obj && typeof obj === "object" && typeof obj.pipe === "function" && typeof obj.on === "function";\n    }\n    __name(isStream, "isStream");\n    function isBlobLike(object) {\n      return Blob2 && object instanceof Blob2 || object && typeof object === "object" && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && /^(Blob|File)$/.test(object[Symbol.toStringTag]);\n    }\n    __name(isBlobLike, "isBlobLike");\n    function buildURL(url, queryParams) {\n      if (url.includes("?") || url.includes("#")) {\n        throw new Error(\'Query params cannot be passed when url already contains "?" or "#".\');\n      }\n      const stringified = stringify(queryParams);\n      if (stringified) {\n        url += "?" + stringified;\n      }\n      return url;\n    }\n    __name(buildURL, "buildURL");\n    function parseURL(url) {\n      if (typeof url === "string") {\n        url = new URL(url);\n        if (!/^https?:/.test(url.origin || url.protocol)) {\n          throw new InvalidArgumentError2("Invalid URL protocol: the URL must start with `http:` or `https:`.");\n        }\n        return url;\n      }\n      if (!url || typeof url !== "object") {\n        throw new InvalidArgumentError2("Invalid URL: The URL argument must be a non-null object.");\n      }\n      if (url.port != null && url.port !== "" && !Number.isFinite(parseInt(url.port))) {\n        throw new InvalidArgumentError2("Invalid URL: port must be a valid integer or a string representation of an integer.");\n      }\n      if (url.path != null && typeof url.path !== "string") {\n        throw new InvalidArgumentError2("Invalid URL path: the path must be a string or null/undefined.");\n      }\n      if (url.pathname != null && typeof url.pathname !== "string") {\n        throw new InvalidArgumentError2("Invalid URL pathname: the pathname must be a string or null/undefined.");\n      }\n      if (url.hostname != null && typeof url.hostname !== "string") {\n        throw new InvalidArgumentError2("Invalid URL hostname: the hostname must be a string or null/undefined.");\n      }\n      if (url.origin != null && typeof url.origin !== "string") {\n        throw new InvalidArgumentError2("Invalid URL origin: the origin must be a string or null/undefined.");\n      }\n      if (!/^https?:/.test(url.origin || url.protocol)) {\n        throw new InvalidArgumentError2("Invalid URL protocol: the URL must start with `http:` or `https:`.");\n      }\n      if (!(url instanceof URL)) {\n        const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80;\n        let origin = url.origin != null ? url.origin : `${url.protocol}//${url.hostname}:${port}`;\n        let path = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`;\n        if (origin.endsWith("/")) {\n          origin = origin.substring(0, origin.length - 1);\n        }\n        if (path && !path.startsWith("/")) {\n          path = `/${path}`;\n        }\n        url = new URL(origin + path);\n      }\n      return url;\n    }\n    __name(parseURL, "parseURL");\n    function parseOrigin(url) {\n      url = parseURL(url);\n      if (url.pathname !== "/" || url.search || url.hash) {\n        throw new InvalidArgumentError2("invalid url");\n      }\n      return url;\n    }\n    __name(parseOrigin, "parseOrigin");\n    function getHostname(host) {\n      if (host[0] === "[") {\n        const idx2 = host.indexOf("]");\n        assert(idx2 !== -1);\n        return host.substr(1, idx2 - 1);\n      }\n      const idx = host.indexOf(":");\n      if (idx === -1)\n        return host;\n      return host.substr(0, idx);\n    }\n    __name(getHostname, "getHostname");\n    function getServerName(host) {\n      if (!host) {\n        return null;\n      }\n      assert.strictEqual(typeof host, "string");\n      const servername = getHostname(host);\n      if (net.isIP(servername)) {\n        return "";\n      }\n      return servername;\n    }\n    __name(getServerName, "getServerName");\n    function deepClone(obj) {\n      return JSON.parse(JSON.stringify(obj));\n    }\n    __name(deepClone, "deepClone");\n    function isAsyncIterable(obj) {\n      return !!(obj != null && typeof obj[Symbol.asyncIterator] === "function");\n    }\n    __name(isAsyncIterable, "isAsyncIterable");\n    function isIterable(obj) {\n      return !!(obj != null && (typeof obj[Symbol.iterator] === "function" || typeof obj[Symbol.asyncIterator] === "function"));\n    }\n    __name(isIterable, "isIterable");\n    function bodyLength(body) {\n      if (body == null) {\n        return 0;\n      } else if (isStream(body)) {\n        const state = body._readableState;\n        return state && state.ended === true && Number.isFinite(state.length) ? state.length : null;\n      } else if (isBlobLike(body)) {\n        return body.size != null ? body.size : null;\n      } else if (isBuffer(body)) {\n        return body.byteLength;\n      }\n      return null;\n    }\n    __name(bodyLength, "bodyLength");\n    function isDestroyed(stream2) {\n      return !stream2 || !!(stream2.destroyed || stream2[kDestroyed]);\n    }\n    __name(isDestroyed, "isDestroyed");\n    function isReadableAborted(stream2) {\n      const state = stream2 && stream2._readableState;\n      return isDestroyed(stream2) && state && !state.endEmitted;\n    }\n    __name(isReadableAborted, "isReadableAborted");\n    function destroy(stream2, err) {\n      if (!isStream(stream2) || isDestroyed(stream2)) {\n        return;\n      }\n      if (typeof stream2.destroy === "function") {\n        if (Object.getPrototypeOf(stream2).constructor === IncomingMessage) {\n          stream2.socket = null;\n        }\n        stream2.destroy(err);\n      } else if (err) {\n        define_process_default.nextTick((stream3, err2) => {\n          stream3.emit("error", err2);\n        }, stream2, err);\n      }\n      if (stream2.destroyed !== true) {\n        stream2[kDestroyed] = true;\n      }\n    }\n    __name(destroy, "destroy");\n    var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/;\n    function parseKeepAliveTimeout(val) {\n      const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR);\n      return m ? parseInt(m[1], 10) * 1e3 : null;\n    }\n    __name(parseKeepAliveTimeout, "parseKeepAliveTimeout");\n    function parseHeaders(headers, obj = {}) {\n      for (let i = 0; i < headers.length; i += 2) {\n        const key = headers[i].toString().toLowerCase();\n        let val = obj[key];\n        if (!val) {\n          if (Array.isArray(headers[i + 1])) {\n            obj[key] = headers[i + 1];\n          } else {\n            obj[key] = headers[i + 1].toString("utf8");\n          }\n        } else {\n          if (!Array.isArray(val)) {\n            val = [val];\n            obj[key] = val;\n          }\n          val.push(headers[i + 1].toString("utf8"));\n        }\n      }\n      if ("content-length" in obj && "content-disposition" in obj) {\n        obj["content-disposition"] = Buffer.from(obj["content-disposition"]).toString("latin1");\n      }\n      return obj;\n    }\n    __name(parseHeaders, "parseHeaders");\n    function parseRawHeaders(headers) {\n      const ret = [];\n      let hasContentLength = false;\n      let contentDispositionIdx = -1;\n      for (let n = 0; n < headers.length; n += 2) {\n        const key = headers[n + 0].toString();\n        const val = headers[n + 1].toString("utf8");\n        if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) {\n          ret.push(key, val);\n          hasContentLength = true;\n        } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) {\n          contentDispositionIdx = ret.push(key, val) - 1;\n        } else {\n          ret.push(key, val);\n        }\n      }\n      if (hasContentLength && contentDispositionIdx !== -1) {\n        ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString("latin1");\n      }\n      return ret;\n    }\n    __name(parseRawHeaders, "parseRawHeaders");\n    function isBuffer(buffer) {\n      return buffer instanceof Uint8Array || Buffer.isBuffer(buffer);\n    }\n    __name(isBuffer, "isBuffer");\n    function validateHandler(handler, method, upgrade) {\n      if (!handler || typeof handler !== "object") {\n        throw new InvalidArgumentError2("handler must be an object");\n      }\n      if (typeof handler.onConnect !== "function") {\n        throw new InvalidArgumentError2("invalid onConnect method");\n      }\n      if (typeof handler.onError !== "function") {\n        throw new InvalidArgumentError2("invalid onError method");\n      }\n      if (typeof handler.onBodySent !== "function" && handler.onBodySent !== void 0) {\n        throw new InvalidArgumentError2("invalid onBodySent method");\n      }\n      if (upgrade || method === "CONNECT") {\n        if (typeof handler.onUpgrade !== "function") {\n          throw new InvalidArgumentError2("invalid onUpgrade method");\n        }\n      } else {\n        if (typeof handler.onHeaders !== "function") {\n          throw new InvalidArgumentError2("invalid onHeaders method");\n        }\n        if (typeof handler.onData !== "function") {\n          throw new InvalidArgumentError2("invalid onData method");\n        }\n        if (typeof handler.onComplete !== "function") {\n          throw new InvalidArgumentError2("invalid onComplete method");\n        }\n      }\n    }\n    __name(validateHandler, "validateHandler");\n    function isDisturbed(body) {\n      return !!(body && (stream.isDisturbed ? stream.isDisturbed(body) || body[kBodyUsed] : body[kBodyUsed] || body.readableDidRead || body._readableState && body._readableState.dataEmitted || isReadableAborted(body)));\n    }\n    __name(isDisturbed, "isDisturbed");\n    function isErrored(body) {\n      return !!(body && (stream.isErrored ? stream.isErrored(body) : /state: \'errored\'/.test(\n        nodeUtil.inspect(body)\n      )));\n    }\n    __name(isErrored, "isErrored");\n    function isReadable(body) {\n      return !!(body && (stream.isReadable ? stream.isReadable(body) : /state: \'readable\'/.test(\n        nodeUtil.inspect(body)\n      )));\n    }\n    __name(isReadable, "isReadable");\n    function getSocketInfo(socket) {\n      return {\n        localAddress: socket.localAddress,\n        localPort: socket.localPort,\n        remoteAddress: socket.remoteAddress,\n        remotePort: socket.remotePort,\n        remoteFamily: socket.remoteFamily,\n        timeout: socket.timeout,\n        bytesWritten: socket.bytesWritten,\n        bytesRead: socket.bytesRead\n      };\n    }\n    __name(getSocketInfo, "getSocketInfo");\n    var ReadableStream;\n    function ReadableStreamFrom(iterable) {\n      if (!ReadableStream) {\n        ReadableStream = require("./streams").ReadableStream;\n      }\n      if (ReadableStream.from) {\n        return ReadableStream.from(iterable);\n      }\n      let iterator;\n      return new ReadableStream(\n        {\n          async start() {\n            iterator = iterable[Symbol.asyncIterator]();\n          },\n          async pull(controller) {\n            const { done, value } = await iterator.next();\n            if (done) {\n              queueMicrotask(() => {\n                controller.close();\n              });\n            } else {\n              const buf = Buffer.isBuffer(value) ? value : Buffer.from(value);\n              controller.enqueue(new Uint8Array(buf));\n            }\n            return controller.desiredSize > 0;\n          },\n          async cancel(reason) {\n            await iterator.return();\n          }\n        },\n        0\n      );\n    }\n    __name(ReadableStreamFrom, "ReadableStreamFrom");\n    function isFormDataLike(object) {\n      return object && typeof object === "object" && typeof object.append === "function" && typeof object.delete === "function" && typeof object.get === "function" && typeof object.getAll === "function" && typeof object.has === "function" && typeof object.set === "function" && object[Symbol.toStringTag] === "FormData";\n    }\n    __name(isFormDataLike, "isFormDataLike");\n    function throwIfAborted(signal) {\n      if (!signal) {\n        return;\n      }\n      if (typeof signal.throwIfAborted === "function") {\n        signal.throwIfAborted();\n      } else {\n        if (signal.aborted) {\n          const err = new Error("The operation was aborted");\n          err.name = "AbortError";\n          throw err;\n        }\n      }\n    }\n    __name(throwIfAborted, "throwIfAborted");\n    var events;\n    function addAbortListener(signal, listener) {\n      if (typeof Symbol.dispose === "symbol") {\n        if (!events) {\n          events = require("events");\n        }\n        if (typeof events.addAbortListener === "function" && "aborted" in signal) {\n          return events.addAbortListener(signal, listener);\n        }\n      }\n      if ("addEventListener" in signal) {\n        signal.addEventListener("abort", listener, { once: true });\n        return () => signal.removeEventListener("abort", listener);\n      }\n      signal.addListener("abort", listener);\n      return () => signal.removeListener("abort", listener);\n    }\n    __name(addAbortListener, "addAbortListener");\n    var hasToWellFormed = !!String.prototype.toWellFormed;\n    function toUSVString(val) {\n      if (hasToWellFormed) {\n        return `${val}`.toWellFormed();\n      } else if (nodeUtil.toUSVString) {\n        return nodeUtil.toUSVString(val);\n      }\n      return `${val}`;\n    }\n    __name(toUSVString, "toUSVString");\n    var kEnumerableProperty = /* @__PURE__ */ Object.create(null);\n    kEnumerableProperty.enumerable = true;\n    module2.exports = {\n      kEnumerableProperty,\n      nop,\n      isDisturbed,\n      isErrored,\n      isReadable,\n      toUSVString,\n      isReadableAborted,\n      isBlobLike,\n      parseOrigin,\n      parseURL,\n      getServerName,\n      isStream,\n      isIterable,\n      isAsyncIterable,\n      isDestroyed,\n      parseRawHeaders,\n      parseHeaders,\n      parseKeepAliveTimeout,\n      destroy,\n      bodyLength,\n      deepClone,\n      ReadableStreamFrom,\n      isBuffer,\n      validateHandler,\n      getSocketInfo,\n      isFormDataLike,\n      buildURL,\n      throwIfAborted,\n      addAbortListener,\n      nodeMajor,\n      nodeMinor,\n      nodeHasAutoSelectFamily: nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 13\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/constants.js\nvar require_constants = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/constants.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { MessageChannel, receiveMessageOnPort } = require("worker_threads");\n    var corsSafeListedMethods = ["GET", "HEAD", "POST"];\n    var nullBodyStatus = [101, 204, 205, 304];\n    var redirectStatus = [301, 302, 303, 307, 308];\n    var badPorts = [\n      "1",\n      "7",\n      "9",\n      "11",\n      "13",\n      "15",\n      "17",\n      "19",\n      "20",\n      "21",\n      "22",\n      "23",\n      "25",\n      "37",\n      "42",\n      "43",\n      "53",\n      "69",\n      "77",\n      "79",\n      "87",\n      "95",\n      "101",\n      "102",\n      "103",\n      "104",\n      "109",\n      "110",\n      "111",\n      "113",\n      "115",\n      "117",\n      "119",\n      "123",\n      "135",\n      "137",\n      "139",\n      "143",\n      "161",\n      "179",\n      "389",\n      "427",\n      "465",\n      "512",\n      "513",\n      "514",\n      "515",\n      "526",\n      "530",\n      "531",\n      "532",\n      "540",\n      "548",\n      "554",\n      "556",\n      "563",\n      "587",\n      "601",\n      "636",\n      "989",\n      "990",\n      "993",\n      "995",\n      "1719",\n      "1720",\n      "1723",\n      "2049",\n      "3659",\n      "4045",\n      "5060",\n      "5061",\n      "6000",\n      "6566",\n      "6665",\n      "6666",\n      "6667",\n      "6668",\n      "6669",\n      "6697",\n      "10080"\n    ];\n    var referrerPolicy = [\n      "",\n      "no-referrer",\n      "no-referrer-when-downgrade",\n      "same-origin",\n      "origin",\n      "strict-origin",\n      "origin-when-cross-origin",\n      "strict-origin-when-cross-origin",\n      "unsafe-url"\n    ];\n    var requestRedirect = ["follow", "manual", "error"];\n    var safeMethods = ["GET", "HEAD", "OPTIONS", "TRACE"];\n    var requestMode = ["navigate", "same-origin", "no-cors", "cors"];\n    var requestCredentials = ["omit", "same-origin", "include"];\n    var requestCache = [\n      "default",\n      "no-store",\n      "reload",\n      "no-cache",\n      "force-cache",\n      "only-if-cached"\n    ];\n    var requestBodyHeader = [\n      "content-encoding",\n      "content-language",\n      "content-location",\n      "content-type",\n      // See https://github.com/nodejs/undici/issues/2021\n      // \'Content-Length\' is a forbidden header name, which is typically\n      // removed in the Headers implementation. However, undici doesn\'t\n      // filter out headers, so we add it here.\n      "content-length"\n    ];\n    var requestDuplex = [\n      "half"\n    ];\n    var forbiddenMethods = ["CONNECT", "TRACE", "TRACK"];\n    var subresource = [\n      "audio",\n      "audioworklet",\n      "font",\n      "image",\n      "manifest",\n      "paintworklet",\n      "script",\n      "style",\n      "track",\n      "video",\n      "xslt",\n      ""\n    ];\n    var DOMException = globalThis.DOMException ?? (() => {\n      try {\n        atob("~");\n      } catch (err) {\n        return Object.getPrototypeOf(err).constructor;\n      }\n    })();\n    var channel;\n    var structuredClone = globalThis.structuredClone ?? // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js\n    // structuredClone was added in v17.0.0, but fetch supports v16.8\n    /* @__PURE__ */ __name(function structuredClone2(value, options = void 0) {\n      if (arguments.length === 0) {\n        throw new TypeError("missing argument");\n      }\n      if (!channel) {\n        channel = new MessageChannel();\n      }\n      channel.port1.unref();\n      channel.port2.unref();\n      channel.port1.postMessage(value, options?.transfer);\n      return receiveMessageOnPort(channel.port2).message;\n    }, "structuredClone");\n    module2.exports = {\n      DOMException,\n      structuredClone,\n      subresource,\n      forbiddenMethods,\n      requestBodyHeader,\n      referrerPolicy,\n      requestRedirect,\n      requestMode,\n      requestCredentials,\n      requestCache,\n      redirectStatus,\n      corsSafeListedMethods,\n      nullBodyStatus,\n      safeMethods,\n      badPorts,\n      requestDuplex\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/global.js\nvar require_global = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/global.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var globalOrigin = Symbol.for("undici.globalOrigin.1");\n    function getGlobalOrigin() {\n      return globalThis[globalOrigin];\n    }\n    __name(getGlobalOrigin, "getGlobalOrigin");\n    function setGlobalOrigin(newOrigin) {\n      if (newOrigin !== void 0 && typeof newOrigin !== "string" && !(newOrigin instanceof URL)) {\n        throw new Error("Invalid base url");\n      }\n      if (newOrigin === void 0) {\n        Object.defineProperty(globalThis, globalOrigin, {\n          value: void 0,\n          writable: true,\n          enumerable: false,\n          configurable: false\n        });\n        return;\n      }\n      const parsedURL = new URL(newOrigin);\n      if (parsedURL.protocol !== "http:" && parsedURL.protocol !== "https:") {\n        throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`);\n      }\n      Object.defineProperty(globalThis, globalOrigin, {\n        value: parsedURL,\n        writable: true,\n        enumerable: false,\n        configurable: false\n      });\n    }\n    __name(setGlobalOrigin, "setGlobalOrigin");\n    module2.exports = {\n      getGlobalOrigin,\n      setGlobalOrigin\n    };\n  }\n});\n\n// src/patches/util-types.js\nvar require_util_types = __commonJS({\n  "src/patches/util-types.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    module2.exports = require("util").types;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/util.js\nvar require_util2 = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/util.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { redirectStatus, badPorts, referrerPolicy: referrerPolicyTokens } = require_constants();\n    var { getGlobalOrigin } = require_global();\n    var { performance: performance2 } = require("perf_hooks");\n    var { isBlobLike, toUSVString, ReadableStreamFrom } = require_util();\n    var assert = require("assert");\n    var { isUint8Array } = require_util_types();\n    var crypto;\n    try {\n      crypto = require("crypto");\n    } catch {\n    }\n    function responseURL(response) {\n      const urlList = response.urlList;\n      const length = urlList.length;\n      return length === 0 ? null : urlList[length - 1].toString();\n    }\n    __name(responseURL, "responseURL");\n    function responseLocationURL(response, requestFragment) {\n      if (!redirectStatus.includes(response.status)) {\n        return null;\n      }\n      let location = response.headersList.get("location");\n      if (location !== null && isValidHeaderValue(location)) {\n        location = new URL(location, responseURL(response));\n      }\n      if (location && !location.hash) {\n        location.hash = requestFragment;\n      }\n      return location;\n    }\n    __name(responseLocationURL, "responseLocationURL");\n    function requestCurrentURL(request) {\n      return request.urlList[request.urlList.length - 1];\n    }\n    __name(requestCurrentURL, "requestCurrentURL");\n    function requestBadPort(request) {\n      const url = requestCurrentURL(request);\n      if (urlIsHttpHttpsScheme(url) && badPorts.includes(url.port)) {\n        return "blocked";\n      }\n      return "allowed";\n    }\n    __name(requestBadPort, "requestBadPort");\n    function isErrorLike(object) {\n      return object instanceof Error || (object?.constructor?.name === "Error" || object?.constructor?.name === "DOMException");\n    }\n    __name(isErrorLike, "isErrorLike");\n    function isValidReasonPhrase(statusText) {\n      for (let i = 0; i < statusText.length; ++i) {\n        const c = statusText.charCodeAt(i);\n        if (!(c === 9 || // HTAB\n        c >= 32 && c <= 126 || // SP / VCHAR\n        c >= 128 && c <= 255)) {\n          return false;\n        }\n      }\n      return true;\n    }\n    __name(isValidReasonPhrase, "isValidReasonPhrase");\n    function isTokenChar(c) {\n      return !(c >= 127 || c <= 32 || c === "(" || c === ")" || c === "<" || c === ">" || c === "@" || c === "," || c === ";" || c === ":" || c === "\\\\" || c === \'"\' || c === "/" || c === "[" || c === "]" || c === "?" || c === "=" || c === "{" || c === "}");\n    }\n    __name(isTokenChar, "isTokenChar");\n    function isValidHTTPToken(characters) {\n      if (!characters || typeof characters !== "string") {\n        return false;\n      }\n      for (let i = 0; i < characters.length; ++i) {\n        const c = characters.charCodeAt(i);\n        if (c > 127 || !isTokenChar(c)) {\n          return false;\n        }\n      }\n      return true;\n    }\n    __name(isValidHTTPToken, "isValidHTTPToken");\n    function isValidHeaderName2(potentialValue) {\n      if (potentialValue.length === 0) {\n        return false;\n      }\n      return isValidHTTPToken(potentialValue);\n    }\n    __name(isValidHeaderName2, "isValidHeaderName");\n    function isValidHeaderValue(potentialValue) {\n      if (potentialValue.startsWith("	") || potentialValue.startsWith(" ") || potentialValue.endsWith("	") || potentialValue.endsWith(" ")) {\n        return false;\n      }\n      if (potentialValue.includes("\\0") || potentialValue.includes("\\r") || potentialValue.includes("\\n")) {\n        return false;\n      }\n      return true;\n    }\n    __name(isValidHeaderValue, "isValidHeaderValue");\n    function setRequestReferrerPolicyOnRedirect(request, actualResponse) {\n      const { headersList } = actualResponse;\n      const policyHeader = (headersList.get("referrer-policy") ?? "").split(",");\n      let policy = "";\n      if (policyHeader.length > 0) {\n        for (let i = policyHeader.length; i !== 0; i--) {\n          const token = policyHeader[i - 1].trim();\n          if (referrerPolicyTokens.includes(token)) {\n            policy = token;\n            break;\n          }\n        }\n      }\n      if (policy !== "") {\n        request.referrerPolicy = policy;\n      }\n    }\n    __name(setRequestReferrerPolicyOnRedirect, "setRequestReferrerPolicyOnRedirect");\n    function crossOriginResourcePolicyCheck() {\n      return "allowed";\n    }\n    __name(crossOriginResourcePolicyCheck, "crossOriginResourcePolicyCheck");\n    function corsCheck() {\n      return "success";\n    }\n    __name(corsCheck, "corsCheck");\n    function TAOCheck() {\n      return "success";\n    }\n    __name(TAOCheck, "TAOCheck");\n    function appendFetchMetadata(httpRequest) {\n      let header = null;\n      header = httpRequest.mode;\n      httpRequest.headersList.set("sec-fetch-mode", header);\n    }\n    __name(appendFetchMetadata, "appendFetchMetadata");\n    function appendRequestOriginHeader(request) {\n      let serializedOrigin = request.origin;\n      if (request.responseTainting === "cors" || request.mode === "websocket") {\n        if (serializedOrigin) {\n          request.headersList.append("origin", serializedOrigin);\n        }\n      } else if (request.method !== "GET" && request.method !== "HEAD") {\n        switch (request.referrerPolicy) {\n          case "no-referrer":\n            serializedOrigin = null;\n            break;\n          case "no-referrer-when-downgrade":\n          case "strict-origin":\n          case "strict-origin-when-cross-origin":\n            if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n              serializedOrigin = null;\n            }\n            break;\n          case "same-origin":\n            if (!sameOrigin(request, requestCurrentURL(request))) {\n              serializedOrigin = null;\n            }\n            break;\n          default:\n        }\n        if (serializedOrigin) {\n          request.headersList.append("origin", serializedOrigin);\n        }\n      }\n    }\n    __name(appendRequestOriginHeader, "appendRequestOriginHeader");\n    function coarsenedSharedCurrentTime(crossOriginIsolatedCapability) {\n      return performance2.now();\n    }\n    __name(coarsenedSharedCurrentTime, "coarsenedSharedCurrentTime");\n    function createOpaqueTimingInfo(timingInfo) {\n      return {\n        startTime: timingInfo.startTime ?? 0,\n        redirectStartTime: 0,\n        redirectEndTime: 0,\n        postRedirectStartTime: timingInfo.startTime ?? 0,\n        finalServiceWorkerStartTime: 0,\n        finalNetworkResponseStartTime: 0,\n        finalNetworkRequestStartTime: 0,\n        endTime: 0,\n        encodedBodySize: 0,\n        decodedBodySize: 0,\n        finalConnectionTimingInfo: null\n      };\n    }\n    __name(createOpaqueTimingInfo, "createOpaqueTimingInfo");\n    function makePolicyContainer() {\n      return {\n        referrerPolicy: "strict-origin-when-cross-origin"\n      };\n    }\n    __name(makePolicyContainer, "makePolicyContainer");\n    function clonePolicyContainer(policyContainer) {\n      return {\n        referrerPolicy: policyContainer.referrerPolicy\n      };\n    }\n    __name(clonePolicyContainer, "clonePolicyContainer");\n    function determineRequestsReferrer(request) {\n      const policy = request.referrerPolicy;\n      assert(policy);\n      let referrerSource = null;\n      if (request.referrer === "client") {\n        const globalOrigin = getGlobalOrigin();\n        if (!globalOrigin || globalOrigin.origin === "null") {\n          return "no-referrer";\n        }\n        referrerSource = new URL(globalOrigin);\n      } else if (request.referrer instanceof URL) {\n        referrerSource = request.referrer;\n      }\n      let referrerURL = stripURLForReferrer(referrerSource);\n      const referrerOrigin = stripURLForReferrer(referrerSource, true);\n      if (referrerURL.toString().length > 4096) {\n        referrerURL = referrerOrigin;\n      }\n      const areSameOrigin = sameOrigin(request, referrerURL);\n      const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(request.url);\n      switch (policy) {\n        case "origin":\n          return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true);\n        case "unsafe-url":\n          return referrerURL;\n        case "same-origin":\n          return areSameOrigin ? referrerOrigin : "no-referrer";\n        case "origin-when-cross-origin":\n          return areSameOrigin ? referrerURL : referrerOrigin;\n        case "strict-origin-when-cross-origin": {\n          const currentURL = requestCurrentURL(request);\n          if (sameOrigin(referrerURL, currentURL)) {\n            return referrerURL;\n          }\n          if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n            return "no-referrer";\n          }\n          return referrerOrigin;\n        }\n        case "strict-origin":\n        case "no-referrer-when-downgrade":\n        default:\n          return isNonPotentiallyTrustWorthy ? "no-referrer" : referrerOrigin;\n      }\n    }\n    __name(determineRequestsReferrer, "determineRequestsReferrer");\n    function stripURLForReferrer(url, originOnly) {\n      assert(url instanceof URL);\n      if (url.protocol === "file:" || url.protocol === "about:" || url.protocol === "blank:") {\n        return "no-referrer";\n      }\n      url.username = "";\n      url.password = "";\n      url.hash = "";\n      if (originOnly) {\n        url.pathname = "";\n        url.search = "";\n      }\n      return url;\n    }\n    __name(stripURLForReferrer, "stripURLForReferrer");\n    function isURLPotentiallyTrustworthy(url) {\n      if (!(url instanceof URL)) {\n        return false;\n      }\n      if (url.href === "about:blank" || url.href === "about:srcdoc") {\n        return true;\n      }\n      if (url.protocol === "data:")\n        return true;\n      if (url.protocol === "file:")\n        return true;\n      return isOriginPotentiallyTrustworthy(url.origin);\n      function isOriginPotentiallyTrustworthy(origin) {\n        if (origin == null || origin === "null")\n          return false;\n        const originAsURL = new URL(origin);\n        if (originAsURL.protocol === "https:" || originAsURL.protocol === "wss:") {\n          return true;\n        }\n        if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) || (originAsURL.hostname === "localhost" || originAsURL.hostname.includes("localhost.")) || originAsURL.hostname.endsWith(".localhost")) {\n          return true;\n        }\n        return false;\n      }\n      __name(isOriginPotentiallyTrustworthy, "isOriginPotentiallyTrustworthy");\n    }\n    __name(isURLPotentiallyTrustworthy, "isURLPotentiallyTrustworthy");\n    function bytesMatch(bytes, metadataList) {\n      if (crypto === void 0) {\n        return true;\n      }\n      const parsedMetadata = parseMetadata(metadataList);\n      if (parsedMetadata === "no metadata") {\n        return true;\n      }\n      if (parsedMetadata.length === 0) {\n        return true;\n      }\n      const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo));\n      const strongest = list[0].algo;\n      const metadata = list.filter((item) => item.algo === strongest);\n      for (const item of metadata) {\n        const algorithm = item.algo;\n        const expectedValue = item.hash;\n        const actualValue = crypto.createHash(algorithm).update(bytes).digest("base64");\n        if (actualValue === expectedValue) {\n          return true;\n        }\n      }\n      return false;\n    }\n    __name(bytesMatch, "bytesMatch");\n    var parseHashWithOptions = /((?<algo>sha256|sha384|sha512)-(?<hash>[A-z0-9+/]{1}.*={0,2}))( +[\\x21-\\x7e]?)?/i;\n    function parseMetadata(metadata) {\n      const result = [];\n      let empty = true;\n      const supportedHashes = crypto.getHashes();\n      for (const token of metadata.split(" ")) {\n        empty = false;\n        const parsedToken = parseHashWithOptions.exec(token);\n        if (parsedToken === null || parsedToken.groups === void 0) {\n          continue;\n        }\n        const algorithm = parsedToken.groups.algo;\n        if (supportedHashes.includes(algorithm.toLowerCase())) {\n          result.push(parsedToken.groups);\n        }\n      }\n      if (empty === true) {\n        return "no metadata";\n      }\n      return result;\n    }\n    __name(parseMetadata, "parseMetadata");\n    function tryUpgradeRequestToAPotentiallyTrustworthyURL(request) {\n    }\n    __name(tryUpgradeRequestToAPotentiallyTrustworthyURL, "tryUpgradeRequestToAPotentiallyTrustworthyURL");\n    function sameOrigin(A, B) {\n      if (A.origin === B.origin && A.origin === "null") {\n        return true;\n      }\n      if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n        return true;\n      }\n      return false;\n    }\n    __name(sameOrigin, "sameOrigin");\n    function createDeferredPromise() {\n      let res;\n      let rej;\n      const promise = new Promise((resolve, reject) => {\n        res = resolve;\n        rej = reject;\n      });\n      return { promise, resolve: res, reject: rej };\n    }\n    __name(createDeferredPromise, "createDeferredPromise");\n    function isAborted(fetchParams) {\n      return fetchParams.controller.state === "aborted";\n    }\n    __name(isAborted, "isAborted");\n    function isCancelled(fetchParams) {\n      return fetchParams.controller.state === "aborted" || fetchParams.controller.state === "terminated";\n    }\n    __name(isCancelled, "isCancelled");\n    function normalizeMethod(method) {\n      return /^(DELETE|GET|HEAD|OPTIONS|POST|PUT)$/i.test(method) ? method.toUpperCase() : method;\n    }\n    __name(normalizeMethod, "normalizeMethod");\n    function serializeJavascriptValueToJSONString(value) {\n      const result = JSON.stringify(value);\n      if (result === void 0) {\n        throw new TypeError("Value is not JSON serializable");\n      }\n      assert(typeof result === "string");\n      return result;\n    }\n    __name(serializeJavascriptValueToJSONString, "serializeJavascriptValueToJSONString");\n    var esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()));\n    function makeIterator(iterator, name, kind) {\n      const object = {\n        index: 0,\n        kind,\n        target: iterator\n      };\n      const i = {\n        next() {\n          if (Object.getPrototypeOf(this) !== i) {\n            throw new TypeError(\n              `\'next\' called on an object that does not implement interface ${name} Iterator.`\n            );\n          }\n          const { index, kind: kind2, target } = object;\n          const values = target();\n          const len = values.length;\n          if (index >= len) {\n            return { value: void 0, done: true };\n          }\n          const pair = values[index];\n          object.index = index + 1;\n          return iteratorResult(pair, kind2);\n        },\n        // The class string of an iterator prototype object for a given interface is the\n        // result of concatenating the identifier of the interface and the string " Iterator".\n        [Symbol.toStringTag]: `${name} Iterator`\n      };\n      Object.setPrototypeOf(i, esIteratorPrototype);\n      return Object.setPrototypeOf({}, i);\n    }\n    __name(makeIterator, "makeIterator");\n    function iteratorResult(pair, kind) {\n      let result;\n      switch (kind) {\n        case "key": {\n          result = pair[0];\n          break;\n        }\n        case "value": {\n          result = pair[1];\n          break;\n        }\n        case "key+value": {\n          result = pair;\n          break;\n        }\n      }\n      return { value: result, done: false };\n    }\n    __name(iteratorResult, "iteratorResult");\n    function fullyReadBody(body, processBody, processBodyError) {\n      const successSteps = /* @__PURE__ */ __name((bytes) => queueMicrotask(() => processBody(bytes)), "successSteps");\n      const errorSteps = /* @__PURE__ */ __name((error) => queueMicrotask(() => processBodyError(error)), "errorSteps");\n      let reader;\n      try {\n        reader = body.stream.getReader();\n      } catch (e) {\n        errorSteps(e);\n        return;\n      }\n      readAllBytes(reader, successSteps, errorSteps);\n    }\n    __name(fullyReadBody, "fullyReadBody");\n    var ReadableStream = globalThis.ReadableStream;\n    function isReadableStreamLike(stream) {\n      if (!ReadableStream) {\n        ReadableStream = require("./streams").ReadableStream;\n      }\n      return stream instanceof ReadableStream || stream[Symbol.toStringTag] === "ReadableStream" && typeof stream.tee === "function";\n    }\n    __name(isReadableStreamLike, "isReadableStreamLike");\n    var MAXIMUM_ARGUMENT_LENGTH = 65535;\n    function isomorphicDecode(input) {\n      if (input.length < MAXIMUM_ARGUMENT_LENGTH) {\n        return String.fromCharCode(...input);\n      }\n      return input.reduce((previous, current) => previous + String.fromCharCode(current), "");\n    }\n    __name(isomorphicDecode, "isomorphicDecode");\n    function readableStreamClose(controller) {\n      try {\n        controller.close();\n      } catch (err) {\n        if (!err.message.includes("Controller is already closed")) {\n          throw err;\n        }\n      }\n    }\n    __name(readableStreamClose, "readableStreamClose");\n    function isomorphicEncode(input) {\n      for (let i = 0; i < input.length; i++) {\n        assert(input.charCodeAt(i) <= 255);\n      }\n      return input;\n    }\n    __name(isomorphicEncode, "isomorphicEncode");\n    async function readAllBytes(reader, successSteps, failureSteps) {\n      const bytes = [];\n      let byteLength = 0;\n      while (true) {\n        let done;\n        let chunk;\n        try {\n          ({ done, value: chunk } = await reader.read());\n        } catch (e) {\n          failureSteps(e);\n          return;\n        }\n        if (done) {\n          successSteps(Buffer.concat(bytes, byteLength));\n          return;\n        }\n        if (!isUint8Array(chunk)) {\n          failureSteps(new TypeError("Received non-Uint8Array chunk"));\n          return;\n        }\n        bytes.push(chunk);\n        byteLength += chunk.length;\n      }\n    }\n    __name(readAllBytes, "readAllBytes");\n    function urlIsLocal(url) {\n      assert("protocol" in url);\n      const protocol = url.protocol;\n      return protocol === "about:" || protocol === "blob:" || protocol === "data:";\n    }\n    __name(urlIsLocal, "urlIsLocal");\n    function urlHasHttpsScheme(url) {\n      if (typeof url === "string") {\n        return url.startsWith("https:");\n      }\n      return url.protocol === "https:";\n    }\n    __name(urlHasHttpsScheme, "urlHasHttpsScheme");\n    function urlIsHttpHttpsScheme(url) {\n      assert("protocol" in url);\n      const protocol = url.protocol;\n      return protocol === "http:" || protocol === "https:";\n    }\n    __name(urlIsHttpHttpsScheme, "urlIsHttpHttpsScheme");\n    var hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key));\n    module2.exports = {\n      isAborted,\n      isCancelled,\n      createDeferredPromise,\n      ReadableStreamFrom,\n      toUSVString,\n      tryUpgradeRequestToAPotentiallyTrustworthyURL,\n      coarsenedSharedCurrentTime,\n      determineRequestsReferrer,\n      makePolicyContainer,\n      clonePolicyContainer,\n      appendFetchMetadata,\n      appendRequestOriginHeader,\n      TAOCheck,\n      corsCheck,\n      crossOriginResourcePolicyCheck,\n      createOpaqueTimingInfo,\n      setRequestReferrerPolicyOnRedirect,\n      isValidHTTPToken,\n      requestBadPort,\n      requestCurrentURL,\n      responseURL,\n      responseLocationURL,\n      isBlobLike,\n      isURLPotentiallyTrustworthy,\n      isValidReasonPhrase,\n      sameOrigin,\n      normalizeMethod,\n      serializeJavascriptValueToJSONString,\n      makeIterator,\n      isValidHeaderName: isValidHeaderName2,\n      isValidHeaderValue,\n      hasOwn,\n      isErrorLike,\n      fullyReadBody,\n      bytesMatch,\n      isReadableStreamLike,\n      readableStreamClose,\n      isomorphicEncode,\n      isomorphicDecode,\n      urlIsLocal,\n      urlHasHttpsScheme,\n      urlIsHttpHttpsScheme,\n      readAllBytes\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/webidl.js\nvar require_webidl = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/webidl.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { types } = require("util");\n    var { hasOwn, toUSVString } = require_util2();\n    var webidl = {};\n    webidl.converters = {};\n    webidl.util = {};\n    webidl.errors = {};\n    webidl.errors.exception = function(message) {\n      return new TypeError(`${message.header}: ${message.message}`);\n    };\n    webidl.errors.conversionFailed = function(context) {\n      const plural = context.types.length === 1 ? "" : " one of";\n      const message = `${context.argument} could not be converted to${plural}: ${context.types.join(", ")}.`;\n      return webidl.errors.exception({\n        header: context.prefix,\n        message\n      });\n    };\n    webidl.errors.invalidArgument = function(context) {\n      return webidl.errors.exception({\n        header: context.prefix,\n        message: `"${context.value}" is an invalid ${context.type}.`\n      });\n    };\n    webidl.brandCheck = function(V, I, opts = void 0) {\n      if (opts?.strict !== false && !(V instanceof I)) {\n        throw new TypeError("Illegal invocation");\n      } else {\n        return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag];\n      }\n    };\n    webidl.argumentLengthCheck = function({ length }, min, ctx) {\n      if (length < min) {\n        throw webidl.errors.exception({\n          message: `${min} argument${min !== 1 ? "s" : ""} required, but${length ? " only" : ""} ${length} found.`,\n          ...ctx\n        });\n      }\n    };\n    webidl.illegalConstructor = function() {\n      throw webidl.errors.exception({\n        header: "TypeError",\n        message: "Illegal constructor"\n      });\n    };\n    webidl.util.Type = function(V) {\n      switch (typeof V) {\n        case "undefined":\n          return "Undefined";\n        case "boolean":\n          return "Boolean";\n        case "string":\n          return "String";\n        case "symbol":\n          return "Symbol";\n        case "number":\n          return "Number";\n        case "bigint":\n          return "BigInt";\n        case "function":\n        case "object": {\n          if (V === null) {\n            return "Null";\n          }\n          return "Object";\n        }\n      }\n    };\n    webidl.util.ConvertToInt = function(V, bitLength, signedness, opts = {}) {\n      let upperBound;\n      let lowerBound;\n      if (bitLength === 64) {\n        upperBound = Math.pow(2, 53) - 1;\n        if (signedness === "unsigned") {\n          lowerBound = 0;\n        } else {\n          lowerBound = Math.pow(-2, 53) + 1;\n        }\n      } else if (signedness === "unsigned") {\n        lowerBound = 0;\n        upperBound = Math.pow(2, bitLength) - 1;\n      } else {\n        lowerBound = Math.pow(-2, bitLength) - 1;\n        upperBound = Math.pow(2, bitLength - 1) - 1;\n      }\n      let x = Number(V);\n      if (x === 0) {\n        x = 0;\n      }\n      if (opts.enforceRange === true) {\n        if (Number.isNaN(x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) {\n          throw webidl.errors.exception({\n            header: "Integer conversion",\n            message: `Could not convert ${V} to an integer.`\n          });\n        }\n        x = webidl.util.IntegerPart(x);\n        if (x < lowerBound || x > upperBound) {\n          throw webidl.errors.exception({\n            header: "Integer conversion",\n            message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n          });\n        }\n        return x;\n      }\n      if (!Number.isNaN(x) && opts.clamp === true) {\n        x = Math.min(Math.max(x, lowerBound), upperBound);\n        if (Math.floor(x) % 2 === 0) {\n          x = Math.floor(x);\n        } else {\n          x = Math.ceil(x);\n        }\n        return x;\n      }\n      if (Number.isNaN(x) || x === 0 && Object.is(0, x) || x === Number.POSITIVE_INFINITY || x === Number.NEGATIVE_INFINITY) {\n        return 0;\n      }\n      x = webidl.util.IntegerPart(x);\n      x = x % Math.pow(2, bitLength);\n      if (signedness === "signed" && x >= Math.pow(2, bitLength) - 1) {\n        return x - Math.pow(2, bitLength);\n      }\n      return x;\n    };\n    webidl.util.IntegerPart = function(n) {\n      const r = Math.floor(Math.abs(n));\n      if (n < 0) {\n        return -1 * r;\n      }\n      return r;\n    };\n    webidl.sequenceConverter = function(converter) {\n      return (V) => {\n        if (webidl.util.Type(V) !== "Object") {\n          throw webidl.errors.exception({\n            header: "Sequence",\n            message: `Value of type ${webidl.util.Type(V)} is not an Object.`\n          });\n        }\n        const method = V?.[Symbol.iterator]?.();\n        const seq = [];\n        if (method === void 0 || typeof method.next !== "function") {\n          throw webidl.errors.exception({\n            header: "Sequence",\n            message: "Object is not an iterator."\n          });\n        }\n        while (true) {\n          const { done, value } = method.next();\n          if (done) {\n            break;\n          }\n          seq.push(converter(value));\n        }\n        return seq;\n      };\n    };\n    webidl.recordConverter = function(keyConverter, valueConverter) {\n      return (O) => {\n        if (webidl.util.Type(O) !== "Object") {\n          throw webidl.errors.exception({\n            header: "Record",\n            message: `Value of type ${webidl.util.Type(O)} is not an Object.`\n          });\n        }\n        const result = {};\n        if (!types.isProxy(O)) {\n          const keys2 = Object.keys(O);\n          for (const key of keys2) {\n            const typedKey = keyConverter(key);\n            const typedValue = valueConverter(O[key]);\n            result[typedKey] = typedValue;\n          }\n          return result;\n        }\n        const keys = Reflect.ownKeys(O);\n        for (const key of keys) {\n          const desc = Reflect.getOwnPropertyDescriptor(O, key);\n          if (desc?.enumerable) {\n            const typedKey = keyConverter(key);\n            const typedValue = valueConverter(O[key]);\n            result[typedKey] = typedValue;\n          }\n        }\n        return result;\n      };\n    };\n    webidl.interfaceConverter = function(i) {\n      return (V, opts = {}) => {\n        if (opts.strict !== false && !(V instanceof i)) {\n          throw webidl.errors.exception({\n            header: i.name,\n            message: `Expected ${V} to be an instance of ${i.name}.`\n          });\n        }\n        return V;\n      };\n    };\n    webidl.dictionaryConverter = function(converters) {\n      return (dictionary) => {\n        const type = webidl.util.Type(dictionary);\n        const dict = {};\n        if (type === "Null" || type === "Undefined") {\n          return dict;\n        } else if (type !== "Object") {\n          throw webidl.errors.exception({\n            header: "Dictionary",\n            message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n          });\n        }\n        for (const options of converters) {\n          const { key, defaultValue, required, converter } = options;\n          if (required === true) {\n            if (!hasOwn(dictionary, key)) {\n              throw webidl.errors.exception({\n                header: "Dictionary",\n                message: `Missing required key "${key}".`\n              });\n            }\n          }\n          let value = dictionary[key];\n          const hasDefault = hasOwn(options, "defaultValue");\n          if (hasDefault && value !== null) {\n            value = value ?? defaultValue;\n          }\n          if (required || hasDefault || value !== void 0) {\n            value = converter(value);\n            if (options.allowedValues && !options.allowedValues.includes(value)) {\n              throw webidl.errors.exception({\n                header: "Dictionary",\n                message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(", ")}.`\n              });\n            }\n            dict[key] = value;\n          }\n        }\n        return dict;\n      };\n    };\n    webidl.nullableConverter = function(converter) {\n      return (V) => {\n        if (V === null) {\n          return V;\n        }\n        return converter(V);\n      };\n    };\n    webidl.converters.DOMString = function(V, opts = {}) {\n      if (V === null && opts.legacyNullToEmptyString) {\n        return "";\n      }\n      if (typeof V === "symbol") {\n        throw new TypeError("Could not convert argument of type symbol to string.");\n      }\n      return String(V);\n    };\n    webidl.converters.ByteString = function(V) {\n      const x = webidl.converters.DOMString(V);\n      for (let index = 0; index < x.length; index++) {\n        const charCode = x.charCodeAt(index);\n        if (charCode > 255) {\n          throw new TypeError(\n            `Cannot convert argument to a ByteString because the character at index ${index} has a value of ${charCode} which is greater than 255.`\n          );\n        }\n      }\n      return x;\n    };\n    webidl.converters.USVString = toUSVString;\n    webidl.converters.boolean = function(V) {\n      const x = Boolean(V);\n      return x;\n    };\n    webidl.converters.any = function(V) {\n      return V;\n    };\n    webidl.converters["long long"] = function(V) {\n      const x = webidl.util.ConvertToInt(V, 64, "signed");\n      return x;\n    };\n    webidl.converters["unsigned long long"] = function(V) {\n      const x = webidl.util.ConvertToInt(V, 64, "unsigned");\n      return x;\n    };\n    webidl.converters["unsigned long"] = function(V) {\n      const x = webidl.util.ConvertToInt(V, 32, "unsigned");\n      return x;\n    };\n    webidl.converters["unsigned short"] = function(V, opts) {\n      const x = webidl.util.ConvertToInt(V, 16, "unsigned", opts);\n      return x;\n    };\n    webidl.converters.ArrayBuffer = function(V, opts = {}) {\n      if (webidl.util.Type(V) !== "Object" || !types.isAnyArrayBuffer(V)) {\n        throw webidl.errors.conversionFailed({\n          prefix: `${V}`,\n          argument: `${V}`,\n          types: ["ArrayBuffer"]\n        });\n      }\n      if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {\n        throw webidl.errors.exception({\n          header: "ArrayBuffer",\n          message: "SharedArrayBuffer is not allowed."\n        });\n      }\n      return V;\n    };\n    webidl.converters.TypedArray = function(V, T, opts = {}) {\n      if (webidl.util.Type(V) !== "Object" || !types.isTypedArray(V) || V.constructor.name !== T.name) {\n        throw webidl.errors.conversionFailed({\n          prefix: `${T.name}`,\n          argument: `${V}`,\n          types: [T.name]\n        });\n      }\n      if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n        throw webidl.errors.exception({\n          header: "ArrayBuffer",\n          message: "SharedArrayBuffer is not allowed."\n        });\n      }\n      return V;\n    };\n    webidl.converters.DataView = function(V, opts = {}) {\n      if (webidl.util.Type(V) !== "Object" || !types.isDataView(V)) {\n        throw webidl.errors.exception({\n          header: "DataView",\n          message: "Object is not a DataView."\n        });\n      }\n      if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n        throw webidl.errors.exception({\n          header: "ArrayBuffer",\n          message: "SharedArrayBuffer is not allowed."\n        });\n      }\n      return V;\n    };\n    webidl.converters.BufferSource = function(V, opts = {}) {\n      if (types.isAnyArrayBuffer(V)) {\n        return webidl.converters.ArrayBuffer(V, opts);\n      }\n      if (types.isTypedArray(V)) {\n        return webidl.converters.TypedArray(V, V.constructor);\n      }\n      if (types.isDataView(V)) {\n        return webidl.converters.DataView(V, opts);\n      }\n      throw new TypeError(`Could not convert ${V} to a BufferSource.`);\n    };\n    webidl.converters["sequence<ByteString>"] = webidl.sequenceConverter(\n      webidl.converters.ByteString\n    );\n    webidl.converters["sequence<sequence<ByteString>>"] = webidl.sequenceConverter(\n      webidl.converters["sequence<ByteString>"]\n    );\n    webidl.converters["record<ByteString, ByteString>"] = webidl.recordConverter(\n      webidl.converters.ByteString,\n      webidl.converters.ByteString\n    );\n    module2.exports = {\n      webidl\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/headers.js\nvar require_headers = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/headers.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { kHeadersList } = require_symbols2();\n    var { kGuard: kGuard2 } = require_symbols();\n    var { kEnumerableProperty } = require_util();\n    var {\n      makeIterator,\n      isValidHeaderName: isValidHeaderName2,\n      isValidHeaderValue\n    } = require_util2();\n    var { webidl } = require_webidl();\n    var assert = require("assert");\n    var kHeadersMap = Symbol("headers map");\n    var kHeadersSortedMap = Symbol("headers map sorted");\n    function headerValueNormalize(potentialValue) {\n      let i = potentialValue.length;\n      while (/[\\r\\n\\t ]/.test(potentialValue.charAt(--i)))\n        ;\n      return potentialValue.slice(0, i + 1).replace(/^[\\r\\n\\t ]+/, "");\n    }\n    __name(headerValueNormalize, "headerValueNormalize");\n    function fill(headers, object) {\n      if (Array.isArray(object)) {\n        for (const header of object) {\n          if (header.length !== 2) {\n            throw webidl.errors.exception({\n              header: "Headers constructor",\n              message: `expected name/value pair to be length 2, found ${header.length}.`\n            });\n          }\n          headers.append(header[0], header[1]);\n        }\n      } else if (typeof object === "object" && object !== null) {\n        for (const [key, value] of Object.entries(object)) {\n          headers.append(key, value);\n        }\n      } else {\n        throw webidl.errors.conversionFailed({\n          prefix: "Headers constructor",\n          argument: "Argument 1",\n          types: ["sequence<sequence<ByteString>>", "record<ByteString, ByteString>"]\n        });\n      }\n    }\n    __name(fill, "fill");\n    var _HeadersList = class _HeadersList {\n      /** @type {[string, string][]|null} */\n      cookies = null;\n      constructor(init) {\n        if (init instanceof _HeadersList) {\n          this[kHeadersMap] = new Map(init[kHeadersMap]);\n          this[kHeadersSortedMap] = init[kHeadersSortedMap];\n          this.cookies = init.cookies;\n        } else {\n          this[kHeadersMap] = new Map(init);\n          this[kHeadersSortedMap] = null;\n        }\n      }\n      // https://fetch.spec.whatwg.org/#header-list-contains\n      contains(name) {\n        name = name.toLowerCase();\n        return this[kHeadersMap].has(name);\n      }\n      clear() {\n        this[kHeadersMap].clear();\n        this[kHeadersSortedMap] = null;\n        this.cookies = null;\n      }\n      // https://fetch.spec.whatwg.org/#concept-header-list-append\n      append(name, value) {\n        this[kHeadersSortedMap] = null;\n        const lowercaseName = name.toLowerCase();\n        const exists = this[kHeadersMap].get(lowercaseName);\n        if (exists) {\n          const delimiter = lowercaseName === "cookie" ? "; " : ", ";\n          this[kHeadersMap].set(lowercaseName, {\n            name: exists.name,\n            value: `${exists.value}${delimiter}${value}`\n          });\n        } else {\n          this[kHeadersMap].set(lowercaseName, { name, value });\n        }\n        if (lowercaseName === "set-cookie") {\n          this.cookies ??= [];\n          this.cookies.push(value);\n        }\n      }\n      // https://fetch.spec.whatwg.org/#concept-header-list-set\n      set(name, value) {\n        this[kHeadersSortedMap] = null;\n        const lowercaseName = name.toLowerCase();\n        if (lowercaseName === "set-cookie") {\n          this.cookies = [value];\n        }\n        return this[kHeadersMap].set(lowercaseName, { name, value });\n      }\n      // https://fetch.spec.whatwg.org/#concept-header-list-delete\n      delete(name) {\n        this[kHeadersSortedMap] = null;\n        name = name.toLowerCase();\n        if (name === "set-cookie") {\n          this.cookies = null;\n        }\n        return this[kHeadersMap].delete(name);\n      }\n      // https://fetch.spec.whatwg.org/#concept-header-list-get\n      get(name) {\n        if (!this.contains(name)) {\n          return null;\n        }\n        return this[kHeadersMap].get(name.toLowerCase())?.value ?? null;\n      }\n      *[Symbol.iterator]() {\n        for (const [name, { value }] of this[kHeadersMap]) {\n          yield [name, value];\n        }\n      }\n      get entries() {\n        const headers = {};\n        if (this[kHeadersMap].size) {\n          for (const { name, value } of this[kHeadersMap].values()) {\n            headers[name] = value;\n          }\n        }\n        return headers;\n      }\n    };\n    __name(_HeadersList, "HeadersList");\n    var HeadersList = _HeadersList;\n    var _Headers = class _Headers {\n      constructor(init = void 0) {\n        this[kHeadersList] = new HeadersList();\n        this[kGuard2] = "none";\n        if (init !== void 0) {\n          init = webidl.converters.HeadersInit(init);\n          fill(this, init);\n        }\n      }\n      // https://fetch.spec.whatwg.org/#dom-headers-append\n      append(name, value) {\n        webidl.brandCheck(this, _Headers);\n        webidl.argumentLengthCheck(arguments, 2, { header: "Headers.append" });\n        name = webidl.converters.ByteString(name);\n        value = webidl.converters.ByteString(value);\n        value = headerValueNormalize(value);\n        if (!isValidHeaderName2(name)) {\n          throw webidl.errors.invalidArgument({\n            prefix: "Headers.append",\n            value: name,\n            type: "header name"\n          });\n        } else if (!isValidHeaderValue(value)) {\n          throw webidl.errors.invalidArgument({\n            prefix: "Headers.append",\n            value,\n            type: "header value"\n          });\n        }\n        if (this[kGuard2] === "immutable") {\n          throw new TypeError("immutable");\n        } else if (this[kGuard2] === "request-no-cors") {\n        }\n        return this[kHeadersList].append(name, value);\n      }\n      // https://fetch.spec.whatwg.org/#dom-headers-delete\n      delete(name) {\n        webidl.brandCheck(this, _Headers);\n        webidl.argumentLengthCheck(arguments, 1, { header: "Headers.delete" });\n        name = webidl.converters.ByteString(name);\n        if (!isValidHeaderName2(name)) {\n          throw webidl.errors.invalidArgument({\n            prefix: "Headers.delete",\n            value: name,\n            type: "header name"\n          });\n        }\n        if (this[kGuard2] === "immutable") {\n          throw new TypeError("immutable");\n        } else if (this[kGuard2] === "request-no-cors") {\n        }\n        if (!this[kHeadersList].contains(name)) {\n          return;\n        }\n        return this[kHeadersList].delete(name);\n      }\n      // https://fetch.spec.whatwg.org/#dom-headers-get\n      get(name) {\n        webidl.brandCheck(this, _Headers);\n        webidl.argumentLengthCheck(arguments, 1, { header: "Headers.get" });\n        name = webidl.converters.ByteString(name);\n        if (!isValidHeaderName2(name)) {\n          throw webidl.errors.invalidArgument({\n            prefix: "Headers.get",\n            value: name,\n            type: "header name"\n          });\n        }\n        return this[kHeadersList].get(name);\n      }\n      // https://fetch.spec.whatwg.org/#dom-headers-has\n      has(name) {\n        webidl.brandCheck(this, _Headers);\n        webidl.argumentLengthCheck(arguments, 1, { header: "Headers.has" });\n        name = webidl.converters.ByteString(name);\n        if (!isValidHeaderName2(name)) {\n          throw webidl.errors.invalidArgument({\n            prefix: "Headers.has",\n            value: name,\n            type: "header name"\n          });\n        }\n        return this[kHeadersList].contains(name);\n      }\n      // https://fetch.spec.whatwg.org/#dom-headers-set\n      set(name, value) {\n        webidl.brandCheck(this, _Headers);\n        webidl.argumentLengthCheck(arguments, 2, { header: "Headers.set" });\n        name = webidl.converters.ByteString(name);\n        value = webidl.converters.ByteString(value);\n        value = headerValueNormalize(value);\n        if (!isValidHeaderName2(name)) {\n          throw webidl.errors.invalidArgument({\n            prefix: "Headers.set",\n            value: name,\n            type: "header name"\n          });\n        } else if (!isValidHeaderValue(value)) {\n          throw webidl.errors.invalidArgument({\n            prefix: "Headers.set",\n            value,\n            type: "header value"\n          });\n        }\n        if (this[kGuard2] === "immutable") {\n          throw new TypeError("immutable");\n        } else if (this[kGuard2] === "request-no-cors") {\n        }\n        return this[kHeadersList].set(name, value);\n      }\n      // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n      getSetCookie() {\n        webidl.brandCheck(this, _Headers);\n        const list = this[kHeadersList].cookies;\n        if (list) {\n          return [...list];\n        }\n        return [];\n      }\n      // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n      get [kHeadersSortedMap]() {\n        if (this[kHeadersList][kHeadersSortedMap]) {\n          return this[kHeadersList][kHeadersSortedMap];\n        }\n        const headers = [];\n        const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1);\n        const cookies = this[kHeadersList].cookies;\n        for (const [name, value] of names) {\n          if (name === "set-cookie") {\n            for (const value2 of cookies) {\n              headers.push([name, value2]);\n            }\n          } else {\n            assert(value !== null);\n            headers.push([name, value]);\n          }\n        }\n        this[kHeadersList][kHeadersSortedMap] = headers;\n        return headers;\n      }\n      keys() {\n        webidl.brandCheck(this, _Headers);\n        return makeIterator(\n          () => [...this[kHeadersSortedMap].values()],\n          "Headers",\n          "key"\n        );\n      }\n      values() {\n        webidl.brandCheck(this, _Headers);\n        return makeIterator(\n          () => [...this[kHeadersSortedMap].values()],\n          "Headers",\n          "value"\n        );\n      }\n      entries() {\n        webidl.brandCheck(this, _Headers);\n        return makeIterator(\n          () => [...this[kHeadersSortedMap].values()],\n          "Headers",\n          "key+value"\n        );\n      }\n      /**\n       * @param {(value: string, key: string, self: Headers) => void} callbackFn\n       * @param {unknown} thisArg\n       */\n      forEach(callbackFn, thisArg = globalThis) {\n        webidl.brandCheck(this, _Headers);\n        webidl.argumentLengthCheck(arguments, 1, { header: "Headers.forEach" });\n        if (typeof callbackFn !== "function") {\n          throw new TypeError(\n            "Failed to execute \'forEach\' on \'Headers\': parameter 1 is not of type \'Function\'."\n          );\n        }\n        for (const [key, value] of this) {\n          callbackFn.apply(thisArg, [value, key, this]);\n        }\n      }\n      [Symbol.for("nodejs.util.inspect.custom")]() {\n        webidl.brandCheck(this, _Headers);\n        return this[kHeadersList];\n      }\n    };\n    __name(_Headers, "Headers");\n    var Headers3 = _Headers;\n    Headers3.prototype[Symbol.iterator] = Headers3.prototype.entries;\n    Object.defineProperties(Headers3.prototype, {\n      append: kEnumerableProperty,\n      delete: kEnumerableProperty,\n      get: kEnumerableProperty,\n      has: kEnumerableProperty,\n      set: kEnumerableProperty,\n      getSetCookie: kEnumerableProperty,\n      keys: kEnumerableProperty,\n      values: kEnumerableProperty,\n      entries: kEnumerableProperty,\n      forEach: kEnumerableProperty,\n      [Symbol.iterator]: { enumerable: false },\n      [Symbol.toStringTag]: {\n        value: "Headers",\n        configurable: true\n      }\n    });\n    webidl.converters.HeadersInit = function(V) {\n      if (webidl.util.Type(V) === "Object") {\n        if (V[Symbol.iterator]) {\n          return webidl.converters["sequence<sequence<ByteString>>"](V);\n        }\n        return webidl.converters["record<ByteString, ByteString>"](V);\n      }\n      throw webidl.errors.conversionFailed({\n        prefix: "Headers constructor",\n        argument: "Argument 1",\n        types: ["sequence<sequence<ByteString>>", "record<ByteString, ByteString>"]\n      });\n    };\n    module2.exports = {\n      fill,\n      Headers: Headers3,\n      HeadersList\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/utils.js\nvar require_utils = __commonJS({\n  "../../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/utils.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    function parseContentType(str) {\n      if (str.length === 0)\n        return;\n      const params = /* @__PURE__ */ Object.create(null);\n      let i = 0;\n      for (; i < str.length; ++i) {\n        const code = str.charCodeAt(i);\n        if (TOKEN[code] !== 1) {\n          if (code !== 47 || i === 0)\n            return;\n          break;\n        }\n      }\n      if (i === str.length)\n        return;\n      const type = str.slice(0, i).toLowerCase();\n      const subtypeStart = ++i;\n      for (; i < str.length; ++i) {\n        const code = str.charCodeAt(i);\n        if (TOKEN[code] !== 1) {\n          if (i === subtypeStart)\n            return;\n          if (parseContentTypeParams(str, i, params) === void 0)\n            return;\n          break;\n        }\n      }\n      if (i === subtypeStart)\n        return;\n      const subtype = str.slice(subtypeStart, i).toLowerCase();\n      return { type, subtype, params };\n    }\n    __name(parseContentType, "parseContentType");\n    function parseContentTypeParams(str, i, params) {\n      while (i < str.length) {\n        for (; i < str.length; ++i) {\n          const code = str.charCodeAt(i);\n          if (code !== 32 && code !== 9)\n            break;\n        }\n        if (i === str.length)\n          break;\n        if (str.charCodeAt(i++) !== 59)\n          return;\n        for (; i < str.length; ++i) {\n          const code = str.charCodeAt(i);\n          if (code !== 32 && code !== 9)\n            break;\n        }\n        if (i === str.length)\n          return;\n        let name;\n        const nameStart = i;\n        for (; i < str.length; ++i) {\n          const code = str.charCodeAt(i);\n          if (TOKEN[code] !== 1) {\n            if (code !== 61)\n              return;\n            break;\n          }\n        }\n        if (i === str.length)\n          return;\n        name = str.slice(nameStart, i);\n        ++i;\n        if (i === str.length)\n          return;\n        let value = "";\n        let valueStart;\n        if (str.charCodeAt(i) === 34) {\n          valueStart = ++i;\n          let escaping = false;\n          for (; i < str.length; ++i) {\n            const code = str.charCodeAt(i);\n            if (code === 92) {\n              if (escaping) {\n                valueStart = i;\n                escaping = false;\n              } else {\n                value += str.slice(valueStart, i);\n                escaping = true;\n              }\n              continue;\n            }\n            if (code === 34) {\n              if (escaping) {\n                valueStart = i;\n                escaping = false;\n                continue;\n              }\n              value += str.slice(valueStart, i);\n              break;\n            }\n            if (escaping) {\n              valueStart = i - 1;\n              escaping = false;\n            }\n            if (QDTEXT[code] !== 1)\n              return;\n          }\n          if (i === str.length)\n            return;\n          ++i;\n        } else {\n          valueStart = i;\n          for (; i < str.length; ++i) {\n            const code = str.charCodeAt(i);\n            if (TOKEN[code] !== 1) {\n              if (i === valueStart)\n                return;\n              break;\n            }\n          }\n          value = str.slice(valueStart, i);\n        }\n        name = name.toLowerCase();\n        if (params[name] === void 0)\n          params[name] = value;\n      }\n      return params;\n    }\n    __name(parseContentTypeParams, "parseContentTypeParams");\n    function parseDisposition(str, defDecoder) {\n      if (str.length === 0)\n        return;\n      const params = /* @__PURE__ */ Object.create(null);\n      let i = 0;\n      for (; i < str.length; ++i) {\n        const code = str.charCodeAt(i);\n        if (TOKEN[code] !== 1) {\n          if (parseDispositionParams(str, i, params, defDecoder) === void 0)\n            return;\n          break;\n        }\n      }\n      const type = str.slice(0, i).toLowerCase();\n      return { type, params };\n    }\n    __name(parseDisposition, "parseDisposition");\n    function parseDispositionParams(str, i, params, defDecoder) {\n      while (i < str.length) {\n        for (; i < str.length; ++i) {\n          const code = str.charCodeAt(i);\n          if (code !== 32 && code !== 9)\n            break;\n        }\n        if (i === str.length)\n          break;\n        if (str.charCodeAt(i++) !== 59)\n          return;\n        for (; i < str.length; ++i) {\n          const code = str.charCodeAt(i);\n          if (code !== 32 && code !== 9)\n            break;\n        }\n        if (i === str.length)\n          return;\n        let name;\n        const nameStart = i;\n        for (; i < str.length; ++i) {\n          const code = str.charCodeAt(i);\n          if (TOKEN[code] !== 1) {\n            if (code === 61)\n              break;\n            return;\n          }\n        }\n        if (i === str.length)\n          return;\n        let value = "";\n        let valueStart;\n        let charset;\n        name = str.slice(nameStart, i);\n        if (name.charCodeAt(name.length - 1) === 42) {\n          const charsetStart = ++i;\n          for (; i < str.length; ++i) {\n            const code = str.charCodeAt(i);\n            if (CHARSET[code] !== 1) {\n              if (code !== 39)\n                return;\n              break;\n            }\n          }\n          if (i === str.length)\n            return;\n          charset = str.slice(charsetStart, i);\n          ++i;\n          for (; i < str.length; ++i) {\n            const code = str.charCodeAt(i);\n            if (code === 39)\n              break;\n          }\n          if (i === str.length)\n            return;\n          ++i;\n          if (i === str.length)\n            return;\n          valueStart = i;\n          let encode = 0;\n          for (; i < str.length; ++i) {\n            const code = str.charCodeAt(i);\n            if (EXTENDED_VALUE[code] !== 1) {\n              if (code === 37) {\n                let hexUpper;\n                let hexLower;\n                if (i + 2 < str.length && (hexUpper = HEX_VALUES[str.charCodeAt(i + 1)]) !== -1 && (hexLower = HEX_VALUES[str.charCodeAt(i + 2)]) !== -1) {\n                  const byteVal = (hexUpper << 4) + hexLower;\n                  value += str.slice(valueStart, i);\n                  value += String.fromCharCode(byteVal);\n                  i += 2;\n                  valueStart = i + 1;\n                  if (byteVal >= 128)\n                    encode = 2;\n                  else if (encode === 0)\n                    encode = 1;\n                  continue;\n                }\n                return;\n              }\n              break;\n            }\n          }\n          value += str.slice(valueStart, i);\n          value = convertToUTF8(value, charset, encode);\n          if (value === void 0)\n            return;\n        } else {\n          ++i;\n          if (i === str.length)\n            return;\n          if (str.charCodeAt(i) === 34) {\n            valueStart = ++i;\n            let escaping = false;\n            for (; i < str.length; ++i) {\n              const code = str.charCodeAt(i);\n              if (code === 92) {\n                if (escaping) {\n                  valueStart = i;\n                  escaping = false;\n                } else {\n                  value += str.slice(valueStart, i);\n                  escaping = true;\n                }\n                continue;\n              }\n              if (code === 34) {\n                if (escaping) {\n                  valueStart = i;\n                  escaping = false;\n                  continue;\n                }\n                value += str.slice(valueStart, i);\n                break;\n              }\n              if (escaping) {\n                valueStart = i - 1;\n                escaping = false;\n              }\n              if (QDTEXT[code] !== 1)\n                return;\n            }\n            if (i === str.length)\n              return;\n            ++i;\n          } else {\n            valueStart = i;\n            for (; i < str.length; ++i) {\n              const code = str.charCodeAt(i);\n              if (TOKEN[code] !== 1) {\n                if (i === valueStart)\n                  return;\n                break;\n              }\n            }\n            value = str.slice(valueStart, i);\n          }\n          value = defDecoder(value, 2);\n          if (value === void 0)\n            return;\n        }\n        name = name.toLowerCase();\n        if (params[name] === void 0)\n          params[name] = value;\n      }\n      return params;\n    }\n    __name(parseDispositionParams, "parseDispositionParams");\n    function getDecoder(charset) {\n      let lc;\n      while (true) {\n        switch (charset) {\n          case "utf-8":\n          case "utf8":\n            return decoders.utf8;\n          case "latin1":\n          case "ascii":\n          case "us-ascii":\n          case "iso-8859-1":\n          case "iso8859-1":\n          case "iso88591":\n          case "iso_8859-1":\n          case "windows-1252":\n          case "iso_8859-1:1987":\n          case "cp1252":\n          case "x-cp1252":\n            return decoders.latin1;\n          case "utf16le":\n          case "utf-16le":\n          case "ucs2":\n          case "ucs-2":\n            return decoders.utf16le;\n          case "base64":\n            return decoders.base64;\n          default:\n            if (lc === void 0) {\n              lc = true;\n              charset = charset.toLowerCase();\n              continue;\n            }\n            return decoders.other.bind(charset);\n        }\n      }\n    }\n    __name(getDecoder, "getDecoder");\n    var decoders = {\n      utf8: (data, hint) => {\n        if (data.length === 0)\n          return "";\n        if (typeof data === "string") {\n          if (hint < 2)\n            return data;\n          data = Buffer.from(data, "latin1");\n        }\n        return data.utf8Slice(0, data.length);\n      },\n      latin1: (data, hint) => {\n        if (data.length === 0)\n          return "";\n        if (typeof data === "string")\n          return data;\n        return data.latin1Slice(0, data.length);\n      },\n      utf16le: (data, hint) => {\n        if (data.length === 0)\n          return "";\n        if (typeof data === "string")\n          data = Buffer.from(data, "latin1");\n        return data.ucs2Slice(0, data.length);\n      },\n      base64: (data, hint) => {\n        if (data.length === 0)\n          return "";\n        if (typeof data === "string")\n          data = Buffer.from(data, "latin1");\n        return data.base64Slice(0, data.length);\n      },\n      other: (data, hint) => {\n        if (data.length === 0)\n          return "";\n        if (typeof data === "string")\n          data = Buffer.from(data, "latin1");\n        try {\n          const decoder = new TextDecoder(exports2);\n          return decoder.decode(data);\n        } catch {\n        }\n      }\n    };\n    function convertToUTF8(data, charset, hint) {\n      const decode = getDecoder(charset);\n      if (decode)\n        return decode(data, hint);\n    }\n    __name(convertToUTF8, "convertToUTF8");\n    function basename(path) {\n      if (typeof path !== "string")\n        return "";\n      for (let i = path.length - 1; i >= 0; --i) {\n        switch (path.charCodeAt(i)) {\n          case 47:\n          case 92:\n            path = path.slice(i + 1);\n            return path === ".." || path === "." ? "" : path;\n        }\n      }\n      return path === ".." || path === "." ? "" : path;\n    }\n    __name(basename, "basename");\n    var TOKEN = [\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      1,\n      1,\n      0,\n      1,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      1,\n      0,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0\n    ];\n    var QDTEXT = [\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1\n    ];\n    var CHARSET = [\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      0,\n      0,\n      1,\n      0,\n      1,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      1,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0\n    ];\n    var EXTENDED_VALUE = [\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      0,\n      1,\n      1,\n      0,\n      1,\n      0,\n      0,\n      0,\n      0,\n      1,\n      0,\n      1,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      1,\n      0,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0\n    ];\n    var HEX_VALUES = [\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      0,\n      1,\n      2,\n      3,\n      4,\n      5,\n      6,\n      7,\n      8,\n      9,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      10,\n      11,\n      12,\n      13,\n      14,\n      15,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      10,\n      11,\n      12,\n      13,\n      14,\n      15,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1\n    ];\n    module2.exports = {\n      basename,\n      convertToUTF8,\n      getDecoder,\n      parseContentType,\n      parseDisposition\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/streamsearch@1.1.0/node_modules/streamsearch/lib/sbmh.js\nvar require_sbmh = __commonJS({\n  "../../node_modules/.pnpm/streamsearch@1.1.0/node_modules/streamsearch/lib/sbmh.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    function memcmp(buf1, pos1, buf2, pos2, num) {\n      for (let i = 0; i < num; ++i) {\n        if (buf1[pos1 + i] !== buf2[pos2 + i])\n          return false;\n      }\n      return true;\n    }\n    __name(memcmp, "memcmp");\n    var _SBMH = class _SBMH {\n      constructor(needle, cb) {\n        if (typeof cb !== "function")\n          throw new Error("Missing match callback");\n        if (typeof needle === "string")\n          needle = Buffer.from(needle);\n        else if (!Buffer.isBuffer(needle))\n          throw new Error(`Expected Buffer for needle, got ${typeof needle}`);\n        const needleLen = needle.length;\n        this.maxMatches = Infinity;\n        this.matches = 0;\n        this._cb = cb;\n        this._lookbehindSize = 0;\n        this._needle = needle;\n        this._bufPos = 0;\n        this._lookbehind = Buffer.allocUnsafe(needleLen);\n        this._occ = [\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen,\n          needleLen\n        ];\n        if (needleLen > 1) {\n          for (let i = 0; i < needleLen - 1; ++i)\n            this._occ[needle[i]] = needleLen - 1 - i;\n        }\n      }\n      reset() {\n        this.matches = 0;\n        this._lookbehindSize = 0;\n        this._bufPos = 0;\n      }\n      push(chunk, pos) {\n        let result;\n        if (!Buffer.isBuffer(chunk))\n          chunk = Buffer.from(chunk, "latin1");\n        const chunkLen = chunk.length;\n        this._bufPos = pos || 0;\n        while (result !== chunkLen && this.matches < this.maxMatches)\n          result = feed(this, chunk);\n        return result;\n      }\n      destroy() {\n        const lbSize = this._lookbehindSize;\n        if (lbSize)\n          this._cb(false, this._lookbehind, 0, lbSize, false);\n        this.reset();\n      }\n    };\n    __name(_SBMH, "SBMH");\n    var SBMH = _SBMH;\n    function feed(self, data) {\n      const len = data.length;\n      const needle = self._needle;\n      const needleLen = needle.length;\n      let pos = -self._lookbehindSize;\n      const lastNeedleCharPos = needleLen - 1;\n      const lastNeedleChar = needle[lastNeedleCharPos];\n      const end = len - needleLen;\n      const occ = self._occ;\n      const lookbehind = self._lookbehind;\n      if (pos < 0) {\n        while (pos < 0 && pos <= end) {\n          const nextPos = pos + lastNeedleCharPos;\n          const ch = nextPos < 0 ? lookbehind[self._lookbehindSize + nextPos] : data[nextPos];\n          if (ch === lastNeedleChar && matchNeedle(self, data, pos, lastNeedleCharPos)) {\n            self._lookbehindSize = 0;\n            ++self.matches;\n            if (pos > -self._lookbehindSize)\n              self._cb(true, lookbehind, 0, self._lookbehindSize + pos, false);\n            else\n              self._cb(true, void 0, 0, 0, true);\n            return self._bufPos = pos + needleLen;\n          }\n          pos += occ[ch];\n        }\n        while (pos < 0 && !matchNeedle(self, data, pos, len - pos))\n          ++pos;\n        if (pos < 0) {\n          const bytesToCutOff = self._lookbehindSize + pos;\n          if (bytesToCutOff > 0) {\n            self._cb(false, lookbehind, 0, bytesToCutOff, false);\n          }\n          self._lookbehindSize -= bytesToCutOff;\n          lookbehind.copy(lookbehind, 0, bytesToCutOff, self._lookbehindSize);\n          lookbehind.set(data, self._lookbehindSize);\n          self._lookbehindSize += len;\n          self._bufPos = len;\n          return len;\n        }\n        self._cb(false, lookbehind, 0, self._lookbehindSize, false);\n        self._lookbehindSize = 0;\n      }\n      pos += self._bufPos;\n      const firstNeedleChar = needle[0];\n      while (pos <= end) {\n        const ch = data[pos + lastNeedleCharPos];\n        if (ch === lastNeedleChar && data[pos] === firstNeedleChar && memcmp(needle, 0, data, pos, lastNeedleCharPos)) {\n          ++self.matches;\n          if (pos > 0)\n            self._cb(true, data, self._bufPos, pos, true);\n          else\n            self._cb(true, void 0, 0, 0, true);\n          return self._bufPos = pos + needleLen;\n        }\n        pos += occ[ch];\n      }\n      while (pos < len) {\n        if (data[pos] !== firstNeedleChar || !memcmp(data, pos, needle, 0, len - pos)) {\n          ++pos;\n          continue;\n        }\n        data.copy(lookbehind, 0, pos, len);\n        self._lookbehindSize = len - pos;\n        break;\n      }\n      if (pos > 0)\n        self._cb(false, data, self._bufPos, pos < len ? pos : len, true);\n      self._bufPos = len;\n      return len;\n    }\n    __name(feed, "feed");\n    function matchNeedle(self, data, pos, len) {\n      const lb = self._lookbehind;\n      const lbSize = self._lookbehindSize;\n      const needle = self._needle;\n      for (let i = 0; i < len; ++i, ++pos) {\n        const ch = pos < 0 ? lb[lbSize + pos] : data[pos];\n        if (ch !== needle[i])\n          return false;\n      }\n      return true;\n    }\n    __name(matchNeedle, "matchNeedle");\n    module2.exports = SBMH;\n  }\n});\n\n// ../../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/types/multipart.js\nvar require_multipart = __commonJS({\n  "../../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/types/multipart.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { Readable, Writable } = require("stream");\n    var StreamSearch = require_sbmh();\n    var {\n      basename,\n      convertToUTF8,\n      getDecoder,\n      parseContentType,\n      parseDisposition\n    } = require_utils();\n    var BUF_CRLF = Buffer.from("\\r\\n");\n    var BUF_CR = Buffer.from("\\r");\n    var BUF_DASH = Buffer.from("-");\n    function noop() {\n    }\n    __name(noop, "noop");\n    var MAX_HEADER_PAIRS = 2e3;\n    var MAX_HEADER_SIZE = 16 * 1024;\n    var HPARSER_NAME = 0;\n    var HPARSER_PRE_OWS = 1;\n    var HPARSER_VALUE = 2;\n    var _HeaderParser = class _HeaderParser {\n      constructor(cb) {\n        this.header = /* @__PURE__ */ Object.create(null);\n        this.pairCount = 0;\n        this.byteCount = 0;\n        this.state = HPARSER_NAME;\n        this.name = "";\n        this.value = "";\n        this.crlf = 0;\n        this.cb = cb;\n      }\n      reset() {\n        this.header = /* @__PURE__ */ Object.create(null);\n        this.pairCount = 0;\n        this.byteCount = 0;\n        this.state = HPARSER_NAME;\n        this.name = "";\n        this.value = "";\n        this.crlf = 0;\n      }\n      push(chunk, pos, end) {\n        let start = pos;\n        while (pos < end) {\n          switch (this.state) {\n            case HPARSER_NAME: {\n              let done = false;\n              for (; pos < end; ++pos) {\n                if (this.byteCount === MAX_HEADER_SIZE)\n                  return -1;\n                ++this.byteCount;\n                const code = chunk[pos];\n                if (TOKEN[code] !== 1) {\n                  if (code !== 58)\n                    return -1;\n                  this.name += chunk.latin1Slice(start, pos);\n                  if (this.name.length === 0)\n                    return -1;\n                  ++pos;\n                  done = true;\n                  this.state = HPARSER_PRE_OWS;\n                  break;\n                }\n              }\n              if (!done) {\n                this.name += chunk.latin1Slice(start, pos);\n                break;\n              }\n            }\n            case HPARSER_PRE_OWS: {\n              let done = false;\n              for (; pos < end; ++pos) {\n                if (this.byteCount === MAX_HEADER_SIZE)\n                  return -1;\n                ++this.byteCount;\n                const code = chunk[pos];\n                if (code !== 32 && code !== 9) {\n                  start = pos;\n                  done = true;\n                  this.state = HPARSER_VALUE;\n                  break;\n                }\n              }\n              if (!done)\n                break;\n            }\n            case HPARSER_VALUE:\n              switch (this.crlf) {\n                case 0:\n                  for (; pos < end; ++pos) {\n                    if (this.byteCount === MAX_HEADER_SIZE)\n                      return -1;\n                    ++this.byteCount;\n                    const code = chunk[pos];\n                    if (FIELD_VCHAR[code] !== 1) {\n                      if (code !== 13)\n                        return -1;\n                      ++this.crlf;\n                      break;\n                    }\n                  }\n                  this.value += chunk.latin1Slice(start, pos++);\n                  break;\n                case 1:\n                  if (this.byteCount === MAX_HEADER_SIZE)\n                    return -1;\n                  ++this.byteCount;\n                  if (chunk[pos++] !== 10)\n                    return -1;\n                  ++this.crlf;\n                  break;\n                case 2: {\n                  if (this.byteCount === MAX_HEADER_SIZE)\n                    return -1;\n                  ++this.byteCount;\n                  const code = chunk[pos];\n                  if (code === 32 || code === 9) {\n                    start = pos;\n                    this.crlf = 0;\n                  } else {\n                    if (++this.pairCount < MAX_HEADER_PAIRS) {\n                      this.name = this.name.toLowerCase();\n                      if (this.header[this.name] === void 0)\n                        this.header[this.name] = [this.value];\n                      else\n                        this.header[this.name].push(this.value);\n                    }\n                    if (code === 13) {\n                      ++this.crlf;\n                      ++pos;\n                    } else {\n                      start = pos;\n                      this.crlf = 0;\n                      this.state = HPARSER_NAME;\n                      this.name = "";\n                      this.value = "";\n                    }\n                  }\n                  break;\n                }\n                case 3: {\n                  if (this.byteCount === MAX_HEADER_SIZE)\n                    return -1;\n                  ++this.byteCount;\n                  if (chunk[pos++] !== 10)\n                    return -1;\n                  const header = this.header;\n                  this.reset();\n                  this.cb(header);\n                  return pos;\n                }\n              }\n              break;\n          }\n        }\n        return pos;\n      }\n    };\n    __name(_HeaderParser, "HeaderParser");\n    var HeaderParser = _HeaderParser;\n    var _FileStream = class _FileStream extends Readable {\n      constructor(opts, owner) {\n        super(opts);\n        this.truncated = false;\n        this._readcb = null;\n        this.once("end", () => {\n          this._read();\n          if (--owner._fileEndsLeft === 0 && owner._finalcb) {\n            const cb = owner._finalcb;\n            owner._finalcb = null;\n            define_process_default.nextTick(cb);\n          }\n        });\n      }\n      _read(n) {\n        const cb = this._readcb;\n        if (cb) {\n          this._readcb = null;\n          cb();\n        }\n      }\n    };\n    __name(_FileStream, "FileStream");\n    var FileStream = _FileStream;\n    var ignoreData = {\n      push: (chunk, pos) => {\n      },\n      destroy: () => {\n      }\n    };\n    function callAndUnsetCb(self, err) {\n      const cb = self._writecb;\n      self._writecb = null;\n      if (err)\n        self.destroy(err);\n      else if (cb)\n        cb();\n    }\n    __name(callAndUnsetCb, "callAndUnsetCb");\n    function nullDecoder(val, hint) {\n      return val;\n    }\n    __name(nullDecoder, "nullDecoder");\n    var _Multipart = class _Multipart extends Writable {\n      constructor(cfg) {\n        const streamOpts = {\n          autoDestroy: true,\n          emitClose: true,\n          highWaterMark: typeof cfg.highWaterMark === "number" ? cfg.highWaterMark : void 0\n        };\n        super(streamOpts);\n        if (!cfg.conType.params || typeof cfg.conType.params.boundary !== "string")\n          throw new Error("Multipart: Boundary not found");\n        const boundary = cfg.conType.params.boundary;\n        const paramDecoder = typeof cfg.defParamCharset === "string" && cfg.defParamCharset ? getDecoder(cfg.defParamCharset) : nullDecoder;\n        const defCharset = cfg.defCharset || "utf8";\n        const preservePath = cfg.preservePath;\n        const fileOpts = {\n          autoDestroy: true,\n          emitClose: true,\n          highWaterMark: typeof cfg.fileHwm === "number" ? cfg.fileHwm : void 0\n        };\n        const limits = cfg.limits;\n        const fieldSizeLimit = limits && typeof limits.fieldSize === "number" ? limits.fieldSize : 1 * 1024 * 1024;\n        const fileSizeLimit = limits && typeof limits.fileSize === "number" ? limits.fileSize : Infinity;\n        const filesLimit = limits && typeof limits.files === "number" ? limits.files : Infinity;\n        const fieldsLimit = limits && typeof limits.fields === "number" ? limits.fields : Infinity;\n        const partsLimit = limits && typeof limits.parts === "number" ? limits.parts : Infinity;\n        let parts = -1;\n        let fields = 0;\n        let files = 0;\n        let skipPart = false;\n        this._fileEndsLeft = 0;\n        this._fileStream = void 0;\n        this._complete = false;\n        let fileSize = 0;\n        let field;\n        let fieldSize = 0;\n        let partCharset;\n        let partEncoding;\n        let partType;\n        let partName;\n        let partTruncated = false;\n        let hitFilesLimit = false;\n        let hitFieldsLimit = false;\n        this._hparser = null;\n        const hparser = new HeaderParser((header) => {\n          this._hparser = null;\n          skipPart = false;\n          partType = "text/plain";\n          partCharset = defCharset;\n          partEncoding = "7bit";\n          partName = void 0;\n          partTruncated = false;\n          let filename;\n          if (!header["content-disposition"]) {\n            skipPart = true;\n            return;\n          }\n          const disp = parseDisposition(\n            header["content-disposition"][0],\n            paramDecoder\n          );\n          if (!disp || disp.type !== "form-data") {\n            skipPart = true;\n            return;\n          }\n          if (disp.params) {\n            if (disp.params.name)\n              partName = disp.params.name;\n            if (disp.params["filename*"])\n              filename = disp.params["filename*"];\n            else if (disp.params.filename)\n              filename = disp.params.filename;\n            if (filename !== void 0 && !preservePath)\n              filename = basename(filename);\n          }\n          if (header["content-type"]) {\n            const conType = parseContentType(header["content-type"][0]);\n            if (conType) {\n              partType = `${conType.type}/${conType.subtype}`;\n              if (conType.params && typeof conType.params.charset === "string")\n                partCharset = conType.params.charset.toLowerCase();\n            }\n          }\n          if (header["content-transfer-encoding"])\n            partEncoding = header["content-transfer-encoding"][0].toLowerCase();\n          if (partType === "application/octet-stream" || filename !== void 0) {\n            if (files === filesLimit) {\n              if (!hitFilesLimit) {\n                hitFilesLimit = true;\n                this.emit("filesLimit");\n              }\n              skipPart = true;\n              return;\n            }\n            ++files;\n            if (this.listenerCount("file") === 0) {\n              skipPart = true;\n              return;\n            }\n            fileSize = 0;\n            this._fileStream = new FileStream(fileOpts, this);\n            ++this._fileEndsLeft;\n            this.emit(\n              "file",\n              partName,\n              this._fileStream,\n              {\n                filename,\n                encoding: partEncoding,\n                mimeType: partType\n              }\n            );\n          } else {\n            if (fields === fieldsLimit) {\n              if (!hitFieldsLimit) {\n                hitFieldsLimit = true;\n                this.emit("fieldsLimit");\n              }\n              skipPart = true;\n              return;\n            }\n            ++fields;\n            if (this.listenerCount("field") === 0) {\n              skipPart = true;\n              return;\n            }\n            field = [];\n            fieldSize = 0;\n          }\n        });\n        let matchPostBoundary = 0;\n        const ssCb = /* @__PURE__ */ __name((isMatch, data, start, end, isDataSafe) => {\n          retrydata:\n            while (data) {\n              if (this._hparser !== null) {\n                const ret = this._hparser.push(data, start, end);\n                if (ret === -1) {\n                  this._hparser = null;\n                  hparser.reset();\n                  this.emit("error", new Error("Malformed part header"));\n                  break;\n                }\n                start = ret;\n              }\n              if (start === end)\n                break;\n              if (matchPostBoundary !== 0) {\n                if (matchPostBoundary === 1) {\n                  switch (data[start]) {\n                    case 45:\n                      matchPostBoundary = 2;\n                      ++start;\n                      break;\n                    case 13:\n                      matchPostBoundary = 3;\n                      ++start;\n                      break;\n                    default:\n                      matchPostBoundary = 0;\n                  }\n                  if (start === end)\n                    return;\n                }\n                if (matchPostBoundary === 2) {\n                  matchPostBoundary = 0;\n                  if (data[start] === 45) {\n                    this._complete = true;\n                    this._bparser = ignoreData;\n                    return;\n                  }\n                  const writecb = this._writecb;\n                  this._writecb = noop;\n                  ssCb(false, BUF_DASH, 0, 1, false);\n                  this._writecb = writecb;\n                } else if (matchPostBoundary === 3) {\n                  matchPostBoundary = 0;\n                  if (data[start] === 10) {\n                    ++start;\n                    if (parts >= partsLimit)\n                      break;\n                    this._hparser = hparser;\n                    if (start === end)\n                      break;\n                    continue retrydata;\n                  } else {\n                    const writecb = this._writecb;\n                    this._writecb = noop;\n                    ssCb(false, BUF_CR, 0, 1, false);\n                    this._writecb = writecb;\n                  }\n                }\n              }\n              if (!skipPart) {\n                if (this._fileStream) {\n                  let chunk;\n                  const actualLen = Math.min(end - start, fileSizeLimit - fileSize);\n                  if (!isDataSafe) {\n                    chunk = Buffer.allocUnsafe(actualLen);\n                    data.copy(chunk, 0, start, start + actualLen);\n                  } else {\n                    chunk = data.slice(start, start + actualLen);\n                  }\n                  fileSize += chunk.length;\n                  if (fileSize === fileSizeLimit) {\n                    if (chunk.length > 0)\n                      this._fileStream.push(chunk);\n                    this._fileStream.emit("limit");\n                    this._fileStream.truncated = true;\n                    skipPart = true;\n                  } else if (!this._fileStream.push(chunk)) {\n                    if (this._writecb)\n                      this._fileStream._readcb = this._writecb;\n                    this._writecb = null;\n                  }\n                } else if (field !== void 0) {\n                  let chunk;\n                  const actualLen = Math.min(\n                    end - start,\n                    fieldSizeLimit - fieldSize\n                  );\n                  if (!isDataSafe) {\n                    chunk = Buffer.allocUnsafe(actualLen);\n                    data.copy(chunk, 0, start, start + actualLen);\n                  } else {\n                    chunk = data.slice(start, start + actualLen);\n                  }\n                  fieldSize += actualLen;\n                  field.push(chunk);\n                  if (fieldSize === fieldSizeLimit) {\n                    skipPart = true;\n                    partTruncated = true;\n                  }\n                }\n              }\n              break;\n            }\n          if (isMatch) {\n            matchPostBoundary = 1;\n            if (this._fileStream) {\n              this._fileStream.push(null);\n              this._fileStream = null;\n            } else if (field !== void 0) {\n              let data2;\n              switch (field.length) {\n                case 0:\n                  data2 = "";\n                  break;\n                case 1:\n                  data2 = convertToUTF8(field[0], partCharset, 0);\n                  break;\n                default:\n                  data2 = convertToUTF8(\n                    Buffer.concat(field, fieldSize),\n                    partCharset,\n                    0\n                  );\n              }\n              field = void 0;\n              fieldSize = 0;\n              this.emit(\n                "field",\n                partName,\n                data2,\n                {\n                  nameTruncated: false,\n                  valueTruncated: partTruncated,\n                  encoding: partEncoding,\n                  mimeType: partType\n                }\n              );\n            }\n            if (++parts === partsLimit)\n              this.emit("partsLimit");\n          }\n        }, "ssCb");\n        this._bparser = new StreamSearch(`\\r\n--${boundary}`, ssCb);\n        this._writecb = null;\n        this._finalcb = null;\n        this.write(BUF_CRLF);\n      }\n      static detect(conType) {\n        return conType.type === "multipart" && conType.subtype === "form-data";\n      }\n      _write(chunk, enc, cb) {\n        this._writecb = cb;\n        this._bparser.push(chunk, 0);\n        if (this._writecb)\n          callAndUnsetCb(this);\n      }\n      _destroy(err, cb) {\n        this._hparser = null;\n        this._bparser = ignoreData;\n        if (!err)\n          err = checkEndState(this);\n        const fileStream = this._fileStream;\n        if (fileStream) {\n          this._fileStream = null;\n          fileStream.destroy(err);\n        }\n        cb(err);\n      }\n      _final(cb) {\n        this._bparser.destroy();\n        if (!this._complete)\n          return cb(new Error("Unexpected end of form"));\n        if (this._fileEndsLeft)\n          this._finalcb = finalcb.bind(null, this, cb);\n        else\n          finalcb(this, cb);\n      }\n    };\n    __name(_Multipart, "Multipart");\n    var Multipart = _Multipart;\n    function finalcb(self, cb, err) {\n      if (err)\n        return cb(err);\n      err = checkEndState(self);\n      cb(err);\n    }\n    __name(finalcb, "finalcb");\n    function checkEndState(self) {\n      if (self._hparser)\n        return new Error("Malformed part header");\n      const fileStream = self._fileStream;\n      if (fileStream) {\n        self._fileStream = null;\n        fileStream.destroy(new Error("Unexpected end of file"));\n      }\n      if (!self._complete)\n        return new Error("Unexpected end of form");\n    }\n    __name(checkEndState, "checkEndState");\n    var TOKEN = [\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      1,\n      1,\n      0,\n      1,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      1,\n      0,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0\n    ];\n    var FIELD_VCHAR = [\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      0,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1,\n      1\n    ];\n    module2.exports = Multipart;\n  }\n});\n\n// ../../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/types/urlencoded.js\nvar require_urlencoded = __commonJS({\n  "../../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/types/urlencoded.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { Writable } = require("stream");\n    var { getDecoder } = require_utils();\n    var _URLEncoded = class _URLEncoded extends Writable {\n      constructor(cfg) {\n        const streamOpts = {\n          autoDestroy: true,\n          emitClose: true,\n          highWaterMark: typeof cfg.highWaterMark === "number" ? cfg.highWaterMark : void 0\n        };\n        super(streamOpts);\n        let charset = cfg.defCharset || "utf8";\n        if (cfg.conType.params && typeof cfg.conType.params.charset === "string")\n          charset = cfg.conType.params.charset;\n        this.charset = charset;\n        const limits = cfg.limits;\n        this.fieldSizeLimit = limits && typeof limits.fieldSize === "number" ? limits.fieldSize : 1 * 1024 * 1024;\n        this.fieldsLimit = limits && typeof limits.fields === "number" ? limits.fields : Infinity;\n        this.fieldNameSizeLimit = limits && typeof limits.fieldNameSize === "number" ? limits.fieldNameSize : 100;\n        this._inKey = true;\n        this._keyTrunc = false;\n        this._valTrunc = false;\n        this._bytesKey = 0;\n        this._bytesVal = 0;\n        this._fields = 0;\n        this._key = "";\n        this._val = "";\n        this._byte = -2;\n        this._lastPos = 0;\n        this._encode = 0;\n        this._decoder = getDecoder(charset);\n      }\n      static detect(conType) {\n        return conType.type === "application" && conType.subtype === "x-www-form-urlencoded";\n      }\n      _write(chunk, enc, cb) {\n        if (this._fields >= this.fieldsLimit)\n          return cb();\n        let i = 0;\n        const len = chunk.length;\n        this._lastPos = 0;\n        if (this._byte !== -2) {\n          i = readPctEnc(this, chunk, i, len);\n          if (i === -1)\n            return cb(new Error("Malformed urlencoded form"));\n          if (i >= len)\n            return cb();\n          if (this._inKey)\n            ++this._bytesKey;\n          else\n            ++this._bytesVal;\n        }\n        main:\n          while (i < len) {\n            if (this._inKey) {\n              i = skipKeyBytes(this, chunk, i, len);\n              while (i < len) {\n                switch (chunk[i]) {\n                  case 61:\n                    if (this._lastPos < i)\n                      this._key += chunk.latin1Slice(this._lastPos, i);\n                    this._lastPos = ++i;\n                    this._key = this._decoder(this._key, this._encode);\n                    this._encode = 0;\n                    this._inKey = false;\n                    continue main;\n                  case 38:\n                    if (this._lastPos < i)\n                      this._key += chunk.latin1Slice(this._lastPos, i);\n                    this._lastPos = ++i;\n                    this._key = this._decoder(this._key, this._encode);\n                    this._encode = 0;\n                    if (this._bytesKey > 0) {\n                      this.emit(\n                        "field",\n                        this._key,\n                        "",\n                        {\n                          nameTruncated: this._keyTrunc,\n                          valueTruncated: false,\n                          encoding: this.charset,\n                          mimeType: "text/plain"\n                        }\n                      );\n                    }\n                    this._key = "";\n                    this._val = "";\n                    this._keyTrunc = false;\n                    this._valTrunc = false;\n                    this._bytesKey = 0;\n                    this._bytesVal = 0;\n                    if (++this._fields >= this.fieldsLimit) {\n                      this.emit("fieldsLimit");\n                      return cb();\n                    }\n                    continue;\n                  case 43:\n                    if (this._lastPos < i)\n                      this._key += chunk.latin1Slice(this._lastPos, i);\n                    this._key += " ";\n                    this._lastPos = i + 1;\n                    break;\n                  case 37:\n                    if (this._encode === 0)\n                      this._encode = 1;\n                    if (this._lastPos < i)\n                      this._key += chunk.latin1Slice(this._lastPos, i);\n                    this._lastPos = i + 1;\n                    this._byte = -1;\n                    i = readPctEnc(this, chunk, i + 1, len);\n                    if (i === -1)\n                      return cb(new Error("Malformed urlencoded form"));\n                    if (i >= len)\n                      return cb();\n                    ++this._bytesKey;\n                    i = skipKeyBytes(this, chunk, i, len);\n                    continue;\n                }\n                ++i;\n                ++this._bytesKey;\n                i = skipKeyBytes(this, chunk, i, len);\n              }\n              if (this._lastPos < i)\n                this._key += chunk.latin1Slice(this._lastPos, i);\n            } else {\n              i = skipValBytes(this, chunk, i, len);\n              while (i < len) {\n                switch (chunk[i]) {\n                  case 38:\n                    if (this._lastPos < i)\n                      this._val += chunk.latin1Slice(this._lastPos, i);\n                    this._lastPos = ++i;\n                    this._inKey = true;\n                    this._val = this._decoder(this._val, this._encode);\n                    this._encode = 0;\n                    if (this._bytesKey > 0 || this._bytesVal > 0) {\n                      this.emit(\n                        "field",\n                        this._key,\n                        this._val,\n                        {\n                          nameTruncated: this._keyTrunc,\n                          valueTruncated: this._valTrunc,\n                          encoding: this.charset,\n                          mimeType: "text/plain"\n                        }\n                      );\n                    }\n                    this._key = "";\n                    this._val = "";\n                    this._keyTrunc = false;\n                    this._valTrunc = false;\n                    this._bytesKey = 0;\n                    this._bytesVal = 0;\n                    if (++this._fields >= this.fieldsLimit) {\n                      this.emit("fieldsLimit");\n                      return cb();\n                    }\n                    continue main;\n                  case 43:\n                    if (this._lastPos < i)\n                      this._val += chunk.latin1Slice(this._lastPos, i);\n                    this._val += " ";\n                    this._lastPos = i + 1;\n                    break;\n                  case 37:\n                    if (this._encode === 0)\n                      this._encode = 1;\n                    if (this._lastPos < i)\n                      this._val += chunk.latin1Slice(this._lastPos, i);\n                    this._lastPos = i + 1;\n                    this._byte = -1;\n                    i = readPctEnc(this, chunk, i + 1, len);\n                    if (i === -1)\n                      return cb(new Error("Malformed urlencoded form"));\n                    if (i >= len)\n                      return cb();\n                    ++this._bytesVal;\n                    i = skipValBytes(this, chunk, i, len);\n                    continue;\n                }\n                ++i;\n                ++this._bytesVal;\n                i = skipValBytes(this, chunk, i, len);\n              }\n              if (this._lastPos < i)\n                this._val += chunk.latin1Slice(this._lastPos, i);\n            }\n          }\n        cb();\n      }\n      _final(cb) {\n        if (this._byte !== -2)\n          return cb(new Error("Malformed urlencoded form"));\n        if (!this._inKey || this._bytesKey > 0 || this._bytesVal > 0) {\n          if (this._inKey)\n            this._key = this._decoder(this._key, this._encode);\n          else\n            this._val = this._decoder(this._val, this._encode);\n          this.emit(\n            "field",\n            this._key,\n            this._val,\n            {\n              nameTruncated: this._keyTrunc,\n              valueTruncated: this._valTrunc,\n              encoding: this.charset,\n              mimeType: "text/plain"\n            }\n          );\n        }\n        cb();\n      }\n    };\n    __name(_URLEncoded, "URLEncoded");\n    var URLEncoded = _URLEncoded;\n    function readPctEnc(self, chunk, pos, len) {\n      if (pos >= len)\n        return len;\n      if (self._byte === -1) {\n        const hexUpper = HEX_VALUES[chunk[pos++]];\n        if (hexUpper === -1)\n          return -1;\n        if (hexUpper >= 8)\n          self._encode = 2;\n        if (pos < len) {\n          const hexLower = HEX_VALUES[chunk[pos++]];\n          if (hexLower === -1)\n            return -1;\n          if (self._inKey)\n            self._key += String.fromCharCode((hexUpper << 4) + hexLower);\n          else\n            self._val += String.fromCharCode((hexUpper << 4) + hexLower);\n          self._byte = -2;\n          self._lastPos = pos;\n        } else {\n          self._byte = hexUpper;\n        }\n      } else {\n        const hexLower = HEX_VALUES[chunk[pos++]];\n        if (hexLower === -1)\n          return -1;\n        if (self._inKey)\n          self._key += String.fromCharCode((self._byte << 4) + hexLower);\n        else\n          self._val += String.fromCharCode((self._byte << 4) + hexLower);\n        self._byte = -2;\n        self._lastPos = pos;\n      }\n      return pos;\n    }\n    __name(readPctEnc, "readPctEnc");\n    function skipKeyBytes(self, chunk, pos, len) {\n      if (self._bytesKey > self.fieldNameSizeLimit) {\n        if (!self._keyTrunc) {\n          if (self._lastPos < pos)\n            self._key += chunk.latin1Slice(self._lastPos, pos - 1);\n        }\n        self._keyTrunc = true;\n        for (; pos < len; ++pos) {\n          const code = chunk[pos];\n          if (code === 61 || code === 38)\n            break;\n          ++self._bytesKey;\n        }\n        self._lastPos = pos;\n      }\n      return pos;\n    }\n    __name(skipKeyBytes, "skipKeyBytes");\n    function skipValBytes(self, chunk, pos, len) {\n      if (self._bytesVal > self.fieldSizeLimit) {\n        if (!self._valTrunc) {\n          if (self._lastPos < pos)\n            self._val += chunk.latin1Slice(self._lastPos, pos - 1);\n        }\n        self._valTrunc = true;\n        for (; pos < len; ++pos) {\n          if (chunk[pos] === 38)\n            break;\n          ++self._bytesVal;\n        }\n        self._lastPos = pos;\n      }\n      return pos;\n    }\n    __name(skipValBytes, "skipValBytes");\n    var HEX_VALUES = [\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      0,\n      1,\n      2,\n      3,\n      4,\n      5,\n      6,\n      7,\n      8,\n      9,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      10,\n      11,\n      12,\n      13,\n      14,\n      15,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      10,\n      11,\n      12,\n      13,\n      14,\n      15,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1,\n      -1\n    ];\n    module2.exports = URLEncoded;\n  }\n});\n\n// ../../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/index.js\nvar require_lib = __commonJS({\n  "../../node_modules/.pnpm/busboy@1.6.0/node_modules/busboy/lib/index.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { parseContentType } = require_utils();\n    function getInstance(cfg) {\n      const headers = cfg.headers;\n      const conType = parseContentType(headers["content-type"]);\n      if (!conType)\n        throw new Error("Malformed content type");\n      for (const type of TYPES) {\n        const matched = type.detect(conType);\n        if (!matched)\n          continue;\n        const instanceCfg = {\n          limits: cfg.limits,\n          headers,\n          conType,\n          highWaterMark: void 0,\n          fileHwm: void 0,\n          defCharset: void 0,\n          defParamCharset: void 0,\n          preservePath: false\n        };\n        if (cfg.highWaterMark)\n          instanceCfg.highWaterMark = cfg.highWaterMark;\n        if (cfg.fileHwm)\n          instanceCfg.fileHwm = cfg.fileHwm;\n        instanceCfg.defCharset = cfg.defCharset;\n        instanceCfg.defParamCharset = cfg.defParamCharset;\n        instanceCfg.preservePath = cfg.preservePath;\n        return new type(instanceCfg);\n      }\n      throw new Error(`Unsupported content type: ${headers["content-type"]}`);\n    }\n    __name(getInstance, "getInstance");\n    var TYPES = [\n      require_multipart(),\n      require_urlencoded()\n    ].filter(function(typemod) {\n      return typeof typemod.detect === "function";\n    });\n    module2.exports = (cfg) => {\n      if (typeof cfg !== "object" || cfg === null)\n        cfg = {};\n      if (typeof cfg.headers !== "object" || cfg.headers === null || typeof cfg.headers["content-type"] !== "string") {\n        throw new Error("Missing Content-Type");\n      }\n      return getInstance(cfg);\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/dataURL.js\nvar require_dataURL = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/dataURL.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var assert = require("assert");\n    var { atob: atob2 } = require("buffer");\n    var { isomorphicDecode } = require_util2();\n    var encoder = new TextEncoder();\n    var HTTP_TOKEN_CODEPOINTS = /^[!#$%&\'*+-.^_|~A-Za-z0-9]+$/;\n    var HTTP_WHITESPACE_REGEX = /(\\u000A|\\u000D|\\u0009|\\u0020)/;\n    var HTTP_QUOTED_STRING_TOKENS = /[\\u0009|\\u0020-\\u007E|\\u0080-\\u00FF]/;\n    function dataURLProcessor(dataURL) {\n      assert(dataURL.protocol === "data:");\n      let input = URLSerializer(dataURL, true);\n      input = input.slice(5);\n      const position = { position: 0 };\n      let mimeType = collectASequenceOfCodePointsFast(\n        ",",\n        input,\n        position\n      );\n      const mimeTypeLength = mimeType.length;\n      mimeType = removeASCIIWhitespace(mimeType, true, true);\n      if (position.position >= input.length) {\n        return "failure";\n      }\n      position.position++;\n      const encodedBody = input.slice(mimeTypeLength + 1);\n      let body = stringPercentDecode(encodedBody);\n      if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n        const stringBody = isomorphicDecode(body);\n        body = forgivingBase64(stringBody);\n        if (body === "failure") {\n          return "failure";\n        }\n        mimeType = mimeType.slice(0, -6);\n        mimeType = mimeType.replace(/(\\u0020)+$/, "");\n        mimeType = mimeType.slice(0, -1);\n      }\n      if (mimeType.startsWith(";")) {\n        mimeType = "text/plain" + mimeType;\n      }\n      let mimeTypeRecord = parseMIMEType(mimeType);\n      if (mimeTypeRecord === "failure") {\n        mimeTypeRecord = parseMIMEType("text/plain;charset=US-ASCII");\n      }\n      return { mimeType: mimeTypeRecord, body };\n    }\n    __name(dataURLProcessor, "dataURLProcessor");\n    function URLSerializer(url, excludeFragment = false) {\n      const href = url.href;\n      if (!excludeFragment) {\n        return href;\n      }\n      const hash = href.lastIndexOf("#");\n      if (hash === -1) {\n        return href;\n      }\n      return href.slice(0, hash);\n    }\n    __name(URLSerializer, "URLSerializer");\n    function collectASequenceOfCodePoints(condition, input, position) {\n      let result = "";\n      while (position.position < input.length && condition(input[position.position])) {\n        result += input[position.position];\n        position.position++;\n      }\n      return result;\n    }\n    __name(collectASequenceOfCodePoints, "collectASequenceOfCodePoints");\n    function collectASequenceOfCodePointsFast(char, input, position) {\n      const idx = input.indexOf(char, position.position);\n      const start = position.position;\n      if (idx === -1) {\n        position.position = input.length;\n        return input.slice(start);\n      }\n      position.position = idx;\n      return input.slice(start, position.position);\n    }\n    __name(collectASequenceOfCodePointsFast, "collectASequenceOfCodePointsFast");\n    function stringPercentDecode(input) {\n      const bytes = encoder.encode(input);\n      return percentDecode(bytes);\n    }\n    __name(stringPercentDecode, "stringPercentDecode");\n    function percentDecode(input) {\n      const output = [];\n      for (let i = 0; i < input.length; i++) {\n        const byte = input[i];\n        if (byte !== 37) {\n          output.push(byte);\n        } else if (byte === 37 && !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))) {\n          output.push(37);\n        } else {\n          const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2]);\n          const bytePoint = Number.parseInt(nextTwoBytes, 16);\n          output.push(bytePoint);\n          i += 2;\n        }\n      }\n      return Uint8Array.from(output);\n    }\n    __name(percentDecode, "percentDecode");\n    function parseMIMEType(input) {\n      input = removeHTTPWhitespace(input, true, true);\n      const position = { position: 0 };\n      const type = collectASequenceOfCodePointsFast(\n        "/",\n        input,\n        position\n      );\n      if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n        return "failure";\n      }\n      if (position.position > input.length) {\n        return "failure";\n      }\n      position.position++;\n      let subtype = collectASequenceOfCodePointsFast(\n        ";",\n        input,\n        position\n      );\n      subtype = removeHTTPWhitespace(subtype, false, true);\n      if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n        return "failure";\n      }\n      const typeLowercase = type.toLowerCase();\n      const subtypeLowercase = subtype.toLowerCase();\n      const mimeType = {\n        type: typeLowercase,\n        subtype: subtypeLowercase,\n        /** @type {Map<string, string>} */\n        parameters: /* @__PURE__ */ new Map(),\n        // https://mimesniff.spec.whatwg.org/#mime-type-essence\n        essence: `${typeLowercase}/${subtypeLowercase}`\n      };\n      while (position.position < input.length) {\n        position.position++;\n        collectASequenceOfCodePoints(\n          // https://fetch.spec.whatwg.org/#http-whitespace\n          (char) => HTTP_WHITESPACE_REGEX.test(char),\n          input,\n          position\n        );\n        let parameterName = collectASequenceOfCodePoints(\n          (char) => char !== ";" && char !== "=",\n          input,\n          position\n        );\n        parameterName = parameterName.toLowerCase();\n        if (position.position < input.length) {\n          if (input[position.position] === ";") {\n            continue;\n          }\n          position.position++;\n        }\n        if (position.position > input.length) {\n          break;\n        }\n        let parameterValue = null;\n        if (input[position.position] === \'"\') {\n          parameterValue = collectAnHTTPQuotedString(input, position, true);\n          collectASequenceOfCodePointsFast(\n            ";",\n            input,\n            position\n          );\n        } else {\n          parameterValue = collectASequenceOfCodePointsFast(\n            ";",\n            input,\n            position\n          );\n          parameterValue = removeHTTPWhitespace(parameterValue, false, true);\n          if (parameterValue.length === 0) {\n            continue;\n          }\n        }\n        if (parameterName.length !== 0 && HTTP_TOKEN_CODEPOINTS.test(parameterName) && (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) && !mimeType.parameters.has(parameterName)) {\n          mimeType.parameters.set(parameterName, parameterValue);\n        }\n      }\n      return mimeType;\n    }\n    __name(parseMIMEType, "parseMIMEType");\n    function forgivingBase64(data) {\n      data = data.replace(/[\\u0009\\u000A\\u000C\\u000D\\u0020]/g, "");\n      if (data.length % 4 === 0) {\n        data = data.replace(/=?=$/, "");\n      }\n      if (data.length % 4 === 1) {\n        return "failure";\n      }\n      if (/[^+/0-9A-Za-z]/.test(data)) {\n        return "failure";\n      }\n      const binary = atob2(data);\n      const bytes = new Uint8Array(binary.length);\n      for (let byte = 0; byte < binary.length; byte++) {\n        bytes[byte] = binary.charCodeAt(byte);\n      }\n      return bytes;\n    }\n    __name(forgivingBase64, "forgivingBase64");\n    function collectAnHTTPQuotedString(input, position, extractValue) {\n      const positionStart = position.position;\n      let value = "";\n      assert(input[position.position] === \'"\');\n      position.position++;\n      while (true) {\n        value += collectASequenceOfCodePoints(\n          (char) => char !== \'"\' && char !== "\\\\",\n          input,\n          position\n        );\n        if (position.position >= input.length) {\n          break;\n        }\n        const quoteOrBackslash = input[position.position];\n        position.position++;\n        if (quoteOrBackslash === "\\\\") {\n          if (position.position >= input.length) {\n            value += "\\\\";\n            break;\n          }\n          value += input[position.position];\n          position.position++;\n        } else {\n          assert(quoteOrBackslash === \'"\');\n          break;\n        }\n      }\n      if (extractValue) {\n        return value;\n      }\n      return input.slice(positionStart, position.position);\n    }\n    __name(collectAnHTTPQuotedString, "collectAnHTTPQuotedString");\n    function serializeAMimeType(mimeType) {\n      assert(mimeType !== "failure");\n      const { parameters, essence } = mimeType;\n      let serialization = essence;\n      for (let [name, value] of parameters.entries()) {\n        serialization += ";";\n        serialization += name;\n        serialization += "=";\n        if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n          value = value.replace(/(\\\\|")/g, "\\\\$1");\n          value = \'"\' + value;\n          value += \'"\';\n        }\n        serialization += value;\n      }\n      return serialization;\n    }\n    __name(serializeAMimeType, "serializeAMimeType");\n    function isHTTPWhiteSpace(char) {\n      return char === "\\r" || char === "\\n" || char === "	" || char === " ";\n    }\n    __name(isHTTPWhiteSpace, "isHTTPWhiteSpace");\n    function removeHTTPWhitespace(str, leading = true, trailing = true) {\n      let lead = 0;\n      let trail = str.length - 1;\n      if (leading) {\n        for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++)\n          ;\n      }\n      if (trailing) {\n        for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--)\n          ;\n      }\n      return str.slice(lead, trail + 1);\n    }\n    __name(removeHTTPWhitespace, "removeHTTPWhitespace");\n    function isASCIIWhitespace(char) {\n      return char === "\\r" || char === "\\n" || char === "	" || char === "\\f" || char === " ";\n    }\n    __name(isASCIIWhitespace, "isASCIIWhitespace");\n    function removeASCIIWhitespace(str, leading = true, trailing = true) {\n      let lead = 0;\n      let trail = str.length - 1;\n      if (leading) {\n        for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++)\n          ;\n      }\n      if (trailing) {\n        for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--)\n          ;\n      }\n      return str.slice(lead, trail + 1);\n    }\n    __name(removeASCIIWhitespace, "removeASCIIWhitespace");\n    module2.exports = {\n      dataURLProcessor,\n      URLSerializer,\n      collectASequenceOfCodePoints,\n      collectASequenceOfCodePointsFast,\n      stringPercentDecode,\n      parseMIMEType,\n      collectAnHTTPQuotedString,\n      serializeAMimeType\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/file.js\nvar require_file = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/file.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { Blob: Blob2, File: NativeFile } = require("buffer");\n    var { types } = require("util");\n    var { kState } = require_symbols();\n    var { isBlobLike } = require_util2();\n    var { webidl } = require_webidl();\n    var { parseMIMEType, serializeAMimeType } = require_dataURL();\n    var { kEnumerableProperty } = require_util();\n    var _File = class _File extends Blob2 {\n      constructor(fileBits, fileName, options = {}) {\n        webidl.argumentLengthCheck(arguments, 2, { header: "File constructor" });\n        fileBits = webidl.converters["sequence<BlobPart>"](fileBits);\n        fileName = webidl.converters.USVString(fileName);\n        options = webidl.converters.FilePropertyBag(options);\n        const n = fileName;\n        let t = options.type;\n        let d;\n        substep: {\n          if (t) {\n            t = parseMIMEType(t);\n            if (t === "failure") {\n              t = "";\n              break substep;\n            }\n            t = serializeAMimeType(t).toLowerCase();\n          }\n          d = options.lastModified;\n        }\n        super(processBlobParts(fileBits, options), { type: t });\n        this[kState] = {\n          name: n,\n          lastModified: d,\n          type: t\n        };\n      }\n      get name() {\n        webidl.brandCheck(this, _File);\n        return this[kState].name;\n      }\n      get lastModified() {\n        webidl.brandCheck(this, _File);\n        return this[kState].lastModified;\n      }\n      get type() {\n        webidl.brandCheck(this, _File);\n        return this[kState].type;\n      }\n    };\n    __name(_File, "File");\n    var File2 = _File;\n    var _FileLike = class _FileLike {\n      constructor(blobLike, fileName, options = {}) {\n        const n = fileName;\n        const t = options.type;\n        const d = options.lastModified ?? Date.now();\n        this[kState] = {\n          blobLike,\n          name: n,\n          type: t,\n          lastModified: d\n        };\n      }\n      stream(...args) {\n        webidl.brandCheck(this, _FileLike);\n        return this[kState].blobLike.stream(...args);\n      }\n      arrayBuffer(...args) {\n        webidl.brandCheck(this, _FileLike);\n        return this[kState].blobLike.arrayBuffer(...args);\n      }\n      slice(...args) {\n        webidl.brandCheck(this, _FileLike);\n        return this[kState].blobLike.slice(...args);\n      }\n      text(...args) {\n        webidl.brandCheck(this, _FileLike);\n        return this[kState].blobLike.text(...args);\n      }\n      get size() {\n        webidl.brandCheck(this, _FileLike);\n        return this[kState].blobLike.size;\n      }\n      get type() {\n        webidl.brandCheck(this, _FileLike);\n        return this[kState].blobLike.type;\n      }\n      get name() {\n        webidl.brandCheck(this, _FileLike);\n        return this[kState].name;\n      }\n      get lastModified() {\n        webidl.brandCheck(this, _FileLike);\n        return this[kState].lastModified;\n      }\n      get [Symbol.toStringTag]() {\n        return "File";\n      }\n    };\n    __name(_FileLike, "FileLike");\n    var FileLike = _FileLike;\n    Object.defineProperties(File2.prototype, {\n      [Symbol.toStringTag]: {\n        value: "File",\n        configurable: true\n      },\n      name: kEnumerableProperty,\n      lastModified: kEnumerableProperty\n    });\n    webidl.converters.Blob = webidl.interfaceConverter(Blob2);\n    webidl.converters.BlobPart = function(V, opts) {\n      if (webidl.util.Type(V) === "Object") {\n        if (isBlobLike(V)) {\n          return webidl.converters.Blob(V, { strict: false });\n        }\n        if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {\n          return webidl.converters.BufferSource(V, opts);\n        }\n      }\n      return webidl.converters.USVString(V, opts);\n    };\n    webidl.converters["sequence<BlobPart>"] = webidl.sequenceConverter(\n      webidl.converters.BlobPart\n    );\n    webidl.converters.FilePropertyBag = webidl.dictionaryConverter([\n      {\n        key: "lastModified",\n        converter: webidl.converters["long long"],\n        get defaultValue() {\n          return Date.now();\n        }\n      },\n      {\n        key: "type",\n        converter: webidl.converters.DOMString,\n        defaultValue: ""\n      },\n      {\n        key: "endings",\n        converter: (value) => {\n          value = webidl.converters.DOMString(value);\n          value = value.toLowerCase();\n          if (value !== "native") {\n            value = "transparent";\n          }\n          return value;\n        },\n        defaultValue: "transparent"\n      }\n    ]);\n    function processBlobParts(parts, options) {\n      const bytes = [];\n      for (const element of parts) {\n        if (typeof element === "string") {\n          let s = element;\n          if (options.endings === "native") {\n            s = convertLineEndingsNative(s);\n          }\n          bytes.push(new TextEncoder().encode(s));\n        } else if (types.isAnyArrayBuffer(element) || types.isTypedArray(element)) {\n          if (!element.buffer) {\n            bytes.push(new Uint8Array(element));\n          } else {\n            bytes.push(\n              new Uint8Array(element.buffer, element.byteOffset, element.byteLength)\n            );\n          }\n        } else if (isBlobLike(element)) {\n          bytes.push(element);\n        }\n      }\n      return bytes;\n    }\n    __name(processBlobParts, "processBlobParts");\n    function convertLineEndingsNative(s) {\n      let nativeLineEnding = "\\n";\n      if (define_process_default.platform === "win32") {\n        nativeLineEnding = "\\r\\n";\n      }\n      return s.replace(/\\r?\\n/g, nativeLineEnding);\n    }\n    __name(convertLineEndingsNative, "convertLineEndingsNative");\n    function isFileLike(object) {\n      return NativeFile && object instanceof NativeFile || object instanceof File2 || object && (typeof object.stream === "function" || typeof object.arrayBuffer === "function") && object[Symbol.toStringTag] === "File";\n    }\n    __name(isFileLike, "isFileLike");\n    module2.exports = { File: File2, FileLike, isFileLike };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/formdata.js\nvar require_formdata = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/formdata.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { isBlobLike, toUSVString, makeIterator } = require_util2();\n    var { kState } = require_symbols();\n    var { File: UndiciFile, FileLike, isFileLike } = require_file();\n    var { webidl } = require_webidl();\n    var { Blob: Blob2, File: NativeFile } = require("buffer");\n    var File2 = NativeFile ?? UndiciFile;\n    var _FormData = class _FormData {\n      constructor(form) {\n        if (form !== void 0) {\n          throw webidl.errors.conversionFailed({\n            prefix: "FormData constructor",\n            argument: "Argument 1",\n            types: ["undefined"]\n          });\n        }\n        this[kState] = [];\n      }\n      append(name, value, filename = void 0) {\n        webidl.brandCheck(this, _FormData);\n        webidl.argumentLengthCheck(arguments, 2, { header: "FormData.append" });\n        if (arguments.length === 3 && !isBlobLike(value)) {\n          throw new TypeError(\n            "Failed to execute \'append\' on \'FormData\': parameter 2 is not of type \'Blob\'"\n          );\n        }\n        name = webidl.converters.USVString(name);\n        value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value);\n        filename = arguments.length === 3 ? webidl.converters.USVString(filename) : void 0;\n        const entry = makeEntry(name, value, filename);\n        this[kState].push(entry);\n      }\n      delete(name) {\n        webidl.brandCheck(this, _FormData);\n        webidl.argumentLengthCheck(arguments, 1, { header: "FormData.delete" });\n        name = webidl.converters.USVString(name);\n        this[kState] = this[kState].filter((entry) => entry.name !== name);\n      }\n      get(name) {\n        webidl.brandCheck(this, _FormData);\n        webidl.argumentLengthCheck(arguments, 1, { header: "FormData.get" });\n        name = webidl.converters.USVString(name);\n        const idx = this[kState].findIndex((entry) => entry.name === name);\n        if (idx === -1) {\n          return null;\n        }\n        return this[kState][idx].value;\n      }\n      getAll(name) {\n        webidl.brandCheck(this, _FormData);\n        webidl.argumentLengthCheck(arguments, 1, { header: "FormData.getAll" });\n        name = webidl.converters.USVString(name);\n        return this[kState].filter((entry) => entry.name === name).map((entry) => entry.value);\n      }\n      has(name) {\n        webidl.brandCheck(this, _FormData);\n        webidl.argumentLengthCheck(arguments, 1, { header: "FormData.has" });\n        name = webidl.converters.USVString(name);\n        return this[kState].findIndex((entry) => entry.name === name) !== -1;\n      }\n      set(name, value, filename = void 0) {\n        webidl.brandCheck(this, _FormData);\n        webidl.argumentLengthCheck(arguments, 2, { header: "FormData.set" });\n        if (arguments.length === 3 && !isBlobLike(value)) {\n          throw new TypeError(\n            "Failed to execute \'set\' on \'FormData\': parameter 2 is not of type \'Blob\'"\n          );\n        }\n        name = webidl.converters.USVString(name);\n        value = isBlobLike(value) ? webidl.converters.Blob(value, { strict: false }) : webidl.converters.USVString(value);\n        filename = arguments.length === 3 ? toUSVString(filename) : void 0;\n        const entry = makeEntry(name, value, filename);\n        const idx = this[kState].findIndex((entry2) => entry2.name === name);\n        if (idx !== -1) {\n          this[kState] = [\n            ...this[kState].slice(0, idx),\n            entry,\n            ...this[kState].slice(idx + 1).filter((entry2) => entry2.name !== name)\n          ];\n        } else {\n          this[kState].push(entry);\n        }\n      }\n      entries() {\n        webidl.brandCheck(this, _FormData);\n        return makeIterator(\n          () => this[kState].map((pair) => [pair.name, pair.value]),\n          "FormData",\n          "key+value"\n        );\n      }\n      keys() {\n        webidl.brandCheck(this, _FormData);\n        return makeIterator(\n          () => this[kState].map((pair) => [pair.name, pair.value]),\n          "FormData",\n          "key"\n        );\n      }\n      values() {\n        webidl.brandCheck(this, _FormData);\n        return makeIterator(\n          () => this[kState].map((pair) => [pair.name, pair.value]),\n          "FormData",\n          "value"\n        );\n      }\n      /**\n       * @param {(value: string, key: string, self: FormData) => void} callbackFn\n       * @param {unknown} thisArg\n       */\n      forEach(callbackFn, thisArg = globalThis) {\n        webidl.brandCheck(this, _FormData);\n        webidl.argumentLengthCheck(arguments, 1, { header: "FormData.forEach" });\n        if (typeof callbackFn !== "function") {\n          throw new TypeError(\n            "Failed to execute \'forEach\' on \'FormData\': parameter 1 is not of type \'Function\'."\n          );\n        }\n        for (const [key, value] of this) {\n          callbackFn.apply(thisArg, [value, key, this]);\n        }\n      }\n    };\n    __name(_FormData, "FormData");\n    var FormData2 = _FormData;\n    FormData2.prototype[Symbol.iterator] = FormData2.prototype.entries;\n    Object.defineProperties(FormData2.prototype, {\n      [Symbol.toStringTag]: {\n        value: "FormData",\n        configurable: true\n      }\n    });\n    function makeEntry(name, value, filename) {\n      name = Buffer.from(name).toString("utf8");\n      if (typeof value === "string") {\n        value = Buffer.from(value).toString("utf8");\n      } else {\n        if (!isFileLike(value)) {\n          value = value instanceof Blob2 ? new File2([value], "blob", { type: value.type }) : new FileLike(value, "blob", { type: value.type });\n        }\n        if (filename !== void 0) {\n          const options = {\n            type: value.type,\n            lastModified: value.lastModified\n          };\n          value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File2([value], filename, options) : new FileLike(value, filename, options);\n        }\n      }\n      return { name, value };\n    }\n    __name(makeEntry, "makeEntry");\n    module2.exports = { FormData: FormData2 };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/body.js\nvar require_body = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/body.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var Busboy = require_lib();\n    var util = require_util();\n    var {\n      ReadableStreamFrom,\n      isBlobLike,\n      isReadableStreamLike,\n      readableStreamClose,\n      createDeferredPromise,\n      fullyReadBody\n    } = require_util2();\n    var { FormData: FormData2 } = require_formdata();\n    var { kState } = require_symbols();\n    var { webidl } = require_webidl();\n    var { DOMException, structuredClone } = require_constants();\n    var { Blob: Blob2, File: NativeFile } = require("buffer");\n    var { kBodyUsed } = require_symbols2();\n    var assert = require("assert");\n    var { isErrored } = require_util();\n    var { isUint8Array, isArrayBuffer } = require_util_types();\n    var { File: UndiciFile } = require_file();\n    var { parseMIMEType, serializeAMimeType } = require_dataURL();\n    var ReadableStream = globalThis.ReadableStream;\n    var File2 = NativeFile ?? UndiciFile;\n    function extractBody(object, keepalive = false) {\n      if (!ReadableStream) {\n        ReadableStream = require("./streams").ReadableStream;\n      }\n      let stream = null;\n      if (object instanceof ReadableStream) {\n        stream = object;\n      } else if (isBlobLike(object)) {\n        stream = object.stream();\n      } else {\n        stream = new ReadableStream({\n          async pull(controller) {\n            controller.enqueue(\n              typeof source === "string" ? new TextEncoder().encode(source) : source\n            );\n            queueMicrotask(() => readableStreamClose(controller));\n          },\n          start() {\n          },\n          type: void 0\n        });\n      }\n      assert(isReadableStreamLike(stream));\n      let action = null;\n      let source = null;\n      let length = null;\n      let type = null;\n      if (typeof object === "string") {\n        source = object;\n        type = "text/plain;charset=UTF-8";\n      } else if (object instanceof URLSearchParams) {\n        source = object.toString();\n        type = "application/x-www-form-urlencoded;charset=UTF-8";\n      } else if (isArrayBuffer(object)) {\n        source = new Uint8Array(object.slice());\n      } else if (ArrayBuffer.isView(object)) {\n        source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength));\n      } else if (util.isFormDataLike(object)) {\n        const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`;\n        const prefix = `--${boundary}\\r\nContent-Disposition: form-data`;\n        const escape = /* @__PURE__ */ __name((str) => str.replace(/\\n/g, "%0A").replace(/\\r/g, "%0D").replace(/"/g, "%22"), "escape");\n        const normalizeLinefeeds = /* @__PURE__ */ __name((value) => value.replace(/\\r?\\n|\\r/g, "\\r\\n"), "normalizeLinefeeds");\n        const enc = new TextEncoder();\n        const blobParts = [];\n        const rn = new Uint8Array([13, 10]);\n        length = 0;\n        let hasUnknownSizeValue = false;\n        for (const [name, value] of object) {\n          if (typeof value === "string") {\n            const chunk2 = enc.encode(prefix + `; name="${escape(normalizeLinefeeds(name))}"\\r\n\\r\n${normalizeLinefeeds(value)}\\r\n`);\n            blobParts.push(chunk2);\n            length += chunk2.byteLength;\n          } else {\n            const chunk2 = enc.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape(value.name)}"` : "") + `\\r\nContent-Type: ${value.type || "application/octet-stream"}\\r\n\\r\n`);\n            blobParts.push(chunk2, value, rn);\n            if (typeof value.size === "number") {\n              length += chunk2.byteLength + value.size + rn.byteLength;\n            } else {\n              hasUnknownSizeValue = true;\n            }\n          }\n        }\n        const chunk = enc.encode(`--${boundary}--`);\n        blobParts.push(chunk);\n        length += chunk.byteLength;\n        if (hasUnknownSizeValue) {\n          length = null;\n        }\n        source = object;\n        action = /* @__PURE__ */ __name(async function* () {\n          for (const part of blobParts) {\n            if (part.stream) {\n              yield* part.stream();\n            } else {\n              yield part;\n            }\n          }\n        }, "action");\n        type = "multipart/form-data; boundary=" + boundary;\n      } else if (isBlobLike(object)) {\n        source = object;\n        length = object.size;\n        if (object.type) {\n          type = object.type;\n        }\n      } else if (typeof object[Symbol.asyncIterator] === "function") {\n        if (keepalive) {\n          throw new TypeError("keepalive");\n        }\n        if (util.isDisturbed(object) || object.locked) {\n          throw new TypeError(\n            "Response body object should not be disturbed or locked"\n          );\n        }\n        stream = object instanceof ReadableStream ? object : ReadableStreamFrom(object);\n      }\n      if (typeof source === "string" || util.isBuffer(source)) {\n        length = Buffer.byteLength(source);\n      }\n      if (action != null) {\n        let iterator;\n        stream = new ReadableStream({\n          async start() {\n            iterator = action(object)[Symbol.asyncIterator]();\n          },\n          async pull(controller) {\n            const { value, done } = await iterator.next();\n            if (done) {\n              queueMicrotask(() => {\n                controller.close();\n              });\n            } else {\n              if (!isErrored(stream)) {\n                controller.enqueue(new Uint8Array(value));\n              }\n            }\n            return controller.desiredSize > 0;\n          },\n          async cancel(reason) {\n            await iterator.return();\n          },\n          type: void 0\n        });\n      }\n      const body = { stream, source, length };\n      return [body, type];\n    }\n    __name(extractBody, "extractBody");\n    function safelyExtractBody(object, keepalive = false) {\n      if (!ReadableStream) {\n        ReadableStream = require("./streams").ReadableStream;\n      }\n      if (object instanceof ReadableStream) {\n        assert(!util.isDisturbed(object), "The body has already been consumed.");\n        assert(!object.locked, "The stream is locked.");\n      }\n      return extractBody(object, keepalive);\n    }\n    __name(safelyExtractBody, "safelyExtractBody");\n    function cloneBody(body) {\n      const [out1, out2] = body.stream.tee();\n      const out2Clone = structuredClone(out2, { transfer: [out2] });\n      const [, finalClone] = out2Clone.tee();\n      body.stream = out1;\n      return {\n        stream: finalClone,\n        length: body.length,\n        source: body.source\n      };\n    }\n    __name(cloneBody, "cloneBody");\n    async function* consumeBody(body) {\n      if (body) {\n        if (isUint8Array(body)) {\n          yield body;\n        } else {\n          const stream = body.stream;\n          if (util.isDisturbed(stream)) {\n            throw new TypeError("The body has already been consumed.");\n          }\n          if (stream.locked) {\n            throw new TypeError("The stream is locked.");\n          }\n          stream[kBodyUsed] = true;\n          yield* stream;\n        }\n      }\n    }\n    __name(consumeBody, "consumeBody");\n    function throwIfAborted(state) {\n      if (state.aborted) {\n        throw new DOMException("The operation was aborted.", "AbortError");\n      }\n    }\n    __name(throwIfAborted, "throwIfAborted");\n    function bodyMixinMethods(instance) {\n      const methods = {\n        blob() {\n          return specConsumeBody(this, (bytes) => {\n            let mimeType = bodyMimeType(this);\n            if (mimeType === "failure") {\n              mimeType = "";\n            } else if (mimeType) {\n              mimeType = serializeAMimeType(mimeType);\n            }\n            return new Blob2([bytes], { type: mimeType });\n          }, instance);\n        },\n        arrayBuffer() {\n          return specConsumeBody(this, (bytes) => {\n            return new Uint8Array(bytes).buffer;\n          }, instance);\n        },\n        text() {\n          return specConsumeBody(this, utf8DecodeBytes, instance);\n        },\n        json() {\n          return specConsumeBody(this, parseJSONFromBytes, instance);\n        },\n        async formData() {\n          webidl.brandCheck(this, instance);\n          throwIfAborted(this[kState]);\n          const contentType = this.headers.get("Content-Type");\n          if (/multipart\\/form-data/.test(contentType)) {\n            const headers = {};\n            for (const [key, value] of this.headers)\n              headers[key.toLowerCase()] = value;\n            const responseFormData = new FormData2();\n            let busboy;\n            try {\n              busboy = Busboy({\n                headers,\n                defParamCharset: "utf8"\n              });\n            } catch (err) {\n              throw new DOMException(`${err}`, "AbortError");\n            }\n            busboy.on("field", (name, value) => {\n              responseFormData.append(name, value);\n            });\n            busboy.on("file", (name, value, info) => {\n              const { filename, encoding, mimeType } = info;\n              const chunks = [];\n              if (encoding === "base64" || encoding.toLowerCase() === "base64") {\n                let base64chunk = "";\n                value.on("data", (chunk) => {\n                  base64chunk += chunk.toString().replace(/[\\r\\n]/gm, "");\n                  const end = base64chunk.length - base64chunk.length % 4;\n                  chunks.push(Buffer.from(base64chunk.slice(0, end), "base64"));\n                  base64chunk = base64chunk.slice(end);\n                });\n                value.on("end", () => {\n                  chunks.push(Buffer.from(base64chunk, "base64"));\n                  responseFormData.append(name, new File2(chunks, filename, { type: mimeType }));\n                });\n              } else {\n                value.on("data", (chunk) => {\n                  chunks.push(chunk);\n                });\n                value.on("end", () => {\n                  responseFormData.append(name, new File2(chunks, filename, { type: mimeType }));\n                });\n              }\n            });\n            const busboyResolve = new Promise((resolve, reject) => {\n              busboy.on("finish", resolve);\n              busboy.on("error", (err) => reject(new TypeError(err)));\n            });\n            if (this.body !== null)\n              for await (const chunk of consumeBody(this[kState].body))\n                busboy.write(chunk);\n            busboy.end();\n            await busboyResolve;\n            return responseFormData;\n          } else if (/application\\/x-www-form-urlencoded/.test(contentType)) {\n            let entries;\n            try {\n              let text = "";\n              const textDecoder = new TextDecoder("utf-8", { ignoreBOM: true });\n              for await (const chunk of consumeBody(this[kState].body)) {\n                if (!isUint8Array(chunk)) {\n                  throw new TypeError("Expected Uint8Array chunk");\n                }\n                text += textDecoder.decode(chunk, { stream: true });\n              }\n              text += textDecoder.decode();\n              entries = new URLSearchParams(text);\n            } catch (err) {\n              throw Object.assign(new TypeError(), { cause: err });\n            }\n            const formData = new FormData2();\n            for (const [name, value] of entries) {\n              formData.append(name, value);\n            }\n            return formData;\n          } else {\n            await Promise.resolve();\n            throwIfAborted(this[kState]);\n            throw webidl.errors.exception({\n              header: `${instance.name}.formData`,\n              message: "Could not parse content as FormData."\n            });\n          }\n        }\n      };\n      return methods;\n    }\n    __name(bodyMixinMethods, "bodyMixinMethods");\n    function mixinBody(prototype) {\n      Object.assign(prototype.prototype, bodyMixinMethods(prototype));\n    }\n    __name(mixinBody, "mixinBody");\n    async function specConsumeBody(object, convertBytesToJSValue, instance) {\n      webidl.brandCheck(object, instance);\n      throwIfAborted(object[kState]);\n      if (bodyUnusable(object[kState].body)) {\n        throw new TypeError("Body is unusable");\n      }\n      const promise = createDeferredPromise();\n      const errorSteps = /* @__PURE__ */ __name((error) => promise.reject(error), "errorSteps");\n      const successSteps = /* @__PURE__ */ __name((data) => {\n        try {\n          promise.resolve(convertBytesToJSValue(data));\n        } catch (e) {\n          errorSteps(e);\n        }\n      }, "successSteps");\n      if (object[kState].body == null) {\n        successSteps(new Uint8Array());\n        return promise.promise;\n      }\n      fullyReadBody(object[kState].body, successSteps, errorSteps);\n      return promise.promise;\n    }\n    __name(specConsumeBody, "specConsumeBody");\n    function bodyUnusable(body) {\n      return body != null && (body.stream.locked || util.isDisturbed(body.stream));\n    }\n    __name(bodyUnusable, "bodyUnusable");\n    function utf8DecodeBytes(buffer) {\n      if (buffer.length === 0) {\n        return "";\n      }\n      if (buffer[0] === 239 && buffer[1] === 187 && buffer[2] === 191) {\n        buffer = buffer.subarray(3);\n      }\n      const output = new TextDecoder().decode(buffer);\n      return output;\n    }\n    __name(utf8DecodeBytes, "utf8DecodeBytes");\n    function parseJSONFromBytes(bytes) {\n      return JSON.parse(utf8DecodeBytes(bytes));\n    }\n    __name(parseJSONFromBytes, "parseJSONFromBytes");\n    function bodyMimeType(object) {\n      const { headersList } = object[kState];\n      const contentType = headersList.get("content-type");\n      if (contentType === null) {\n        return "failure";\n      }\n      return parseMIMEType(contentType);\n    }\n    __name(bodyMimeType, "bodyMimeType");\n    module2.exports = {\n      extractBody,\n      safelyExtractBody,\n      cloneBody,\n      mixinBody\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/response.js\nvar require_response = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/response.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { Headers: Headers3, HeadersList, fill } = require_headers();\n    var { extractBody, cloneBody, mixinBody } = require_body();\n    var util = require_util();\n    var { kEnumerableProperty } = util;\n    var {\n      isValidReasonPhrase,\n      isCancelled,\n      isAborted,\n      isBlobLike,\n      serializeJavascriptValueToJSONString,\n      isErrorLike,\n      isomorphicEncode\n    } = require_util2();\n    var {\n      redirectStatus,\n      nullBodyStatus,\n      DOMException\n    } = require_constants();\n    var { kState, kHeaders: kHeaders2, kGuard: kGuard2, kRealm } = require_symbols();\n    var { webidl } = require_webidl();\n    var { FormData: FormData2 } = require_formdata();\n    var { getGlobalOrigin } = require_global();\n    var { URLSerializer } = require_dataURL();\n    var { kHeadersList } = require_symbols2();\n    var assert = require("assert");\n    var { types } = require("util");\n    var ReadableStream = globalThis.ReadableStream || require("./streams").ReadableStream;\n    var _Response = class _Response {\n      // Creates network error Response.\n      static error() {\n        const relevantRealm = { settingsObject: {} };\n        const responseObject = new _Response();\n        responseObject[kState] = makeNetworkError();\n        responseObject[kRealm] = relevantRealm;\n        responseObject[kHeaders2][kHeadersList] = responseObject[kState].headersList;\n        responseObject[kHeaders2][kGuard2] = "immutable";\n        responseObject[kHeaders2][kRealm] = relevantRealm;\n        return responseObject;\n      }\n      // https://fetch.spec.whatwg.org/#dom-response-json\n      static json(data = void 0, init = {}) {\n        webidl.argumentLengthCheck(arguments, 1, { header: "Response.json" });\n        if (init !== null) {\n          init = webidl.converters.ResponseInit(init);\n        }\n        const bytes = new TextEncoder("utf-8").encode(\n          serializeJavascriptValueToJSONString(data)\n        );\n        const body = extractBody(bytes);\n        const relevantRealm = { settingsObject: {} };\n        const responseObject = new _Response();\n        responseObject[kRealm] = relevantRealm;\n        responseObject[kHeaders2][kGuard2] = "response";\n        responseObject[kHeaders2][kRealm] = relevantRealm;\n        initializeResponse(responseObject, init, { body: body[0], type: "application/json" });\n        return responseObject;\n      }\n      // Creates a redirect Response that redirects to url with status status.\n      static redirect(url, status = 302) {\n        const relevantRealm = { settingsObject: {} };\n        webidl.argumentLengthCheck(arguments, 1, { header: "Response.redirect" });\n        url = webidl.converters.USVString(url);\n        status = webidl.converters["unsigned short"](status);\n        let parsedURL;\n        try {\n          parsedURL = new URL(url, getGlobalOrigin());\n        } catch (err) {\n          throw Object.assign(new TypeError("Failed to parse URL from " + url), {\n            cause: err\n          });\n        }\n        if (!redirectStatus.includes(status)) {\n          throw new RangeError("Invalid status code " + status);\n        }\n        const responseObject = new _Response();\n        responseObject[kRealm] = relevantRealm;\n        responseObject[kHeaders2][kGuard2] = "immutable";\n        responseObject[kHeaders2][kRealm] = relevantRealm;\n        responseObject[kState].status = status;\n        const value = isomorphicEncode(URLSerializer(parsedURL));\n        responseObject[kState].headersList.append("location", value);\n        return responseObject;\n      }\n      // https://fetch.spec.whatwg.org/#dom-response\n      constructor(body = null, init = {}) {\n        if (body !== null) {\n          body = webidl.converters.BodyInit(body);\n        }\n        init = webidl.converters.ResponseInit(init);\n        this[kRealm] = { settingsObject: {} };\n        this[kState] = makeResponse({});\n        this[kHeaders2] = new Headers3();\n        this[kHeaders2][kGuard2] = "response";\n        this[kHeaders2][kHeadersList] = this[kState].headersList;\n        this[kHeaders2][kRealm] = this[kRealm];\n        let bodyWithType = null;\n        if (body != null) {\n          const [extractedBody, type] = extractBody(body);\n          bodyWithType = { body: extractedBody, type };\n        }\n        initializeResponse(this, init, bodyWithType);\n      }\n      // Returns response\u2019s type, e.g., "cors".\n      get type() {\n        webidl.brandCheck(this, _Response);\n        return this[kState].type;\n      }\n      // Returns response\u2019s URL, if it has one; otherwise the empty string.\n      get url() {\n        webidl.brandCheck(this, _Response);\n        const urlList = this[kState].urlList;\n        const url = urlList[urlList.length - 1] ?? null;\n        if (url === null) {\n          return "";\n        }\n        return URLSerializer(url, true);\n      }\n      // Returns whether response was obtained through a redirect.\n      get redirected() {\n        webidl.brandCheck(this, _Response);\n        return this[kState].urlList.length > 1;\n      }\n      // Returns response\u2019s status.\n      get status() {\n        webidl.brandCheck(this, _Response);\n        return this[kState].status;\n      }\n      // Returns whether response\u2019s status is an ok status.\n      get ok() {\n        webidl.brandCheck(this, _Response);\n        return this[kState].status >= 200 && this[kState].status <= 299;\n      }\n      // Returns response\u2019s status message.\n      get statusText() {\n        webidl.brandCheck(this, _Response);\n        return this[kState].statusText;\n      }\n      // Returns response\u2019s headers as Headers.\n      get headers() {\n        webidl.brandCheck(this, _Response);\n        return this[kHeaders2];\n      }\n      get body() {\n        webidl.brandCheck(this, _Response);\n        return this[kState].body ? this[kState].body.stream : null;\n      }\n      get bodyUsed() {\n        webidl.brandCheck(this, _Response);\n        return !!this[kState].body && util.isDisturbed(this[kState].body.stream);\n      }\n      // Returns a clone of response.\n      clone() {\n        webidl.brandCheck(this, _Response);\n        if (this.bodyUsed || this.body && this.body.locked) {\n          throw webidl.errors.exception({\n            header: "Response.clone",\n            message: "Body has already been consumed."\n          });\n        }\n        const clonedResponse = cloneResponse(this[kState]);\n        const clonedResponseObject = new _Response();\n        clonedResponseObject[kState] = clonedResponse;\n        clonedResponseObject[kRealm] = this[kRealm];\n        clonedResponseObject[kHeaders2][kHeadersList] = clonedResponse.headersList;\n        clonedResponseObject[kHeaders2][kGuard2] = this[kHeaders2][kGuard2];\n        clonedResponseObject[kHeaders2][kRealm] = this[kHeaders2][kRealm];\n        return clonedResponseObject;\n      }\n    };\n    __name(_Response, "Response");\n    var Response3 = _Response;\n    mixinBody(Response3);\n    Object.defineProperties(Response3.prototype, {\n      type: kEnumerableProperty,\n      url: kEnumerableProperty,\n      status: kEnumerableProperty,\n      ok: kEnumerableProperty,\n      redirected: kEnumerableProperty,\n      statusText: kEnumerableProperty,\n      headers: kEnumerableProperty,\n      clone: kEnumerableProperty,\n      body: kEnumerableProperty,\n      bodyUsed: kEnumerableProperty,\n      [Symbol.toStringTag]: {\n        value: "Response",\n        configurable: true\n      }\n    });\n    Object.defineProperties(Response3, {\n      json: kEnumerableProperty,\n      redirect: kEnumerableProperty,\n      error: kEnumerableProperty\n    });\n    function cloneResponse(response) {\n      if (response.internalResponse) {\n        return filterResponse(\n          cloneResponse(response.internalResponse),\n          response.type\n        );\n      }\n      const newResponse = makeResponse({ ...response, body: null });\n      if (response.body != null) {\n        newResponse.body = cloneBody(response.body);\n      }\n      return newResponse;\n    }\n    __name(cloneResponse, "cloneResponse");\n    function makeResponse(init) {\n      return {\n        aborted: false,\n        rangeRequested: false,\n        timingAllowPassed: false,\n        requestIncludesCredentials: false,\n        type: "default",\n        status: 200,\n        timingInfo: null,\n        cacheState: "",\n        statusText: "",\n        ...init,\n        headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList(),\n        urlList: init.urlList ? [...init.urlList] : []\n      };\n    }\n    __name(makeResponse, "makeResponse");\n    function makeNetworkError(reason) {\n      const isError = isErrorLike(reason);\n      return makeResponse({\n        type: "error",\n        status: 0,\n        error: isError ? reason : new Error(reason ? String(reason) : reason),\n        aborted: reason && reason.name === "AbortError"\n      });\n    }\n    __name(makeNetworkError, "makeNetworkError");\n    function makeFilteredResponse(response, state) {\n      state = {\n        internalResponse: response,\n        ...state\n      };\n      return new Proxy(response, {\n        get(target, p) {\n          return p in state ? state[p] : target[p];\n        },\n        set(target, p, value) {\n          assert(!(p in state));\n          target[p] = value;\n          return true;\n        }\n      });\n    }\n    __name(makeFilteredResponse, "makeFilteredResponse");\n    function filterResponse(response, type) {\n      if (type === "basic") {\n        return makeFilteredResponse(response, {\n          type: "basic",\n          headersList: response.headersList\n        });\n      } else if (type === "cors") {\n        return makeFilteredResponse(response, {\n          type: "cors",\n          headersList: response.headersList\n        });\n      } else if (type === "opaque") {\n        return makeFilteredResponse(response, {\n          type: "opaque",\n          urlList: Object.freeze([]),\n          status: 0,\n          statusText: "",\n          body: null\n        });\n      } else if (type === "opaqueredirect") {\n        return makeFilteredResponse(response, {\n          type: "opaqueredirect",\n          status: 0,\n          statusText: "",\n          headersList: [],\n          body: null\n        });\n      } else {\n        assert(false);\n      }\n    }\n    __name(filterResponse, "filterResponse");\n    function makeAppropriateNetworkError(fetchParams) {\n      assert(isCancelled(fetchParams));\n      return isAborted(fetchParams) ? makeNetworkError(new DOMException("The operation was aborted.", "AbortError")) : makeNetworkError("Request was cancelled.");\n    }\n    __name(makeAppropriateNetworkError, "makeAppropriateNetworkError");\n    function initializeResponse(response, init, body) {\n      if (init.status !== null && (init.status < 200 || init.status > 599)) {\n        throw new RangeError(\'init["status"] must be in the range of 200 to 599, inclusive.\');\n      }\n      if ("statusText" in init && init.statusText != null) {\n        if (!isValidReasonPhrase(String(init.statusText))) {\n          throw new TypeError("Invalid statusText");\n        }\n      }\n      if ("status" in init && init.status != null) {\n        response[kState].status = init.status;\n      }\n      if ("statusText" in init && init.statusText != null) {\n        response[kState].statusText = init.statusText;\n      }\n      if ("headers" in init && init.headers != null) {\n        fill(response[kHeaders2], init.headers);\n      }\n      if (body) {\n        if (nullBodyStatus.includes(response.status)) {\n          throw webidl.errors.exception({\n            header: "Response constructor",\n            message: "Invalid response status code " + response.status\n          });\n        }\n        response[kState].body = body.body;\n        if (body.type != null && !response[kState].headersList.contains("Content-Type")) {\n          response[kState].headersList.append("content-type", body.type);\n        }\n      }\n    }\n    __name(initializeResponse, "initializeResponse");\n    webidl.converters.ReadableStream = webidl.interfaceConverter(\n      ReadableStream\n    );\n    webidl.converters.FormData = webidl.interfaceConverter(\n      FormData2\n    );\n    webidl.converters.URLSearchParams = webidl.interfaceConverter(\n      URLSearchParams\n    );\n    webidl.converters.XMLHttpRequestBodyInit = function(V) {\n      if (typeof V === "string") {\n        return webidl.converters.USVString(V);\n      }\n      if (isBlobLike(V)) {\n        return webidl.converters.Blob(V, { strict: false });\n      }\n      if (types.isAnyArrayBuffer(V) || types.isTypedArray(V) || types.isDataView(V)) {\n        return webidl.converters.BufferSource(V);\n      }\n      if (util.isFormDataLike(V)) {\n        return webidl.converters.FormData(V, { strict: false });\n      }\n      if (V instanceof URLSearchParams) {\n        return webidl.converters.URLSearchParams(V);\n      }\n      return webidl.converters.DOMString(V);\n    };\n    webidl.converters.BodyInit = function(V) {\n      if (V instanceof ReadableStream) {\n        return webidl.converters.ReadableStream(V);\n      }\n      if (V?.[Symbol.asyncIterator]) {\n        return V;\n      }\n      return webidl.converters.XMLHttpRequestBodyInit(V);\n    };\n    webidl.converters.ResponseInit = webidl.dictionaryConverter([\n      {\n        key: "status",\n        converter: webidl.converters["unsigned short"],\n        defaultValue: 200\n      },\n      {\n        key: "statusText",\n        converter: webidl.converters.ByteString,\n        defaultValue: ""\n      },\n      {\n        key: "headers",\n        converter: webidl.converters.HeadersInit\n      }\n    ]);\n    module2.exports = {\n      makeNetworkError,\n      makeResponse,\n      makeAppropriateNetworkError,\n      filterResponse,\n      Response: Response3,\n      cloneResponse\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/compat/dispatcher-weakref.js\nvar require_dispatcher_weakref = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/compat/dispatcher-weakref.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { kConnected, kSize } = require_symbols2();\n    var _CompatWeakRef = class _CompatWeakRef {\n      constructor(value) {\n        this.value = value;\n      }\n      deref() {\n        return this.value[kConnected] === 0 && this.value[kSize] === 0 ? void 0 : this.value;\n      }\n    };\n    __name(_CompatWeakRef, "CompatWeakRef");\n    var CompatWeakRef = _CompatWeakRef;\n    var _CompatFinalizer = class _CompatFinalizer {\n      constructor(finalizer) {\n        this.finalizer = finalizer;\n      }\n      register(dispatcher, key) {\n        dispatcher.on("disconnect", () => {\n          if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n            this.finalizer(key);\n          }\n        });\n      }\n    };\n    __name(_CompatFinalizer, "CompatFinalizer");\n    var CompatFinalizer = _CompatFinalizer;\n    module2.exports = function() {\n      return {\n        WeakRef: global.WeakRef || CompatWeakRef,\n        FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer\n      };\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/request.js\nvar require_request = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/request.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    global.FinalizationRegistry = function() {\n      return { register: function() {\n      } };\n    };\n    var { extractBody, mixinBody, cloneBody } = require_body();\n    var { Headers: Headers3, fill: fillHeaders, HeadersList } = require_headers();\n    var { FinalizationRegistry } = require_dispatcher_weakref()();\n    var util = require_util();\n    var {\n      isValidHTTPToken,\n      sameOrigin,\n      normalizeMethod,\n      makePolicyContainer\n    } = require_util2();\n    var {\n      forbiddenMethods,\n      corsSafeListedMethods,\n      referrerPolicy,\n      requestRedirect,\n      requestMode,\n      requestCredentials,\n      requestCache,\n      requestDuplex\n    } = require_constants();\n    var { kEnumerableProperty } = util;\n    var { kHeaders: kHeaders2, kSignal, kState, kGuard: kGuard2, kRealm } = require_symbols();\n    var { webidl } = require_webidl();\n    var { getGlobalOrigin } = require_global();\n    var { URLSerializer } = require_dataURL();\n    var { kHeadersList } = require_symbols2();\n    var assert = require("assert");\n    var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events");\n    var TransformStream = globalThis.TransformStream;\n    var kInit = Symbol("init");\n    var kAbortController = Symbol("abortController");\n    var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n      signal.removeEventListener("abort", abort);\n    });\n    var _Request2 = class _Request2 {\n      // https://fetch.spec.whatwg.org/#dom-request\n      constructor(input, init = {}) {\n        if (input === kInit) {\n          return;\n        }\n        webidl.argumentLengthCheck(arguments, 1, { header: "Request constructor" });\n        input = webidl.converters.RequestInfo(input);\n        init = webidl.converters.RequestInit(init);\n        this[kRealm] = {\n          settingsObject: {\n            baseUrl: getGlobalOrigin(),\n            get origin() {\n              return this.baseUrl?.origin;\n            },\n            policyContainer: makePolicyContainer()\n          }\n        };\n        let request = null;\n        let fallbackMode = null;\n        const baseUrl = this[kRealm].settingsObject.baseUrl;\n        let signal = null;\n        if (typeof input === "string") {\n          let parsedURL;\n          try {\n            parsedURL = new URL(input, baseUrl);\n          } catch (err) {\n            throw new TypeError("Failed to parse URL from " + input, { cause: err });\n          }\n          if (parsedURL.username || parsedURL.password) {\n            throw new TypeError(\n              "Request cannot be constructed from a URL that includes credentials: " + input\n            );\n          }\n          request = makeRequest({ urlList: [parsedURL] });\n          fallbackMode = "cors";\n        } else {\n          assert(input instanceof _Request2);\n          request = input[kState];\n          signal = input[kSignal];\n        }\n        const origin = this[kRealm].settingsObject.origin;\n        let window = "client";\n        if (request.window?.constructor?.name === "EnvironmentSettingsObject" && sameOrigin(request.window, origin)) {\n          window = request.window;\n        }\n        if (init.window != null) {\n          throw new TypeError(`\'window\' option \'${window}\' must be null`);\n        }\n        if ("window" in init) {\n          window = "no-window";\n        }\n        request = makeRequest({\n          // URL request\u2019s URL.\n          // undici implementation note: this is set as the first item in request\'s urlList in makeRequest\n          // method request\u2019s method.\n          method: request.method,\n          // header list A copy of request\u2019s header list.\n          // undici implementation note: headersList is cloned in makeRequest\n          headersList: request.headersList,\n          // unsafe-request flag Set.\n          unsafeRequest: request.unsafeRequest,\n          // client This\u2019s relevant settings object.\n          client: this[kRealm].settingsObject,\n          // window window.\n          window,\n          // priority request\u2019s priority.\n          priority: request.priority,\n          // origin request\u2019s origin. The propagation of the origin is only significant for navigation requests\n          // being handled by a service worker. In this scenario a request can have an origin that is different\n          // from the current client.\n          origin: request.origin,\n          // referrer request\u2019s referrer.\n          referrer: request.referrer,\n          // referrer policy request\u2019s referrer policy.\n          referrerPolicy: request.referrerPolicy,\n          // mode request\u2019s mode.\n          mode: request.mode,\n          // credentials mode request\u2019s credentials mode.\n          credentials: request.credentials,\n          // cache mode request\u2019s cache mode.\n          cache: request.cache,\n          // redirect mode request\u2019s redirect mode.\n          redirect: request.redirect,\n          // integrity metadata request\u2019s integrity metadata.\n          integrity: request.integrity,\n          // keepalive request\u2019s keepalive.\n          keepalive: request.keepalive,\n          // reload-navigation flag request\u2019s reload-navigation flag.\n          reloadNavigation: request.reloadNavigation,\n          // history-navigation flag request\u2019s history-navigation flag.\n          historyNavigation: request.historyNavigation,\n          // URL list A clone of request\u2019s URL list.\n          urlList: [...request.urlList]\n        });\n        if (Object.keys(init).length > 0) {\n          if (request.mode === "navigate") {\n            request.mode = "same-origin";\n          }\n          request.reloadNavigation = false;\n          request.historyNavigation = false;\n          request.origin = "client";\n          request.referrer = "client";\n          request.referrerPolicy = "";\n          request.url = request.urlList[request.urlList.length - 1];\n          request.urlList = [request.url];\n        }\n        if (init.referrer !== void 0) {\n          const referrer = init.referrer;\n          if (referrer === "") {\n            request.referrer = "no-referrer";\n          } else {\n            let parsedReferrer;\n            try {\n              parsedReferrer = new URL(referrer, baseUrl);\n            } catch (err) {\n              throw new TypeError(`Referrer "${referrer}" is not a valid URL.`, { cause: err });\n            }\n            if (parsedReferrer.protocol === "about:" && parsedReferrer.hostname === "client" || origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl)) {\n              request.referrer = "client";\n            } else {\n              request.referrer = parsedReferrer;\n            }\n          }\n        }\n        if (init.referrerPolicy !== void 0) {\n          request.referrerPolicy = init.referrerPolicy;\n        }\n        let mode;\n        if (init.mode !== void 0) {\n          mode = init.mode;\n        } else {\n          mode = fallbackMode;\n        }\n        if (mode === "navigate") {\n          throw webidl.errors.exception({\n            header: "Request constructor",\n            message: "invalid request mode navigate."\n          });\n        }\n        if (mode != null) {\n          request.mode = mode;\n        }\n        if (init.credentials !== void 0) {\n          request.credentials = init.credentials;\n        }\n        if (init.cache !== void 0) {\n          request.cache = init.cache;\n        }\n        if (request.cache === "only-if-cached" && request.mode !== "same-origin") {\n          throw new TypeError(\n            "\'only-if-cached\' can be set only with \'same-origin\' mode"\n          );\n        }\n        if (init.redirect !== void 0) {\n          request.redirect = init.redirect;\n        }\n        if (init.integrity !== void 0 && init.integrity != null) {\n          request.integrity = String(init.integrity);\n        }\n        if (init.keepalive !== void 0) {\n          request.keepalive = Boolean(init.keepalive);\n        }\n        if (init.method !== void 0) {\n          let method = init.method;\n          if (!isValidHTTPToken(init.method)) {\n            throw TypeError(`\'${init.method}\' is not a valid HTTP method.`);\n          }\n          if (forbiddenMethods.indexOf(method.toUpperCase()) !== -1) {\n            throw TypeError(`\'${init.method}\' HTTP method is unsupported.`);\n          }\n          method = normalizeMethod(init.method);\n          request.method = method;\n        }\n        if (init.signal !== void 0) {\n          signal = init.signal;\n        }\n        this[kState] = request;\n        const ac = new AbortController();\n        this[kSignal] = ac.signal;\n        this[kSignal][kRealm] = this[kRealm];\n        if (signal != null) {\n          if (!signal || typeof signal.aborted !== "boolean" || typeof signal.addEventListener !== "function") {\n            throw new TypeError(\n              "Failed to construct \'Request\': member signal is not of type AbortSignal."\n            );\n          }\n          if (signal.aborted) {\n            ac.abort(signal.reason);\n          } else {\n            this[kAbortController] = ac;\n            const acRef = new WeakRef(ac);\n            const abort = /* @__PURE__ */ __name(function() {\n              const ac2 = acRef.deref();\n              if (ac2 !== void 0) {\n                ac2.abort(this.reason);\n              }\n            }, "abort");\n            try {\n              if (typeof getMaxListeners === "function" && getMaxListeners(signal) === defaultMaxListeners) {\n                setMaxListeners(100, signal);\n              } else if (getEventListeners(signal, "abort").length >= defaultMaxListeners) {\n                setMaxListeners(100, signal);\n              }\n            } catch {\n            }\n            util.addAbortListener(signal, abort);\n            requestFinalizer.register(ac, { signal, abort });\n          }\n        }\n        this[kHeaders2] = new Headers3();\n        this[kHeaders2][kHeadersList] = request.headersList;\n        this[kHeaders2][kGuard2] = "request";\n        this[kHeaders2][kRealm] = this[kRealm];\n        if (mode === "no-cors") {\n          if (!corsSafeListedMethods.includes(request.method)) {\n            throw new TypeError(\n              `\'${request.method} is unsupported in no-cors mode.`\n            );\n          }\n          this[kHeaders2][kGuard2] = "request-no-cors";\n        }\n        if (Object.keys(init).length !== 0) {\n          let headers = new Headers3(this[kHeaders2]);\n          if (init.headers !== void 0) {\n            headers = init.headers;\n          }\n          this[kHeaders2][kHeadersList].clear();\n          if (headers.constructor.name === "Headers") {\n            for (const [key, val] of headers) {\n              this[kHeaders2].append(key, val);\n            }\n          } else {\n            fillHeaders(this[kHeaders2], headers);\n          }\n        }\n        const inputBody = input instanceof _Request2 ? input[kState].body : null;\n        if ((init.body != null || inputBody != null) && (request.method === "GET" || request.method === "HEAD")) {\n          throw new TypeError("Request with GET/HEAD method cannot have body.");\n        }\n        let initBody = null;\n        if (init.body != null) {\n          const [extractedBody, contentType] = extractBody(\n            init.body,\n            request.keepalive\n          );\n          initBody = extractedBody;\n          if (contentType && !this[kHeaders2][kHeadersList].contains("content-type")) {\n            this[kHeaders2].append("content-type", contentType);\n          }\n        }\n        const inputOrInitBody = initBody ?? inputBody;\n        if (inputOrInitBody != null && inputOrInitBody.source == null) {\n          if (initBody != null && init.duplex == null) {\n            throw new TypeError("RequestInit: duplex option is required when sending a body.");\n          }\n          if (request.mode !== "same-origin" && request.mode !== "cors") {\n            throw new TypeError(\n              \'If request is made from ReadableStream, mode should be "same-origin" or "cors"\'\n            );\n          }\n          request.useCORSPreflightFlag = true;\n        }\n        let finalBody = inputOrInitBody;\n        if (initBody == null && inputBody != null) {\n          if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {\n            throw new TypeError(\n              "Cannot construct a Request with a Request object that has already been used."\n            );\n          }\n          if (!TransformStream) {\n            TransformStream = require("./streams").TransformStream;\n          }\n          const identityTransform = new TransformStream();\n          inputBody.stream.pipeThrough(identityTransform);\n          finalBody = {\n            source: inputBody.source,\n            length: inputBody.length,\n            stream: identityTransform.readable\n          };\n        }\n        this[kState].body = finalBody;\n      }\n      // Returns request\u2019s HTTP method, which is "GET" by default.\n      get method() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].method;\n      }\n      // Returns the URL of request as a string.\n      get url() {\n        webidl.brandCheck(this, _Request2);\n        return URLSerializer(this[kState].url);\n      }\n      // Returns a Headers object consisting of the headers associated with request.\n      // Note that headers added in the network layer by the user agent will not\n      // be accounted for in this object, e.g., the "Host" header.\n      get headers() {\n        webidl.brandCheck(this, _Request2);\n        return this[kHeaders2];\n      }\n      // Returns the kind of resource requested by request, e.g., "document"\n      // or "script".\n      get destination() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].destination;\n      }\n      // Returns the referrer of request. Its value can be a same-origin URL if\n      // explicitly set in init, the empty string to indicate no referrer, and\n      // "about:client" when defaulting to the global\u2019s default. This is used\n      // during fetching to determine the value of the `Referer` header of the\n      // request being made.\n      get referrer() {\n        webidl.brandCheck(this, _Request2);\n        if (this[kState].referrer === "no-referrer") {\n          return "";\n        }\n        if (this[kState].referrer === "client") {\n          return "about:client";\n        }\n        return this[kState].referrer.toString();\n      }\n      // Returns the referrer policy associated with request.\n      // This is used during fetching to compute the value of the request\u2019s\n      // referrer.\n      get referrerPolicy() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].referrerPolicy;\n      }\n      // Returns the mode associated with request, which is a string indicating\n      // whether the request will use CORS, or will be restricted to same-origin\n      // URLs.\n      get mode() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].mode;\n      }\n      // Returns the credentials mode associated with request,\n      // which is a string indicating whether credentials will be sent with the\n      // request always, never, or only when sent to a same-origin URL.\n      get credentials() {\n        return this[kState].credentials;\n      }\n      // Returns the cache mode associated with request,\n      // which is a string indicating how the request will\n      // interact with the browser\u2019s cache when fetching.\n      get cache() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].cache;\n      }\n      // Returns the redirect mode associated with request,\n      // which is a string indicating how redirects for the\n      // request will be handled during fetching. A request\n      // will follow redirects by default.\n      get redirect() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].redirect;\n      }\n      // Returns request\u2019s subresource integrity metadata, which is a\n      // cryptographic hash of the resource being fetched. Its value\n      // consists of multiple hashes separated by whitespace. [SRI]\n      get integrity() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].integrity;\n      }\n      // Returns a boolean indicating whether or not request can outlive the\n      // global in which it was created.\n      get keepalive() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].keepalive;\n      }\n      // Returns a boolean indicating whether or not request is for a reload\n      // navigation.\n      get isReloadNavigation() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].reloadNavigation;\n      }\n      // Returns a boolean indicating whether or not request is for a history\n      // navigation (a.k.a. back-foward navigation).\n      get isHistoryNavigation() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].historyNavigation;\n      }\n      // Returns the signal associated with request, which is an AbortSignal\n      // object indicating whether or not request has been aborted, and its\n      // abort event handler.\n      get signal() {\n        webidl.brandCheck(this, _Request2);\n        return this[kSignal];\n      }\n      get body() {\n        webidl.brandCheck(this, _Request2);\n        return this[kState].body ? this[kState].body.stream : null;\n      }\n      get bodyUsed() {\n        webidl.brandCheck(this, _Request2);\n        return !!this[kState].body && util.isDisturbed(this[kState].body.stream);\n      }\n      get duplex() {\n        webidl.brandCheck(this, _Request2);\n        return "half";\n      }\n      // Returns a clone of request.\n      clone() {\n        webidl.brandCheck(this, _Request2);\n        if (this.bodyUsed || this.body?.locked) {\n          throw new TypeError("unusable");\n        }\n        const clonedRequest = cloneRequest(this[kState]);\n        const clonedRequestObject = new _Request2(kInit);\n        clonedRequestObject[kState] = clonedRequest;\n        clonedRequestObject[kRealm] = this[kRealm];\n        clonedRequestObject[kHeaders2] = new Headers3();\n        clonedRequestObject[kHeaders2][kHeadersList] = clonedRequest.headersList;\n        clonedRequestObject[kHeaders2][kGuard2] = this[kHeaders2][kGuard2];\n        clonedRequestObject[kHeaders2][kRealm] = this[kHeaders2][kRealm];\n        const ac = new AbortController();\n        if (this.signal.aborted) {\n          ac.abort(this.signal.reason);\n        } else {\n          util.addAbortListener(\n            this.signal,\n            () => {\n              ac.abort(this.signal.reason);\n            }\n          );\n        }\n        clonedRequestObject[kSignal] = ac.signal;\n        return clonedRequestObject;\n      }\n    };\n    __name(_Request2, "Request");\n    var Request2 = _Request2;\n    mixinBody(Request2);\n    function makeRequest(init) {\n      const request = {\n        method: "GET",\n        localURLsOnly: false,\n        unsafeRequest: false,\n        body: null,\n        client: null,\n        reservedClient: null,\n        replacesClientId: "",\n        window: "client",\n        keepalive: false,\n        serviceWorkers: "all",\n        initiator: "",\n        destination: "",\n        priority: null,\n        origin: "client",\n        policyContainer: "client",\n        referrer: "client",\n        referrerPolicy: "",\n        mode: "no-cors",\n        useCORSPreflightFlag: false,\n        credentials: "same-origin",\n        useCredentials: false,\n        cache: "default",\n        redirect: "follow",\n        integrity: "",\n        cryptoGraphicsNonceMetadata: "",\n        parserMetadata: "",\n        reloadNavigation: false,\n        historyNavigation: false,\n        userActivation: false,\n        taintedOrigin: false,\n        redirectCount: 0,\n        responseTainting: "basic",\n        preventNoCacheCacheControlHeaderModification: false,\n        done: false,\n        timingAllowFailed: false,\n        ...init,\n        headersList: init.headersList ? new HeadersList(init.headersList) : new HeadersList()\n      };\n      request.url = request.urlList[0];\n      return request;\n    }\n    __name(makeRequest, "makeRequest");\n    function cloneRequest(request) {\n      const newRequest = makeRequest({ ...request, body: null });\n      if (request.body != null) {\n        newRequest.body = cloneBody(request.body);\n      }\n      return newRequest;\n    }\n    __name(cloneRequest, "cloneRequest");\n    Object.defineProperties(Request2.prototype, {\n      method: kEnumerableProperty,\n      url: kEnumerableProperty,\n      headers: kEnumerableProperty,\n      redirect: kEnumerableProperty,\n      clone: kEnumerableProperty,\n      signal: kEnumerableProperty,\n      duplex: kEnumerableProperty,\n      destination: kEnumerableProperty,\n      body: kEnumerableProperty,\n      bodyUsed: kEnumerableProperty,\n      isHistoryNavigation: kEnumerableProperty,\n      isReloadNavigation: kEnumerableProperty,\n      keepalive: kEnumerableProperty,\n      integrity: kEnumerableProperty,\n      cache: kEnumerableProperty,\n      credentials: kEnumerableProperty,\n      attribute: kEnumerableProperty,\n      referrerPolicy: kEnumerableProperty,\n      referrer: kEnumerableProperty,\n      mode: kEnumerableProperty,\n      [Symbol.toStringTag]: {\n        value: "Request",\n        configurable: true\n      }\n    });\n    webidl.converters.Request = webidl.interfaceConverter(\n      Request2\n    );\n    webidl.converters.RequestInfo = function(V) {\n      if (typeof V === "string") {\n        return webidl.converters.USVString(V);\n      }\n      if (V instanceof Request2) {\n        return webidl.converters.Request(V);\n      }\n      return webidl.converters.USVString(V);\n    };\n    webidl.converters.AbortSignal = webidl.interfaceConverter(\n      AbortSignal\n    );\n    webidl.converters.RequestInit = webidl.dictionaryConverter([\n      {\n        key: "method",\n        converter: webidl.converters.ByteString\n      },\n      {\n        key: "headers",\n        converter: webidl.converters.HeadersInit\n      },\n      {\n        key: "body",\n        converter: webidl.nullableConverter(\n          webidl.converters.BodyInit\n        )\n      },\n      {\n        key: "referrer",\n        converter: webidl.converters.USVString\n      },\n      {\n        key: "referrerPolicy",\n        converter: webidl.converters.DOMString,\n        // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n        allowedValues: referrerPolicy\n      },\n      {\n        key: "mode",\n        converter: webidl.converters.DOMString,\n        // https://fetch.spec.whatwg.org/#concept-request-mode\n        allowedValues: requestMode\n      },\n      {\n        key: "credentials",\n        converter: webidl.converters.DOMString,\n        // https://fetch.spec.whatwg.org/#requestcredentials\n        allowedValues: requestCredentials\n      },\n      {\n        key: "cache",\n        converter: webidl.converters.DOMString,\n        // https://fetch.spec.whatwg.org/#requestcache\n        allowedValues: requestCache\n      },\n      {\n        key: "redirect",\n        converter: webidl.converters.DOMString,\n        // https://fetch.spec.whatwg.org/#requestredirect\n        allowedValues: requestRedirect\n      },\n      {\n        key: "integrity",\n        converter: webidl.converters.DOMString\n      },\n      {\n        key: "keepalive",\n        converter: webidl.converters.boolean\n      },\n      {\n        key: "signal",\n        converter: webidl.nullableConverter(\n          (signal) => webidl.converters.AbortSignal(\n            signal,\n            { strict: false }\n          )\n        )\n      },\n      {\n        key: "window",\n        converter: webidl.converters.any\n      },\n      {\n        key: "duplex",\n        converter: webidl.converters.DOMString,\n        allowedValues: requestDuplex\n      }\n    ]);\n    module2.exports = { Request: Request2, makeRequest };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/dispatcher.js\nvar require_dispatcher = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/dispatcher.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var EventEmitter = require("events");\n    var _Dispatcher = class _Dispatcher extends EventEmitter {\n      dispatch() {\n        throw new Error("not implemented");\n      }\n      close() {\n        throw new Error("not implemented");\n      }\n      destroy() {\n        throw new Error("not implemented");\n      }\n    };\n    __name(_Dispatcher, "Dispatcher");\n    var Dispatcher = _Dispatcher;\n    module2.exports = Dispatcher;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/dispatcher-base.js\nvar require_dispatcher_base = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/dispatcher-base.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var Dispatcher = require_dispatcher();\n    var {\n      ClientDestroyedError,\n      ClientClosedError,\n      InvalidArgumentError: InvalidArgumentError2\n    } = require_errors();\n    var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols2();\n    var kDestroyed = Symbol("destroyed");\n    var kClosed = Symbol("closed");\n    var kOnDestroyed = Symbol("onDestroyed");\n    var kOnClosed = Symbol("onClosed");\n    var kInterceptedDispatch = Symbol("Intercepted Dispatch");\n    var _DispatcherBase = class _DispatcherBase extends Dispatcher {\n      constructor() {\n        super();\n        this[kDestroyed] = false;\n        this[kOnDestroyed] = null;\n        this[kClosed] = false;\n        this[kOnClosed] = [];\n      }\n      get destroyed() {\n        return this[kDestroyed];\n      }\n      get closed() {\n        return this[kClosed];\n      }\n      get interceptors() {\n        return this[kInterceptors];\n      }\n      set interceptors(newInterceptors) {\n        if (newInterceptors) {\n          for (let i = newInterceptors.length - 1; i >= 0; i--) {\n            const interceptor = this[kInterceptors][i];\n            if (typeof interceptor !== "function") {\n              throw new InvalidArgumentError2("interceptor must be an function");\n            }\n          }\n        }\n        this[kInterceptors] = newInterceptors;\n      }\n      close(callback) {\n        if (callback === void 0) {\n          return new Promise((resolve, reject) => {\n            this.close((err, data) => {\n              return err ? reject(err) : resolve(data);\n            });\n          });\n        }\n        if (typeof callback !== "function") {\n          throw new InvalidArgumentError2("invalid callback");\n        }\n        if (this[kDestroyed]) {\n          queueMicrotask(() => callback(new ClientDestroyedError(), null));\n          return;\n        }\n        if (this[kClosed]) {\n          if (this[kOnClosed]) {\n            this[kOnClosed].push(callback);\n          } else {\n            queueMicrotask(() => callback(null, null));\n          }\n          return;\n        }\n        this[kClosed] = true;\n        this[kOnClosed].push(callback);\n        const onClosed = /* @__PURE__ */ __name(() => {\n          const callbacks = this[kOnClosed];\n          this[kOnClosed] = null;\n          for (let i = 0; i < callbacks.length; i++) {\n            callbacks[i](null, null);\n          }\n        }, "onClosed");\n        this[kClose]().then(() => this.destroy()).then(() => {\n          queueMicrotask(onClosed);\n        });\n      }\n      destroy(err, callback) {\n        if (typeof err === "function") {\n          callback = err;\n          err = null;\n        }\n        if (callback === void 0) {\n          return new Promise((resolve, reject) => {\n            this.destroy(err, (err2, data) => {\n              return err2 ? (\n                /* istanbul ignore next: should never error */\n                reject(err2)\n              ) : resolve(data);\n            });\n          });\n        }\n        if (typeof callback !== "function") {\n          throw new InvalidArgumentError2("invalid callback");\n        }\n        if (this[kDestroyed]) {\n          if (this[kOnDestroyed]) {\n            this[kOnDestroyed].push(callback);\n          } else {\n            queueMicrotask(() => callback(null, null));\n          }\n          return;\n        }\n        if (!err) {\n          err = new ClientDestroyedError();\n        }\n        this[kDestroyed] = true;\n        this[kOnDestroyed] = this[kOnDestroyed] || [];\n        this[kOnDestroyed].push(callback);\n        const onDestroyed = /* @__PURE__ */ __name(() => {\n          const callbacks = this[kOnDestroyed];\n          this[kOnDestroyed] = null;\n          for (let i = 0; i < callbacks.length; i++) {\n            callbacks[i](null, null);\n          }\n        }, "onDestroyed");\n        this[kDestroy](err).then(() => {\n          queueMicrotask(onDestroyed);\n        });\n      }\n      [kInterceptedDispatch](opts, handler) {\n        if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n          this[kInterceptedDispatch] = this[kDispatch];\n          return this[kDispatch](opts, handler);\n        }\n        let dispatch = this[kDispatch].bind(this);\n        for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n          dispatch = this[kInterceptors][i](dispatch);\n        }\n        this[kInterceptedDispatch] = dispatch;\n        return dispatch(opts, handler);\n      }\n      dispatch(opts, handler) {\n        if (!handler || typeof handler !== "object") {\n          throw new InvalidArgumentError2("handler must be an object");\n        }\n        try {\n          if (!opts || typeof opts !== "object") {\n            throw new InvalidArgumentError2("opts must be an object.");\n          }\n          if (this[kDestroyed] || this[kOnDestroyed]) {\n            throw new ClientDestroyedError();\n          }\n          if (this[kClosed]) {\n            throw new ClientClosedError();\n          }\n          return this[kInterceptedDispatch](opts, handler);\n        } catch (err) {\n          if (typeof handler.onError !== "function") {\n            throw new InvalidArgumentError2("invalid onError method");\n          }\n          handler.onError(err);\n          return false;\n        }\n      }\n    };\n    __name(_DispatcherBase, "DispatcherBase");\n    var DispatcherBase = _DispatcherBase;\n    module2.exports = DispatcherBase;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/node/fixed-queue.js\nvar require_fixed_queue = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/node/fixed-queue.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var kSize = 2048;\n    var kMask = kSize - 1;\n    var _FixedCircularBuffer = class _FixedCircularBuffer {\n      constructor() {\n        this.bottom = 0;\n        this.top = 0;\n        this.list = new Array(kSize);\n        this.next = null;\n      }\n      isEmpty() {\n        return this.top === this.bottom;\n      }\n      isFull() {\n        return (this.top + 1 & kMask) === this.bottom;\n      }\n      push(data) {\n        this.list[this.top] = data;\n        this.top = this.top + 1 & kMask;\n      }\n      shift() {\n        const nextItem = this.list[this.bottom];\n        if (nextItem === void 0)\n          return null;\n        this.list[this.bottom] = void 0;\n        this.bottom = this.bottom + 1 & kMask;\n        return nextItem;\n      }\n    };\n    __name(_FixedCircularBuffer, "FixedCircularBuffer");\n    var FixedCircularBuffer = _FixedCircularBuffer;\n    var _a;\n    module2.exports = (_a = class {\n      constructor() {\n        this.head = this.tail = new FixedCircularBuffer();\n      }\n      isEmpty() {\n        return this.head.isEmpty();\n      }\n      push(data) {\n        if (this.head.isFull()) {\n          this.head = this.head.next = new FixedCircularBuffer();\n        }\n        this.head.push(data);\n      }\n      shift() {\n        const tail = this.tail;\n        const next = tail.shift();\n        if (tail.isEmpty() && tail.next !== null) {\n          this.tail = tail.next;\n        }\n        return next;\n      }\n    }, __name(_a, "FixedQueue"), _a);\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/pool-stats.js\nvar require_pool_stats = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/pool-stats.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols2();\n    var kPool = Symbol("pool");\n    var _PoolStats = class _PoolStats {\n      constructor(pool) {\n        this[kPool] = pool;\n      }\n      get connected() {\n        return this[kPool][kConnected];\n      }\n      get free() {\n        return this[kPool][kFree];\n      }\n      get pending() {\n        return this[kPool][kPending];\n      }\n      get queued() {\n        return this[kPool][kQueued];\n      }\n      get running() {\n        return this[kPool][kRunning];\n      }\n      get size() {\n        return this[kPool][kSize];\n      }\n    };\n    __name(_PoolStats, "PoolStats");\n    var PoolStats = _PoolStats;\n    module2.exports = PoolStats;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/pool-base.js\nvar require_pool_base = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/pool-base.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var DispatcherBase = require_dispatcher_base();\n    var FixedQueue = require_fixed_queue();\n    var { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require_symbols2();\n    var PoolStats = require_pool_stats();\n    var kClients = Symbol("clients");\n    var kNeedDrain = Symbol("needDrain");\n    var kQueue = Symbol("queue");\n    var kClosedResolve = Symbol("closed resolve");\n    var kOnDrain = Symbol("onDrain");\n    var kOnConnect = Symbol("onConnect");\n    var kOnDisconnect = Symbol("onDisconnect");\n    var kOnConnectionError = Symbol("onConnectionError");\n    var kGetDispatcher = Symbol("get dispatcher");\n    var kAddClient = Symbol("add client");\n    var kRemoveClient = Symbol("remove client");\n    var kStats = Symbol("stats");\n    var _PoolBase = class _PoolBase extends DispatcherBase {\n      constructor() {\n        super();\n        this[kQueue] = new FixedQueue();\n        this[kClients] = [];\n        this[kQueued] = 0;\n        const pool = this;\n        this[kOnDrain] = /* @__PURE__ */ __name(function onDrain(origin, targets) {\n          const queue = pool[kQueue];\n          let needDrain = false;\n          while (!needDrain) {\n            const item = queue.shift();\n            if (!item) {\n              break;\n            }\n            pool[kQueued]--;\n            needDrain = !this.dispatch(item.opts, item.handler);\n          }\n          this[kNeedDrain] = needDrain;\n          if (!this[kNeedDrain] && pool[kNeedDrain]) {\n            pool[kNeedDrain] = false;\n            pool.emit("drain", origin, [pool, ...targets]);\n          }\n          if (pool[kClosedResolve] && queue.isEmpty()) {\n            Promise.all(pool[kClients].map((c) => c.close())).then(pool[kClosedResolve]);\n          }\n        }, "onDrain");\n        this[kOnConnect] = (origin, targets) => {\n          pool.emit("connect", origin, [pool, ...targets]);\n        };\n        this[kOnDisconnect] = (origin, targets, err) => {\n          pool.emit("disconnect", origin, [pool, ...targets], err);\n        };\n        this[kOnConnectionError] = (origin, targets, err) => {\n          pool.emit("connectionError", origin, [pool, ...targets], err);\n        };\n        this[kStats] = new PoolStats(this);\n      }\n      get [kBusy]() {\n        return this[kNeedDrain];\n      }\n      get [kConnected]() {\n        return this[kClients].filter((client) => client[kConnected]).length;\n      }\n      get [kFree]() {\n        return this[kClients].filter((client) => client[kConnected] && !client[kNeedDrain]).length;\n      }\n      get [kPending]() {\n        let ret = this[kQueued];\n        for (const { [kPending]: pending } of this[kClients]) {\n          ret += pending;\n        }\n        return ret;\n      }\n      get [kRunning]() {\n        let ret = 0;\n        for (const { [kRunning]: running } of this[kClients]) {\n          ret += running;\n        }\n        return ret;\n      }\n      get [kSize]() {\n        let ret = this[kQueued];\n        for (const { [kSize]: size } of this[kClients]) {\n          ret += size;\n        }\n        return ret;\n      }\n      get stats() {\n        return this[kStats];\n      }\n      async [kClose]() {\n        if (this[kQueue].isEmpty()) {\n          return Promise.all(this[kClients].map((c) => c.close()));\n        } else {\n          return new Promise((resolve) => {\n            this[kClosedResolve] = resolve;\n          });\n        }\n      }\n      async [kDestroy](err) {\n        while (true) {\n          const item = this[kQueue].shift();\n          if (!item) {\n            break;\n          }\n          item.handler.onError(err);\n        }\n        return Promise.all(this[kClients].map((c) => c.destroy(err)));\n      }\n      [kDispatch](opts, handler) {\n        const dispatcher = this[kGetDispatcher]();\n        if (!dispatcher) {\n          this[kNeedDrain] = true;\n          this[kQueue].push({ opts, handler });\n          this[kQueued]++;\n        } else if (!dispatcher.dispatch(opts, handler)) {\n          dispatcher[kNeedDrain] = true;\n          this[kNeedDrain] = !this[kGetDispatcher]();\n        }\n        return !this[kNeedDrain];\n      }\n      [kAddClient](client) {\n        client.on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]);\n        this[kClients].push(client);\n        if (this[kNeedDrain]) {\n          define_process_default.nextTick(() => {\n            if (this[kNeedDrain]) {\n              this[kOnDrain](client[kUrl], [this, client]);\n            }\n          });\n        }\n        return this;\n      }\n      [kRemoveClient](client) {\n        client.close(() => {\n          const idx = this[kClients].indexOf(client);\n          if (idx !== -1) {\n            this[kClients].splice(idx, 1);\n          }\n        });\n        this[kNeedDrain] = this[kClients].some((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true);\n      }\n    };\n    __name(_PoolBase, "PoolBase");\n    var PoolBase = _PoolBase;\n    module2.exports = {\n      PoolBase,\n      kClients,\n      kNeedDrain,\n      kAddClient,\n      kRemoveClient,\n      kGetDispatcher\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/timers.js\nvar require_timers = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/timers.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var fastNow = Date.now();\n    var fastNowTimeout;\n    var fastTimers = [];\n    function onTimeout() {\n      fastNow = Date.now();\n      let len = fastTimers.length;\n      let idx = 0;\n      while (idx < len) {\n        const timer = fastTimers[idx];\n        if (timer.state === 0) {\n          timer.state = fastNow + timer.delay;\n        } else if (timer.state > 0 && fastNow >= timer.state) {\n          timer.state = -1;\n          timer.callback(timer.opaque);\n        }\n        if (timer.state === -1) {\n          timer.state = -2;\n          if (idx !== len - 1) {\n            fastTimers[idx] = fastTimers.pop();\n          } else {\n            fastTimers.pop();\n          }\n          len -= 1;\n        } else {\n          idx += 1;\n        }\n      }\n      if (fastTimers.length > 0) {\n        refreshTimeout();\n      }\n    }\n    __name(onTimeout, "onTimeout");\n    function refreshTimeout() {\n      if (fastNowTimeout && fastNowTimeout.refresh) {\n        fastNowTimeout.refresh();\n      } else {\n        clearTimeout(fastNowTimeout);\n        fastNowTimeout = setTimeout(onTimeout, 1e3);\n        if (fastNowTimeout.unref) {\n          fastNowTimeout.unref();\n        }\n      }\n    }\n    __name(refreshTimeout, "refreshTimeout");\n    var _Timeout = class _Timeout {\n      constructor(callback, delay, opaque) {\n        this.callback = callback;\n        this.delay = delay;\n        this.opaque = opaque;\n        this.state = -2;\n        this.refresh();\n      }\n      refresh() {\n        if (this.state === -2) {\n          fastTimers.push(this);\n          if (!fastNowTimeout || fastTimers.length === 1) {\n            refreshTimeout();\n          }\n        }\n        this.state = 0;\n      }\n      clear() {\n        this.state = -1;\n      }\n    };\n    __name(_Timeout, "Timeout");\n    var Timeout = _Timeout;\n    module2.exports = {\n      setTimeout(callback, delay, opaque) {\n        return delay < 1e3 ? setTimeout(callback, delay, opaque) : new Timeout(callback, delay, opaque);\n      },\n      clearTimeout(timeout) {\n        if (timeout instanceof Timeout) {\n          timeout.clear();\n        } else {\n          clearTimeout(timeout);\n        }\n      }\n    };\n  }\n});\n\n// src/patches/undici-core-request.js\nvar require_undici_core_request = __commonJS({\n  "src/patches/undici-core-request.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { InvalidArgumentError: InvalidArgumentError2 } = require_errors();\n    var assert = require("assert");\n    var util = require_util();\n    var tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&\'*+.|~]+$/;\n    var headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/;\n    var invalidPathRegex = /[^\\u0021-\\u00ff]/;\n    var kHandler = Symbol("handler");\n    var channels = {};\n    var extractBody;\n    try {\n      const diagnosticsChannel = require("diagnostics_channel");\n      channels.create = diagnosticsChannel.channel("undici:request:create");\n      channels.bodySent = diagnosticsChannel.channel("undici:request:bodySent");\n      channels.headers = diagnosticsChannel.channel("undici:request:headers");\n      channels.trailers = diagnosticsChannel.channel("undici:request:trailers");\n      channels.error = diagnosticsChannel.channel("undici:request:error");\n    } catch {\n      channels.create = { hasSubscribers: false };\n      channels.bodySent = { hasSubscribers: false };\n      channels.headers = { hasSubscribers: false };\n      channels.trailers = { hasSubscribers: false };\n      channels.error = { hasSubscribers: false };\n    }\n    var _Request2 = class _Request2 {\n      constructor(origin, {\n        path,\n        method,\n        body,\n        headers,\n        query,\n        idempotent,\n        blocking,\n        upgrade,\n        headersTimeout,\n        bodyTimeout,\n        reset,\n        throwOnError\n      }, handler) {\n        if (typeof path !== "string") {\n          throw new InvalidArgumentError2("path must be a string");\n        } else if (path[0] !== "/" && !(path.startsWith("http://") || path.startsWith("https://")) && method !== "CONNECT") {\n          throw new InvalidArgumentError2(\n            "path must be an absolute URL or start with a slash"\n          );\n        } else if (invalidPathRegex.exec(path) !== null) {\n          throw new InvalidArgumentError2("invalid request path");\n        }\n        if (typeof method !== "string") {\n          throw new InvalidArgumentError2("method must be a string");\n        } else if (tokenRegExp.exec(method) === null) {\n          throw new InvalidArgumentError2("invalid request method");\n        }\n        if (upgrade && typeof upgrade !== "string") {\n          throw new InvalidArgumentError2("upgrade must be a string");\n        }\n        if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n          throw new InvalidArgumentError2("invalid headersTimeout");\n        }\n        if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n          throw new InvalidArgumentError2("invalid bodyTimeout");\n        }\n        if (reset != null && typeof reset !== "boolean") {\n          throw new InvalidArgumentError2("invalid reset");\n        }\n        this.headersTimeout = headersTimeout;\n        this.bodyTimeout = bodyTimeout;\n        this.throwOnError = throwOnError === true;\n        this.method = method;\n        if (body == null) {\n          this.body = null;\n        } else if (util.isStream(body)) {\n          this.body = body;\n        } else if (util.isBuffer(body)) {\n          this.body = body.byteLength ? body : null;\n        } else if (ArrayBuffer.isView(body)) {\n          this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null;\n        } else if (body instanceof ArrayBuffer) {\n          this.body = body.byteLength ? Buffer.from(body) : null;\n        } else if (typeof body === "string") {\n          this.body = body.length ? Buffer.from(body) : null;\n        } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {\n          this.body = body;\n        } else {\n          throw new InvalidArgumentError2(\n            "body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable"\n          );\n        }\n        this.completed = false;\n        this.aborted = false;\n        this.upgrade = upgrade || null;\n        this.path = query ? util.buildURL(path, query) : path;\n        this.origin = origin;\n        this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;\n        this.blocking = blocking == null ? false : blocking;\n        this.reset = reset == null ? null : reset;\n        this.host = null;\n        this.contentLength = null;\n        this.contentType = null;\n        this.headers = "";\n        if (Array.isArray(headers)) {\n          if (headers.length % 2 !== 0) {\n            throw new InvalidArgumentError2("headers array must be even");\n          }\n          for (let i = 0; i < headers.length; i += 2) {\n            processHeader(this, headers[i], headers[i + 1]);\n          }\n        } else if (headers && typeof headers === "object") {\n          const keys = Object.keys(headers);\n          for (let i = 0; i < keys.length; i++) {\n            const key = keys[i];\n            processHeader(this, key, headers[key]);\n          }\n        } else if (headers != null) {\n          throw new InvalidArgumentError2("headers must be an object or an array");\n        }\n        if (util.isFormDataLike(this.body)) {\n          if (util.nodeMajor < 16 || util.nodeMajor === 16 && util.nodeMinor < 8) {\n            throw new InvalidArgumentError2(\n              "Form-Data bodies are only supported in node v16.8 and newer."\n            );\n          }\n          if (!extractBody) {\n            extractBody = require_body().extractBody;\n          }\n          const [bodyStream, contentType] = extractBody(body);\n          if (this.contentType == null) {\n            this.contentType = contentType;\n            this.headers += `content-type: ${contentType}\\r\n`;\n          }\n          this.body = bodyStream.stream;\n          this.contentLength = bodyStream.length;\n        } else if (util.isBlobLike(body) && this.contentType == null && body.type) {\n          this.contentType = body.type;\n          this.headers += `content-type: ${body.type}\\r\n`;\n        }\n        util.validateHandler(handler, method, upgrade);\n        this.servername = util.getServerName(this.host);\n        this[kHandler] = handler;\n        if (channels.create.hasSubscribers) {\n          channels.create.publish({ request: this });\n        }\n      }\n      onBodySent(chunk) {\n        if (this[kHandler].onBodySent) {\n          try {\n            this[kHandler].onBodySent(chunk);\n          } catch (err) {\n            this.onError(err);\n          }\n        }\n      }\n      onRequestSent() {\n        if (channels.bodySent.hasSubscribers) {\n          channels.bodySent.publish({ request: this });\n        }\n      }\n      onConnect(abort) {\n        assert(!this.aborted);\n        assert(!this.completed);\n        return this[kHandler].onConnect(abort);\n      }\n      onHeaders(statusCode, headers, resume, statusText) {\n        assert(!this.aborted);\n        assert(!this.completed);\n        if (channels.headers.hasSubscribers) {\n          channels.headers.publish({\n            request: this,\n            response: { statusCode, headers, statusText }\n          });\n        }\n        return this[kHandler].onHeaders(statusCode, headers, resume, statusText);\n      }\n      onData(chunk) {\n        assert(!this.aborted);\n        assert(!this.completed);\n        return this[kHandler].onData(chunk);\n      }\n      onUpgrade(statusCode, headers, socket) {\n        assert(!this.aborted);\n        assert(!this.completed);\n        return this[kHandler].onUpgrade(statusCode, headers, socket);\n      }\n      onComplete(trailers) {\n        assert(!this.aborted);\n        this.completed = true;\n        if (channels.trailers.hasSubscribers) {\n          channels.trailers.publish({ request: this, trailers });\n        }\n        return this[kHandler].onComplete(trailers);\n      }\n      onError(error) {\n        if (channels.error.hasSubscribers) {\n          channels.error.publish({ request: this, error });\n        }\n        if (this.aborted) {\n          return;\n        }\n        this.aborted = true;\n        return this[kHandler].onError(error);\n      }\n      addHeader(key, value) {\n        processHeader(this, key, value);\n        return this;\n      }\n    };\n    __name(_Request2, "Request");\n    var Request2 = _Request2;\n    function processHeaderValue(key, val) {\n      if (val && typeof val === "object") {\n        throw new InvalidArgumentError2(`invalid ${key} header`);\n      }\n      val = val != null ? `${val}` : "";\n      if (headerCharRegex.exec(val) !== null) {\n        throw new InvalidArgumentError2(`invalid ${key} header`);\n      }\n      return `${key}: ${val}\\r\n`;\n    }\n    __name(processHeaderValue, "processHeaderValue");\n    function processHeader(request, key, val) {\n      if (val && typeof val === "object" && !Array.isArray(val)) {\n        throw new InvalidArgumentError2(`invalid ${key} header`);\n      } else if (val === void 0) {\n        return;\n      }\n      if (request.host === null && key.length === 4 && key.toLowerCase() === "host") {\n        request.host = val;\n      } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") {\n        request.contentLength = parseInt(val, 10);\n        if (!Number.isFinite(request.contentLength)) {\n          throw new InvalidArgumentError2("invalid content-length header");\n        }\n      } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") {\n        request.contentType = val;\n        request.headers += processHeaderValue(key, val);\n      } else {\n        if (Array.isArray(val)) {\n          for (let i = 0; i < val.length; i++) {\n            request.headers += processHeaderValue(key, val[i]);\n          }\n        } else {\n          request.headers += processHeaderValue(key, val);\n        }\n      }\n    }\n    __name(processHeader, "processHeader");\n    module2.exports = Request2;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/core/connect.js\nvar require_connect = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/core/connect.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var net = require("net");\n    var assert = require("assert");\n    var util = require_util();\n    var { InvalidArgumentError: InvalidArgumentError2, ConnectTimeoutError } = require_errors();\n    var tls;\n    var SessionCache;\n    var _a, _b;\n    if (global.FinalizationRegistry) {\n      SessionCache = (_a = class {\n        constructor(maxCachedSessions) {\n          this._maxCachedSessions = maxCachedSessions;\n          this._sessionCache = /* @__PURE__ */ new Map();\n          this._sessionRegistry = new global.FinalizationRegistry((key) => {\n            if (this._sessionCache.size < this._maxCachedSessions) {\n              return;\n            }\n            const ref = this._sessionCache.get(key);\n            if (ref !== void 0 && ref.deref() === void 0) {\n              this._sessionCache.delete(key);\n            }\n          });\n        }\n        get(sessionKey) {\n          const ref = this._sessionCache.get(sessionKey);\n          return ref ? ref.deref() : null;\n        }\n        set(sessionKey, session) {\n          if (this._maxCachedSessions === 0) {\n            return;\n          }\n          this._sessionCache.set(sessionKey, new WeakRef(session));\n          this._sessionRegistry.register(session, sessionKey);\n        }\n      }, __name(_a, "WeakSessionCache"), _a);\n    } else {\n      SessionCache = (_b = class {\n        constructor(maxCachedSessions) {\n          this._maxCachedSessions = maxCachedSessions;\n          this._sessionCache = /* @__PURE__ */ new Map();\n        }\n        get(sessionKey) {\n          return this._sessionCache.get(sessionKey);\n        }\n        set(sessionKey, session) {\n          if (this._maxCachedSessions === 0) {\n            return;\n          }\n          if (this._sessionCache.size >= this._maxCachedSessions) {\n            const { value: oldestKey } = this._sessionCache.keys().next();\n            this._sessionCache.delete(oldestKey);\n          }\n          this._sessionCache.set(sessionKey, session);\n        }\n      }, __name(_b, "SimpleSessionCache"), _b);\n    }\n    function buildConnector({ maxCachedSessions, socketPath, timeout, ...opts }) {\n      if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n        throw new InvalidArgumentError2("maxCachedSessions must be a positive integer or zero");\n      }\n      const options = { path: socketPath, ...opts };\n      const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);\n      timeout = timeout == null ? 1e4 : timeout;\n      return /* @__PURE__ */ __name(function connect({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n        let socket;\n        if (protocol === "https:") {\n          if (!tls) {\n            tls = require("tls");\n          }\n          servername = servername || options.servername || util.getServerName(host) || null;\n          const sessionKey = servername || hostname;\n          const session = sessionCache.get(sessionKey) || null;\n          assert(sessionKey);\n          socket = tls.connect({\n            highWaterMark: 16384,\n            // TLS in node can\'t have bigger HWM anyway...\n            ...options,\n            servername,\n            session,\n            localAddress,\n            socket: httpSocket,\n            // upgrade socket connection\n            port: port || 443,\n            host: hostname\n          });\n          socket.on("session", function(session2) {\n            sessionCache.set(sessionKey, session2);\n          });\n        } else {\n          assert(!httpSocket, "httpSocket can only be sent on TLS update");\n          socket = net.connect({\n            highWaterMark: 64 * 1024,\n            // Same as nodejs fs streams.\n            ...options,\n            localAddress,\n            port: port || 80,\n            host: hostname\n          });\n        }\n        if (options.keepAlive == null || options.keepAlive) {\n          const keepAliveInitialDelay = options.keepAliveInitialDelay === void 0 ? 6e4 : options.keepAliveInitialDelay;\n          socket.setKeepAlive(true, keepAliveInitialDelay);\n        }\n        const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout);\n        socket.setNoDelay(true).once(protocol === "https:" ? "secureConnect" : "connect", function() {\n          cancelTimeout();\n          if (callback) {\n            const cb = callback;\n            callback = null;\n            cb(null, this);\n          }\n        }).on("error", function(err) {\n          cancelTimeout();\n          if (callback) {\n            const cb = callback;\n            callback = null;\n            cb(err);\n          }\n        });\n        return socket;\n      }, "connect");\n    }\n    __name(buildConnector, "buildConnector");\n    function setupTimeout(onConnectTimeout2, timeout) {\n      if (!timeout) {\n        return () => {\n        };\n      }\n      let s1 = null;\n      let s2 = null;\n      const timeoutId = setTimeout(() => {\n        s1 = setImmediate(() => {\n          if (define_process_default.platform === "win32") {\n            s2 = setImmediate(() => onConnectTimeout2());\n          } else {\n            onConnectTimeout2();\n          }\n        });\n      }, timeout);\n      return () => {\n        clearTimeout(timeoutId);\n        clearImmediate(s1);\n        clearImmediate(s2);\n      };\n    }\n    __name(setupTimeout, "setupTimeout");\n    function onConnectTimeout(socket) {\n      util.destroy(socket, new ConnectTimeoutError());\n    }\n    __name(onConnectTimeout, "onConnectTimeout");\n    module2.exports = buildConnector;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/llhttp/utils.js\nvar require_utils2 = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/llhttp/utils.js"(exports2) {\n    "use strict";\n    init_define_process();\n    Object.defineProperty(exports2, "__esModule", { value: true });\n    exports2.enumToMap = void 0;\n    function enumToMap(obj) {\n      const res = {};\n      Object.keys(obj).forEach((key) => {\n        const value = obj[key];\n        if (typeof value === "number") {\n          res[key] = value;\n        }\n      });\n      return res;\n    }\n    __name(enumToMap, "enumToMap");\n    exports2.enumToMap = enumToMap;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/llhttp/constants.js\nvar require_constants2 = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/llhttp/constants.js"(exports2) {\n    "use strict";\n    init_define_process();\n    Object.defineProperty(exports2, "__esModule", { value: true });\n    exports2.SPECIAL_HEADERS = exports2.HEADER_STATE = exports2.MINOR = exports2.MAJOR = exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS = exports2.TOKEN = exports2.STRICT_TOKEN = exports2.HEX = exports2.URL_CHAR = exports2.STRICT_URL_CHAR = exports2.USERINFO_CHARS = exports2.MARK = exports2.ALPHANUM = exports2.NUM = exports2.HEX_MAP = exports2.NUM_MAP = exports2.ALPHA = exports2.FINISH = exports2.H_METHOD_MAP = exports2.METHOD_MAP = exports2.METHODS_RTSP = exports2.METHODS_ICE = exports2.METHODS_HTTP = exports2.METHODS = exports2.LENIENT_FLAGS = exports2.FLAGS = exports2.TYPE = exports2.ERROR = void 0;\n    var utils_1 = require_utils2();\n    var ERROR;\n    (function(ERROR2) {\n      ERROR2[ERROR2["OK"] = 0] = "OK";\n      ERROR2[ERROR2["INTERNAL"] = 1] = "INTERNAL";\n      ERROR2[ERROR2["STRICT"] = 2] = "STRICT";\n      ERROR2[ERROR2["LF_EXPECTED"] = 3] = "LF_EXPECTED";\n      ERROR2[ERROR2["UNEXPECTED_CONTENT_LENGTH"] = 4] = "UNEXPECTED_CONTENT_LENGTH";\n      ERROR2[ERROR2["CLOSED_CONNECTION"] = 5] = "CLOSED_CONNECTION";\n      ERROR2[ERROR2["INVALID_METHOD"] = 6] = "INVALID_METHOD";\n      ERROR2[ERROR2["INVALID_URL"] = 7] = "INVALID_URL";\n      ERROR2[ERROR2["INVALID_CONSTANT"] = 8] = "INVALID_CONSTANT";\n      ERROR2[ERROR2["INVALID_VERSION"] = 9] = "INVALID_VERSION";\n      ERROR2[ERROR2["INVALID_HEADER_TOKEN"] = 10] = "INVALID_HEADER_TOKEN";\n      ERROR2[ERROR2["INVALID_CONTENT_LENGTH"] = 11] = "INVALID_CONTENT_LENGTH";\n      ERROR2[ERROR2["INVALID_CHUNK_SIZE"] = 12] = "INVALID_CHUNK_SIZE";\n      ERROR2[ERROR2["INVALID_STATUS"] = 13] = "INVALID_STATUS";\n      ERROR2[ERROR2["INVALID_EOF_STATE"] = 14] = "INVALID_EOF_STATE";\n      ERROR2[ERROR2["INVALID_TRANSFER_ENCODING"] = 15] = "INVALID_TRANSFER_ENCODING";\n      ERROR2[ERROR2["CB_MESSAGE_BEGIN"] = 16] = "CB_MESSAGE_BEGIN";\n      ERROR2[ERROR2["CB_HEADERS_COMPLETE"] = 17] = "CB_HEADERS_COMPLETE";\n      ERROR2[ERROR2["CB_MESSAGE_COMPLETE"] = 18] = "CB_MESSAGE_COMPLETE";\n      ERROR2[ERROR2["CB_CHUNK_HEADER"] = 19] = "CB_CHUNK_HEADER";\n      ERROR2[ERROR2["CB_CHUNK_COMPLETE"] = 20] = "CB_CHUNK_COMPLETE";\n      ERROR2[ERROR2["PAUSED"] = 21] = "PAUSED";\n      ERROR2[ERROR2["PAUSED_UPGRADE"] = 22] = "PAUSED_UPGRADE";\n      ERROR2[ERROR2["PAUSED_H2_UPGRADE"] = 23] = "PAUSED_H2_UPGRADE";\n      ERROR2[ERROR2["USER"] = 24] = "USER";\n    })(ERROR = exports2.ERROR || (exports2.ERROR = {}));\n    var TYPE;\n    (function(TYPE2) {\n      TYPE2[TYPE2["BOTH"] = 0] = "BOTH";\n      TYPE2[TYPE2["REQUEST"] = 1] = "REQUEST";\n      TYPE2[TYPE2["RESPONSE"] = 2] = "RESPONSE";\n    })(TYPE = exports2.TYPE || (exports2.TYPE = {}));\n    var FLAGS;\n    (function(FLAGS2) {\n      FLAGS2[FLAGS2["CONNECTION_KEEP_ALIVE"] = 1] = "CONNECTION_KEEP_ALIVE";\n      FLAGS2[FLAGS2["CONNECTION_CLOSE"] = 2] = "CONNECTION_CLOSE";\n      FLAGS2[FLAGS2["CONNECTION_UPGRADE"] = 4] = "CONNECTION_UPGRADE";\n      FLAGS2[FLAGS2["CHUNKED"] = 8] = "CHUNKED";\n      FLAGS2[FLAGS2["UPGRADE"] = 16] = "UPGRADE";\n      FLAGS2[FLAGS2["CONTENT_LENGTH"] = 32] = "CONTENT_LENGTH";\n      FLAGS2[FLAGS2["SKIPBODY"] = 64] = "SKIPBODY";\n      FLAGS2[FLAGS2["TRAILING"] = 128] = "TRAILING";\n      FLAGS2[FLAGS2["TRANSFER_ENCODING"] = 512] = "TRANSFER_ENCODING";\n    })(FLAGS = exports2.FLAGS || (exports2.FLAGS = {}));\n    var LENIENT_FLAGS;\n    (function(LENIENT_FLAGS2) {\n      LENIENT_FLAGS2[LENIENT_FLAGS2["HEADERS"] = 1] = "HEADERS";\n      LENIENT_FLAGS2[LENIENT_FLAGS2["CHUNKED_LENGTH"] = 2] = "CHUNKED_LENGTH";\n      LENIENT_FLAGS2[LENIENT_FLAGS2["KEEP_ALIVE"] = 4] = "KEEP_ALIVE";\n    })(LENIENT_FLAGS = exports2.LENIENT_FLAGS || (exports2.LENIENT_FLAGS = {}));\n    var METHODS;\n    (function(METHODS2) {\n      METHODS2[METHODS2["DELETE"] = 0] = "DELETE";\n      METHODS2[METHODS2["GET"] = 1] = "GET";\n      METHODS2[METHODS2["HEAD"] = 2] = "HEAD";\n      METHODS2[METHODS2["POST"] = 3] = "POST";\n      METHODS2[METHODS2["PUT"] = 4] = "PUT";\n      METHODS2[METHODS2["CONNECT"] = 5] = "CONNECT";\n      METHODS2[METHODS2["OPTIONS"] = 6] = "OPTIONS";\n      METHODS2[METHODS2["TRACE"] = 7] = "TRACE";\n      METHODS2[METHODS2["COPY"] = 8] = "COPY";\n      METHODS2[METHODS2["LOCK"] = 9] = "LOCK";\n      METHODS2[METHODS2["MKCOL"] = 10] = "MKCOL";\n      METHODS2[METHODS2["MOVE"] = 11] = "MOVE";\n      METHODS2[METHODS2["PROPFIND"] = 12] = "PROPFIND";\n      METHODS2[METHODS2["PROPPATCH"] = 13] = "PROPPATCH";\n      METHODS2[METHODS2["SEARCH"] = 14] = "SEARCH";\n      METHODS2[METHODS2["UNLOCK"] = 15] = "UNLOCK";\n      METHODS2[METHODS2["BIND"] = 16] = "BIND";\n      METHODS2[METHODS2["REBIND"] = 17] = "REBIND";\n      METHODS2[METHODS2["UNBIND"] = 18] = "UNBIND";\n      METHODS2[METHODS2["ACL"] = 19] = "ACL";\n      METHODS2[METHODS2["REPORT"] = 20] = "REPORT";\n      METHODS2[METHODS2["MKACTIVITY"] = 21] = "MKACTIVITY";\n      METHODS2[METHODS2["CHECKOUT"] = 22] = "CHECKOUT";\n      METHODS2[METHODS2["MERGE"] = 23] = "MERGE";\n      METHODS2[METHODS2["M-SEARCH"] = 24] = "M-SEARCH";\n      METHODS2[METHODS2["NOTIFY"] = 25] = "NOTIFY";\n      METHODS2[METHODS2["SUBSCRIBE"] = 26] = "SUBSCRIBE";\n      METHODS2[METHODS2["UNSUBSCRIBE"] = 27] = "UNSUBSCRIBE";\n      METHODS2[METHODS2["PATCH"] = 28] = "PATCH";\n      METHODS2[METHODS2["PURGE"] = 29] = "PURGE";\n      METHODS2[METHODS2["MKCALENDAR"] = 30] = "MKCALENDAR";\n      METHODS2[METHODS2["LINK"] = 31] = "LINK";\n      METHODS2[METHODS2["UNLINK"] = 32] = "UNLINK";\n      METHODS2[METHODS2["SOURCE"] = 33] = "SOURCE";\n      METHODS2[METHODS2["PRI"] = 34] = "PRI";\n      METHODS2[METHODS2["DESCRIBE"] = 35] = "DESCRIBE";\n      METHODS2[METHODS2["ANNOUNCE"] = 36] = "ANNOUNCE";\n      METHODS2[METHODS2["SETUP"] = 37] = "SETUP";\n      METHODS2[METHODS2["PLAY"] = 38] = "PLAY";\n      METHODS2[METHODS2["PAUSE"] = 39] = "PAUSE";\n      METHODS2[METHODS2["TEARDOWN"] = 40] = "TEARDOWN";\n      METHODS2[METHODS2["GET_PARAMETER"] = 41] = "GET_PARAMETER";\n      METHODS2[METHODS2["SET_PARAMETER"] = 42] = "SET_PARAMETER";\n      METHODS2[METHODS2["REDIRECT"] = 43] = "REDIRECT";\n      METHODS2[METHODS2["RECORD"] = 44] = "RECORD";\n      METHODS2[METHODS2["FLUSH"] = 45] = "FLUSH";\n    })(METHODS = exports2.METHODS || (exports2.METHODS = {}));\n    exports2.METHODS_HTTP = [\n      METHODS.DELETE,\n      METHODS.GET,\n      METHODS.HEAD,\n      METHODS.POST,\n      METHODS.PUT,\n      METHODS.CONNECT,\n      METHODS.OPTIONS,\n      METHODS.TRACE,\n      METHODS.COPY,\n      METHODS.LOCK,\n      METHODS.MKCOL,\n      METHODS.MOVE,\n      METHODS.PROPFIND,\n      METHODS.PROPPATCH,\n      METHODS.SEARCH,\n      METHODS.UNLOCK,\n      METHODS.BIND,\n      METHODS.REBIND,\n      METHODS.UNBIND,\n      METHODS.ACL,\n      METHODS.REPORT,\n      METHODS.MKACTIVITY,\n      METHODS.CHECKOUT,\n      METHODS.MERGE,\n      METHODS["M-SEARCH"],\n      METHODS.NOTIFY,\n      METHODS.SUBSCRIBE,\n      METHODS.UNSUBSCRIBE,\n      METHODS.PATCH,\n      METHODS.PURGE,\n      METHODS.MKCALENDAR,\n      METHODS.LINK,\n      METHODS.UNLINK,\n      METHODS.PRI,\n      // TODO(indutny): should we allow it with HTTP?\n      METHODS.SOURCE\n    ];\n    exports2.METHODS_ICE = [\n      METHODS.SOURCE\n    ];\n    exports2.METHODS_RTSP = [\n      METHODS.OPTIONS,\n      METHODS.DESCRIBE,\n      METHODS.ANNOUNCE,\n      METHODS.SETUP,\n      METHODS.PLAY,\n      METHODS.PAUSE,\n      METHODS.TEARDOWN,\n      METHODS.GET_PARAMETER,\n      METHODS.SET_PARAMETER,\n      METHODS.REDIRECT,\n      METHODS.RECORD,\n      METHODS.FLUSH,\n      // For AirPlay\n      METHODS.GET,\n      METHODS.POST\n    ];\n    exports2.METHOD_MAP = utils_1.enumToMap(METHODS);\n    exports2.H_METHOD_MAP = {};\n    Object.keys(exports2.METHOD_MAP).forEach((key) => {\n      if (/^H/.test(key)) {\n        exports2.H_METHOD_MAP[key] = exports2.METHOD_MAP[key];\n      }\n    });\n    var FINISH;\n    (function(FINISH2) {\n      FINISH2[FINISH2["SAFE"] = 0] = "SAFE";\n      FINISH2[FINISH2["SAFE_WITH_CB"] = 1] = "SAFE_WITH_CB";\n      FINISH2[FINISH2["UNSAFE"] = 2] = "UNSAFE";\n    })(FINISH = exports2.FINISH || (exports2.FINISH = {}));\n    exports2.ALPHA = [];\n    for (let i = "A".charCodeAt(0); i <= "Z".charCodeAt(0); i++) {\n      exports2.ALPHA.push(String.fromCharCode(i));\n      exports2.ALPHA.push(String.fromCharCode(i + 32));\n    }\n    exports2.NUM_MAP = {\n      0: 0,\n      1: 1,\n      2: 2,\n      3: 3,\n      4: 4,\n      5: 5,\n      6: 6,\n      7: 7,\n      8: 8,\n      9: 9\n    };\n    exports2.HEX_MAP = {\n      0: 0,\n      1: 1,\n      2: 2,\n      3: 3,\n      4: 4,\n      5: 5,\n      6: 6,\n      7: 7,\n      8: 8,\n      9: 9,\n      A: 10,\n      B: 11,\n      C: 12,\n      D: 13,\n      E: 14,\n      F: 15,\n      a: 10,\n      b: 11,\n      c: 12,\n      d: 13,\n      e: 14,\n      f: 15\n    };\n    exports2.NUM = [\n      "0",\n      "1",\n      "2",\n      "3",\n      "4",\n      "5",\n      "6",\n      "7",\n      "8",\n      "9"\n    ];\n    exports2.ALPHANUM = exports2.ALPHA.concat(exports2.NUM);\n    exports2.MARK = ["-", "_", ".", "!", "~", "*", "\'", "(", ")"];\n    exports2.USERINFO_CHARS = exports2.ALPHANUM.concat(exports2.MARK).concat(["%", ";", ":", "&", "=", "+", "$", ","]);\n    exports2.STRICT_URL_CHAR = [\n      "!",\n      \'"\',\n      "$",\n      "%",\n      "&",\n      "\'",\n      "(",\n      ")",\n      "*",\n      "+",\n      ",",\n      "-",\n      ".",\n      "/",\n      ":",\n      ";",\n      "<",\n      "=",\n      ">",\n      "@",\n      "[",\n      "\\\\",\n      "]",\n      "^",\n      "_",\n      "`",\n      "{",\n      "|",\n      "}",\n      "~"\n    ].concat(exports2.ALPHANUM);\n    exports2.URL_CHAR = exports2.STRICT_URL_CHAR.concat(["	", "\\f"]);\n    for (let i = 128; i <= 255; i++) {\n      exports2.URL_CHAR.push(i);\n    }\n    exports2.HEX = exports2.NUM.concat(["a", "b", "c", "d", "e", "f", "A", "B", "C", "D", "E", "F"]);\n    exports2.STRICT_TOKEN = [\n      "!",\n      "#",\n      "$",\n      "%",\n      "&",\n      "\'",\n      "*",\n      "+",\n      "-",\n      ".",\n      "^",\n      "_",\n      "`",\n      "|",\n      "~"\n    ].concat(exports2.ALPHANUM);\n    exports2.TOKEN = exports2.STRICT_TOKEN.concat([" "]);\n    exports2.HEADER_CHARS = ["	"];\n    for (let i = 32; i <= 255; i++) {\n      if (i !== 127) {\n        exports2.HEADER_CHARS.push(i);\n      }\n    }\n    exports2.CONNECTION_TOKEN_CHARS = exports2.HEADER_CHARS.filter((c) => c !== 44);\n    exports2.MAJOR = exports2.NUM_MAP;\n    exports2.MINOR = exports2.MAJOR;\n    var HEADER_STATE;\n    (function(HEADER_STATE2) {\n      HEADER_STATE2[HEADER_STATE2["GENERAL"] = 0] = "GENERAL";\n      HEADER_STATE2[HEADER_STATE2["CONNECTION"] = 1] = "CONNECTION";\n      HEADER_STATE2[HEADER_STATE2["CONTENT_LENGTH"] = 2] = "CONTENT_LENGTH";\n      HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING"] = 3] = "TRANSFER_ENCODING";\n      HEADER_STATE2[HEADER_STATE2["UPGRADE"] = 4] = "UPGRADE";\n      HEADER_STATE2[HEADER_STATE2["CONNECTION_KEEP_ALIVE"] = 5] = "CONNECTION_KEEP_ALIVE";\n      HEADER_STATE2[HEADER_STATE2["CONNECTION_CLOSE"] = 6] = "CONNECTION_CLOSE";\n      HEADER_STATE2[HEADER_STATE2["CONNECTION_UPGRADE"] = 7] = "CONNECTION_UPGRADE";\n      HEADER_STATE2[HEADER_STATE2["TRANSFER_ENCODING_CHUNKED"] = 8] = "TRANSFER_ENCODING_CHUNKED";\n    })(HEADER_STATE = exports2.HEADER_STATE || (exports2.HEADER_STATE = {}));\n    exports2.SPECIAL_HEADERS = {\n      "connection": HEADER_STATE.CONNECTION,\n      "content-length": HEADER_STATE.CONTENT_LENGTH,\n      "proxy-connection": HEADER_STATE.CONNECTION,\n      "transfer-encoding": HEADER_STATE.TRANSFER_ENCODING,\n      "upgrade": HEADER_STATE.UPGRADE\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/handler/RedirectHandler.js\nvar require_RedirectHandler = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/handler/RedirectHandler.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var util = require_util();\n    var { kBodyUsed } = require_symbols2();\n    var assert = require("assert");\n    var { InvalidArgumentError: InvalidArgumentError2 } = require_errors();\n    var EE = require("events");\n    var redirectableStatusCodes = [300, 301, 302, 303, 307, 308];\n    var kBody = Symbol("body");\n    var _BodyAsyncIterable = class _BodyAsyncIterable {\n      constructor(body) {\n        this[kBody] = body;\n        this[kBodyUsed] = false;\n      }\n      async *[Symbol.asyncIterator]() {\n        assert(!this[kBodyUsed], "disturbed");\n        this[kBodyUsed] = true;\n        yield* this[kBody];\n      }\n    };\n    __name(_BodyAsyncIterable, "BodyAsyncIterable");\n    var BodyAsyncIterable = _BodyAsyncIterable;\n    var _RedirectHandler = class _RedirectHandler {\n      constructor(dispatch, maxRedirections, opts, handler) {\n        if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n          throw new InvalidArgumentError2("maxRedirections must be a positive number");\n        }\n        util.validateHandler(handler, opts.method, opts.upgrade);\n        this.dispatch = dispatch;\n        this.location = null;\n        this.abort = null;\n        this.opts = { ...opts, maxRedirections: 0 };\n        this.maxRedirections = maxRedirections;\n        this.handler = handler;\n        this.history = [];\n        if (util.isStream(this.opts.body)) {\n          if (util.bodyLength(this.opts.body) === 0) {\n            this.opts.body.on("data", function() {\n              assert(false);\n            });\n          }\n          if (typeof this.opts.body.readableDidRead !== "boolean") {\n            this.opts.body[kBodyUsed] = false;\n            EE.prototype.on.call(this.opts.body, "data", function() {\n              this[kBodyUsed] = true;\n            });\n          }\n        } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") {\n          this.opts.body = new BodyAsyncIterable(this.opts.body);\n        } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util.isIterable(this.opts.body)) {\n          this.opts.body = new BodyAsyncIterable(this.opts.body);\n        }\n      }\n      onConnect(abort) {\n        this.abort = abort;\n        this.handler.onConnect(abort, { history: this.history });\n      }\n      onUpgrade(statusCode, headers, socket) {\n        this.handler.onUpgrade(statusCode, headers, socket);\n      }\n      onError(error) {\n        this.handler.onError(error);\n      }\n      onHeaders(statusCode, headers, resume, statusText) {\n        this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers);\n        if (this.opts.origin) {\n          this.history.push(new URL(this.opts.path, this.opts.origin));\n        }\n        if (!this.location) {\n          return this.handler.onHeaders(statusCode, headers, resume, statusText);\n        }\n        const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));\n        const path = search ? `${pathname}${search}` : pathname;\n        this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);\n        this.opts.path = path;\n        this.opts.origin = origin;\n        this.opts.maxRedirections = 0;\n        this.opts.query = null;\n        if (statusCode === 303 && this.opts.method !== "HEAD") {\n          this.opts.method = "GET";\n          this.opts.body = null;\n        }\n      }\n      onData(chunk) {\n        if (this.location) {\n        } else {\n          return this.handler.onData(chunk);\n        }\n      }\n      onComplete(trailers) {\n        if (this.location) {\n          this.location = null;\n          this.abort = null;\n          this.dispatch(this.opts, this);\n        } else {\n          this.handler.onComplete(trailers);\n        }\n      }\n      onBodySent(chunk) {\n        if (this.handler.onBodySent) {\n          this.handler.onBodySent(chunk);\n        }\n      }\n    };\n    __name(_RedirectHandler, "RedirectHandler");\n    var RedirectHandler = _RedirectHandler;\n    function parseLocation(statusCode, headers) {\n      if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n        return null;\n      }\n      for (let i = 0; i < headers.length; i += 2) {\n        if (headers[i].toString().toLowerCase() === "location") {\n          return headers[i + 1];\n        }\n      }\n    }\n    __name(parseLocation, "parseLocation");\n    function shouldRemoveHeader(header, removeContent, unknownOrigin) {\n      return header.length === 4 && header.toString().toLowerCase() === "host" || removeContent && header.toString().toLowerCase().indexOf("content-") === 0 || unknownOrigin && header.length === 13 && header.toString().toLowerCase() === "authorization" || unknownOrigin && header.length === 6 && header.toString().toLowerCase() === "cookie";\n    }\n    __name(shouldRemoveHeader, "shouldRemoveHeader");\n    function cleanRequestHeaders(headers, removeContent, unknownOrigin) {\n      const ret = [];\n      if (Array.isArray(headers)) {\n        for (let i = 0; i < headers.length; i += 2) {\n          if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n            ret.push(headers[i], headers[i + 1]);\n          }\n        }\n      } else if (headers && typeof headers === "object") {\n        for (const key of Object.keys(headers)) {\n          if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n            ret.push(key, headers[key]);\n          }\n        }\n      } else {\n        assert(headers == null, "headers must be an object or an array");\n      }\n      return ret;\n    }\n    __name(cleanRequestHeaders, "cleanRequestHeaders");\n    module2.exports = RedirectHandler;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/interceptor/redirectInterceptor.js\nvar require_redirectInterceptor = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/interceptor/redirectInterceptor.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var RedirectHandler = require_RedirectHandler();\n    function createRedirectInterceptor({ maxRedirections: defaultMaxRedirections }) {\n      return (dispatch) => {\n        return /* @__PURE__ */ __name(function Intercept(opts, handler) {\n          const { maxRedirections = defaultMaxRedirections } = opts;\n          if (!maxRedirections) {\n            return dispatch(opts, handler);\n          }\n          const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler);\n          opts = { ...opts, maxRedirections: 0 };\n          return dispatch(opts, redirectHandler);\n        }, "Intercept");\n      };\n    }\n    __name(createRedirectInterceptor, "createRedirectInterceptor");\n    module2.exports = createRedirectInterceptor;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/llhttp/llhttp-wasm.js\nvar require_llhttp_wasm = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/llhttp/llhttp-wasm.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    module2.exports = " ";\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js\nvar require_llhttp_simd_wasm = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    module2.exports = " ";\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/client.js\nvar require_client = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/client.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var assert = require("assert");\n    var net = require("net");\n    var util = require_util();\n    var timers = require_timers();\n    var Request2 = require_undici_core_request();\n    var DispatcherBase = require_dispatcher_base();\n    var {\n      RequestContentLengthMismatchError,\n      ResponseContentLengthMismatchError,\n      InvalidArgumentError: InvalidArgumentError2,\n      RequestAbortedError,\n      HeadersTimeoutError,\n      HeadersOverflowError,\n      SocketError,\n      InformationalError,\n      BodyTimeoutError,\n      HTTPParserError,\n      ResponseExceededMaxSizeError,\n      ClientDestroyedError\n    } = require_errors();\n    var buildConnector = require_connect();\n    var {\n      kUrl,\n      kReset,\n      kServerName,\n      kClient,\n      kBusy,\n      kParser,\n      kConnect,\n      kBlocking,\n      kResuming,\n      kRunning,\n      kPending,\n      kSize,\n      kWriting,\n      kQueue,\n      kConnected,\n      kConnecting,\n      kNeedDrain,\n      kNoRef,\n      kKeepAliveDefaultTimeout,\n      kHostHeader,\n      kPendingIdx,\n      kRunningIdx,\n      kError,\n      kPipelining,\n      kSocket,\n      kKeepAliveTimeoutValue,\n      kMaxHeadersSize,\n      kKeepAliveMaxTimeout,\n      kKeepAliveTimeoutThreshold,\n      kHeadersTimeout,\n      kBodyTimeout,\n      kStrictContentLength,\n      kConnector,\n      kMaxRedirections,\n      kMaxRequests,\n      kCounter,\n      kClose,\n      kDestroy,\n      kDispatch,\n      kInterceptors,\n      kLocalAddress,\n      kMaxResponseSize\n    } = require_symbols2();\n    var FastBuffer = Buffer[Symbol.species];\n    var kClosedResolve = Symbol("kClosedResolve");\n    var channels = {};\n    try {\n      const diagnosticsChannel = require("diagnostics_channel");\n      channels.sendHeaders = diagnosticsChannel.channel("undici:client:sendHeaders");\n      channels.beforeConnect = diagnosticsChannel.channel("undici:client:beforeConnect");\n      channels.connectError = diagnosticsChannel.channel("undici:client:connectError");\n      channels.connected = diagnosticsChannel.channel("undici:client:connected");\n    } catch {\n      channels.sendHeaders = { hasSubscribers: false };\n      channels.beforeConnect = { hasSubscribers: false };\n      channels.connectError = { hasSubscribers: false };\n      channels.connected = { hasSubscribers: false };\n    }\n    var _Client = class _Client extends DispatcherBase {\n      /**\n       *\n       * @param {string|URL} url\n       * @param {import(\'../types/client\').Client.Options} options\n       */\n      constructor(url, {\n        interceptors,\n        maxHeaderSize,\n        headersTimeout,\n        socketTimeout,\n        requestTimeout,\n        connectTimeout,\n        bodyTimeout,\n        idleTimeout,\n        keepAlive,\n        keepAliveTimeout,\n        maxKeepAliveTimeout,\n        keepAliveMaxTimeout,\n        keepAliveTimeoutThreshold,\n        socketPath,\n        pipelining,\n        tls,\n        strictContentLength,\n        maxCachedSessions,\n        maxRedirections,\n        connect: connect2,\n        maxRequestsPerClient,\n        localAddress,\n        maxResponseSize,\n        autoSelectFamily,\n        autoSelectFamilyAttemptTimeout\n      } = {}) {\n        super();\n        if (keepAlive !== void 0) {\n          throw new InvalidArgumentError2("unsupported keepAlive, use pipelining=0 instead");\n        }\n        if (socketTimeout !== void 0) {\n          throw new InvalidArgumentError2("unsupported socketTimeout, use headersTimeout & bodyTimeout instead");\n        }\n        if (requestTimeout !== void 0) {\n          throw new InvalidArgumentError2("unsupported requestTimeout, use headersTimeout & bodyTimeout instead");\n        }\n        if (idleTimeout !== void 0) {\n          throw new InvalidArgumentError2("unsupported idleTimeout, use keepAliveTimeout instead");\n        }\n        if (maxKeepAliveTimeout !== void 0) {\n          throw new InvalidArgumentError2("unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead");\n        }\n        if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n          throw new InvalidArgumentError2("invalid maxHeaderSize");\n        }\n        if (socketPath != null && typeof socketPath !== "string") {\n          throw new InvalidArgumentError2("invalid socketPath");\n        }\n        if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n          throw new InvalidArgumentError2("invalid connectTimeout");\n        }\n        if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n          throw new InvalidArgumentError2("invalid keepAliveTimeout");\n        }\n        if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n          throw new InvalidArgumentError2("invalid keepAliveMaxTimeout");\n        }\n        if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n          throw new InvalidArgumentError2("invalid keepAliveTimeoutThreshold");\n        }\n        if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n          throw new InvalidArgumentError2("headersTimeout must be a positive integer or zero");\n        }\n        if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n          throw new InvalidArgumentError2("bodyTimeout must be a positive integer or zero");\n        }\n        if (connect2 != null && typeof connect2 !== "function" && typeof connect2 !== "object") {\n          throw new InvalidArgumentError2("connect must be a function or an object");\n        }\n        if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n          throw new InvalidArgumentError2("maxRedirections must be a positive number");\n        }\n        if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n          throw new InvalidArgumentError2("maxRequestsPerClient must be a positive number");\n        }\n        if (localAddress != null && (typeof localAddress !== "string" || net.isIP(localAddress) === 0)) {\n          throw new InvalidArgumentError2("localAddress must be valid string IP address");\n        }\n        if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n          throw new InvalidArgumentError2("maxResponseSize must be a positive number");\n        }\n        if (autoSelectFamilyAttemptTimeout != null && (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)) {\n          throw new InvalidArgumentError2("autoSelectFamilyAttemptTimeout must be a positive number");\n        }\n        if (typeof connect2 !== "function") {\n          connect2 = buildConnector({\n            ...tls,\n            maxCachedSessions,\n            socketPath,\n            timeout: connectTimeout,\n            ...util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,\n            ...connect2\n          });\n        }\n        this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })];\n        this[kUrl] = util.parseOrigin(url);\n        this[kConnector] = connect2;\n        this[kSocket] = null;\n        this[kPipelining] = pipelining != null ? pipelining : 1;\n        this[kMaxHeadersSize] = maxHeaderSize || 16384;\n        this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout;\n        this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 6e5 : keepAliveMaxTimeout;\n        this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold;\n        this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout];\n        this[kServerName] = null;\n        this[kLocalAddress] = localAddress != null ? localAddress : null;\n        this[kResuming] = 0;\n        this[kNeedDrain] = 0;\n        this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ""}\\r\n`;\n        this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 3e5;\n        this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 3e5;\n        this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength;\n        this[kMaxRedirections] = maxRedirections;\n        this[kMaxRequests] = maxRequestsPerClient;\n        this[kClosedResolve] = null;\n        this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1;\n        this[kQueue] = [];\n        this[kRunningIdx] = 0;\n        this[kPendingIdx] = 0;\n      }\n      get pipelining() {\n        return this[kPipelining];\n      }\n      set pipelining(value) {\n        this[kPipelining] = value;\n        resume(this, true);\n      }\n      get [kPending]() {\n        return this[kQueue].length - this[kPendingIdx];\n      }\n      get [kRunning]() {\n        return this[kPendingIdx] - this[kRunningIdx];\n      }\n      get [kSize]() {\n        return this[kQueue].length - this[kRunningIdx];\n      }\n      get [kConnected]() {\n        return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed;\n      }\n      get [kBusy]() {\n        const socket = this[kSocket];\n        return socket && (socket[kReset] || socket[kWriting] || socket[kBlocking]) || this[kSize] >= (this[kPipelining] || 1) || this[kPending] > 0;\n      }\n      /* istanbul ignore: only used for test */\n      [kConnect](cb) {\n        connect(this);\n        this.once("connect", cb);\n      }\n      [kDispatch](opts, handler) {\n        const origin = opts.origin || this[kUrl].origin;\n        const request = new Request2(origin, opts, handler);\n        this[kQueue].push(request);\n        if (this[kResuming]) {\n        } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n          this[kResuming] = 1;\n          define_process_default.nextTick(resume, this);\n        } else {\n          resume(this, true);\n        }\n        if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n          this[kNeedDrain] = 2;\n        }\n        return this[kNeedDrain] < 2;\n      }\n      async [kClose]() {\n        return new Promise((resolve) => {\n          if (!this[kSize]) {\n            resolve(null);\n          } else {\n            this[kClosedResolve] = resolve;\n          }\n        });\n      }\n      async [kDestroy](err) {\n        return new Promise((resolve) => {\n          const requests = this[kQueue].splice(this[kPendingIdx]);\n          for (let i = 0; i < requests.length; i++) {\n            const request = requests[i];\n            errorRequest(this, request, err);\n          }\n          const callback = /* @__PURE__ */ __name(() => {\n            if (this[kClosedResolve]) {\n              this[kClosedResolve]();\n              this[kClosedResolve] = null;\n            }\n            resolve();\n          }, "callback");\n          if (!this[kSocket]) {\n            queueMicrotask(callback);\n          } else {\n            util.destroy(this[kSocket].on("close", callback), err);\n          }\n          resume(this);\n        });\n      }\n    };\n    __name(_Client, "Client");\n    var Client = _Client;\n    var constants = require_constants2();\n    var createRedirectInterceptor = require_redirectInterceptor();\n    var EMPTY_BUF = Buffer.alloc(0);\n    async function lazyllhttp() {\n      const llhttpWasmData = define_process_default.env.JEST_WORKER_ID ? require_llhttp_wasm() : void 0;\n      let mod;\n      try {\n        mod = await WebAssembly.compile(Buffer.from(require_llhttp_simd_wasm(), "base64"));\n      } catch (e) {\n        mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || require_llhttp_wasm(), "base64"));\n      }\n      return await WebAssembly.instantiate(mod, {\n        env: {\n          /* eslint-disable camelcase */\n          wasm_on_url: (p, at, len) => {\n            return 0;\n          },\n          wasm_on_status: (p, at, len) => {\n            assert.strictEqual(currentParser.ptr, p);\n            const start = at - currentBufferPtr + currentBufferRef.byteOffset;\n            return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;\n          },\n          wasm_on_message_begin: (p) => {\n            assert.strictEqual(currentParser.ptr, p);\n            return currentParser.onMessageBegin() || 0;\n          },\n          wasm_on_header_field: (p, at, len) => {\n            assert.strictEqual(currentParser.ptr, p);\n            const start = at - currentBufferPtr + currentBufferRef.byteOffset;\n            return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;\n          },\n          wasm_on_header_value: (p, at, len) => {\n            assert.strictEqual(currentParser.ptr, p);\n            const start = at - currentBufferPtr + currentBufferRef.byteOffset;\n            return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;\n          },\n          wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n            assert.strictEqual(currentParser.ptr, p);\n            return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0;\n          },\n          wasm_on_body: (p, at, len) => {\n            assert.strictEqual(currentParser.ptr, p);\n            const start = at - currentBufferPtr + currentBufferRef.byteOffset;\n            return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0;\n          },\n          wasm_on_message_complete: (p) => {\n            assert.strictEqual(currentParser.ptr, p);\n            return currentParser.onMessageComplete() || 0;\n          }\n          /* eslint-enable camelcase */\n        }\n      });\n    }\n    __name(lazyllhttp, "lazyllhttp");\n    var llhttpInstance = null;\n    var llhttpPromise = lazyllhttp();\n    llhttpPromise.catch();\n    var currentParser = null;\n    var currentBufferRef = null;\n    var currentBufferSize = 0;\n    var currentBufferPtr = null;\n    var TIMEOUT_HEADERS = 1;\n    var TIMEOUT_BODY = 2;\n    var TIMEOUT_IDLE = 3;\n    var _Parser = class _Parser {\n      constructor(client, socket, { exports: exports3 }) {\n        assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0);\n        this.llhttp = exports3;\n        this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE);\n        this.client = client;\n        this.socket = socket;\n        this.timeout = null;\n        this.timeoutValue = null;\n        this.timeoutType = null;\n        this.statusCode = null;\n        this.statusText = "";\n        this.upgrade = false;\n        this.headers = [];\n        this.headersSize = 0;\n        this.headersMaxSize = client[kMaxHeadersSize];\n        this.shouldKeepAlive = false;\n        this.paused = false;\n        this.resume = this.resume.bind(this);\n        this.bytesRead = 0;\n        this.keepAlive = "";\n        this.contentLength = "";\n        this.connection = "";\n        this.maxResponseSize = client[kMaxResponseSize];\n      }\n      setTimeout(value, type) {\n        this.timeoutType = type;\n        if (value !== this.timeoutValue) {\n          timers.clearTimeout(this.timeout);\n          if (value) {\n            this.timeout = timers.setTimeout(onParserTimeout, value, this);\n            if (this.timeout.unref) {\n              this.timeout.unref();\n            }\n          } else {\n            this.timeout = null;\n          }\n          this.timeoutValue = value;\n        } else if (this.timeout) {\n          if (this.timeout.refresh) {\n            this.timeout.refresh();\n          }\n        }\n      }\n      resume() {\n        if (this.socket.destroyed || !this.paused) {\n          return;\n        }\n        assert(this.ptr != null);\n        assert(currentParser == null);\n        this.llhttp.llhttp_resume(this.ptr);\n        assert(this.timeoutType === TIMEOUT_BODY);\n        if (this.timeout) {\n          if (this.timeout.refresh) {\n            this.timeout.refresh();\n          }\n        }\n        this.paused = false;\n        this.execute(this.socket.read() || EMPTY_BUF);\n        this.readMore();\n      }\n      readMore() {\n        while (!this.paused && this.ptr) {\n          const chunk = this.socket.read();\n          if (chunk === null) {\n            break;\n          }\n          this.execute(chunk);\n        }\n      }\n      execute(data) {\n        assert(this.ptr != null);\n        assert(currentParser == null);\n        assert(!this.paused);\n        const { socket, llhttp } = this;\n        if (data.length > currentBufferSize) {\n          if (currentBufferPtr) {\n            llhttp.free(currentBufferPtr);\n          }\n          currentBufferSize = Math.ceil(data.length / 4096) * 4096;\n          currentBufferPtr = llhttp.malloc(currentBufferSize);\n        }\n        new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data);\n        try {\n          let ret;\n          try {\n            currentBufferRef = data;\n            currentParser = this;\n            ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length);\n          } catch (err) {\n            throw err;\n          } finally {\n            currentParser = null;\n            currentBufferRef = null;\n          }\n          const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr;\n          if (ret === constants.ERROR.PAUSED_UPGRADE) {\n            this.onUpgrade(data.slice(offset));\n          } else if (ret === constants.ERROR.PAUSED) {\n            this.paused = true;\n            socket.unshift(data.slice(offset));\n          } else if (ret !== constants.ERROR.OK) {\n            const ptr = llhttp.llhttp_get_error_reason(this.ptr);\n            let message = "";\n            if (ptr) {\n              const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0);\n              message = "Response does not match the HTTP/1.1 protocol (" + Buffer.from(llhttp.memory.buffer, ptr, len).toString() + ")";\n            }\n            throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset));\n          }\n        } catch (err) {\n          util.destroy(socket, err);\n        }\n      }\n      destroy() {\n        assert(this.ptr != null);\n        assert(currentParser == null);\n        this.llhttp.llhttp_free(this.ptr);\n        this.ptr = null;\n        timers.clearTimeout(this.timeout);\n        this.timeout = null;\n        this.timeoutValue = null;\n        this.timeoutType = null;\n        this.paused = false;\n      }\n      onStatus(buf) {\n        this.statusText = buf.toString();\n      }\n      onMessageBegin() {\n        const { socket, client } = this;\n        if (socket.destroyed) {\n          return -1;\n        }\n        const request = client[kQueue][client[kRunningIdx]];\n        if (!request) {\n          return -1;\n        }\n      }\n      onHeaderField(buf) {\n        const len = this.headers.length;\n        if ((len & 1) === 0) {\n          this.headers.push(buf);\n        } else {\n          this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]);\n        }\n        this.trackHeader(buf.length);\n      }\n      onHeaderValue(buf) {\n        let len = this.headers.length;\n        if ((len & 1) === 1) {\n          this.headers.push(buf);\n          len += 1;\n        } else {\n          this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf]);\n        }\n        const key = this.headers[len - 2];\n        if (key.length === 10 && key.toString().toLowerCase() === "keep-alive") {\n          this.keepAlive += buf.toString();\n        } else if (key.length === 10 && key.toString().toLowerCase() === "connection") {\n          this.connection += buf.toString();\n        } else if (key.length === 14 && key.toString().toLowerCase() === "content-length") {\n          this.contentLength += buf.toString();\n        }\n        this.trackHeader(buf.length);\n      }\n      trackHeader(len) {\n        this.headersSize += len;\n        if (this.headersSize >= this.headersMaxSize) {\n          util.destroy(this.socket, new HeadersOverflowError());\n        }\n      }\n      onUpgrade(head) {\n        const { upgrade, client, socket, headers, statusCode } = this;\n        assert(upgrade);\n        const request = client[kQueue][client[kRunningIdx]];\n        assert(request);\n        assert(!socket.destroyed);\n        assert(socket === client[kSocket]);\n        assert(!this.paused);\n        assert(request.upgrade || request.method === "CONNECT");\n        this.statusCode = null;\n        this.statusText = "";\n        this.shouldKeepAlive = null;\n        assert(this.headers.length % 2 === 0);\n        this.headers = [];\n        this.headersSize = 0;\n        socket.unshift(head);\n        socket[kParser].destroy();\n        socket[kParser] = null;\n        socket[kClient] = null;\n        socket[kError] = null;\n        socket.removeListener("error", onSocketError).removeListener("readable", onSocketReadable).removeListener("end", onSocketEnd).removeListener("close", onSocketClose);\n        client[kSocket] = null;\n        client[kQueue][client[kRunningIdx]++] = null;\n        client.emit("disconnect", client[kUrl], [client], new InformationalError("upgrade"));\n        try {\n          request.onUpgrade(statusCode, headers, socket);\n        } catch (err) {\n          util.destroy(socket, err);\n        }\n        resume(client);\n      }\n      onHeadersComplete(statusCode, upgrade, shouldKeepAlive) {\n        const { client, socket, headers, statusText } = this;\n        if (socket.destroyed) {\n          return -1;\n        }\n        const request = client[kQueue][client[kRunningIdx]];\n        if (!request) {\n          return -1;\n        }\n        assert(!this.upgrade);\n        assert(this.statusCode < 200);\n        if (statusCode === 100) {\n          util.destroy(socket, new SocketError("bad response", util.getSocketInfo(socket)));\n          return -1;\n        }\n        if (upgrade && !request.upgrade) {\n          util.destroy(socket, new SocketError("bad upgrade", util.getSocketInfo(socket)));\n          return -1;\n        }\n        assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS);\n        this.statusCode = statusCode;\n        this.shouldKeepAlive = shouldKeepAlive || // Override llhttp value which does not allow keepAlive for HEAD.\n        request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive";\n        if (this.statusCode >= 200) {\n          const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout];\n          this.setTimeout(bodyTimeout, TIMEOUT_BODY);\n        } else if (this.timeout) {\n          if (this.timeout.refresh) {\n            this.timeout.refresh();\n          }\n        }\n        if (request.method === "CONNECT") {\n          assert(client[kRunning] === 1);\n          this.upgrade = true;\n          return 2;\n        }\n        if (upgrade) {\n          assert(client[kRunning] === 1);\n          this.upgrade = true;\n          return 2;\n        }\n        assert(this.headers.length % 2 === 0);\n        this.headers = [];\n        this.headersSize = 0;\n        if (this.shouldKeepAlive && client[kPipelining]) {\n          const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null;\n          if (keepAliveTimeout != null) {\n            const timeout = Math.min(\n              keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n              client[kKeepAliveMaxTimeout]\n            );\n            if (timeout <= 0) {\n              socket[kReset] = true;\n            } else {\n              client[kKeepAliveTimeoutValue] = timeout;\n            }\n          } else {\n            client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout];\n          }\n        } else {\n          socket[kReset] = true;\n        }\n        let pause;\n        try {\n          pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false;\n        } catch (err) {\n          util.destroy(socket, err);\n          return -1;\n        }\n        if (request.method === "HEAD") {\n          return 1;\n        }\n        if (statusCode < 200) {\n          return 1;\n        }\n        if (socket[kBlocking]) {\n          socket[kBlocking] = false;\n          resume(client);\n        }\n        return pause ? constants.ERROR.PAUSED : 0;\n      }\n      onBody(buf) {\n        const { client, socket, statusCode, maxResponseSize } = this;\n        if (socket.destroyed) {\n          return -1;\n        }\n        const request = client[kQueue][client[kRunningIdx]];\n        assert(request);\n        assert.strictEqual(this.timeoutType, TIMEOUT_BODY);\n        if (this.timeout) {\n          if (this.timeout.refresh) {\n            this.timeout.refresh();\n          }\n        }\n        assert(statusCode >= 200);\n        if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n          util.destroy(socket, new ResponseExceededMaxSizeError());\n          return -1;\n        }\n        this.bytesRead += buf.length;\n        try {\n          if (request.onData(buf) === false) {\n            return constants.ERROR.PAUSED;\n          }\n        } catch (err) {\n          util.destroy(socket, err);\n          return -1;\n        }\n      }\n      onMessageComplete() {\n        const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this;\n        if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n          return -1;\n        }\n        if (upgrade) {\n          return;\n        }\n        const request = client[kQueue][client[kRunningIdx]];\n        assert(request);\n        assert(statusCode >= 100);\n        this.statusCode = null;\n        this.statusText = "";\n        this.bytesRead = 0;\n        this.contentLength = "";\n        this.keepAlive = "";\n        this.connection = "";\n        assert(this.headers.length % 2 === 0);\n        this.headers = [];\n        this.headersSize = 0;\n        if (statusCode < 200) {\n          return;\n        }\n        if (request.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n          util.destroy(socket, new ResponseContentLengthMismatchError());\n          return -1;\n        }\n        try {\n          request.onComplete(headers);\n        } catch (err) {\n          errorRequest(client, request, err);\n        }\n        client[kQueue][client[kRunningIdx]++] = null;\n        if (socket[kWriting]) {\n          assert.strictEqual(client[kRunning], 0);\n          util.destroy(socket, new InformationalError("reset"));\n          return constants.ERROR.PAUSED;\n        } else if (!shouldKeepAlive) {\n          util.destroy(socket, new InformationalError("reset"));\n          return constants.ERROR.PAUSED;\n        } else if (socket[kReset] && client[kRunning] === 0) {\n          util.destroy(socket, new InformationalError("reset"));\n          return constants.ERROR.PAUSED;\n        } else if (client[kPipelining] === 1) {\n          setImmediate(resume, client);\n        } else {\n          resume(client);\n        }\n      }\n    };\n    __name(_Parser, "Parser");\n    var Parser = _Parser;\n    function onParserTimeout(parser) {\n      const { socket, timeoutType, client } = parser;\n      if (timeoutType === TIMEOUT_HEADERS) {\n        if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n          assert(!parser.paused, "cannot be paused while waiting for headers");\n          util.destroy(socket, new HeadersTimeoutError());\n        }\n      } else if (timeoutType === TIMEOUT_BODY) {\n        if (!parser.paused) {\n          util.destroy(socket, new BodyTimeoutError());\n        }\n      } else if (timeoutType === TIMEOUT_IDLE) {\n        assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);\n        util.destroy(socket, new InformationalError("socket idle timeout"));\n      }\n    }\n    __name(onParserTimeout, "onParserTimeout");\n    function onSocketReadable() {\n      const { [kParser]: parser } = this;\n      parser.readMore();\n    }\n    __name(onSocketReadable, "onSocketReadable");\n    function onSocketError(err) {\n      const { [kParser]: parser } = this;\n      assert(err.code !== "ERR_TLS_CERT_ALTNAME_INVALID");\n      if (err.code === "ECONNRESET" && parser.statusCode && !parser.shouldKeepAlive) {\n        parser.onMessageComplete();\n        return;\n      }\n      this[kError] = err;\n      onError(this[kClient], err);\n    }\n    __name(onSocketError, "onSocketError");\n    function onError(client, err) {\n      if (client[kRunning] === 0 && err.code !== "UND_ERR_INFO" && err.code !== "UND_ERR_SOCKET") {\n        assert(client[kPendingIdx] === client[kRunningIdx]);\n        const requests = client[kQueue].splice(client[kRunningIdx]);\n        for (let i = 0; i < requests.length; i++) {\n          const request = requests[i];\n          errorRequest(client, request, err);\n        }\n        assert(client[kSize] === 0);\n      }\n    }\n    __name(onError, "onError");\n    function onSocketEnd() {\n      const { [kParser]: parser } = this;\n      if (parser.statusCode && !parser.shouldKeepAlive) {\n        parser.onMessageComplete();\n        return;\n      }\n      util.destroy(this, new SocketError("other side closed", util.getSocketInfo(this)));\n    }\n    __name(onSocketEnd, "onSocketEnd");\n    function onSocketClose() {\n      const { [kClient]: client } = this;\n      if (!this[kError] && this[kParser].statusCode && !this[kParser].shouldKeepAlive) {\n        this[kParser].onMessageComplete();\n      }\n      this[kParser].destroy();\n      this[kParser] = null;\n      const err = this[kError] || new SocketError("closed", util.getSocketInfo(this));\n      client[kSocket] = null;\n      if (client.destroyed) {\n        assert(client[kPending] === 0);\n        const requests = client[kQueue].splice(client[kRunningIdx]);\n        for (let i = 0; i < requests.length; i++) {\n          const request = requests[i];\n          errorRequest(client, request, err);\n        }\n      } else if (client[kRunning] > 0 && err.code !== "UND_ERR_INFO") {\n        const request = client[kQueue][client[kRunningIdx]];\n        client[kQueue][client[kRunningIdx]++] = null;\n        errorRequest(client, request, err);\n      }\n      client[kPendingIdx] = client[kRunningIdx];\n      assert(client[kRunning] === 0);\n      client.emit("disconnect", client[kUrl], [client], err);\n      resume(client);\n    }\n    __name(onSocketClose, "onSocketClose");\n    async function connect(client) {\n      assert(!client[kConnecting]);\n      assert(!client[kSocket]);\n      let { host, hostname, protocol, port } = client[kUrl];\n      if (hostname[0] === "[") {\n        const idx = hostname.indexOf("]");\n        assert(idx !== -1);\n        const ip = hostname.substr(1, idx - 1);\n        assert(net.isIP(ip));\n        hostname = ip;\n      }\n      client[kConnecting] = true;\n      if (channels.beforeConnect.hasSubscribers) {\n        channels.beforeConnect.publish({\n          connectParams: {\n            host,\n            hostname,\n            protocol,\n            port,\n            servername: client[kServerName],\n            localAddress: client[kLocalAddress]\n          },\n          connector: client[kConnector]\n        });\n      }\n      try {\n        const socket = await new Promise((resolve, reject) => {\n          client[kConnector]({\n            host,\n            hostname,\n            protocol,\n            port,\n            servername: client[kServerName],\n            localAddress: client[kLocalAddress]\n          }, (err, socket2) => {\n            if (err) {\n              reject(err);\n            } else {\n              resolve(socket2);\n            }\n          });\n        });\n        if (client.destroyed) {\n          util.destroy(socket.on("error", () => {\n          }), new ClientDestroyedError());\n          return;\n        }\n        if (!llhttpInstance) {\n          llhttpInstance = await llhttpPromise;\n          llhttpPromise = null;\n        }\n        client[kConnecting] = false;\n        assert(socket);\n        socket[kNoRef] = false;\n        socket[kWriting] = false;\n        socket[kReset] = false;\n        socket[kBlocking] = false;\n        socket[kError] = null;\n        socket[kParser] = new Parser(client, socket, llhttpInstance);\n        socket[kClient] = client;\n        socket[kCounter] = 0;\n        socket[kMaxRequests] = client[kMaxRequests];\n        socket.on("error", onSocketError).on("readable", onSocketReadable).on("end", onSocketEnd).on("close", onSocketClose);\n        client[kSocket] = socket;\n        if (channels.connected.hasSubscribers) {\n          channels.connected.publish({\n            connectParams: {\n              host,\n              hostname,\n              protocol,\n              port,\n              servername: client[kServerName],\n              localAddress: client[kLocalAddress]\n            },\n            connector: client[kConnector],\n            socket\n          });\n        }\n        client.emit("connect", client[kUrl], [client]);\n      } catch (err) {\n        if (client.destroyed) {\n          return;\n        }\n        client[kConnecting] = false;\n        if (channels.connectError.hasSubscribers) {\n          channels.connectError.publish({\n            connectParams: {\n              host,\n              hostname,\n              protocol,\n              port,\n              servername: client[kServerName],\n              localAddress: client[kLocalAddress]\n            },\n            connector: client[kConnector],\n            error: err\n          });\n        }\n        if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {\n          assert(client[kRunning] === 0);\n          while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n            const request = client[kQueue][client[kPendingIdx]++];\n            errorRequest(client, request, err);\n          }\n        } else {\n          onError(client, err);\n        }\n        client.emit("connectionError", client[kUrl], [client], err);\n      }\n      resume(client);\n    }\n    __name(connect, "connect");\n    function emitDrain(client) {\n      client[kNeedDrain] = 0;\n      client.emit("drain", client[kUrl], [client]);\n    }\n    __name(emitDrain, "emitDrain");\n    function resume(client, sync) {\n      if (client[kResuming] === 2) {\n        return;\n      }\n      client[kResuming] = 2;\n      _resume(client, sync);\n      client[kResuming] = 0;\n      if (client[kRunningIdx] > 256) {\n        client[kQueue].splice(0, client[kRunningIdx]);\n        client[kPendingIdx] -= client[kRunningIdx];\n        client[kRunningIdx] = 0;\n      }\n    }\n    __name(resume, "resume");\n    function _resume(client, sync) {\n      while (true) {\n        if (client.destroyed) {\n          assert(client[kPending] === 0);\n          return;\n        }\n        if (client[kClosedResolve] && !client[kSize]) {\n          client[kClosedResolve]();\n          client[kClosedResolve] = null;\n          return;\n        }\n        const socket = client[kSocket];\n        if (socket && !socket.destroyed) {\n          if (client[kSize] === 0) {\n            if (!socket[kNoRef] && socket.unref) {\n              socket.unref();\n              socket[kNoRef] = true;\n            }\n          } else if (socket[kNoRef] && socket.ref) {\n            socket.ref();\n            socket[kNoRef] = false;\n          }\n          if (client[kSize] === 0) {\n            if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {\n              socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE);\n            }\n          } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n            if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n              const request2 = client[kQueue][client[kRunningIdx]];\n              const headersTimeout = request2.headersTimeout != null ? request2.headersTimeout : client[kHeadersTimeout];\n              socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS);\n            }\n          }\n        }\n        if (client[kBusy]) {\n          client[kNeedDrain] = 2;\n        } else if (client[kNeedDrain] === 2) {\n          if (sync) {\n            client[kNeedDrain] = 1;\n            define_process_default.nextTick(emitDrain, client);\n          } else {\n            emitDrain(client);\n          }\n          continue;\n        }\n        if (client[kPending] === 0) {\n          return;\n        }\n        if (client[kRunning] >= (client[kPipelining] || 1)) {\n          return;\n        }\n        const request = client[kQueue][client[kPendingIdx]];\n        if (client[kUrl].protocol === "https:" && client[kServerName] !== request.servername) {\n          if (client[kRunning] > 0) {\n            return;\n          }\n          client[kServerName] = request.servername;\n          if (socket && socket.servername !== request.servername) {\n            util.destroy(socket, new InformationalError("servername changed"));\n            return;\n          }\n        }\n        if (client[kConnecting]) {\n          return;\n        }\n        if (!socket) {\n          connect(client);\n          return;\n        }\n        if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {\n          return;\n        }\n        if (client[kRunning] > 0 && !request.idempotent) {\n          return;\n        }\n        if (client[kRunning] > 0 && (request.upgrade || request.method === "CONNECT")) {\n          return;\n        }\n        if (util.isStream(request.body) && util.bodyLength(request.body) === 0) {\n          request.body.on(\n            "data",\n            /* istanbul ignore next */\n            function() {\n              assert(false);\n            }\n          ).on("error", function(err) {\n            errorRequest(client, request, err);\n          }).on("end", function() {\n            util.destroy(this);\n          });\n          request.body = null;\n        }\n        if (client[kRunning] > 0 && (util.isStream(request.body) || util.isAsyncIterable(request.body))) {\n          return;\n        }\n        if (!request.aborted && write(client, request)) {\n          client[kPendingIdx]++;\n        } else {\n          client[kQueue].splice(client[kPendingIdx], 1);\n        }\n      }\n    }\n    __name(_resume, "_resume");\n    function write(client, request) {\n      const { body, method, path, host, upgrade, headers, blocking, reset } = request;\n      const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";\n      if (body && typeof body.read === "function") {\n        body.read(0);\n      }\n      let contentLength = util.bodyLength(body);\n      if (contentLength === null) {\n        contentLength = request.contentLength;\n      }\n      if (contentLength === 0 && !expectsPayload) {\n        contentLength = null;\n      }\n      if (request.contentLength !== null && request.contentLength !== contentLength) {\n        if (client[kStrictContentLength]) {\n          errorRequest(client, request, new RequestContentLengthMismatchError());\n          return false;\n        }\n        define_process_default.emitWarning(new RequestContentLengthMismatchError());\n      }\n      const socket = client[kSocket];\n      try {\n        request.onConnect((err) => {\n          if (request.aborted || request.completed) {\n            return;\n          }\n          errorRequest(client, request, err || new RequestAbortedError());\n          util.destroy(socket, new InformationalError("aborted"));\n        });\n      } catch (err) {\n        errorRequest(client, request, err);\n      }\n      if (request.aborted) {\n        return false;\n      }\n      if (method === "HEAD") {\n        socket[kReset] = true;\n      }\n      if (upgrade || method === "CONNECT") {\n        socket[kReset] = true;\n      }\n      if (reset != null) {\n        socket[kReset] = reset;\n      }\n      if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n        socket[kReset] = true;\n      }\n      if (blocking) {\n        socket[kBlocking] = true;\n      }\n      let header = `${method} ${path} HTTP/1.1\\r\n`;\n      if (typeof host === "string") {\n        header += `host: ${host}\\r\n`;\n      } else {\n        header += client[kHostHeader];\n      }\n      if (upgrade) {\n        header += `connection: upgrade\\r\nupgrade: ${upgrade}\\r\n`;\n      } else if (client[kPipelining] && !socket[kReset]) {\n        header += "connection: keep-alive\\r\\n";\n      } else {\n        header += "connection: close\\r\\n";\n      }\n      if (headers) {\n        header += headers;\n      }\n      if (channels.sendHeaders.hasSubscribers) {\n        channels.sendHeaders.publish({ request, headers: header, socket });\n      }\n      if (!body) {\n        if (contentLength === 0) {\n          socket.write(`${header}content-length: 0\\r\n\\r\n`, "latin1");\n        } else {\n          assert(contentLength === null, "no body must not have content length");\n          socket.write(`${header}\\r\n`, "latin1");\n        }\n        request.onRequestSent();\n      } else if (util.isBuffer(body)) {\n        assert(contentLength === body.byteLength, "buffer body must have content length");\n        socket.cork();\n        socket.write(`${header}content-length: ${contentLength}\\r\n\\r\n`, "latin1");\n        socket.write(body);\n        socket.uncork();\n        request.onBodySent(body);\n        request.onRequestSent();\n        if (!expectsPayload) {\n          socket[kReset] = true;\n        }\n      } else if (util.isBlobLike(body)) {\n        if (typeof body.stream === "function") {\n          writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload });\n        } else {\n          writeBlob({ body, client, request, socket, contentLength, header, expectsPayload });\n        }\n      } else if (util.isStream(body)) {\n        writeStream({ body, client, request, socket, contentLength, header, expectsPayload });\n      } else if (util.isIterable(body)) {\n        writeIterable({ body, client, request, socket, contentLength, header, expectsPayload });\n      } else {\n        assert(false);\n      }\n      return true;\n    }\n    __name(write, "write");\n    function writeStream({ body, client, request, socket, contentLength, header, expectsPayload }) {\n      assert(contentLength !== 0 || client[kRunning] === 0, "stream body cannot be pipelined");\n      let finished = false;\n      const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header });\n      const onData = /* @__PURE__ */ __name(function(chunk) {\n        if (finished) {\n          return;\n        }\n        try {\n          if (!writer.write(chunk) && this.pause) {\n            this.pause();\n          }\n        } catch (err) {\n          util.destroy(this, err);\n        }\n      }, "onData");\n      const onDrain = /* @__PURE__ */ __name(function() {\n        if (finished) {\n          return;\n        }\n        if (body.resume) {\n          body.resume();\n        }\n      }, "onDrain");\n      const onAbort = /* @__PURE__ */ __name(function() {\n        onFinished(new RequestAbortedError());\n      }, "onAbort");\n      const onFinished = /* @__PURE__ */ __name(function(err) {\n        if (finished) {\n          return;\n        }\n        finished = true;\n        assert(socket.destroyed || socket[kWriting] && client[kRunning] <= 1);\n        socket.off("drain", onDrain).off("error", onFinished);\n        body.removeListener("data", onData).removeListener("end", onFinished).removeListener("error", onFinished).removeListener("close", onAbort);\n        if (!err) {\n          try {\n            writer.end();\n          } catch (er) {\n            err = er;\n          }\n        }\n        writer.destroy(err);\n        if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) {\n          util.destroy(body, err);\n        } else {\n          util.destroy(body);\n        }\n      }, "onFinished");\n      body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort);\n      if (body.resume) {\n        body.resume();\n      }\n      socket.on("drain", onDrain).on("error", onFinished);\n    }\n    __name(writeStream, "writeStream");\n    async function writeBlob({ body, client, request, socket, contentLength, header, expectsPayload }) {\n      assert(contentLength === body.size, "blob body must have content length");\n      try {\n        if (contentLength != null && contentLength !== body.size) {\n          throw new RequestContentLengthMismatchError();\n        }\n        const buffer = Buffer.from(await body.arrayBuffer());\n        socket.cork();\n        socket.write(`${header}content-length: ${contentLength}\\r\n\\r\n`, "latin1");\n        socket.write(buffer);\n        socket.uncork();\n        request.onBodySent(buffer);\n        request.onRequestSent();\n        if (!expectsPayload) {\n          socket[kReset] = true;\n        }\n        resume(client);\n      } catch (err) {\n        util.destroy(socket, err);\n      }\n    }\n    __name(writeBlob, "writeBlob");\n    async function writeIterable({ body, client, request, socket, contentLength, header, expectsPayload }) {\n      assert(contentLength !== 0 || client[kRunning] === 0, "iterator body cannot be pipelined");\n      let callback = null;\n      function onDrain() {\n        if (callback) {\n          const cb = callback;\n          callback = null;\n          cb();\n        }\n      }\n      __name(onDrain, "onDrain");\n      const waitForDrain = /* @__PURE__ */ __name(() => new Promise((resolve, reject) => {\n        assert(callback === null);\n        if (socket[kError]) {\n          reject(socket[kError]);\n        } else {\n          callback = resolve;\n        }\n      }), "waitForDrain");\n      socket.on("close", onDrain).on("drain", onDrain);\n      const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header });\n      try {\n        for await (const chunk of body) {\n          if (socket[kError]) {\n            throw socket[kError];\n          }\n          if (!writer.write(chunk)) {\n            await waitForDrain();\n          }\n        }\n        writer.end();\n      } catch (err) {\n        writer.destroy(err);\n      } finally {\n        socket.off("close", onDrain).off("drain", onDrain);\n      }\n    }\n    __name(writeIterable, "writeIterable");\n    var _AsyncWriter = class _AsyncWriter {\n      constructor({ socket, request, contentLength, client, expectsPayload, header }) {\n        this.socket = socket;\n        this.request = request;\n        this.contentLength = contentLength;\n        this.client = client;\n        this.bytesWritten = 0;\n        this.expectsPayload = expectsPayload;\n        this.header = header;\n        socket[kWriting] = true;\n      }\n      write(chunk) {\n        const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this;\n        if (socket[kError]) {\n          throw socket[kError];\n        }\n        if (socket.destroyed) {\n          return false;\n        }\n        const len = Buffer.byteLength(chunk);\n        if (!len) {\n          return true;\n        }\n        if (contentLength !== null && bytesWritten + len > contentLength) {\n          if (client[kStrictContentLength]) {\n            throw new RequestContentLengthMismatchError();\n          }\n          define_process_default.emitWarning(new RequestContentLengthMismatchError());\n        }\n        socket.cork();\n        if (bytesWritten === 0) {\n          if (!expectsPayload) {\n            socket[kReset] = true;\n          }\n          if (contentLength === null) {\n            socket.write(`${header}transfer-encoding: chunked\\r\n`, "latin1");\n          } else {\n            socket.write(`${header}content-length: ${contentLength}\\r\n\\r\n`, "latin1");\n          }\n        }\n        if (contentLength === null) {\n          socket.write(`\\r\n${len.toString(16)}\\r\n`, "latin1");\n        }\n        this.bytesWritten += len;\n        const ret = socket.write(chunk);\n        socket.uncork();\n        request.onBodySent(chunk);\n        if (!ret) {\n          if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n            if (socket[kParser].timeout.refresh) {\n              socket[kParser].timeout.refresh();\n            }\n          }\n        }\n        return ret;\n      }\n      end() {\n        const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this;\n        request.onRequestSent();\n        socket[kWriting] = false;\n        if (socket[kError]) {\n          throw socket[kError];\n        }\n        if (socket.destroyed) {\n          return;\n        }\n        if (bytesWritten === 0) {\n          if (expectsPayload) {\n            socket.write(`${header}content-length: 0\\r\n\\r\n`, "latin1");\n          } else {\n            socket.write(`${header}\\r\n`, "latin1");\n          }\n        } else if (contentLength === null) {\n          socket.write("\\r\\n0\\r\\n\\r\\n", "latin1");\n        }\n        if (contentLength !== null && bytesWritten !== contentLength) {\n          if (client[kStrictContentLength]) {\n            throw new RequestContentLengthMismatchError();\n          } else {\n            define_process_default.emitWarning(new RequestContentLengthMismatchError());\n          }\n        }\n        if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n          if (socket[kParser].timeout.refresh) {\n            socket[kParser].timeout.refresh();\n          }\n        }\n        resume(client);\n      }\n      destroy(err) {\n        const { socket, client } = this;\n        socket[kWriting] = false;\n        if (err) {\n          assert(client[kRunning] <= 1, "pipeline should only contain this request");\n          util.destroy(socket, err);\n        }\n      }\n    };\n    __name(_AsyncWriter, "AsyncWriter");\n    var AsyncWriter = _AsyncWriter;\n    function errorRequest(client, request, err) {\n      try {\n        request.onError(err);\n        assert(request.aborted);\n      } catch (err2) {\n        client.emit("error", err2);\n      }\n    }\n    __name(errorRequest, "errorRequest");\n    module2.exports = Client;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/pool.js\nvar require_pool = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/pool.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var {\n      PoolBase,\n      kClients,\n      kNeedDrain,\n      kAddClient,\n      kGetDispatcher\n    } = require_pool_base();\n    var Client = require_client();\n    var {\n      InvalidArgumentError: InvalidArgumentError2\n    } = require_errors();\n    var util = require_util();\n    var { kUrl, kInterceptors } = require_symbols2();\n    var buildConnector = require_connect();\n    var kOptions = Symbol("options");\n    var kConnections = Symbol("connections");\n    var kFactory = Symbol("factory");\n    function defaultFactory(origin, opts) {\n      return new Client(origin, opts);\n    }\n    __name(defaultFactory, "defaultFactory");\n    var _Pool = class _Pool extends PoolBase {\n      constructor(origin, {\n        connections,\n        factory = defaultFactory,\n        connect,\n        connectTimeout,\n        tls,\n        maxCachedSessions,\n        socketPath,\n        autoSelectFamily,\n        autoSelectFamilyAttemptTimeout,\n        ...options\n      } = {}) {\n        super();\n        if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n          throw new InvalidArgumentError2("invalid connections");\n        }\n        if (typeof factory !== "function") {\n          throw new InvalidArgumentError2("factory must be a function.");\n        }\n        if (connect != null && typeof connect !== "function" && typeof connect !== "object") {\n          throw new InvalidArgumentError2("connect must be a function or an object");\n        }\n        if (typeof connect !== "function") {\n          connect = buildConnector({\n            ...tls,\n            maxCachedSessions,\n            socketPath,\n            timeout: connectTimeout == null ? 1e4 : connectTimeout,\n            ...util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,\n            ...connect\n          });\n        }\n        this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool) ? options.interceptors.Pool : [];\n        this[kConnections] = connections || null;\n        this[kUrl] = util.parseOrigin(origin);\n        this[kOptions] = { ...util.deepClone(options), connect };\n        this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;\n        this[kFactory] = factory;\n      }\n      [kGetDispatcher]() {\n        let dispatcher = this[kClients].find((dispatcher2) => !dispatcher2[kNeedDrain]);\n        if (dispatcher) {\n          return dispatcher;\n        }\n        if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n          dispatcher = this[kFactory](this[kUrl], this[kOptions]);\n          this[kAddClient](dispatcher);\n        }\n        return dispatcher;\n      }\n    };\n    __name(_Pool, "Pool");\n    var Pool = _Pool;\n    module2.exports = Pool;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/agent.js\nvar require_agent = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/agent.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { InvalidArgumentError: InvalidArgumentError2 } = require_errors();\n    var { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require_symbols2();\n    var DispatcherBase = require_dispatcher_base();\n    var Pool = require_pool();\n    var Client = require_client();\n    var util = require_util();\n    var createRedirectInterceptor = require_redirectInterceptor();\n    var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()();\n    var kOnConnect = Symbol("onConnect");\n    var kOnDisconnect = Symbol("onDisconnect");\n    var kOnConnectionError = Symbol("onConnectionError");\n    var kMaxRedirections = Symbol("maxRedirections");\n    var kOnDrain = Symbol("onDrain");\n    var kFactory = Symbol("factory");\n    var kFinalizer = Symbol("finalizer");\n    var kOptions = Symbol("options");\n    function defaultFactory(origin, opts) {\n      return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts);\n    }\n    __name(defaultFactory, "defaultFactory");\n    var _Agent = class _Agent extends DispatcherBase {\n      constructor({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n        super();\n        if (typeof factory !== "function") {\n          throw new InvalidArgumentError2("factory must be a function.");\n        }\n        if (connect != null && typeof connect !== "function" && typeof connect !== "object") {\n          throw new InvalidArgumentError2("connect must be a function or an object");\n        }\n        if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n          throw new InvalidArgumentError2("maxRedirections must be a positive number");\n        }\n        if (connect && typeof connect !== "function") {\n          connect = { ...connect };\n        }\n        this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent) ? options.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })];\n        this[kOptions] = { ...util.deepClone(options), connect };\n        this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0;\n        this[kMaxRedirections] = maxRedirections;\n        this[kFactory] = factory;\n        this[kClients] = /* @__PURE__ */ new Map();\n        this[kFinalizer] = new FinalizationRegistry(\n          /* istanbul ignore next: gc is undeterministic */\n          (key) => {\n            const ref = this[kClients].get(key);\n            if (ref !== void 0 && ref.deref() === void 0) {\n              this[kClients].delete(key);\n            }\n          }\n        );\n        const agent = this;\n        this[kOnDrain] = (origin, targets) => {\n          agent.emit("drain", origin, [agent, ...targets]);\n        };\n        this[kOnConnect] = (origin, targets) => {\n          agent.emit("connect", origin, [agent, ...targets]);\n        };\n        this[kOnDisconnect] = (origin, targets, err) => {\n          agent.emit("disconnect", origin, [agent, ...targets], err);\n        };\n        this[kOnConnectionError] = (origin, targets, err) => {\n          agent.emit("connectionError", origin, [agent, ...targets], err);\n        };\n      }\n      get [kRunning]() {\n        let ret = 0;\n        for (const ref of this[kClients].values()) {\n          const client = ref.deref();\n          if (client) {\n            ret += client[kRunning];\n          }\n        }\n        return ret;\n      }\n      [kDispatch](opts, handler) {\n        let key;\n        if (opts.origin && (typeof opts.origin === "string" || opts.origin instanceof URL)) {\n          key = String(opts.origin);\n        } else {\n          throw new InvalidArgumentError2("opts.origin must be a non-empty string or URL.");\n        }\n        const ref = this[kClients].get(key);\n        let dispatcher = ref ? ref.deref() : null;\n        if (!dispatcher) {\n          dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", this[kOnConnect]).on("disconnect", this[kOnDisconnect]).on("connectionError", this[kOnConnectionError]);\n          this[kClients].set(key, new WeakRef2(dispatcher));\n          this[kFinalizer].register(dispatcher, key);\n        }\n        return dispatcher.dispatch(opts, handler);\n      }\n      async [kClose]() {\n        const closePromises = [];\n        for (const ref of this[kClients].values()) {\n          const client = ref.deref();\n          if (client) {\n            closePromises.push(client.close());\n          }\n        }\n        await Promise.all(closePromises);\n      }\n      async [kDestroy](err) {\n        const destroyPromises = [];\n        for (const ref of this[kClients].values()) {\n          const client = ref.deref();\n          if (client) {\n            destroyPromises.push(client.destroy(err));\n          }\n        }\n        await Promise.all(destroyPromises);\n      }\n    };\n    __name(_Agent, "Agent");\n    var Agent2 = _Agent;\n    module2.exports = Agent2;\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/global.js\nvar require_global2 = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/global.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var globalDispatcher2 = Symbol.for("undici.globalDispatcher.1");\n    var { InvalidArgumentError: InvalidArgumentError2 } = require_errors();\n    var Agent2 = require_agent();\n    if (getGlobalDispatcher2() === void 0) {\n      setGlobalDispatcher2(new Agent2());\n    }\n    function setGlobalDispatcher2(agent) {\n      if (!agent || typeof agent.dispatch !== "function") {\n        throw new InvalidArgumentError2("Argument agent must implement Agent");\n      }\n      Object.defineProperty(globalThis, globalDispatcher2, {\n        value: agent,\n        writable: true,\n        enumerable: false,\n        configurable: false\n      });\n    }\n    __name(setGlobalDispatcher2, "setGlobalDispatcher");\n    function getGlobalDispatcher2() {\n      return globalThis[globalDispatcher2];\n    }\n    __name(getGlobalDispatcher2, "getGlobalDispatcher");\n    module2.exports = {\n      setGlobalDispatcher: setGlobalDispatcher2,\n      getGlobalDispatcher: getGlobalDispatcher2\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/index.js\nvar require_fetch = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/fetch/index.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var {\n      Response: Response3,\n      makeNetworkError,\n      makeAppropriateNetworkError,\n      filterResponse,\n      makeResponse\n    } = require_response();\n    var { Headers: Headers3 } = require_headers();\n    var { Request: Request2, makeRequest } = require_request();\n    var zlib = require("zlib");\n    var {\n      bytesMatch,\n      makePolicyContainer,\n      clonePolicyContainer,\n      requestBadPort,\n      TAOCheck,\n      appendRequestOriginHeader,\n      responseLocationURL,\n      requestCurrentURL,\n      setRequestReferrerPolicyOnRedirect,\n      tryUpgradeRequestToAPotentiallyTrustworthyURL,\n      createOpaqueTimingInfo,\n      appendFetchMetadata,\n      corsCheck,\n      crossOriginResourcePolicyCheck,\n      determineRequestsReferrer,\n      coarsenedSharedCurrentTime,\n      createDeferredPromise,\n      isBlobLike,\n      sameOrigin,\n      isCancelled,\n      isAborted,\n      isErrorLike,\n      fullyReadBody,\n      readableStreamClose,\n      isomorphicEncode,\n      urlIsLocal,\n      urlIsHttpHttpsScheme,\n      urlHasHttpsScheme\n    } = require_util2();\n    var { kState, kHeaders: kHeaders2, kGuard: kGuard2, kRealm } = require_symbols();\n    var assert = require("assert");\n    var { safelyExtractBody } = require_body();\n    var {\n      redirectStatus,\n      nullBodyStatus,\n      safeMethods,\n      requestBodyHeader,\n      subresource,\n      DOMException\n    } = require_constants();\n    var { kHeadersList } = require_symbols2();\n    var EE = require("events");\n    var { Readable, pipeline } = require("stream");\n    var { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = require_util();\n    var { dataURLProcessor, serializeAMimeType } = require_dataURL();\n    var { TransformStream } = require("./streams");\n    var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2();\n    var { webidl } = require_webidl();\n    var { STATUS_CODES } = require("http");\n    var resolveObjectURL;\n    var ReadableStream = globalThis.ReadableStream;\n    var _Fetch = class _Fetch extends EE {\n      constructor(dispatcher) {\n        super();\n        this.dispatcher = dispatcher;\n        this.connection = null;\n        this.dump = false;\n        this.state = "ongoing";\n        this.setMaxListeners(21);\n      }\n      terminate(reason) {\n        if (this.state !== "ongoing") {\n          return;\n        }\n        this.state = "terminated";\n        this.connection?.destroy(reason);\n        this.emit("terminated", reason);\n      }\n      // https://fetch.spec.whatwg.org/#fetch-controller-abort\n      abort(error) {\n        if (this.state !== "ongoing") {\n          return;\n        }\n        this.state = "aborted";\n        if (!error) {\n          error = new DOMException("The operation was aborted.", "AbortError");\n        }\n        this.serializedAbortReason = error;\n        this.connection?.destroy(error);\n        this.emit("terminated", error);\n      }\n    };\n    __name(_Fetch, "Fetch");\n    var Fetch = _Fetch;\n    async function fetch2(input, init = {}) {\n      webidl.argumentLengthCheck(arguments, 1, { header: "globalThis.fetch" });\n      const p = createDeferredPromise();\n      let requestObject;\n      try {\n        requestObject = new Request2(input, init);\n      } catch (e) {\n        p.reject(e);\n        return p.promise;\n      }\n      const request = requestObject[kState];\n      if (requestObject.signal.aborted) {\n        abortFetch(p, request, null, requestObject.signal.reason);\n        return p.promise;\n      }\n      const globalObject = request.client.globalObject;\n      if (globalObject?.constructor?.name === "ServiceWorkerGlobalScope") {\n        request.serviceWorkers = "none";\n      }\n      let responseObject = null;\n      const relevantRealm = null;\n      let locallyAborted = false;\n      let controller = null;\n      addAbortListener(\n        requestObject.signal,\n        () => {\n          locallyAborted = true;\n          assert(controller != null);\n          controller.abort(requestObject.signal.reason);\n          abortFetch(p, request, responseObject, requestObject.signal.reason);\n        }\n      );\n      const handleFetchDone = /* @__PURE__ */ __name((response) => finalizeAndReportTiming(response, "fetch"), "handleFetchDone");\n      const processResponse = /* @__PURE__ */ __name((response) => {\n        if (locallyAborted) {\n          return;\n        }\n        if (response.aborted) {\n          abortFetch(p, request, responseObject, controller.serializedAbortReason);\n          return;\n        }\n        if (response.type === "error") {\n          p.reject(\n            Object.assign(new TypeError("fetch failed"), { cause: response.error })\n          );\n          return;\n        }\n        responseObject = new Response3();\n        responseObject[kState] = response;\n        responseObject[kRealm] = relevantRealm;\n        responseObject[kHeaders2][kHeadersList] = response.headersList;\n        responseObject[kHeaders2][kGuard2] = "immutable";\n        responseObject[kHeaders2][kRealm] = relevantRealm;\n        p.resolve(responseObject);\n      }, "processResponse");\n      controller = fetching({\n        request,\n        processResponseEndOfBody: handleFetchDone,\n        processResponse,\n        dispatcher: init.dispatcher ?? getGlobalDispatcher2()\n        // undici\n      });\n      return p.promise;\n    }\n    __name(fetch2, "fetch");\n    function finalizeAndReportTiming(response, initiatorType = "other") {\n      if (response.type === "error" && response.aborted) {\n        return;\n      }\n      if (!response.urlList?.length) {\n        return;\n      }\n      const originalURL = response.urlList[0];\n      let timingInfo = response.timingInfo;\n      let cacheState = response.cacheState;\n      if (!urlIsHttpHttpsScheme(originalURL)) {\n        return;\n      }\n      if (timingInfo === null) {\n        return;\n      }\n      if (!timingInfo.timingAllowPassed) {\n        timingInfo = createOpaqueTimingInfo({\n          startTime: timingInfo.startTime\n        });\n        cacheState = "";\n      }\n      timingInfo.endTime = coarsenedSharedCurrentTime();\n      response.timingInfo = timingInfo;\n      markResourceTiming(\n        timingInfo,\n        originalURL,\n        initiatorType,\n        globalThis,\n        cacheState\n      );\n    }\n    __name(finalizeAndReportTiming, "finalizeAndReportTiming");\n    function markResourceTiming(timingInfo, originalURL, initiatorType, globalThis2, cacheState) {\n      if (nodeMajor > 18 || nodeMajor === 18 && nodeMinor >= 2) {\n        performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState);\n      }\n    }\n    __name(markResourceTiming, "markResourceTiming");\n    function abortFetch(p, request, responseObject, error) {\n      if (!error) {\n        error = new DOMException("The operation was aborted.", "AbortError");\n      }\n      p.reject(error);\n      if (request.body != null && isReadable(request.body?.stream)) {\n        request.body.stream.cancel(error).catch((err) => {\n          if (err.code === "ERR_INVALID_STATE") {\n            return;\n          }\n          throw err;\n        });\n      }\n      if (responseObject == null) {\n        return;\n      }\n      const response = responseObject[kState];\n      if (response.body != null && isReadable(response.body?.stream)) {\n        response.body.stream.cancel(error).catch((err) => {\n          if (err.code === "ERR_INVALID_STATE") {\n            return;\n          }\n          throw err;\n        });\n      }\n    }\n    __name(abortFetch, "abortFetch");\n    function fetching({\n      request,\n      processRequestBodyChunkLength,\n      processRequestEndOfBody,\n      processResponse,\n      processResponseEndOfBody,\n      processResponseConsumeBody,\n      useParallelQueue = false,\n      dispatcher\n      // undici\n    }) {\n      let taskDestination = null;\n      let crossOriginIsolatedCapability = false;\n      if (request.client != null) {\n        taskDestination = request.client.globalObject;\n        crossOriginIsolatedCapability = request.client.crossOriginIsolatedCapability;\n      }\n      const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability);\n      const timingInfo = createOpaqueTimingInfo({\n        startTime: currenTime\n      });\n      const fetchParams = {\n        controller: new Fetch(dispatcher),\n        request,\n        timingInfo,\n        processRequestBodyChunkLength,\n        processRequestEndOfBody,\n        processResponse,\n        processResponseConsumeBody,\n        processResponseEndOfBody,\n        taskDestination,\n        crossOriginIsolatedCapability\n      };\n      assert(!request.body || request.body.stream);\n      if (request.window === "client") {\n        request.window = request.client?.globalObject?.constructor?.name === "Window" ? request.client : "no-window";\n      }\n      if (request.origin === "client") {\n        request.origin = request.client?.origin;\n      }\n      if (request.policyContainer === "client") {\n        if (request.client != null) {\n          request.policyContainer = clonePolicyContainer(\n            request.client.policyContainer\n          );\n        } else {\n          request.policyContainer = makePolicyContainer();\n        }\n      }\n      if (!request.headersList.contains("accept")) {\n        const value = "*/*";\n        request.headersList.append("accept", value);\n      }\n      if (!request.headersList.contains("accept-language")) {\n        request.headersList.append("accept-language", "*");\n      }\n      if (request.priority === null) {\n      }\n      if (subresource.includes(request.destination)) {\n      }\n      mainFetch(fetchParams).catch((err) => {\n        fetchParams.controller.terminate(err);\n      });\n      return fetchParams.controller;\n    }\n    __name(fetching, "fetching");\n    async function mainFetch(fetchParams, recursive = false) {\n      const request = fetchParams.request;\n      let response = null;\n      if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n        response = makeNetworkError("local URLs only");\n      }\n      tryUpgradeRequestToAPotentiallyTrustworthyURL(request);\n      if (requestBadPort(request) === "blocked") {\n        response = makeNetworkError("bad port");\n      }\n      if (request.referrerPolicy === "") {\n        request.referrerPolicy = request.policyContainer.referrerPolicy;\n      }\n      if (request.referrer !== "no-referrer") {\n        request.referrer = determineRequestsReferrer(request);\n      }\n      if (response === null) {\n        response = await (async () => {\n          const currentURL = requestCurrentURL(request);\n          if (\n            // - request\u2019s current URL\u2019s origin is same origin with request\u2019s origin,\n            //   and request\u2019s response tainting is "basic"\n            sameOrigin(currentURL, request.url) && request.responseTainting === "basic" || // request\u2019s current URL\u2019s scheme is "data"\n            currentURL.protocol === "data:" || // - request\u2019s mode is "navigate" or "websocket"\n            (request.mode === "navigate" || request.mode === "websocket")\n          ) {\n            request.responseTainting = "basic";\n            return await schemeFetch(fetchParams);\n          }\n          if (request.mode === "same-origin") {\n            return makeNetworkError(\'request mode cannot be "same-origin"\');\n          }\n          if (request.mode === "no-cors") {\n            if (request.redirect !== "follow") {\n              return makeNetworkError(\n                \'redirect mode cannot be "follow" for "no-cors" request\'\n              );\n            }\n            request.responseTainting = "opaque";\n            return await schemeFetch(fetchParams);\n          }\n          if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n            return makeNetworkError("URL scheme must be a HTTP(S) scheme");\n          }\n          request.responseTainting = "cors";\n          return await httpFetch(fetchParams);\n        })();\n      }\n      if (recursive) {\n        return response;\n      }\n      if (response.status !== 0 && !response.internalResponse) {\n        if (request.responseTainting === "cors") {\n        }\n        if (request.responseTainting === "basic") {\n          response = filterResponse(response, "basic");\n        } else if (request.responseTainting === "cors") {\n          response = filterResponse(response, "cors");\n        } else if (request.responseTainting === "opaque") {\n          response = filterResponse(response, "opaque");\n        } else {\n          assert(false);\n        }\n      }\n      let internalResponse = response.status === 0 ? response : response.internalResponse;\n      if (internalResponse.urlList.length === 0) {\n        internalResponse.urlList.push(...request.urlList);\n      }\n      if (!request.timingAllowFailed) {\n        response.timingAllowPassed = true;\n      }\n      if (response.type === "opaque" && internalResponse.status === 206 && internalResponse.rangeRequested && !request.headers.contains("range")) {\n        response = internalResponse = makeNetworkError();\n      }\n      if (response.status !== 0 && (request.method === "HEAD" || request.method === "CONNECT" || nullBodyStatus.includes(internalResponse.status))) {\n        internalResponse.body = null;\n        fetchParams.controller.dump = true;\n      }\n      if (request.integrity) {\n        const processBodyError = /* @__PURE__ */ __name((reason) => fetchFinale(fetchParams, makeNetworkError(reason)), "processBodyError");\n        if (request.responseTainting === "opaque" || response.body == null) {\n          processBodyError(response.error);\n          return;\n        }\n        const processBody = /* @__PURE__ */ __name((bytes) => {\n          if (!bytesMatch(bytes, request.integrity)) {\n            processBodyError("integrity mismatch");\n            return;\n          }\n          response.body = safelyExtractBody(bytes)[0];\n          fetchFinale(fetchParams, response);\n        }, "processBody");\n        await fullyReadBody(response.body, processBody, processBodyError);\n      } else {\n        fetchFinale(fetchParams, response);\n      }\n    }\n    __name(mainFetch, "mainFetch");\n    async function schemeFetch(fetchParams) {\n      if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n        return makeAppropriateNetworkError(fetchParams);\n      }\n      const { request } = fetchParams;\n      const { protocol: scheme } = requestCurrentURL(request);\n      switch (scheme) {\n        case "about:": {\n          return makeNetworkError("about scheme is not supported");\n        }\n        case "blob:": {\n          if (!resolveObjectURL) {\n            resolveObjectURL = require("buffer").resolveObjectURL;\n          }\n          const blobURLEntry = requestCurrentURL(request);\n          if (blobURLEntry.search.length !== 0) {\n            return makeNetworkError("NetworkError when attempting to fetch resource.");\n          }\n          const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString());\n          if (request.method !== "GET" || !isBlobLike(blobURLEntryObject)) {\n            return makeNetworkError("invalid method");\n          }\n          const bodyWithType = safelyExtractBody(blobURLEntryObject);\n          const body = bodyWithType[0];\n          const length = isomorphicEncode(`${body.length}`);\n          const type = bodyWithType[1] ?? "";\n          const response = makeResponse({\n            statusText: "OK",\n            headersList: [\n              ["content-length", { name: "Content-Length", value: length }],\n              ["content-type", { name: "Content-Type", value: type }]\n            ]\n          });\n          response.body = body;\n          return response;\n        }\n        case "data:": {\n          const currentURL = requestCurrentURL(request);\n          const dataURLStruct = dataURLProcessor(currentURL);\n          if (dataURLStruct === "failure") {\n            return makeNetworkError("failed to fetch the data URL");\n          }\n          const mimeType = serializeAMimeType(dataURLStruct.mimeType);\n          return makeResponse({\n            statusText: "OK",\n            headersList: [\n              ["content-type", { name: "Content-Type", value: mimeType }]\n            ],\n            body: safelyExtractBody(dataURLStruct.body)[0]\n          });\n        }\n        case "file:": {\n          return makeNetworkError("not implemented... yet...");\n        }\n        case "http:":\n        case "https:": {\n          return await httpFetch(fetchParams).catch((err) => makeNetworkError(err));\n        }\n        default: {\n          return makeNetworkError("unknown scheme");\n        }\n      }\n    }\n    __name(schemeFetch, "schemeFetch");\n    function finalizeResponse(fetchParams, response) {\n      fetchParams.request.done = true;\n      if (fetchParams.processResponseDone != null) {\n        queueMicrotask(() => fetchParams.processResponseDone(response));\n      }\n    }\n    __name(finalizeResponse, "finalizeResponse");\n    async function fetchFinale(fetchParams, response) {\n      if (response.type === "error") {\n        response.urlList = [fetchParams.request.urlList[0]];\n        response.timingInfo = createOpaqueTimingInfo({\n          startTime: fetchParams.timingInfo.startTime\n        });\n      }\n      const processResponseEndOfBody = /* @__PURE__ */ __name(() => {\n        fetchParams.request.done = true;\n        if (fetchParams.processResponseEndOfBody != null) {\n          queueMicrotask(() => fetchParams.processResponseEndOfBody(response));\n        }\n      }, "processResponseEndOfBody");\n      if (fetchParams.processResponse != null) {\n        queueMicrotask(() => fetchParams.processResponse(response));\n      }\n      if (response.body == null) {\n        processResponseEndOfBody();\n      } else {\n        const identityTransformAlgorithm = /* @__PURE__ */ __name((chunk, controller) => {\n          controller.enqueue(chunk);\n        }, "identityTransformAlgorithm");\n        const transformStream = new TransformStream({\n          start() {\n          },\n          transform: identityTransformAlgorithm,\n          flush: processResponseEndOfBody\n        }, {\n          size() {\n            return 1;\n          }\n        }, {\n          size() {\n            return 1;\n          }\n        });\n        response.body = { stream: response.body.stream.pipeThrough(transformStream) };\n      }\n      if (fetchParams.processResponseConsumeBody != null) {\n        const processBody = /* @__PURE__ */ __name((nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes), "processBody");\n        const processBodyError = /* @__PURE__ */ __name((failure) => fetchParams.processResponseConsumeBody(response, failure), "processBodyError");\n        if (response.body == null) {\n          queueMicrotask(() => processBody(null));\n        } else {\n          await fullyReadBody(response.body, processBody, processBodyError);\n        }\n      }\n    }\n    __name(fetchFinale, "fetchFinale");\n    async function httpFetch(fetchParams) {\n      const request = fetchParams.request;\n      let response = null;\n      let actualResponse = null;\n      const timingInfo = fetchParams.timingInfo;\n      if (request.serviceWorkers === "all") {\n      }\n      if (response === null) {\n        if (request.redirect === "follow") {\n          request.serviceWorkers = "none";\n        }\n        actualResponse = response = await httpNetworkOrCacheFetch(fetchParams);\n        if (request.responseTainting === "cors" && corsCheck(request, response) === "failure") {\n          return makeNetworkError("cors failure");\n        }\n        if (TAOCheck(request, response) === "failure") {\n          request.timingAllowFailed = true;\n        }\n      }\n      if ((request.responseTainting === "opaque" || response.type === "opaque") && crossOriginResourcePolicyCheck(\n        request.origin,\n        request.client,\n        request.destination,\n        actualResponse\n      ) === "blocked") {\n        return makeNetworkError("blocked");\n      }\n      if (redirectStatus.includes(actualResponse.status)) {\n        if (request.redirect !== "manual") {\n          fetchParams.controller.connection.destroy();\n        }\n        if (request.redirect === "error") {\n          response = makeNetworkError("unexpected redirect");\n        } else if (request.redirect === "manual") {\n          response = actualResponse;\n        } else if (request.redirect === "follow") {\n          response = await httpRedirectFetch(fetchParams, response);\n        } else {\n          assert(false);\n        }\n      }\n      response.timingInfo = timingInfo;\n      return response;\n    }\n    __name(httpFetch, "httpFetch");\n    async function httpRedirectFetch(fetchParams, response) {\n      const request = fetchParams.request;\n      const actualResponse = response.internalResponse ? response.internalResponse : response;\n      let locationURL;\n      try {\n        locationURL = responseLocationURL(\n          actualResponse,\n          requestCurrentURL(request).hash\n        );\n        if (locationURL == null) {\n          return response;\n        }\n      } catch (err) {\n        return makeNetworkError(err);\n      }\n      if (!urlIsHttpHttpsScheme(locationURL)) {\n        return makeNetworkError("URL scheme must be a HTTP(S) scheme");\n      }\n      if (request.redirectCount === 20) {\n        return makeNetworkError("redirect count exceeded");\n      }\n      request.redirectCount += 1;\n      if (request.mode === "cors" && (locationURL.username || locationURL.password) && !sameOrigin(request, locationURL)) {\n        return makeNetworkError(\'cross origin not allowed for request mode "cors"\');\n      }\n      if (request.responseTainting === "cors" && (locationURL.username || locationURL.password)) {\n        return makeNetworkError(\n          \'URL cannot contain credentials for request mode "cors"\'\n        );\n      }\n      if (actualResponse.status !== 303 && request.body != null && request.body.source == null) {\n        return makeNetworkError();\n      }\n      if ([301, 302].includes(actualResponse.status) && request.method === "POST" || actualResponse.status === 303 && !["GET", "HEAD"].includes(request.method)) {\n        request.method = "GET";\n        request.body = null;\n        for (const headerName of requestBodyHeader) {\n          request.headersList.delete(headerName);\n        }\n      }\n      if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n        request.headersList.delete("authorization");\n      }\n      if (request.body != null) {\n        assert(request.body.source != null);\n        request.body = safelyExtractBody(request.body.source)[0];\n      }\n      const timingInfo = fetchParams.timingInfo;\n      timingInfo.redirectEndTime = timingInfo.postRedirectStartTime = coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability);\n      if (timingInfo.redirectStartTime === 0) {\n        timingInfo.redirectStartTime = timingInfo.startTime;\n      }\n      request.urlList.push(locationURL);\n      setRequestReferrerPolicyOnRedirect(request, actualResponse);\n      return mainFetch(fetchParams, true);\n    }\n    __name(httpRedirectFetch, "httpRedirectFetch");\n    async function httpNetworkOrCacheFetch(fetchParams, isAuthenticationFetch = false, isNewConnectionFetch = false) {\n      const request = fetchParams.request;\n      let httpFetchParams = null;\n      let httpRequest = null;\n      let response = null;\n      const httpCache = null;\n      const revalidatingFlag = false;\n      if (request.window === "no-window" && request.redirect === "error") {\n        httpFetchParams = fetchParams;\n        httpRequest = request;\n      } else {\n        httpRequest = makeRequest(request);\n        httpFetchParams = { ...fetchParams };\n        httpFetchParams.request = httpRequest;\n      }\n      const includeCredentials = request.credentials === "include" || request.credentials === "same-origin" && request.responseTainting === "basic";\n      const contentLength = httpRequest.body ? httpRequest.body.length : null;\n      let contentLengthHeaderValue = null;\n      if (httpRequest.body == null && ["POST", "PUT"].includes(httpRequest.method)) {\n        contentLengthHeaderValue = "0";\n      }\n      if (contentLength != null) {\n        contentLengthHeaderValue = isomorphicEncode(`${contentLength}`);\n      }\n      if (contentLengthHeaderValue != null) {\n        httpRequest.headersList.append("content-length", contentLengthHeaderValue);\n      }\n      if (contentLength != null && httpRequest.keepalive) {\n      }\n      if (httpRequest.referrer instanceof URL) {\n        httpRequest.headersList.append("referer", isomorphicEncode(httpRequest.referrer.href));\n      }\n      appendRequestOriginHeader(httpRequest);\n      appendFetchMetadata(httpRequest);\n      if (!httpRequest.headersList.contains("user-agent")) {\n        httpRequest.headersList.append("user-agent", "undici");\n      }\n      if (httpRequest.cache === "default" && (httpRequest.headersList.contains("if-modified-since") || httpRequest.headersList.contains("if-none-match") || httpRequest.headersList.contains("if-unmodified-since") || httpRequest.headersList.contains("if-match") || httpRequest.headersList.contains("if-range"))) {\n        httpRequest.cache = "no-store";\n      }\n      if (httpRequest.cache === "no-cache" && !httpRequest.preventNoCacheCacheControlHeaderModification && !httpRequest.headersList.contains("cache-control")) {\n        httpRequest.headersList.append("cache-control", "max-age=0");\n      }\n      if (httpRequest.cache === "no-store" || httpRequest.cache === "reload") {\n        if (!httpRequest.headersList.contains("pragma")) {\n          httpRequest.headersList.append("pragma", "no-cache");\n        }\n        if (!httpRequest.headersList.contains("cache-control")) {\n          httpRequest.headersList.append("cache-control", "no-cache");\n        }\n      }\n      if (httpRequest.headersList.contains("range")) {\n        httpRequest.headersList.append("accept-encoding", "identity");\n      }\n      if (!httpRequest.headersList.contains("accept-encoding")) {\n        if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n          httpRequest.headersList.append("accept-encoding", "br, gzip, deflate");\n        } else {\n          httpRequest.headersList.append("accept-encoding", "gzip, deflate");\n        }\n      }\n      if (includeCredentials) {\n      }\n      if (httpCache == null) {\n        httpRequest.cache = "no-store";\n      }\n      if (httpRequest.mode !== "no-store" && httpRequest.mode !== "reload") {\n      }\n      if (response == null) {\n        if (httpRequest.mode === "only-if-cached") {\n          return makeNetworkError("only if cached");\n        }\n        const forwardResponse = await httpNetworkFetch(\n          httpFetchParams,\n          includeCredentials,\n          isNewConnectionFetch\n        );\n        if (!safeMethods.includes(httpRequest.method) && forwardResponse.status >= 200 && forwardResponse.status <= 399) {\n        }\n        if (revalidatingFlag && forwardResponse.status === 304) {\n        }\n        if (response == null) {\n          response = forwardResponse;\n        }\n      }\n      response.urlList = [...httpRequest.urlList];\n      if (httpRequest.headersList.contains("range")) {\n        response.rangeRequested = true;\n      }\n      response.requestIncludesCredentials = includeCredentials;\n      if (response.status === 407) {\n        if (request.window === "no-window") {\n          return makeNetworkError();\n        }\n        if (isCancelled(fetchParams)) {\n          return makeAppropriateNetworkError(fetchParams);\n        }\n        return makeNetworkError("proxy authentication required");\n      }\n      if (\n        // response\u2019s status is 421\n        response.status === 421 && // isNewConnectionFetch is false\n        !isNewConnectionFetch && // request\u2019s body is null, or request\u2019s body is non-null and request\u2019s body\u2019s source is non-null\n        (request.body == null || request.body.source != null)\n      ) {\n        if (isCancelled(fetchParams)) {\n          return makeAppropriateNetworkError(fetchParams);\n        }\n        fetchParams.controller.connection.destroy();\n        response = await httpNetworkOrCacheFetch(\n          fetchParams,\n          isAuthenticationFetch,\n          true\n        );\n      }\n      if (isAuthenticationFetch) {\n      }\n      return response;\n    }\n    __name(httpNetworkOrCacheFetch, "httpNetworkOrCacheFetch");\n    async function httpNetworkFetch(fetchParams, includeCredentials = false, forceNewConnection = false) {\n      assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed);\n      fetchParams.controller.connection = {\n        abort: null,\n        destroyed: false,\n        destroy(err) {\n          if (!this.destroyed) {\n            this.destroyed = true;\n            this.abort?.(err ?? new DOMException("The operation was aborted.", "AbortError"));\n          }\n        }\n      };\n      const request = fetchParams.request;\n      let response = null;\n      const timingInfo = fetchParams.timingInfo;\n      const httpCache = null;\n      if (httpCache == null) {\n        request.cache = "no-store";\n      }\n      const newConnection = forceNewConnection ? "yes" : "no";\n      if (request.mode === "websocket") {\n      } else {\n      }\n      let requestBody = null;\n      if (request.body == null && fetchParams.processRequestEndOfBody) {\n        queueMicrotask(() => fetchParams.processRequestEndOfBody());\n      } else if (request.body != null) {\n        const processBodyChunk = /* @__PURE__ */ __name(async function* (bytes) {\n          if (isCancelled(fetchParams)) {\n            return;\n          }\n          yield bytes;\n          fetchParams.processRequestBodyChunkLength?.(bytes.byteLength);\n        }, "processBodyChunk");\n        const processEndOfBody = /* @__PURE__ */ __name(() => {\n          if (isCancelled(fetchParams)) {\n            return;\n          }\n          if (fetchParams.processRequestEndOfBody) {\n            fetchParams.processRequestEndOfBody();\n          }\n        }, "processEndOfBody");\n        const processBodyError = /* @__PURE__ */ __name((e) => {\n          if (isCancelled(fetchParams)) {\n            return;\n          }\n          if (e.name === "AbortError") {\n            fetchParams.controller.abort();\n          } else {\n            fetchParams.controller.terminate(e);\n          }\n        }, "processBodyError");\n        requestBody = async function* () {\n          try {\n            for await (const bytes of request.body.stream) {\n              yield* processBodyChunk(bytes);\n            }\n            processEndOfBody();\n          } catch (err) {\n            processBodyError(err);\n          }\n        }();\n      }\n      try {\n        const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody });\n        if (socket) {\n          response = makeResponse({ status, statusText, headersList, socket });\n        } else {\n          const iterator = body[Symbol.asyncIterator]();\n          fetchParams.controller.next = () => iterator.next();\n          response = makeResponse({ status, statusText, headersList });\n        }\n      } catch (err) {\n        if (err.name === "AbortError") {\n          fetchParams.controller.connection.destroy();\n          return makeAppropriateNetworkError(fetchParams);\n        }\n        return makeNetworkError(err);\n      }\n      const pullAlgorithm = /* @__PURE__ */ __name(() => {\n        fetchParams.controller.resume();\n      }, "pullAlgorithm");\n      const cancelAlgorithm = /* @__PURE__ */ __name((reason) => {\n        fetchParams.controller.abort(reason);\n      }, "cancelAlgorithm");\n      if (!ReadableStream) {\n        ReadableStream = require("./streams").ReadableStream;\n      }\n      const stream = new ReadableStream(\n        {\n          async start(controller) {\n            fetchParams.controller.controller = controller;\n          },\n          async pull(controller) {\n            await pullAlgorithm(controller);\n          },\n          async cancel(reason) {\n            await cancelAlgorithm(reason);\n          }\n        },\n        {\n          highWaterMark: 0,\n          size() {\n            return 1;\n          }\n        }\n      );\n      response.body = { stream };\n      fetchParams.controller.on("terminated", onAborted);\n      fetchParams.controller.resume = async () => {\n        while (true) {\n          let bytes;\n          let isFailure;\n          try {\n            const { done, value } = await fetchParams.controller.next();\n            if (isAborted(fetchParams)) {\n              break;\n            }\n            bytes = done ? void 0 : value;\n          } catch (err) {\n            if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n              bytes = void 0;\n            } else {\n              bytes = err;\n              isFailure = true;\n            }\n          }\n          if (bytes === void 0) {\n            readableStreamClose(fetchParams.controller.controller);\n            finalizeResponse(fetchParams, response);\n            return;\n          }\n          timingInfo.decodedBodySize += bytes?.byteLength ?? 0;\n          if (isFailure) {\n            fetchParams.controller.terminate(bytes);\n            return;\n          }\n          fetchParams.controller.controller.enqueue(new Uint8Array(bytes));\n          if (isErrored(stream)) {\n            fetchParams.controller.terminate();\n            return;\n          }\n          if (!fetchParams.controller.controller.desiredSize) {\n            return;\n          }\n        }\n      };\n      function onAborted(reason) {\n        if (isAborted(fetchParams)) {\n          response.aborted = true;\n          if (isReadable(stream)) {\n            fetchParams.controller.controller.error(\n              fetchParams.controller.serializedAbortReason\n            );\n          }\n        } else {\n          if (isReadable(stream)) {\n            fetchParams.controller.controller.error(new TypeError("terminated", {\n              cause: isErrorLike(reason) ? reason : void 0\n            }));\n          }\n        }\n        fetchParams.controller.connection.destroy();\n      }\n      __name(onAborted, "onAborted");\n      return response;\n      async function dispatch({ body }) {\n        const url = requestCurrentURL(request);\n        const agent = fetchParams.controller.dispatcher;\n        return new Promise((resolve, reject) => agent.dispatch(\n          {\n            path: url.pathname + url.search,\n            origin: url.origin,\n            method: request.method,\n            body: fetchParams.controller.dispatcher.isMockActive ? request.body && request.body.source : body,\n            headers: request.headersList.entries,\n            maxRedirections: 0,\n            upgrade: request.mode === "websocket" ? "websocket" : void 0\n          },\n          {\n            body: null,\n            abort: null,\n            onConnect(abort) {\n              const { connection } = fetchParams.controller;\n              if (connection.destroyed) {\n                abort(new DOMException("The operation was aborted.", "AbortError"));\n              } else {\n                fetchParams.controller.on("terminated", abort);\n                this.abort = connection.abort = abort;\n              }\n            },\n            onHeaders(status, headersList, resume, statusText) {\n              if (status < 200) {\n                return;\n              }\n              let codings = [];\n              let location = "";\n              const headers = new Headers3();\n              for (let n = 0; n < headersList.length; n += 2) {\n                const key = headersList[n + 0].toString("latin1");\n                const val = headersList[n + 1].toString("latin1");\n                if (key.toLowerCase() === "content-encoding") {\n                  codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse();\n                } else if (key.toLowerCase() === "location") {\n                  location = val;\n                }\n                headers.append(key, val);\n              }\n              this.body = new Readable({ read: resume });\n              const decoders = [];\n              const willFollow = request.redirect === "follow" && location && redirectStatus.includes(status);\n              if (request.method !== "HEAD" && request.method !== "CONNECT" && !nullBodyStatus.includes(status) && !willFollow) {\n                for (const coding of codings) {\n                  if (coding === "x-gzip" || coding === "gzip") {\n                    decoders.push(zlib.createGunzip({\n                      // Be less strict when decoding compressed responses, since sometimes\n                      // servers send slightly invalid responses that are still accepted\n                      // by common browsers.\n                      // Always using Z_SYNC_FLUSH is what cURL does.\n                      flush: zlib.constants.Z_SYNC_FLUSH,\n                      finishFlush: zlib.constants.Z_SYNC_FLUSH\n                    }));\n                  } else if (coding === "deflate") {\n                    decoders.push(zlib.createInflate());\n                  } else if (coding === "br") {\n                    decoders.push(zlib.createBrotliDecompress());\n                  } else {\n                    decoders.length = 0;\n                    break;\n                  }\n                }\n              }\n              resolve({\n                status,\n                statusText,\n                headersList: headers[kHeadersList],\n                body: decoders.length ? pipeline(this.body, ...decoders, () => {\n                }) : this.body.on("error", () => {\n                })\n              });\n              return true;\n            },\n            onData(chunk) {\n              if (fetchParams.controller.dump) {\n                return;\n              }\n              const bytes = chunk;\n              timingInfo.encodedBodySize += bytes.byteLength;\n              return this.body.push(bytes);\n            },\n            onComplete() {\n              if (this.abort) {\n                fetchParams.controller.off("terminated", this.abort);\n              }\n              fetchParams.controller.ended = true;\n              this.body.push(null);\n            },\n            onError(error) {\n              if (this.abort) {\n                fetchParams.controller.off("terminated", this.abort);\n              }\n              this.body?.destroy(error);\n              fetchParams.controller.terminate(error);\n              reject(error);\n            },\n            onUpgrade(status, headersList, socket) {\n              if (status !== 101) {\n                return;\n              }\n              const headers = new Headers3();\n              for (let n = 0; n < headersList.length; n += 2) {\n                const key = headersList[n + 0].toString("latin1");\n                const val = headersList[n + 1].toString("latin1");\n                headers.append(key, val);\n              }\n              resolve({\n                status,\n                statusText: STATUS_CODES[status],\n                headersList: headers[kHeadersList],\n                socket\n              });\n              return true;\n            }\n          }\n        ));\n      }\n      __name(dispatch, "dispatch");\n    }\n    __name(httpNetworkFetch, "httpNetworkFetch");\n    module2.exports = {\n      fetch: fetch2,\n      Fetch,\n      fetching,\n      finalizeAndReportTiming\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/constants.js\nvar require_constants3 = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/constants.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var uid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";\n    var staticPropertyDescriptors = {\n      enumerable: true,\n      writable: false,\n      configurable: false\n    };\n    var states = {\n      CONNECTING: 0,\n      OPEN: 1,\n      CLOSING: 2,\n      CLOSED: 3\n    };\n    var opcodes = {\n      CONTINUATION: 0,\n      TEXT: 1,\n      BINARY: 2,\n      CLOSE: 8,\n      PING: 9,\n      PONG: 10\n    };\n    var maxUnsigned16Bit = 2 ** 16 - 1;\n    var parserStates = {\n      INFO: 0,\n      PAYLOADLENGTH_16: 2,\n      PAYLOADLENGTH_64: 3,\n      READ_DATA: 4\n    };\n    var emptyBuffer = Buffer.allocUnsafe(0);\n    module2.exports = {\n      uid,\n      staticPropertyDescriptors,\n      states,\n      opcodes,\n      maxUnsigned16Bit,\n      parserStates,\n      emptyBuffer\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/symbols.js\nvar require_symbols3 = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/symbols.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    module2.exports = {\n      kWebSocketURL: Symbol("url"),\n      kReadyState: Symbol("ready state"),\n      kController: Symbol("controller"),\n      kResponse: Symbol("response"),\n      kBinaryType: Symbol("binary type"),\n      kSentClose: Symbol("sent close"),\n      kReceivedClose: Symbol("received close"),\n      kByteParser: Symbol("byte parser")\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/events.js\nvar require_events = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/events.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { webidl } = require_webidl();\n    var { kEnumerableProperty } = require_util();\n    var { MessagePort } = require("worker_threads");\n    var _eventInit;\n    var _MessageEvent = class _MessageEvent extends Event {\n      constructor(type, eventInitDict = {}) {\n        webidl.argumentLengthCheck(arguments, 1, { header: "MessageEvent constructor" });\n        type = webidl.converters.DOMString(type);\n        eventInitDict = webidl.converters.MessageEventInit(eventInitDict);\n        super(type, eventInitDict);\n        __privateAdd(this, _eventInit, void 0);\n        __privateSet(this, _eventInit, eventInitDict);\n      }\n      get data() {\n        webidl.brandCheck(this, _MessageEvent);\n        return __privateGet(this, _eventInit).data;\n      }\n      get origin() {\n        webidl.brandCheck(this, _MessageEvent);\n        return __privateGet(this, _eventInit).origin;\n      }\n      get lastEventId() {\n        webidl.brandCheck(this, _MessageEvent);\n        return __privateGet(this, _eventInit).lastEventId;\n      }\n      get source() {\n        webidl.brandCheck(this, _MessageEvent);\n        return __privateGet(this, _eventInit).source;\n      }\n      get ports() {\n        webidl.brandCheck(this, _MessageEvent);\n        if (!Object.isFrozen(__privateGet(this, _eventInit).ports)) {\n          Object.freeze(__privateGet(this, _eventInit).ports);\n        }\n        return __privateGet(this, _eventInit).ports;\n      }\n      initMessageEvent(type, bubbles = false, cancelable = false, data = null, origin = "", lastEventId = "", source = null, ports = []) {\n        webidl.brandCheck(this, _MessageEvent);\n        webidl.argumentLengthCheck(arguments, 1, { header: "MessageEvent.initMessageEvent" });\n        return new _MessageEvent(type, {\n          bubbles,\n          cancelable,\n          data,\n          origin,\n          lastEventId,\n          source,\n          ports\n        });\n      }\n    };\n    _eventInit = new WeakMap();\n    __name(_MessageEvent, "MessageEvent");\n    var MessageEvent = _MessageEvent;\n    var _eventInit2;\n    var _CloseEvent = class _CloseEvent extends Event {\n      constructor(type, eventInitDict = {}) {\n        webidl.argumentLengthCheck(arguments, 1, { header: "CloseEvent constructor" });\n        type = webidl.converters.DOMString(type);\n        eventInitDict = webidl.converters.CloseEventInit(eventInitDict);\n        super(type, eventInitDict);\n        __privateAdd(this, _eventInit2, void 0);\n        __privateSet(this, _eventInit2, eventInitDict);\n      }\n      get wasClean() {\n        webidl.brandCheck(this, _CloseEvent);\n        return __privateGet(this, _eventInit2).wasClean;\n      }\n      get code() {\n        webidl.brandCheck(this, _CloseEvent);\n        return __privateGet(this, _eventInit2).code;\n      }\n      get reason() {\n        webidl.brandCheck(this, _CloseEvent);\n        return __privateGet(this, _eventInit2).reason;\n      }\n    };\n    _eventInit2 = new WeakMap();\n    __name(_CloseEvent, "CloseEvent");\n    var CloseEvent = _CloseEvent;\n    var _eventInit3;\n    var _ErrorEvent = class _ErrorEvent extends Event {\n      constructor(type, eventInitDict) {\n        webidl.argumentLengthCheck(arguments, 1, { header: "ErrorEvent constructor" });\n        super(type, eventInitDict);\n        __privateAdd(this, _eventInit3, void 0);\n        type = webidl.converters.DOMString(type);\n        eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {});\n        __privateSet(this, _eventInit3, eventInitDict);\n      }\n      get message() {\n        webidl.brandCheck(this, _ErrorEvent);\n        return __privateGet(this, _eventInit3).message;\n      }\n      get filename() {\n        webidl.brandCheck(this, _ErrorEvent);\n        return __privateGet(this, _eventInit3).filename;\n      }\n      get lineno() {\n        webidl.brandCheck(this, _ErrorEvent);\n        return __privateGet(this, _eventInit3).lineno;\n      }\n      get colno() {\n        webidl.brandCheck(this, _ErrorEvent);\n        return __privateGet(this, _eventInit3).colno;\n      }\n      get error() {\n        webidl.brandCheck(this, _ErrorEvent);\n        return __privateGet(this, _eventInit3).error;\n      }\n    };\n    _eventInit3 = new WeakMap();\n    __name(_ErrorEvent, "ErrorEvent");\n    var ErrorEvent = _ErrorEvent;\n    Object.defineProperties(MessageEvent.prototype, {\n      [Symbol.toStringTag]: {\n        value: "MessageEvent",\n        configurable: true\n      },\n      data: kEnumerableProperty,\n      origin: kEnumerableProperty,\n      lastEventId: kEnumerableProperty,\n      source: kEnumerableProperty,\n      ports: kEnumerableProperty,\n      initMessageEvent: kEnumerableProperty\n    });\n    Object.defineProperties(CloseEvent.prototype, {\n      [Symbol.toStringTag]: {\n        value: "CloseEvent",\n        configurable: true\n      },\n      reason: kEnumerableProperty,\n      code: kEnumerableProperty,\n      wasClean: kEnumerableProperty\n    });\n    Object.defineProperties(ErrorEvent.prototype, {\n      [Symbol.toStringTag]: {\n        value: "ErrorEvent",\n        configurable: true\n      },\n      message: kEnumerableProperty,\n      filename: kEnumerableProperty,\n      lineno: kEnumerableProperty,\n      colno: kEnumerableProperty,\n      error: kEnumerableProperty\n    });\n    webidl.converters.MessagePort = webidl.interfaceConverter(MessagePort);\n    webidl.converters["sequence<MessagePort>"] = webidl.sequenceConverter(\n      webidl.converters.MessagePort\n    );\n    var eventInit = [\n      {\n        key: "bubbles",\n        converter: webidl.converters.boolean,\n        defaultValue: false\n      },\n      {\n        key: "cancelable",\n        converter: webidl.converters.boolean,\n        defaultValue: false\n      },\n      {\n        key: "composed",\n        converter: webidl.converters.boolean,\n        defaultValue: false\n      }\n    ];\n    webidl.converters.MessageEventInit = webidl.dictionaryConverter([\n      ...eventInit,\n      {\n        key: "data",\n        converter: webidl.converters.any,\n        defaultValue: null\n      },\n      {\n        key: "origin",\n        converter: webidl.converters.USVString,\n        defaultValue: ""\n      },\n      {\n        key: "lastEventId",\n        converter: webidl.converters.DOMString,\n        defaultValue: ""\n      },\n      {\n        key: "source",\n        // Node doesn\'t implement WindowProxy or ServiceWorker, so the only\n        // valid value for source is a MessagePort.\n        converter: webidl.nullableConverter(webidl.converters.MessagePort),\n        defaultValue: null\n      },\n      {\n        key: "ports",\n        converter: webidl.converters["sequence<MessagePort>"],\n        get defaultValue() {\n          return [];\n        }\n      }\n    ]);\n    webidl.converters.CloseEventInit = webidl.dictionaryConverter([\n      ...eventInit,\n      {\n        key: "wasClean",\n        converter: webidl.converters.boolean,\n        defaultValue: false\n      },\n      {\n        key: "code",\n        converter: webidl.converters["unsigned short"],\n        defaultValue: 0\n      },\n      {\n        key: "reason",\n        converter: webidl.converters.USVString,\n        defaultValue: ""\n      }\n    ]);\n    webidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n      ...eventInit,\n      {\n        key: "message",\n        converter: webidl.converters.DOMString,\n        defaultValue: ""\n      },\n      {\n        key: "filename",\n        converter: webidl.converters.USVString,\n        defaultValue: ""\n      },\n      {\n        key: "lineno",\n        converter: webidl.converters["unsigned long"],\n        defaultValue: 0\n      },\n      {\n        key: "colno",\n        converter: webidl.converters["unsigned long"],\n        defaultValue: 0\n      },\n      {\n        key: "error",\n        converter: webidl.converters.any\n      }\n    ]);\n    module2.exports = {\n      MessageEvent,\n      CloseEvent,\n      ErrorEvent\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/util.js\nvar require_util3 = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/util.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require_symbols3();\n    var { states, opcodes } = require_constants3();\n    var { MessageEvent, ErrorEvent } = require_events();\n    function isEstablished(ws) {\n      return ws[kReadyState] === states.OPEN;\n    }\n    __name(isEstablished, "isEstablished");\n    function isClosing(ws) {\n      return ws[kReadyState] === states.CLOSING;\n    }\n    __name(isClosing, "isClosing");\n    function isClosed(ws) {\n      return ws[kReadyState] === states.CLOSED;\n    }\n    __name(isClosed, "isClosed");\n    function fireEvent(e, target, eventConstructor = Event, eventInitDict) {\n      const event = new eventConstructor(e, eventInitDict);\n      target.dispatchEvent(event);\n    }\n    __name(fireEvent, "fireEvent");\n    function websocketMessageReceived(ws, type, data) {\n      if (ws[kReadyState] !== states.OPEN) {\n        return;\n      }\n      let dataForEvent;\n      if (type === opcodes.TEXT) {\n        try {\n          dataForEvent = new TextDecoder("utf-8", { fatal: true }).decode(data);\n        } catch {\n          failWebsocketConnection(ws, "Received invalid UTF-8 in text frame.");\n          return;\n        }\n      } else if (type === opcodes.BINARY) {\n        if (ws[kBinaryType] === "blob") {\n          dataForEvent = new Blob([data]);\n        } else {\n          dataForEvent = new Uint8Array(data).buffer;\n        }\n      }\n      fireEvent("message", ws, MessageEvent, {\n        origin: ws[kWebSocketURL].origin,\n        data: dataForEvent\n      });\n    }\n    __name(websocketMessageReceived, "websocketMessageReceived");\n    function isValidSubprotocol(protocol) {\n      if (protocol.length === 0) {\n        return false;\n      }\n      for (const char of protocol) {\n        const code = char.charCodeAt(0);\n        if (code < 33 || code > 126 || char === "(" || char === ")" || char === "<" || char === ">" || char === "@" || char === "," || char === ";" || char === ":" || char === "\\\\" || char === \'"\' || char === "/" || char === "[" || char === "]" || char === "?" || char === "=" || char === "{" || char === "}" || code === 32 || // SP\n        code === 9) {\n          return false;\n        }\n      }\n      return true;\n    }\n    __name(isValidSubprotocol, "isValidSubprotocol");\n    function isValidStatusCode(code) {\n      if (code >= 1e3 && code < 1015) {\n        return code !== 1004 && // reserved\n        code !== 1005 && // "MUST NOT be set as a status code"\n        code !== 1006;\n      }\n      return code >= 3e3 && code <= 4999;\n    }\n    __name(isValidStatusCode, "isValidStatusCode");\n    function failWebsocketConnection(ws, reason) {\n      const { [kController]: controller, [kResponse]: response } = ws;\n      controller.abort();\n      if (response?.socket && !response.socket.destroyed) {\n        response.socket.destroy();\n      }\n      if (reason) {\n        fireEvent("error", ws, ErrorEvent, {\n          error: new Error(reason)\n        });\n      }\n    }\n    __name(failWebsocketConnection, "failWebsocketConnection");\n    module2.exports = {\n      isEstablished,\n      isClosing,\n      isClosed,\n      fireEvent,\n      isValidSubprotocol,\n      isValidStatusCode,\n      failWebsocketConnection,\n      websocketMessageReceived\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/connection.js\nvar require_connection = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/connection.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { randomBytes, createHash } = require("crypto");\n    var diagnosticsChannel = require("diagnostics_channel");\n    var { uid, states } = require_constants3();\n    var {\n      kReadyState,\n      kSentClose,\n      kByteParser,\n      kReceivedClose\n    } = require_symbols3();\n    var { fireEvent, failWebsocketConnection } = require_util3();\n    var { CloseEvent } = require_events();\n    var { makeRequest } = require_request();\n    var { fetching } = require_fetch();\n    var { Headers: Headers3 } = require_headers();\n    var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2();\n    var { kHeadersList } = require_symbols2();\n    var channels = {};\n    channels.open = diagnosticsChannel.channel("undici:websocket:open");\n    channels.close = diagnosticsChannel.channel("undici:websocket:close");\n    channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error");\n    function establishWebSocketConnection(url, protocols, ws, onEstablish, options) {\n      const requestURL = url;\n      requestURL.protocol = url.protocol === "ws:" ? "http:" : "https:";\n      const request = makeRequest({\n        urlList: [requestURL],\n        serviceWorkers: "none",\n        referrer: "no-referrer",\n        mode: "websocket",\n        credentials: "include",\n        cache: "no-store",\n        redirect: "error"\n      });\n      if (options.headers) {\n        const headersList = new Headers3(options.headers)[kHeadersList];\n        request.headersList = headersList;\n      }\n      const keyValue = randomBytes(16).toString("base64");\n      request.headersList.append("sec-websocket-key", keyValue);\n      request.headersList.append("sec-websocket-version", "13");\n      for (const protocol of protocols) {\n        request.headersList.append("sec-websocket-protocol", protocol);\n      }\n      const permessageDeflate = "";\n      const controller = fetching({\n        request,\n        useParallelQueue: true,\n        dispatcher: options.dispatcher ?? getGlobalDispatcher2(),\n        processResponse(response) {\n          if (response.type === "error" || response.status !== 101) {\n            failWebsocketConnection(ws, "Received network error or non-101 status code.");\n            return;\n          }\n          if (protocols.length !== 0 && !response.headersList.get("Sec-WebSocket-Protocol")) {\n            failWebsocketConnection(ws, "Server did not respond with sent protocols.");\n            return;\n          }\n          if (response.headersList.get("Upgrade")?.toLowerCase() !== "websocket") {\n            failWebsocketConnection(ws, \'Server did not set Upgrade header to "websocket".\');\n            return;\n          }\n          if (response.headersList.get("Connection")?.toLowerCase() !== "upgrade") {\n            failWebsocketConnection(ws, \'Server did not set Connection header to "upgrade".\');\n            return;\n          }\n          const secWSAccept = response.headersList.get("Sec-WebSocket-Accept");\n          const digest = createHash("sha1").update(keyValue + uid).digest("base64");\n          if (secWSAccept !== digest) {\n            failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header.");\n            return;\n          }\n          const secExtension = response.headersList.get("Sec-WebSocket-Extensions");\n          if (secExtension !== null && secExtension !== permessageDeflate) {\n            failWebsocketConnection(ws, "Received different permessage-deflate than the one set.");\n            return;\n          }\n          const secProtocol = response.headersList.get("Sec-WebSocket-Protocol");\n          if (secProtocol !== null && secProtocol !== request.headersList.get("Sec-WebSocket-Protocol")) {\n            failWebsocketConnection(ws, "Protocol was not set in the opening handshake.");\n            return;\n          }\n          response.socket.on("data", onSocketData);\n          response.socket.on("close", onSocketClose);\n          response.socket.on("error", onSocketError);\n          if (channels.open.hasSubscribers) {\n            channels.open.publish({\n              address: response.socket.address(),\n              protocol: secProtocol,\n              extensions: secExtension\n            });\n          }\n          onEstablish(response);\n        }\n      });\n      return controller;\n    }\n    __name(establishWebSocketConnection, "establishWebSocketConnection");\n    function onSocketData(chunk) {\n      if (!this.ws[kByteParser].write(chunk)) {\n        this.pause();\n      }\n    }\n    __name(onSocketData, "onSocketData");\n    function onSocketClose() {\n      const { ws } = this;\n      const wasClean = ws[kSentClose] && ws[kReceivedClose];\n      let code = 1005;\n      let reason = "";\n      const result = ws[kByteParser].closingInfo;\n      if (result) {\n        code = result.code ?? 1005;\n        reason = result.reason;\n      } else if (!ws[kSentClose]) {\n        code = 1006;\n      }\n      ws[kReadyState] = states.CLOSED;\n      fireEvent("close", ws, CloseEvent, {\n        wasClean,\n        code,\n        reason\n      });\n      if (channels.close.hasSubscribers) {\n        channels.close.publish({\n          websocket: ws,\n          code,\n          reason\n        });\n      }\n    }\n    __name(onSocketClose, "onSocketClose");\n    function onSocketError(error) {\n      const { ws } = this;\n      ws[kReadyState] = states.CLOSING;\n      if (channels.socketError.hasSubscribers) {\n        channels.socketError.publish(error);\n      }\n      this.destroy();\n    }\n    __name(onSocketError, "onSocketError");\n    module2.exports = {\n      establishWebSocketConnection\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/frame.js\nvar require_frame = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/frame.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { randomBytes } = require("crypto");\n    var { maxUnsigned16Bit } = require_constants3();\n    var _WebsocketFrameSend = class _WebsocketFrameSend {\n      /**\n       * @param {Buffer|undefined} data\n       */\n      constructor(data) {\n        this.frameData = data;\n        this.maskKey = randomBytes(4);\n      }\n      createFrame(opcode) {\n        const bodyLength = this.frameData?.byteLength ?? 0;\n        let payloadLength = bodyLength;\n        let offset = 6;\n        if (bodyLength > maxUnsigned16Bit) {\n          offset += 8;\n          payloadLength = 127;\n        } else if (bodyLength > 125) {\n          offset += 2;\n          payloadLength = 126;\n        }\n        const buffer = Buffer.allocUnsafe(bodyLength + offset);\n        buffer[0] = buffer[1] = 0;\n        buffer[0] |= 128;\n        buffer[0] = (buffer[0] & 240) + opcode;\n        buffer[offset - 4] = this.maskKey[0];\n        buffer[offset - 3] = this.maskKey[1];\n        buffer[offset - 2] = this.maskKey[2];\n        buffer[offset - 1] = this.maskKey[3];\n        buffer[1] = payloadLength;\n        if (payloadLength === 126) {\n          buffer.writeUInt16BE(bodyLength, 2);\n        } else if (payloadLength === 127) {\n          buffer[2] = buffer[3] = 0;\n          buffer.writeUIntBE(bodyLength, 4, 6);\n        }\n        buffer[1] |= 128;\n        for (let i = 0; i < bodyLength; i++) {\n          buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4];\n        }\n        return buffer;\n      }\n    };\n    __name(_WebsocketFrameSend, "WebsocketFrameSend");\n    var WebsocketFrameSend = _WebsocketFrameSend;\n    module2.exports = {\n      WebsocketFrameSend\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/receiver.js\nvar require_receiver = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/receiver.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { Writable } = require("stream");\n    var diagnosticsChannel = require("diagnostics_channel");\n    var { parserStates, opcodes, states, emptyBuffer } = require_constants3();\n    var { kReadyState, kSentClose, kResponse, kReceivedClose } = require_symbols3();\n    var { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = require_util3();\n    var { WebsocketFrameSend } = require_frame();\n    var channels = {};\n    channels.ping = diagnosticsChannel.channel("undici:websocket:ping");\n    channels.pong = diagnosticsChannel.channel("undici:websocket:pong");\n    var _buffers, _byteOffset, _state, _info, _fragments;\n    var _ByteParser = class _ByteParser extends Writable {\n      constructor(ws) {\n        super();\n        __privateAdd(this, _buffers, []);\n        __privateAdd(this, _byteOffset, 0);\n        __privateAdd(this, _state, parserStates.INFO);\n        __privateAdd(this, _info, {});\n        __privateAdd(this, _fragments, []);\n        this.ws = ws;\n      }\n      /**\n       * @param {Buffer} chunk\n       * @param {() => void} callback\n       */\n      _write(chunk, _, callback) {\n        __privateGet(this, _buffers).push(chunk);\n        __privateSet(this, _byteOffset, __privateGet(this, _byteOffset) + chunk.length);\n        this.run(callback);\n      }\n      /**\n       * Runs whenever a new chunk is received.\n       * Callback is called whenever there are no more chunks buffering,\n       * or not enough bytes are buffered to parse.\n       */\n      run(callback) {\n        while (true) {\n          if (__privateGet(this, _state) === parserStates.INFO) {\n            if (__privateGet(this, _byteOffset) < 2) {\n              return callback();\n            }\n            const buffer = this.consume(2);\n            __privateGet(this, _info).fin = (buffer[0] & 128) !== 0;\n            __privateGet(this, _info).opcode = buffer[0] & 15;\n            __privateGet(this, _info).originalOpcode ??= __privateGet(this, _info).opcode;\n            __privateGet(this, _info).fragmented = !__privateGet(this, _info).fin && __privateGet(this, _info).opcode !== opcodes.CONTINUATION;\n            if (__privateGet(this, _info).fragmented && __privateGet(this, _info).opcode !== opcodes.BINARY && __privateGet(this, _info).opcode !== opcodes.TEXT) {\n              failWebsocketConnection(this.ws, "Invalid frame type was fragmented.");\n              return;\n            }\n            const payloadLength = buffer[1] & 127;\n            if (payloadLength <= 125) {\n              __privateGet(this, _info).payloadLength = payloadLength;\n              __privateSet(this, _state, parserStates.READ_DATA);\n            } else if (payloadLength === 126) {\n              __privateSet(this, _state, parserStates.PAYLOADLENGTH_16);\n            } else if (payloadLength === 127) {\n              __privateSet(this, _state, parserStates.PAYLOADLENGTH_64);\n            }\n            if (__privateGet(this, _info).fragmented && payloadLength > 125) {\n              failWebsocketConnection(this.ws, "Fragmented frame exceeded 125 bytes.");\n              return;\n            } else if ((__privateGet(this, _info).opcode === opcodes.PING || __privateGet(this, _info).opcode === opcodes.PONG || __privateGet(this, _info).opcode === opcodes.CLOSE) && payloadLength > 125) {\n              failWebsocketConnection(this.ws, "Payload length for control frame exceeded 125 bytes.");\n              return;\n            } else if (__privateGet(this, _info).opcode === opcodes.CLOSE) {\n              if (payloadLength === 1) {\n                failWebsocketConnection(this.ws, "Received close frame with a 1-byte body.");\n                return;\n              }\n              const body = this.consume(payloadLength);\n              __privateGet(this, _info).closeInfo = this.parseCloseBody(false, body);\n              if (!this.ws[kSentClose]) {\n                const body2 = Buffer.allocUnsafe(2);\n                body2.writeUInt16BE(__privateGet(this, _info).closeInfo.code, 0);\n                const closeFrame = new WebsocketFrameSend(body2);\n                this.ws[kResponse].socket.write(\n                  closeFrame.createFrame(opcodes.CLOSE),\n                  (err) => {\n                    if (!err) {\n                      this.ws[kSentClose] = true;\n                    }\n                  }\n                );\n              }\n              this.ws[kReadyState] = states.CLOSING;\n              this.ws[kReceivedClose] = true;\n              this.end();\n              return;\n            } else if (__privateGet(this, _info).opcode === opcodes.PING) {\n              const body = this.consume(payloadLength);\n              if (!this.ws[kReceivedClose]) {\n                const frame = new WebsocketFrameSend(body);\n                this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG));\n                if (channels.ping.hasSubscribers) {\n                  channels.ping.publish({\n                    payload: body\n                  });\n                }\n              }\n              __privateSet(this, _state, parserStates.INFO);\n              if (__privateGet(this, _byteOffset) > 0) {\n                continue;\n              } else {\n                callback();\n                return;\n              }\n            } else if (__privateGet(this, _info).opcode === opcodes.PONG) {\n              const body = this.consume(payloadLength);\n              if (channels.pong.hasSubscribers) {\n                channels.pong.publish({\n                  payload: body\n                });\n              }\n              if (__privateGet(this, _byteOffset) > 0) {\n                continue;\n              } else {\n                callback();\n                return;\n              }\n            }\n          } else if (__privateGet(this, _state) === parserStates.PAYLOADLENGTH_16) {\n            if (__privateGet(this, _byteOffset) < 2) {\n              return callback();\n            }\n            const buffer = this.consume(2);\n            __privateGet(this, _info).payloadLength = buffer.readUInt16BE(0);\n            __privateSet(this, _state, parserStates.READ_DATA);\n          } else if (__privateGet(this, _state) === parserStates.PAYLOADLENGTH_64) {\n            if (__privateGet(this, _byteOffset) < 8) {\n              return callback();\n            }\n            const buffer = this.consume(8);\n            const upper = buffer.readUInt32BE(0);\n            if (upper > 2 ** 31 - 1) {\n              failWebsocketConnection(this.ws, "Received payload length > 2^31 bytes.");\n              return;\n            }\n            const lower = buffer.readUInt32BE(4);\n            __privateGet(this, _info).payloadLength = (upper << 8) + lower;\n            __privateSet(this, _state, parserStates.READ_DATA);\n          } else if (__privateGet(this, _state) === parserStates.READ_DATA) {\n            if (__privateGet(this, _byteOffset) < __privateGet(this, _info).payloadLength) {\n              return callback();\n            } else if (__privateGet(this, _byteOffset) >= __privateGet(this, _info).payloadLength) {\n              const body = this.consume(__privateGet(this, _info).payloadLength);\n              __privateGet(this, _fragments).push(body);\n              if (!__privateGet(this, _info).fragmented || __privateGet(this, _info).fin && __privateGet(this, _info).opcode === opcodes.CONTINUATION) {\n                const fullMessage = Buffer.concat(__privateGet(this, _fragments));\n                websocketMessageReceived(this.ws, __privateGet(this, _info).originalOpcode, fullMessage);\n                __privateSet(this, _info, {});\n                __privateGet(this, _fragments).length = 0;\n              }\n              __privateSet(this, _state, parserStates.INFO);\n            }\n          }\n          if (__privateGet(this, _byteOffset) > 0) {\n            continue;\n          } else {\n            callback();\n            break;\n          }\n        }\n      }\n      /**\n       * Take n bytes from the buffered Buffers\n       * @param {number} n\n       * @returns {Buffer|null}\n       */\n      consume(n) {\n        if (n > __privateGet(this, _byteOffset)) {\n          return null;\n        } else if (n === 0) {\n          return emptyBuffer;\n        }\n        if (__privateGet(this, _buffers)[0].length === n) {\n          __privateSet(this, _byteOffset, __privateGet(this, _byteOffset) - __privateGet(this, _buffers)[0].length);\n          return __privateGet(this, _buffers).shift();\n        }\n        const buffer = Buffer.allocUnsafe(n);\n        let offset = 0;\n        while (offset !== n) {\n          const next = __privateGet(this, _buffers)[0];\n          const { length } = next;\n          if (length + offset === n) {\n            buffer.set(__privateGet(this, _buffers).shift(), offset);\n            break;\n          } else if (length + offset > n) {\n            buffer.set(next.subarray(0, n - offset), offset);\n            __privateGet(this, _buffers)[0] = next.subarray(n - offset);\n            break;\n          } else {\n            buffer.set(__privateGet(this, _buffers).shift(), offset);\n            offset += next.length;\n          }\n        }\n        __privateSet(this, _byteOffset, __privateGet(this, _byteOffset) - n);\n        return buffer;\n      }\n      parseCloseBody(onlyCode, data) {\n        let code;\n        if (data.length >= 2) {\n          code = data.readUInt16BE(0);\n        }\n        if (onlyCode) {\n          if (!isValidStatusCode(code)) {\n            return null;\n          }\n          return { code };\n        }\n        let reason = data.subarray(2);\n        if (reason[0] === 239 && reason[1] === 187 && reason[2] === 191) {\n          reason = reason.subarray(3);\n        }\n        if (code !== void 0 && !isValidStatusCode(code)) {\n          return null;\n        }\n        try {\n          reason = new TextDecoder("utf-8", { fatal: true }).decode(reason);\n        } catch {\n          return null;\n        }\n        return { code, reason };\n      }\n      get closingInfo() {\n        return __privateGet(this, _info).closeInfo;\n      }\n    };\n    _buffers = new WeakMap();\n    _byteOffset = new WeakMap();\n    _state = new WeakMap();\n    _info = new WeakMap();\n    _fragments = new WeakMap();\n    __name(_ByteParser, "ByteParser");\n    var ByteParser = _ByteParser;\n    module2.exports = {\n      ByteParser\n    };\n  }\n});\n\n// ../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/websocket.js\nvar require_websocket = __commonJS({\n  "../../node_modules/.pnpm/undici@5.23.0/node_modules/undici/lib/websocket/websocket.js"(exports2, module2) {\n    "use strict";\n    init_define_process();\n    var { webidl } = require_webidl();\n    var { DOMException } = require_constants();\n    var { URLSerializer } = require_dataURL();\n    var { staticPropertyDescriptors, states, opcodes, emptyBuffer } = require_constants3();\n    var {\n      kWebSocketURL,\n      kReadyState,\n      kController,\n      kBinaryType,\n      kResponse,\n      kSentClose,\n      kByteParser\n    } = require_symbols3();\n    var { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = require_util3();\n    var { establishWebSocketConnection } = require_connection();\n    var { WebsocketFrameSend } = require_frame();\n    var { ByteParser } = require_receiver();\n    var { kEnumerableProperty, isBlobLike } = require_util();\n    var { getGlobalDispatcher: getGlobalDispatcher2 } = require_global2();\n    var { types } = require("util");\n    var experimentalWarned = false;\n    var _events, _bufferedAmount, _protocol, _extensions, _onConnectionEstablished, onConnectionEstablished_fn;\n    var _WebSocket = class _WebSocket extends EventTarget {\n      /**\n       * @param {string} url\n       * @param {string|string[]} protocols\n       */\n      constructor(url, protocols = []) {\n        super();\n        /**\n         * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n         */\n        __privateAdd(this, _onConnectionEstablished);\n        __privateAdd(this, _events, {\n          open: null,\n          error: null,\n          close: null,\n          message: null\n        });\n        __privateAdd(this, _bufferedAmount, 0);\n        __privateAdd(this, _protocol, "");\n        __privateAdd(this, _extensions, "");\n        webidl.argumentLengthCheck(arguments, 1, { header: "WebSocket constructor" });\n        if (!experimentalWarned) {\n          experimentalWarned = true;\n          define_process_default.emitWarning("WebSockets are experimental, expect them to change at any time.", {\n            code: "UNDICI-WS"\n          });\n        }\n        const options = webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"](protocols);\n        url = webidl.converters.USVString(url);\n        protocols = options.protocols;\n        let urlRecord;\n        try {\n          urlRecord = new URL(url);\n        } catch (e) {\n          throw new DOMException(e, "SyntaxError");\n        }\n        if (urlRecord.protocol !== "ws:" && urlRecord.protocol !== "wss:") {\n          throw new DOMException(\n            `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n            "SyntaxError"\n          );\n        }\n        if (urlRecord.hash) {\n          throw new DOMException("Got fragment", "SyntaxError");\n        }\n        if (typeof protocols === "string") {\n          protocols = [protocols];\n        }\n        if (protocols.length !== new Set(protocols.map((p) => p.toLowerCase())).size) {\n          throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");\n        }\n        if (protocols.length > 0 && !protocols.every((p) => isValidSubprotocol(p))) {\n          throw new DOMException("Invalid Sec-WebSocket-Protocol value", "SyntaxError");\n        }\n        this[kWebSocketURL] = urlRecord;\n        this[kController] = establishWebSocketConnection(\n          urlRecord,\n          protocols,\n          this,\n          (response) => __privateMethod(this, _onConnectionEstablished, onConnectionEstablished_fn).call(this, response),\n          options\n        );\n        this[kReadyState] = _WebSocket.CONNECTING;\n        this[kBinaryType] = "blob";\n      }\n      /**\n       * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n       * @param {number|undefined} code\n       * @param {string|undefined} reason\n       */\n      close(code = void 0, reason = void 0) {\n        webidl.brandCheck(this, _WebSocket);\n        if (code !== void 0) {\n          code = webidl.converters["unsigned short"](code, { clamp: true });\n        }\n        if (reason !== void 0) {\n          reason = webidl.converters.USVString(reason);\n        }\n        if (code !== void 0) {\n          if (code !== 1e3 && (code < 3e3 || code > 4999)) {\n            throw new DOMException("invalid code", "InvalidAccessError");\n          }\n        }\n        let reasonByteLength = 0;\n        if (reason !== void 0) {\n          reasonByteLength = Buffer.byteLength(reason);\n          if (reasonByteLength > 123) {\n            throw new DOMException(\n              `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n              "SyntaxError"\n            );\n          }\n        }\n        if (this[kReadyState] === _WebSocket.CLOSING || this[kReadyState] === _WebSocket.CLOSED) {\n        } else if (!isEstablished(this)) {\n          failWebsocketConnection(this, "Connection was closed before it was established.");\n          this[kReadyState] = _WebSocket.CLOSING;\n        } else if (!isClosing(this)) {\n          const frame = new WebsocketFrameSend();\n          if (code !== void 0 && reason === void 0) {\n            frame.frameData = Buffer.allocUnsafe(2);\n            frame.frameData.writeUInt16BE(code, 0);\n          } else if (code !== void 0 && reason !== void 0) {\n            frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength);\n            frame.frameData.writeUInt16BE(code, 0);\n            frame.frameData.write(reason, 2, "utf-8");\n          } else {\n            frame.frameData = emptyBuffer;\n          }\n          const socket = this[kResponse].socket;\n          socket.write(frame.createFrame(opcodes.CLOSE), (err) => {\n            if (!err) {\n              this[kSentClose] = true;\n            }\n          });\n          this[kReadyState] = states.CLOSING;\n        } else {\n          this[kReadyState] = _WebSocket.CLOSING;\n        }\n      }\n      /**\n       * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n       * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n       */\n      send(data) {\n        webidl.brandCheck(this, _WebSocket);\n        webidl.argumentLengthCheck(arguments, 1, { header: "WebSocket.send" });\n        data = webidl.converters.WebSocketSendData(data);\n        if (this[kReadyState] === _WebSocket.CONNECTING) {\n          throw new DOMException("Sent before connected.", "InvalidStateError");\n        }\n        if (!isEstablished(this) || isClosing(this)) {\n          return;\n        }\n        const socket = this[kResponse].socket;\n        if (typeof data === "string") {\n          const value = Buffer.from(data);\n          const frame = new WebsocketFrameSend(value);\n          const buffer = frame.createFrame(opcodes.TEXT);\n          __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) + value.byteLength);\n          socket.write(buffer, () => {\n            __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) - value.byteLength);\n          });\n        } else if (types.isArrayBuffer(data)) {\n          const value = Buffer.from(data);\n          const frame = new WebsocketFrameSend(value);\n          const buffer = frame.createFrame(opcodes.BINARY);\n          __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) + value.byteLength);\n          socket.write(buffer, () => {\n            __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) - value.byteLength);\n          });\n        } else if (ArrayBuffer.isView(data)) {\n          const ab = Buffer.from(data, data.byteOffset, data.byteLength);\n          const frame = new WebsocketFrameSend(ab);\n          const buffer = frame.createFrame(opcodes.BINARY);\n          __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) + ab.byteLength);\n          socket.write(buffer, () => {\n            __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) - ab.byteLength);\n          });\n        } else if (isBlobLike(data)) {\n          const frame = new WebsocketFrameSend();\n          data.arrayBuffer().then((ab) => {\n            const value = Buffer.from(ab);\n            frame.frameData = value;\n            const buffer = frame.createFrame(opcodes.BINARY);\n            __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) + value.byteLength);\n            socket.write(buffer, () => {\n              __privateSet(this, _bufferedAmount, __privateGet(this, _bufferedAmount) - value.byteLength);\n            });\n          });\n        }\n      }\n      get readyState() {\n        webidl.brandCheck(this, _WebSocket);\n        return this[kReadyState];\n      }\n      get bufferedAmount() {\n        webidl.brandCheck(this, _WebSocket);\n        return __privateGet(this, _bufferedAmount);\n      }\n      get url() {\n        webidl.brandCheck(this, _WebSocket);\n        return URLSerializer(this[kWebSocketURL]);\n      }\n      get extensions() {\n        webidl.brandCheck(this, _WebSocket);\n        return __privateGet(this, _extensions);\n      }\n      get protocol() {\n        webidl.brandCheck(this, _WebSocket);\n        return __privateGet(this, _protocol);\n      }\n      get onopen() {\n        webidl.brandCheck(this, _WebSocket);\n        return __privateGet(this, _events).open;\n      }\n      set onopen(fn) {\n        webidl.brandCheck(this, _WebSocket);\n        if (__privateGet(this, _events).open) {\n          this.removeEventListener("open", __privateGet(this, _events).open);\n        }\n        if (typeof fn === "function") {\n          __privateGet(this, _events).open = fn;\n          this.addEventListener("open", fn);\n        } else {\n          __privateGet(this, _events).open = null;\n        }\n      }\n      get onerror() {\n        webidl.brandCheck(this, _WebSocket);\n        return __privateGet(this, _events).error;\n      }\n      set onerror(fn) {\n        webidl.brandCheck(this, _WebSocket);\n        if (__privateGet(this, _events).error) {\n          this.removeEventListener("error", __privateGet(this, _events).error);\n        }\n        if (typeof fn === "function") {\n          __privateGet(this, _events).error = fn;\n          this.addEventListener("error", fn);\n        } else {\n          __privateGet(this, _events).error = null;\n        }\n      }\n      get onclose() {\n        webidl.brandCheck(this, _WebSocket);\n        return __privateGet(this, _events).close;\n      }\n      set onclose(fn) {\n        webidl.brandCheck(this, _WebSocket);\n        if (__privateGet(this, _events).close) {\n          this.removeEventListener("close", __privateGet(this, _events).close);\n        }\n        if (typeof fn === "function") {\n          __privateGet(this, _events).close = fn;\n          this.addEventListener("close", fn);\n        } else {\n          __privateGet(this, _events).close = null;\n        }\n      }\n      get onmessage() {\n        webidl.brandCheck(this, _WebSocket);\n        return __privateGet(this, _events).message;\n      }\n      set onmessage(fn) {\n        webidl.brandCheck(this, _WebSocket);\n        if (__privateGet(this, _events).message) {\n          this.removeEventListener("message", __privateGet(this, _events).message);\n        }\n        if (typeof fn === "function") {\n          __privateGet(this, _events).message = fn;\n          this.addEventListener("message", fn);\n        } else {\n          __privateGet(this, _events).message = null;\n        }\n      }\n      get binaryType() {\n        webidl.brandCheck(this, _WebSocket);\n        return this[kBinaryType];\n      }\n      set binaryType(type) {\n        webidl.brandCheck(this, _WebSocket);\n        if (type !== "blob" && type !== "arraybuffer") {\n          this[kBinaryType] = "blob";\n        } else {\n          this[kBinaryType] = type;\n        }\n      }\n    };\n    _events = new WeakMap();\n    _bufferedAmount = new WeakMap();\n    _protocol = new WeakMap();\n    _extensions = new WeakMap();\n    _onConnectionEstablished = new WeakSet();\n    onConnectionEstablished_fn = /* @__PURE__ */ __name(function(response) {\n      this[kResponse] = response;\n      const parser = new ByteParser(this);\n      parser.on("drain", /* @__PURE__ */ __name(function onParserDrain() {\n        this.ws[kResponse].socket.resume();\n      }, "onParserDrain"));\n      response.socket.ws = this;\n      this[kByteParser] = parser;\n      this[kReadyState] = states.OPEN;\n      const extensions = response.headersList.get("sec-websocket-extensions");\n      if (extensions !== null) {\n        __privateSet(this, _extensions, extensions);\n      }\n      const protocol = response.headersList.get("sec-websocket-protocol");\n      if (protocol !== null) {\n        __privateSet(this, _protocol, protocol);\n      }\n      fireEvent("open", this);\n    }, "#onConnectionEstablished");\n    __name(_WebSocket, "WebSocket");\n    var WebSocket2 = _WebSocket;\n    WebSocket2.CONNECTING = WebSocket2.prototype.CONNECTING = states.CONNECTING;\n    WebSocket2.OPEN = WebSocket2.prototype.OPEN = states.OPEN;\n    WebSocket2.CLOSING = WebSocket2.prototype.CLOSING = states.CLOSING;\n    WebSocket2.CLOSED = WebSocket2.prototype.CLOSED = states.CLOSED;\n    Object.defineProperties(WebSocket2.prototype, {\n      CONNECTING: staticPropertyDescriptors,\n      OPEN: staticPropertyDescriptors,\n      CLOSING: staticPropertyDescriptors,\n      CLOSED: staticPropertyDescriptors,\n      url: kEnumerableProperty,\n      readyState: kEnumerableProperty,\n      bufferedAmount: kEnumerableProperty,\n      onopen: kEnumerableProperty,\n      onerror: kEnumerableProperty,\n      onclose: kEnumerableProperty,\n      close: kEnumerableProperty,\n      onmessage: kEnumerableProperty,\n      binaryType: kEnumerableProperty,\n      send: kEnumerableProperty,\n      extensions: kEnumerableProperty,\n      protocol: kEnumerableProperty,\n      [Symbol.toStringTag]: {\n        value: "WebSocket",\n        writable: false,\n        enumerable: false,\n        configurable: true\n      }\n    });\n    Object.defineProperties(WebSocket2, {\n      CONNECTING: staticPropertyDescriptors,\n      OPEN: staticPropertyDescriptors,\n      CLOSING: staticPropertyDescriptors,\n      CLOSED: staticPropertyDescriptors\n    });\n    webidl.converters["sequence<DOMString>"] = webidl.sequenceConverter(\n      webidl.converters.DOMString\n    );\n    webidl.converters["DOMString or sequence<DOMString>"] = function(V) {\n      if (webidl.util.Type(V) === "Object" && Symbol.iterator in V) {\n        return webidl.converters["sequence<DOMString>"](V);\n      }\n      return webidl.converters.DOMString(V);\n    };\n    webidl.converters.WebSocketInit = webidl.dictionaryConverter([\n      {\n        key: "protocols",\n        converter: webidl.converters["DOMString or sequence<DOMString>"],\n        get defaultValue() {\n          return [];\n        }\n      },\n      {\n        key: "dispatcher",\n        converter: (V) => V,\n        get defaultValue() {\n          return getGlobalDispatcher2();\n        }\n      },\n      {\n        key: "headers",\n        converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n      }\n    ]);\n    webidl.converters["DOMString or sequence<DOMString> or WebSocketInit"] = function(V) {\n      if (webidl.util.Type(V) === "Object" && !(Symbol.iterator in V)) {\n        return webidl.converters.WebSocketInit(V);\n      }\n      return { protocols: webidl.converters["DOMString or sequence<DOMString>"](V) };\n    };\n    webidl.converters.WebSocketSendData = function(V) {\n      if (webidl.util.Type(V) === "Object") {\n        if (isBlobLike(V)) {\n          return webidl.converters.Blob(V, { strict: false });\n        }\n        if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {\n          return webidl.converters.BufferSource(V);\n        }\n      }\n      return webidl.converters.USVString(V);\n    };\n    module2.exports = {\n      WebSocket: WebSocket2\n    };\n  }\n});\n\n// src/primitives/fetch.js\nvar fetch_exports = {};\n__export(fetch_exports, {\n  File: () => import_file.File,\n  FormData: () => import_formdata.FormData,\n  Headers: () => Headers2,\n  Request: () => Request,\n  Response: () => Response2,\n  WebSocket: () => import_websocket.WebSocket,\n  fetch: () => fetch,\n  getGlobalDispatcher: () => getGlobalDispatcher,\n  setGlobalDispatcher: () => setGlobalDispatcher\n});\nmodule.exports = __toCommonJS(fetch_exports);\ninit_define_process();\nvar FetchSymbols = __toESM(require_symbols());\nvar HeadersModule = __toESM(require_headers());\nvar ResponseModule = __toESM(require_response());\nvar UtilModule = __toESM(require_util2());\nvar WebIDLModule = __toESM(require_webidl());\nvar import_request = __toESM(require_request());\nvar import_fetch = __toESM(require_fetch());\nvar import_agent = __toESM(require_agent());\nvar import_formdata = __toESM(require_formdata());\nvar import_file = __toESM(require_file());\nvar import_websocket = __toESM(require_websocket());\ndefine_process_default.nextTick = setImmediate;\ndefine_process_default.emitWarning = () => {\n};\nvar _Request = class _Request extends import_request.Request {\n  constructor(input, init) {\n    super(input, addDuplexToInit(init));\n  }\n};\n__name(_Request, "Request");\nvar Request = _Request;\nvar __entries = HeadersModule.Headers.prototype.entries;\nHeadersModule.Headers.prototype.entries = function* () {\n  let sentSetCookie = false;\n  for (const [key, value] of __entries.call(this)) {\n    if (key === "set-cookie") {\n      if (sentSetCookie) {\n        continue;\n      }\n      sentSetCookie = true;\n      const cookies = this.getSetCookie();\n      yield [key, cookies.join(", ")];\n    } else {\n      yield [key, value];\n    }\n  }\n};\nHeadersModule.Headers[Symbol.iterator] = () => {\n  return HeadersModule.Headers.prototype.entries();\n};\nHeadersModule.Headers.prototype.values = function* () {\n  for (const [, value] of __entries.call(this)) {\n    yield value;\n  }\n};\nHeadersModule.Headers.prototype.getAll = function(name) {\n  const _name = normalizeAndValidateHeaderName(name, "Headers.getAll");\n  if (_name !== "set-cookie") {\n    throw new Error(`getAll can only be used with \'set-cookie\'`);\n  }\n  return this.getSetCookie();\n};\nvar __error = ResponseModule.Response.error;\nResponseModule.Response.error = function(...args) {\n  const response = __error.call(this, ...args);\n  response[FetchSymbols.kHeaders][FetchSymbols.kGuard] = "response";\n  return response;\n};\nfunction normalizeAndValidateHeaderName(potentialName, errorPrefix) {\n  const normalizedName = potentialName.toLowerCase();\n  if (UtilModule.isValidHeaderName(normalizedName)) {\n    return normalizedName;\n  }\n  WebIDLModule.errors.invalidArgument({\n    prefix: errorPrefix,\n    value: normalizedName,\n    type: "header name"\n  });\n}\n__name(normalizeAndValidateHeaderName, "normalizeAndValidateHeaderName");\nvar globalDispatcher = new import_agent.default();\nfunction getGlobalDispatcher() {\n  return globalDispatcher;\n}\n__name(getGlobalDispatcher, "getGlobalDispatcher");\nfunction setGlobalDispatcher(agent) {\n  if (!agent || typeof agent.dispatch !== "function") {\n    throw new InvalidArgumentError("Argument agent must implement Agent");\n  }\n  globalDispatcher = agent;\n}\n__name(setGlobalDispatcher, "setGlobalDispatcher");\nfunction addDuplexToInit(init) {\n  return typeof init === "undefined" || typeof init === "object" && init.duplex === void 0 ? { duplex: "half", ...init } : init;\n}\n__name(addDuplexToInit, "addDuplexToInit");\nasync function fetch(info, init) {\n  init = addDuplexToInit(init);\n  const res = await import_fetch.fetch.call(getGlobalDispatcher(), info, init);\n  const response = new Response2(res.body, res);\n  Object.defineProperty(response, "url", { value: res.url });\n  return response;\n}\n__name(fetch, "fetch");\nvar Headers2 = HeadersModule.Headers;\nvar Response2 = ResponseModule.Response;\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  File,\n  FormData,\n  Headers,\n  Request,\n  Response,\n  WebSocket,\n  fetch,\n  getGlobalDispatcher,\n  setGlobalDispatcher\n});\n';
  }
});

// ../primitives/dist/crypto.js.text.js
var require_crypto_js_text = __commonJS({
  "../primitives/dist/crypto.js.text.js"(exports2, module2) {
    "use strict";
    module2.exports = '"use strict";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, "name", { value, configurable: true });\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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);\n\n// src/primitives/crypto.js\nvar crypto_exports = {};\n__export(crypto_exports, {\n  Crypto: () => Crypto,\n  CryptoKey: () => CryptoKey,\n  SubtleCrypto: () => SubtleCrypto,\n  crypto: () => crypto\n});\nmodule.exports = __toCommonJS(crypto_exports);\nvar import_node_crypto = require("crypto");\nvar { Crypto, CryptoKey } = import_node_crypto.webcrypto;\nfunction SubtleCrypto() {\n  if (!(this instanceof SubtleCrypto))\n    return new SubtleCrypto();\n  throw TypeError("Illegal constructor");\n}\n__name(SubtleCrypto, "SubtleCrypto");\nvar crypto = new Crypto();\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n  Crypto,\n  CryptoKey,\n  SubtleCrypto,\n  crypto\n});\n';
  }
});

// ../primitives/dist/load.js
var require_load = __commonJS({
  "../primitives/dist/load.js"(exports, module) {
    "use strict";
    var __create = Object.create;
    var __defProp = Object.defineProperty;
    var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
    var __getOwnPropNames = Object.getOwnPropertyNames;
    var __getProtoOf = Object.getPrototypeOf;
    var __hasOwnProp = Object.prototype.hasOwnProperty;
    var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
    var __export = (target, all) => {
      for (var name in all)
        __defProp(target, name, { get: all[name], enumerable: true });
    };
    var __copyProps = (to, from, except, desc) => {
      if (from && typeof from === "object" || typeof from === "function") {
        for (let key of __getOwnPropNames(from))
          if (!__hasOwnProp.call(to, key) && key !== except)
            __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
      }
      return to;
    };
    var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
      // If the importer is in node compatibility mode or this is not an ESM
      // file that has been converted to a CommonJS file using a Babel-
      // compatible transform (i.e. "__esModule" has not been set), then set
      // "default" to the CommonJS "module.exports" for node compatibility.
      isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
      mod
    ));
    var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
    var load_exports = {};
    __export(load_exports, {
      load: () => load
    });
    module.exports = __toCommonJS(load_exports);
    var import_module = __toESM(require("module"));
    var import_crypto = __toESM(require("crypto"));
    var import_web = require("stream/web");
    function requireWithFakeGlobalScope(params) {
      const getModuleCode = `(function(module,exports,require,globalThis,${Object.keys(
        params.scopedContext
      ).join(",")}) {${params.sourceCode}
})`;
      const module = {
        exports: {},
        loaded: false,
        id: params.id
      };
      const moduleRequire = (import_module.default.createRequire || import_module.default.createRequireFromPath)(
        __filename
      );
      function throwingRequire(pathToRequire) {
        if (pathToRequire.startsWith("./")) {
          const moduleName = pathToRequire.replace(/^\.\//, "");
          if (!params.cache || !params.cache.has(moduleName)) {
            throw new Error(`Cannot find module '${moduleName}'`);
          }
          return params.cache.get(moduleName).exports;
        }
        return moduleRequire(pathToRequire);
      }
      __name(throwingRequire, "throwingRequire");
      throwingRequire.resolve = moduleRequire.resolve.bind(moduleRequire);
      eval(getModuleCode)(
        module,
        module.exports,
        throwingRequire,
        params.context,
        ...Object.values(params.scopedContext)
      );
      return module.exports;
    }
    __name(requireWithFakeGlobalScope, "requireWithFakeGlobalScope");
    function load(scopedContext = {}) {
      const context = {};
      assign(context, {
        TextDecoder,
        TextEncoder,
        TextEncoderStream: import_web.TextEncoderStream,
        TextDecoderStream: import_web.TextDecoderStream,
        atob,
        btoa,
        performance
      });
      const consoleImpl = requireWithFakeGlobalScope({
        context,
        id: "console.js",
        sourceCode: require_console_js_text(),
        scopedContext
      });
      assign(context, { console: consoleImpl.console });
      const timersImpl = requireWithFakeGlobalScope({
        context,
        id: "timers.js",
        sourceCode: require_timers_js_text(),
        scopedContext
      });
      assign(context, {
        setTimeout: timersImpl.setTimeout,
        setInterval: timersImpl.setInterval
      });
      const eventsImpl = requireWithFakeGlobalScope({
        context,
        id: "events.js",
        sourceCode: require_events_js_text(),
        scopedContext
      });
      assign(context, {
        Event,
        EventTarget,
        FetchEvent: eventsImpl.FetchEvent,
        // @ts-expect-error we need to add this to the type definitions maybe
        PromiseRejectionEvent: eventsImpl.PromiseRejectionEvent
      });
      const streamsImpl = {
        ReadableStream: import_web.ReadableStream,
        ReadableStreamBYOBReader: import_web.ReadableStreamBYOBReader,
        ReadableStreamDefaultReader: import_web.ReadableStreamDefaultReader,
        TransformStream: import_web.TransformStream,
        WritableStream: import_web.WritableStream,
        WritableStreamDefaultWriter: import_web.WritableStreamDefaultWriter
      };
      assign(context, streamsImpl);
      const abortControllerImpl = requireWithFakeGlobalScope({
        context,
        id: "abort-controller.js",
        sourceCode: require_abort_controller_js_text(),
        scopedContext: { ...scopedContext }
      });
      assign(context, {
        AbortController: abortControllerImpl.AbortController,
        AbortSignal: abortControllerImpl.AbortSignal,
        DOMException: abortControllerImpl.DOMException
      });
      const urlImpl = requireWithFakeGlobalScope({
        context,
        id: "url.js",
        sourceCode: require_url_js_text(),
        scopedContext: { ...scopedContext }
      });
      assign(context, {
        URL,
        URLSearchParams,
        URLPattern: urlImpl.URLPattern
      });
      const blobImpl = (() => {
        if (typeof scopedContext.Blob === "function") {
          return { Blob: scopedContext.Blob };
        }
        if (typeof Blob === "function") {
          return { Blob };
        }
        const global2 = { ...streamsImpl, ...scopedContext };
        const globalGlobal = { ...global2, Blob: void 0 };
        Object.setPrototypeOf(globalGlobal, globalThis);
        global2.global = globalGlobal;
        return requireWithFakeGlobalScope({
          context,
          id: "blob.js",
          sourceCode: require_blob_js_text(),
          scopedContext: global2
        });
      })();
      assign(context, {
        Blob: blobImpl.Blob
      });
      const structuredCloneImpl = requireWithFakeGlobalScope({
        id: "structured-clone.js",
        context,
        sourceCode: require_structured_clone_js_text(),
        scopedContext: { ...streamsImpl, ...scopedContext }
      });
      assign(context, {
        structuredClone: structuredCloneImpl.structuredClone
      });
      const fetchImpl = requireWithFakeGlobalScope({
        context,
        id: "fetch.js",
        sourceCode: require_fetch_js_text(),
        cache: /* @__PURE__ */ new Map([
          ["abort-controller", { exports: abortControllerImpl }],
          ["streams", { exports: streamsImpl }]
        ]),
        scopedContext: {
          global: { ...scopedContext },
          ...scopedContext,
          ...urlImpl,
          ...abortControllerImpl,
          ...eventsImpl,
          ...streamsImpl,
          structuredClone: context.structuredClone
        }
      });
      assign(context, {
        fetch: fetchImpl.fetch,
        File: fetchImpl.File,
        FormData: fetchImpl.FormData,
        Headers: fetchImpl.Headers,
        Request: fetchImpl.Request,
        Response: fetchImpl.Response,
        WebSocket: fetchImpl.WebSocket
      });
      const cryptoImpl = getCrypto(context, scopedContext);
      assign(context, {
        crypto: cryptoImpl.crypto,
        Crypto: cryptoImpl.Crypto,
        CryptoKey: cryptoImpl.CryptoKey,
        SubtleCrypto: cryptoImpl.SubtleCrypto
      });
      return context;
    }
    __name(load, "load");
    function getCrypto(context, scopedContext) {
      if (typeof SubtleCrypto !== "undefined" || scopedContext.SubtleCrypto) {
        return {
          crypto: scopedContext.crypto || globalThis.crypto,
          Crypto: scopedContext.Crypto || globalThis.Crypto,
          CryptoKey: scopedContext.CryptoKey || globalThis.CryptoKey,
          SubtleCrypto: scopedContext.SubtleCrypto || globalThis.SubtleCrypto
        };
      } else if (
        // @ts-ignore
        import_crypto.default.webcrypto
      ) {
        const webcrypto = import_crypto.default.webcrypto;
        return {
          crypto: webcrypto,
          Crypto: webcrypto.constructor,
          CryptoKey: webcrypto.CryptoKey,
          SubtleCrypto: webcrypto.subtle.constructor
        };
      }
      return requireWithFakeGlobalScope({
        context,
        id: "crypto.js",
        sourceCode: require_crypto_js_text(),
        scopedContext: {
          ...scopedContext
        }
      });
    }
    __name(getCrypto, "getCrypto");
    function assign(context, additions) {
      Object.assign(context, additions);
    }
    __name(assign, "assign");
  }
});

// ../primitives/dist/index.js
var require_dist = __commonJS({
  "../primitives/dist/index.js"(exports2, module2) {
    "use strict";
    var import_load = require_load();
    module2.exports = (0, import_load.load)({ WeakRef: global.WeakRef });
  }
});

// src/index.ts
var src_exports = {};
__export2(src_exports, {
  buildToFetchEvent: () => buildToFetchEvent,
  buildToHeaders: () => buildToHeaders,
  buildToNodeHandler: () => buildToNodeHandler,
  buildToReadableStream: () => buildToReadableStream,
  buildToRequest: () => buildToRequest,
  mergeIntoServerResponse: () => mergeIntoServerResponse,
  toOutgoingHeaders: () => toOutgoingHeaders,
  toToReadable: () => toToReadable
});
module.exports = __toCommonJS2(src_exports);

// src/node-to-edge/fetch-event.ts
function buildToFetchEvent(dependencies) {
  return function toFetchEvent(request) {
    return new dependencies.FetchEvent(request);
  };
}

// src/node-to-edge/headers.ts
function buildToHeaders({ Headers: Headers2 }) {
  return function toHeaders(nodeHeaders) {
    const headers = new Headers2();
    for (let [key, value] of Object.entries(nodeHeaders)) {
      const values = Array.isArray(value) ? value : [value];
      for (let v of values) {
        if (v !== void 0) {
          headers.append(key, v);
        }
      }
    }
    return headers;
  };
}

// src/node-to-edge/stream.ts
function buildToReadableStream(dependencies) {
  const { ReadableStream, Uint8Array: Uint8Array2 } = dependencies;
  return function toReadableStream(stream) {
    return new ReadableStream({
      start(controller) {
        stream.on("data", (chunk) => {
          controller.enqueue(new Uint8Array2([...new Uint8Array2(chunk)]));
        });
        stream.on("end", () => {
          controller.close();
        });
        stream.on("error", (err) => {
          controller.error(err);
        });
      }
    });
  };
}

// src/node-to-edge/request.ts
function buildToRequest(dependencies) {
  const toHeaders = buildToHeaders(dependencies);
  const toReadableStream = buildToReadableStream(dependencies);
  const { Request } = dependencies;
  return function toRequest(request, options) {
    var _a, _b;
    const base = computeOrigin(request, options.defaultOrigin);
    return new Request(
      String(
        ((_a = request.url) == null ? void 0 : _a.startsWith("//")) ? new URL(base + request.url) : new URL(request.url || "/", base)
      ),
      {
        method: request.method,
        headers: toHeaders(request.headers),
        body: !["HEAD", "GET"].includes((_b = request.method) != null ? _b : "") ? toReadableStream(request) : null
      }
    );
  };
}
function computeOrigin({ headers }, defaultOrigin) {
  const authority = headers.host;
  if (!authority) {
    return defaultOrigin;
  }
  const [, port] = authority.split(":");
  return `${port === "443" ? "https" : "http"}://${authority}`;
}

// src/edge-to-node/headers.ts
var import_primitives = __toESM2(require_dist());
function toOutgoingHeaders(headers) {
  const outputHeaders = {};
  if (headers) {
    const _headers = new import_primitives.Headers(headers).entries();
    for (const [name, value] of _headers) {
      outputHeaders[name] = name === "set-cookie" ? headers.getSetCookie() : value;
    }
  }
  return outputHeaders;
}
function mergeIntoServerResponse(headers, serverResponse) {
  for (const [name, value] of Object.entries(headers)) {
    if (value !== void 0) {
      serverResponse.setHeader(name, value);
    }
  }
}

// src/edge-to-node/stream.ts
var import_node_stream = require("stream");
function toToReadable(webStream, options = {}) {
  const reader = webStream.getReader();
  let closed = false;
  const { highWaterMark, encoding, objectMode = false, signal } = options;
  const readable = new import_node_stream.Readable({
    objectMode,
    highWaterMark,
    encoding,
    // @ts-ignore signal exist only since Node@17
    signal,
    read() {
      reader.read().then(
        (chunk) => {
          if (chunk.done) {
            readable.push(null);
          } else {
            readable.push(chunk.value);
          }
        },
        (error) => readable.destroy(error)
      );
    },
    destroy(error, callback) {
      function done() {
        try {
          callback(error);
        } catch (error2) {
          process.nextTick(() => {
            throw error2;
          });
        }
      }
      if (!closed) {
        reader.cancel(error).then(done, done);
        return;
      }
      done();
    }
  });
  reader.closed.then(
    () => {
      closed = true;
    },
    (error) => {
      closed = true;
      readable.destroy(error);
    }
  );
  return readable;
}

// src/edge-to-node/handler.ts
function buildToNodeHandler(dependencies, options) {
  const toRequest = buildToRequest(dependencies);
  const toFetchEvent = buildToFetchEvent(dependencies);
  return function toNodeHandler(webHandler) {
    return (incomingMessage, serverResponse) => {
      const request = toRequest(incomingMessage, options);
      const maybePromise = webHandler(request, toFetchEvent(request));
      if (maybePromise instanceof Promise) {
        maybePromise.then(
          (response) => toServerResponse(response, serverResponse)
        );
      } else {
        toServerResponse(maybePromise, serverResponse);
      }
    };
  };
}
function toServerResponse(webResponse, serverResponse) {
  if (!webResponse) {
    serverResponse.end();
    return;
  }
  mergeIntoServerResponse(
    toOutgoingHeaders(webResponse.headers),
    serverResponse
  );
  serverResponse.statusCode = webResponse.status;
  serverResponse.statusMessage = webResponse.statusText;
  if (!webResponse.body) {
    serverResponse.end();
    return;
  }
  toToReadable(webResponse.body).pipe(serverResponse);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  buildToFetchEvent,
  buildToHeaders,
  buildToNodeHandler,
  buildToReadableStream,
  buildToRequest,
  mergeIntoServerResponse,
  toOutgoingHeaders,
  toToReadable
});
