@ms-cloudpack/link-proxy 0.2.77 → 0.2.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"lib/index.js","mappings":";wIAIgC,SAASA,EAAaC,EAAMC,EAAaC,GACrE,SAASC,EAAKC,EAAMC,GAWhB,GAVKD,EAAKE,MACNC,OAAOC,eAAeJ,EAAM,OAAQ,CAChCK,MAAO,CACHJ,MACAK,OAAQC,EACRC,OAAQ,IAAIC,KAEhBC,YAAY,IAGhBV,EAAKE,KAAKM,OAAOG,IAAIf,GACrB,OAEJI,EAAKE,KAAKM,OAAOI,IAAIhB,GACrBC,EAAYG,EAAMC,GAElB,MAAMY,EAAQN,EAAEO,UACVC,EAAOZ,OAAOY,KAAKF,GACzB,IAAK,IAAIG,EAAI,EAAGA,EAAID,EAAKE,OAAQD,IAAK,CAClC,MAAME,EAAIH,EAAKC,GACTE,KAAKlB,IACPA,EAAKkB,GAAKL,EAAMK,GAAGC,KAAKnB,GAEhC,CACJ,CAEA,MAAMoB,EAAStB,GAAQsB,QAAUjB,OACjC,MAAMkB,UAAmBD,GAGzB,SAASb,EAAEN,GACP,IAAIqB,EACJ,MAAMtB,EAAOF,GAAQsB,OAAS,IAAIC,EAAeE,KACjDxB,EAAKC,EAAMC,IACVqB,EAAKtB,EAAKE,MAAMsB,WAAaF,EAAGE,SAAW,IAC5C,IAAK,MAAMC,KAAMzB,EAAKE,KAAKsB,SACvBC,IAEJ,OAAOzB,CACX,CAUA,OApBAG,OAAOC,eAAeiB,EAAY,OAAQ,CAAEhB,MAAOT,IAWnDO,OAAOC,eAAeG,EAAG,OAAQ,CAAEF,MAAON,IAC1CI,OAAOC,eAAeG,EAAGmB,OAAOC,YAAa,CACzCtB,MAAQL,MACAF,GAAQsB,QAAUpB,aAAgBF,EAAOsB,SAEtCpB,GAAME,MAAMM,QAAQG,IAAIf,KAGvCO,OAAOC,eAAeG,EAAG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,EAC9B,GAAID,EACF,IAAK,IAAI38B,EAAI,EAAGA,EAAIK,KAAKN,OAAQC,IAAK,CACpC,IAAIgT,EAAK3S,KAAKL,GAAG,GACP,MAANgT,IACF4pB,EAAuB5pB,IAAM,EAEjC,CAEF,IAAK,IAAI6pB,EAAK,EAAGA,EAAKH,EAAQ38B,OAAQ88B,IAAM,CAC1C,IAAInuB,EAAO,GAAGmV,OAAO6Y,EAAQG,IACzBF,GAAUC,EAAuBluB,EAAK,WAGrB,IAAVwsB,SACc,IAAZxsB,EAAK,KAGdA,EAAK,GAAK,SAASmV,OAAOnV,EAAK,GAAG3O,OAAS,EAAI,IAAI8jB,OAAOnV,EAAK,IAAM,GAAI,MAAMmV,OAAOnV,EAAK,GAAI,MAF/FA,EAAK,GAAKwsB,GAMVH,IACGrsB,EAAK,IAGRA,EAAK,GAAK,UAAUmV,OAAOnV,EAAK,GAAI,MAAMmV,OAAOnV,EAAK,GAAI,KAC1DA,EAAK,GAAKqsB,GAHVrsB,EAAK,GAAKqsB,GAMVE,IACGvsB,EAAK,IAGRA,EAAK,GAAK,cAAcmV,OAAOnV,EAAK,GAAI,OAAOmV,OAAOnV,EAAK,GAAI,KAC/DA,EAAK,GAAKusB,GAHVvsB,EAAK,GAAK,GAAGmV,OAAOoX,IAMxBN,EAAKhxB,KAAK+E,GACZ,CACF,EACOisB,CACT,C,UC3EApe,EAAOT,QANP,SAA4BlL,GAC1B,IAAIjC,EAAUymB,SAAS0H,cAAc,SAGrC,OAFAlsB,EAAQikB,cAAclmB,EAASiC,EAAQmsB,YACvCnsB,EAAQkkB,OAAOnmB,EAASiC,EAAQA,SACzBjC,CACT,C","sources":["webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/core/core.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/core/util.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/core/errors.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/core/parse.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/core/regexes.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/core/versions.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/core/schemas.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/core/registries.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/mini/schemas.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/core/api.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/utilities/matchingZodObject.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.1.13-21040ff0ef/package/v4/locales/en.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskStats.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/Timing.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskMessageLocation.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskMessage.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskDescription.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskList.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/NotifyLinkChangeInput.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/LinkPath.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/GetLinkConfigOutput.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/data/busSources.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/PackageUpdatePayload.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/objectSpread2-BvkFp-_Y.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-439526b375/package/dist/observable-UMO3vUa_.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/splitLink-B7Cuf2c_.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-439526b375/package/dist/utils-CLZnJdb_.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/TRPCClientError-CjKyS10w.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/unstable-internals-Bg7n9BBj.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/httpUtils-Dv57hbOd.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/httpLink-DCFpUmZF.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-439526b375/package/dist/getErrorShape-BH60iMC2.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-439526b375/package/dist/tracked-DBSMdVzR.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/httpBatchLink-BOe5aCcR.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-439526b375/package/dist/observable-CUiPknO-.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/loggerLink-ineCN1PO.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/wsLink-CatceK3c.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-04602f74ec/package/dist/index.mjs","webpack://@ms-cloudpack/link-proxy/../api-server/lib/trpc/createCloudpackClient.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/utilities/ensureWebsocketDefined.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/utilities/ignoreSelfSignedCertErrors.js","webpack://@ms-cloudpack/link-proxy/../path-string-parsing/lib/makeUrl.js","webpack://@ms-cloudpack/link-proxy/./src/UIManager.module.css?4067","webpack://@ms-cloudpack/link-proxy/./src/UIManager.ts","webpack://@ms-cloudpack/link-proxy/./src/ConnectionManager.ts","webpack://@ms-cloudpack/link-proxy/./src/isApiServerActive.ts","webpack://@ms-cloudpack/link-proxy/./src/index.ts","webpack://@ms-cloudpack/link-proxy/./src/LinkProxyApp.ts","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/styleTagTransform.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/insertBySelector.js","webpack://@ms-cloudpack/link-proxy/./src/UIManager.module.css","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/injectStylesIntoStyleTag.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/styleDomAPI.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/runtime/sourceMaps.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/setAttributesWithoutAttributes.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/runtime/api.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/insertStyleElement.js"],"sourcesContent":["/** A special constant with type `never` */\nexport const NEVER = Object.freeze({\n status: \"aborted\",\n});\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {\n function init(inst, def) {\n if (!inst._zod) {\n Object.defineProperty(inst, \"_zod\", {\n value: {\n def,\n constr: _,\n traits: new Set(),\n },\n enumerable: false,\n });\n }\n if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n // support prototype modifications\n const proto = _.prototype;\n const keys = Object.keys(proto);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n if (!(k in inst)) {\n inst[k] = proto[k].bind(inst);\n }\n }\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n var _a;\n const inst = params?.Parent ? new Definition() : this;\n init(inst, def);\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n for (const fn of inst._zod.deferred) {\n fn();\n }\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport class $ZodEncodeError extends Error {\n constructor(name) {\n super(`Encountered unidirectional transform during encode: ${name}`);\n this.name = \"ZodEncodeError\";\n }\n}\nexport const globalConfig = {};\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error();\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepString = step.toString();\n let stepDecCount = (stepString.split(\".\")[1] || \"\").length;\n if (stepDecCount === 0 && /\\d?e-\\d?/.test(stepString)) {\n const match = stepString.match(/\\d?e-(\\d?)/);\n if (match?.[1]) {\n stepDecCount = Number.parseInt(match[1]);\n }\n }\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nconst EVALUATING = Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n newShape[key] = currDef.shape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = { ...schema._zod.def.shape };\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\"Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n const def = {\n ...schema._zod.def,\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n checks: schema._zod.def.checks,\n };\n return clone(schema, def);\n}\nexport function merge(a, b) {\n const def = mergeDefs(a._zod.def, {\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: [], // delete existing checks\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);\n Object.defineProperty(inst, \"toString\", {\n value: () => inst.message,\n enumerable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues });\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues });\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, issue.path));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\nexport const _encode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parse(_Err)(schema, value, ctx);\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => (schema, value, _ctx) => {\n return _parse(_Err)(schema, value, _ctx);\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parseAsync(_Err)(schema, value, ctx);\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _parseAsync(_Err)(schema, value, _ctx);\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n","import * as util from \"./util.js\";\nexport const cuid = /^[cC][^\\s-]{8,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;\nexport const mac = (delimiter) => {\n const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\nexport const e164 = /^\\+(?:[0-9]){6,14}[0-9]$/;\n// const dateSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateSource = `(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n const regex = typeof args.precision === \"number\"\n ? args.precision === -1\n ? `${hhmm}`\n : args.precision === 0\n ? `${hhmm}:[0-5]\\\\d`\n : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n const time = timeSource({ precision: args.precision });\n const opts = [\"Z\"];\n if (args.local)\n opts.push(\"\");\n // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n if (args.offset)\n opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n const timeRegex = `${time}(?:${opts.join(\"|\")})`;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n","export const version = {\n major: 4,\n minor: 1,\n patch: 13,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync, safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const checks = [...(inst._zod.def.checks ?? [])];\n // if inst is itself a checks.$ZodCheck, run it as a check\n if (inst._zod.traits.has(\"$ZodCheck\")) {\n checks.unshift(inst);\n }\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer\n // inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n const shouldRun = ch._zod.def.when(payload);\n if (!shouldRun)\n continue;\n }\n else if (isAborted) {\n continue;\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n // const handleChecksResult = (\n // checkResult: ParsePayload,\n // originalResult: ParsePayload,\n // ctx: ParseContextInternal\n // ): util.MaybeAsync<ParsePayload> => {\n // // if the checks mutated the value && there are no issues, re-parse the result\n // if (checkResult.value !== originalResult.value && !checkResult.issues.length)\n // return inst._zod.parse(checkResult, ctx);\n // return originalResult;\n // };\n const handleCanaryResult = (canary, payload, ctx) => {\n // abort if the canary is aborted\n if (util.aborted(canary)) {\n canary.aborted = true;\n return canary;\n }\n // run checks first, then\n const checkResult = runChecks(payload, checks, ctx);\n if (checkResult instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));\n }\n return inst._zod.parse(checkResult, ctx);\n };\n inst._zod.run = (payload, ctx) => {\n if (ctx.skipChecks) {\n return inst._zod.parse(payload, ctx);\n }\n if (ctx.direction === \"backward\") {\n // run canary\n // initial pass (no checks)\n const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });\n if (canary instanceof Promise) {\n return canary.then((canary) => {\n return handleCanaryResult(canary, payload, ctx);\n });\n }\n return handleCanaryResult(canary, payload, ctx);\n }\n // forward\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n inst[\"~standard\"] = {\n validate: (value) => {\n try {\n const r = safeParse(inst, value);\n return r.success ? { value: r.data } : { issues: r.error?.issues };\n }\n catch (_) {\n return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));\n }\n },\n vendor: \"zod\",\n version: 1,\n };\n});\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n // Trim whitespace from input\n const trimmed = payload.value.trim();\n // @ts-ignore\n const url = new URL(trimmed);\n if (def.hostname) {\n def.hostname.lastIndex = 0;\n if (!def.hostname.test(url.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: def.hostname.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n if (def.protocol) {\n def.protocol.lastIndex = 0;\n if (!def.protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n // Set the output value based on normalize flag\n if (def.normalize) {\n // Use normalized URL\n payload.value = url.href;\n }\n else {\n // Preserve the original input (trimmed)\n payload.value = trimmed;\n }\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.nanoid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv4`;\n});\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv6`;\n inst._zod.check = (payload) => {\n try {\n // @ts-ignore\n new URL(`http://[${payload.value}]`);\n // return;\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodMAC = /*@__PURE__*/ core.$constructor(\"$ZodMAC\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.mac(def.delimiter));\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `mac`;\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n const parts = payload.value.split(\"/\");\n try {\n if (parts.length !== 2)\n throw new Error();\n const [address, prefix] = parts;\n if (!prefix)\n throw new Error();\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n throw new Error();\n if (prefixNum < 0 || prefixNum > 128)\n throw new Error();\n // @ts-ignore\n new URL(`http://[${address}]`);\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n if (data.length % 4 !== 0)\n return false;\n try {\n // @ts-ignore\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64\";\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64URL(data) {\n if (!regexes.base64url.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64url);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64url\";\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n if (!header)\n return false;\n // @ts-ignore\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCustomStringFormat\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (def.fn(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? \"Infinity\"\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumberFormat\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checks\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigIntFormat\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = Array(input.length);\n const proms = [];\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n});\nfunction handlePropertyResult(result, final, key, input) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (result.value === undefined) {\n if (key in input) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n for (const k of keys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${k}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n keys,\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst) {\n const unrecognized = [];\n // iterate over input keys\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n for (const key in input) {\n if (keySet.has(key))\n continue;\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input)));\n }\n else {\n handlePropertyResult(r, payload, key, input);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodType.init(inst, def);\n // const sh = def.shape;\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n if (!desc?.get) {\n const sh = def.shape;\n Object.defineProperty(def, \"shape\", {\n get: () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", {\n value: newSh,\n });\n return newSh;\n },\n });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazy(inst._zod, \"propValues\", () => {\n const shape = def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n propValues[key] ?? (propValues[key] = new Set());\n for (const v of field.values)\n propValues[key].add(v);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = {};\n const proms = [];\n const shape = value.shape;\n for (const key of value.keys) {\n const el = shape[key];\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input)));\n }\n else {\n handlePropertyResult(r, payload, key, input);\n }\n }\n if (!catchall) {\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);\n };\n});\nexport const $ZodObjectJIT = /*@__PURE__*/ core.$constructor(\"$ZodObjectJIT\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodObject.init(inst, def);\n const superParse = inst._zod.parse;\n const _normalized = util.cached(() => normalizeDef(def));\n const generateFastpass = (shape) => {\n const doc = new Doc([\"shape\", \"payload\", \"ctx\"]);\n const normalized = _normalized.value;\n const parseStr = (key) => {\n const k = util.esc(key);\n return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n };\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.keys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(`const newResult = {};`);\n for (const key of normalized.keys) {\n const id = ids[key];\n const k = util.esc(key);\n doc.write(`const ${id} = ${parseStr(key)};`);\n doc.write(`\n if (${id}.issues.length) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n \n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n const fn = doc.compile();\n return (payload, ctx) => fn(shape, payload, ctx);\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n if (!catchall)\n return payload;\n return handleCatchall([], input, payload, ctx, value, inst);\n }\n return superParse(payload, ctx);\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n const nonaborted = results.filter((r) => !util.aborted(r));\n if (nonaborted.length === 1) {\n final.value = nonaborted[0].value;\n return nonaborted[0];\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.options.some((o) => o._zod.optin === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"optout\", () => def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"values\", () => {\n if (def.options.every((o) => o._zod.values)) {\n return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n if (def.options.every((o) => o._zod.pattern)) {\n const patterns = def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazy(inst._zod, \"propValues\", () => {\n const propValues = {};\n for (const option of def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const [k, v] of Object.entries(pv)) {\n if (!propValues[k])\n propValues[k] = new Set();\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n return propValues;\n });\n const disc = util.cached(() => {\n const opts = def.options;\n const map = new Map();\n for (const o of opts) {\n const values = o._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n for (const v of values) {\n if (map.has(v)) {\n throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n }\n map.set(v, o);\n }\n }\n return map;\n });\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const opt = disc.value.get(input?.[def.discriminator]);\n if (opt) {\n return opt._zod.run(payload, ctx);\n }\n if (def.unionFallback) {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n discriminator: def.discriminator,\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nfunction mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n if (left.issues.length) {\n result.issues.push(...left.issues);\n }\n if (right.issues.length) {\n result.issues.push(...right.issues);\n }\n if (util.aborted(result))\n return result;\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = [];\n const proms = [];\n const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== \"optional\");\n const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;\n if (!def.rest) {\n const tooBig = input.length > items.length;\n const tooSmall = input.length < optStart - 1;\n if (tooBig || tooSmall) {\n payload.issues.push({\n ...(tooBig ? { code: \"too_big\", maximum: items.length } : { code: \"too_small\", minimum: items.length }),\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n }\n let i = -1;\n for (const item of items) {\n i++;\n if (i >= input.length)\n if (i >= optStart)\n continue;\n const result = item._zod.run({\n value: input[i],\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n if (def.rest) {\n const rest = input.slice(items.length);\n for (const el of rest) {\n i++;\n const result = def.rest._zod.run({\n value: el,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n const values = def.keyType._zod.values;\n if (values) {\n payload.value = {};\n const recordKeys = new Set();\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n recordKeys.add(typeof key === \"number\" ? key.toString() : key);\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n });\n }\n }\n else {\n payload.value = {};\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (keyResult.issues.length) {\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n payload.value[keyResult.value] = keyResult.value;\n continue;\n }\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = new Map();\n for (const [key, value] of input) {\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n code: \"invalid_key\",\n origin: \"map\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = new Set();\n for (const item of input) {\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n const valuesSet = new Set(values);\n inst._zod.values = valuesSet;\n inst._zod.pattern = new RegExp(`^(${values\n .filter((k) => util.propertyKeyTypes.has(typeof k))\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o.toString()))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (valuesSet.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n if (def.values.length === 0) {\n throw new Error(\"Cannot create literal schema with no valid values\");\n }\n const values = new Set(def.values);\n inst._zod.values = values;\n inst._zod.pattern = new RegExp(`^(${def.values\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n // @ts-ignore\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n const _out = def.transform(payload.value, payload);\n if (ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n return payload;\n };\n});\nfunction handleOptionalResult(result, input) {\n if (result.issues.length && input === undefined) {\n return { issues: [], value: undefined };\n }\n return result;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (def.innerType._zod.optin === \"optional\") {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise)\n return result.then((r) => handleOptionalResult(r, payload.value));\n return handleOptionalResult(result, payload.value);\n }\n if (payload.value === undefined) {\n return payload;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n // Forward direction (decode): allow null to pass through\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply defaults for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault returns the default value immediately in forward direction.\n * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe. */\n return payload;\n }\n // Forward direction: continue with default handling\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply prefault for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n const v = def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(\"ZodSuccess\");\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply catch logic\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n });\n }\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handlePipeResult(right, def.in, ctx));\n }\n return handlePipeResult(right, def.in, ctx);\n }\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def.out, ctx));\n }\n return handlePipeResult(left, def.out, ctx);\n };\n});\nfunction handlePipeResult(left, next, ctx) {\n if (left.issues.length) {\n // prevent further checks\n left.aborted = true;\n return left;\n }\n return next._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodCodec = /*@__PURE__*/ core.$constructor(\"$ZodCodec\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handleCodecAResult(left, def, ctx));\n }\n return handleCodecAResult(left, def, ctx);\n }\n else {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handleCodecAResult(right, def, ctx));\n }\n return handleCodecAResult(right, def, ctx);\n }\n };\n});\nfunction handleCodecAResult(result, def, ctx) {\n if (result.issues.length) {\n // prevent further checks\n result.aborted = true;\n return result;\n }\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const transformed = def.transform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));\n }\n return handleCodecTxResult(result, transformed, def.out, ctx);\n }\n else {\n const transformed = def.reverseTransform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));\n }\n return handleCodecTxResult(result, transformed, def.in, ctx);\n }\n}\nfunction handleCodecTxResult(left, value, nextSchema, ctx) {\n // Check if transform added any issues\n if (left.issues.length) {\n left.aborted = true;\n return left;\n }\n return nextSchema._zod.run({ value, issues: left.issues }, ctx);\n}\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"propValues\", () => def.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType?._zod?.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType?._zod?.optout);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n payload.value = Object.freeze(payload.value);\n return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (typeof part === \"object\" && part !== null) {\n // is Zod schema\n if (!part._zod.pattern) {\n // if (!source)\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n if (!source)\n throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n regexParts.push(source.slice(start, end));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"template_literal\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: def.format ?? \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodFunction = /*@__PURE__*/ core.$constructor(\"$ZodFunction\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._def = def;\n inst._zod.def = def;\n inst.implement = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implement() must be called with a function\");\n }\n return function (...args) {\n const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;\n const result = Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return parse(inst._def.output, result);\n }\n return result;\n };\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return async function (...args) {\n const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;\n const result = await Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return await parseAsync(inst._def.output, result);\n }\n return result;\n };\n };\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"function\") {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"function\",\n input: payload.value,\n inst,\n });\n return payload;\n }\n // Check if output is a promise type to determine if we should use async implementation\n const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === \"promise\";\n if (hasPromiseOutput) {\n payload.value = inst.implementAsync(payload.value);\n }\n else {\n payload.value = inst.implement(payload.value);\n }\n return payload;\n };\n inst.input = (...args) => {\n const F = inst.constructor;\n if (Array.isArray(args[0])) {\n return new F({\n type: \"function\",\n input: new $ZodTuple({\n type: \"tuple\",\n items: args[0],\n rest: args[1],\n }),\n output: inst._def.output,\n });\n }\n return new F({\n type: \"function\",\n input: args[0],\n output: inst._def.output,\n });\n };\n inst.output = (output) => {\n const F = inst.constructor;\n return new F({\n type: \"function\",\n input: inst._def.input,\n output,\n });\n };\n return inst;\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n // let _innerType!: any;\n // util.defineLazy(def, \"getter\", () => {\n // if (!_innerType) {\n // _innerType = def.getter();\n // }\n // return () => _innerType;\n // });\n util.defineLazy(inst._zod, \"innerType\", () => def.getter());\n util.defineLazy(inst._zod, \"pattern\", () => inst._zod.innerType?._zod?.pattern);\n util.defineLazy(inst._zod, \"propValues\", () => inst._zod.innerType?._zod?.propValues);\n util.defineLazy(inst._zod, \"optin\", () => inst._zod.innerType?._zod?.optin ?? undefined);\n util.defineLazy(inst._zod, \"optout\", () => inst._zod.innerType?._zod?.optout ?? undefined);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n","var _a;\nexport const $output = Symbol(\"ZodOutput\");\nexport const $input = Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n if (this._idmap.has(meta.id)) {\n throw new Error(`ID ${meta.id} already exists in the registry`);\n }\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n clear() {\n this._map = new WeakMap();\n this._idmap = new Map();\n return this;\n }\n remove(schema) {\n const meta = this._map.get(schema);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.delete(meta.id);\n }\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n const f = { ...pm, ...this._map.get(schema) };\n return Object.keys(f).length ? f : undefined;\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\n(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());\nexport const globalRegistry = globalThis.__zod_globalRegistry;\n","import * as core from \"../core/index.js\";\nimport { util } from \"../core/index.js\";\nimport * as parse from \"./parse.js\";\nexport const ZodMiniType = /*@__PURE__*/ core.$constructor(\"ZodMiniType\", (inst, def) => {\n if (!inst._zod)\n throw new Error(\"Uninitialized schema in ZodMiniType.\");\n core.$ZodType.init(inst, def);\n inst.def = def;\n inst.type = def.type;\n inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });\n inst.safeParse = (data, params) => parse.safeParse(inst, data, params);\n inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });\n inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);\n inst.check = (...checks) => {\n return inst.clone({\n ...def,\n checks: [\n ...(def.checks ?? []),\n ...checks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }\n // { parent: true }\n );\n };\n inst.clone = (_def, params) => core.clone(inst, _def, params);\n inst.brand = () => inst;\n inst.register = ((reg, meta) => {\n reg.add(inst, meta);\n return inst;\n });\n});\nexport const ZodMiniString = /*@__PURE__*/ core.$constructor(\"ZodMiniString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function string(params) {\n return core._string(ZodMiniString, params);\n}\nexport const ZodMiniStringFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n ZodMiniString.init(inst, def);\n});\nexport const ZodMiniEmail = /*@__PURE__*/ core.$constructor(\"ZodMiniEmail\", (inst, def) => {\n core.$ZodEmail.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function email(params) {\n return core._email(ZodMiniEmail, params);\n}\nexport const ZodMiniGUID = /*@__PURE__*/ core.$constructor(\"ZodMiniGUID\", (inst, def) => {\n core.$ZodGUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function guid(params) {\n return core._guid(ZodMiniGUID, params);\n}\nexport const ZodMiniUUID = /*@__PURE__*/ core.$constructor(\"ZodMiniUUID\", (inst, def) => {\n core.$ZodUUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n return core._uuid(ZodMiniUUID, params);\n}\nexport function uuidv4(params) {\n return core._uuidv4(ZodMiniUUID, params);\n}\n// ZodMiniUUIDv6\nexport function uuidv6(params) {\n return core._uuidv6(ZodMiniUUID, params);\n}\n// ZodMiniUUIDv7\nexport function uuidv7(params) {\n return core._uuidv7(ZodMiniUUID, params);\n}\nexport const ZodMiniURL = /*@__PURE__*/ core.$constructor(\"ZodMiniURL\", (inst, def) => {\n core.$ZodURL.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function url(params) {\n return core._url(ZodMiniURL, params);\n}\nexport function httpUrl(params) {\n return core._url(ZodMiniURL, {\n protocol: /^https?$/,\n hostname: core.regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniEmoji = /*@__PURE__*/ core.$constructor(\"ZodMiniEmoji\", (inst, def) => {\n core.$ZodEmoji.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n return core._emoji(ZodMiniEmoji, params);\n}\nexport const ZodMiniNanoID = /*@__PURE__*/ core.$constructor(\"ZodMiniNanoID\", (inst, def) => {\n core.$ZodNanoID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n return core._nanoid(ZodMiniNanoID, params);\n}\nexport const ZodMiniCUID = /*@__PURE__*/ core.$constructor(\"ZodMiniCUID\", (inst, def) => {\n core.$ZodCUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function cuid(params) {\n return core._cuid(ZodMiniCUID, params);\n}\nexport const ZodMiniCUID2 = /*@__PURE__*/ core.$constructor(\"ZodMiniCUID2\", (inst, def) => {\n core.$ZodCUID2.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n return core._cuid2(ZodMiniCUID2, params);\n}\nexport const ZodMiniULID = /*@__PURE__*/ core.$constructor(\"ZodMiniULID\", (inst, def) => {\n core.$ZodULID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n return core._ulid(ZodMiniULID, params);\n}\nexport const ZodMiniXID = /*@__PURE__*/ core.$constructor(\"ZodMiniXID\", (inst, def) => {\n core.$ZodXID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function xid(params) {\n return core._xid(ZodMiniXID, params);\n}\nexport const ZodMiniKSUID = /*@__PURE__*/ core.$constructor(\"ZodMiniKSUID\", (inst, def) => {\n core.$ZodKSUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n return core._ksuid(ZodMiniKSUID, params);\n}\nexport const ZodMiniIPv4 = /*@__PURE__*/ core.$constructor(\"ZodMiniIPv4\", (inst, def) => {\n core.$ZodIPv4.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n return core._ipv4(ZodMiniIPv4, params);\n}\nexport const ZodMiniIPv6 = /*@__PURE__*/ core.$constructor(\"ZodMiniIPv6\", (inst, def) => {\n core.$ZodIPv6.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n return core._ipv6(ZodMiniIPv6, params);\n}\nexport const ZodMiniCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodMiniCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n return core._cidrv4(ZodMiniCIDRv4, params);\n}\nexport const ZodMiniCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodMiniCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n return core._cidrv6(ZodMiniCIDRv6, params);\n}\nexport const ZodMiniMAC = /*@__PURE__*/ core.$constructor(\"ZodMiniMAC\", (inst, def) => {\n core.$ZodMAC.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function mac(params) {\n return core._mac(ZodMiniMAC, params);\n}\nexport const ZodMiniBase64 = /*@__PURE__*/ core.$constructor(\"ZodMiniBase64\", (inst, def) => {\n core.$ZodBase64.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function base64(params) {\n return core._base64(ZodMiniBase64, params);\n}\nexport const ZodMiniBase64URL = /*@__PURE__*/ core.$constructor(\"ZodMiniBase64URL\", (inst, def) => {\n core.$ZodBase64URL.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n return core._base64url(ZodMiniBase64URL, params);\n}\nexport const ZodMiniE164 = /*@__PURE__*/ core.$constructor(\"ZodMiniE164\", (inst, def) => {\n core.$ZodE164.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function e164(params) {\n return core._e164(ZodMiniE164, params);\n}\nexport const ZodMiniJWT = /*@__PURE__*/ core.$constructor(\"ZodMiniJWT\", (inst, def) => {\n core.$ZodJWT.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n return core._jwt(ZodMiniJWT, params);\n}\nexport const ZodMiniCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniCustomStringFormat\", (inst, def) => {\n core.$ZodCustomStringFormat.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params);\n}\nexport function hostname(_params) {\n return core._stringFormat(ZodMiniCustomStringFormat, \"hostname\", core.regexes.hostname, _params);\n}\nexport function hex(_params) {\n return core._stringFormat(ZodMiniCustomStringFormat, \"hex\", core.regexes.hex, _params);\n}\nexport function hash(alg, params) {\n const enc = params?.enc ?? \"hex\";\n const format = `${alg}_${enc}`;\n const regex = core.regexes[format];\n // check for unrecognized format\n if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodMiniCustomStringFormat, format, regex, params);\n}\nexport const ZodMiniNumber = /*@__PURE__*/ core.$constructor(\"ZodMiniNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function number(params) {\n return core._number(ZodMiniNumber, params);\n}\nexport const ZodMiniNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodMiniNumber.init(inst, def);\n});\n// int\nexport function int(params) {\n return core._int(ZodMiniNumberFormat, params);\n}\n// float32\nexport function float32(params) {\n return core._float32(ZodMiniNumberFormat, params);\n}\n// float64\nexport function float64(params) {\n return core._float64(ZodMiniNumberFormat, params);\n}\n// int32\nexport function int32(params) {\n return core._int32(ZodMiniNumberFormat, params);\n}\n// uint32\nexport function uint32(params) {\n return core._uint32(ZodMiniNumberFormat, params);\n}\nexport const ZodMiniBoolean = /*@__PURE__*/ core.$constructor(\"ZodMiniBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function boolean(params) {\n return core._boolean(ZodMiniBoolean, params);\n}\nexport const ZodMiniBigInt = /*@__PURE__*/ core.$constructor(\"ZodMiniBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function bigint(params) {\n return core._bigint(ZodMiniBigInt, params);\n}\nexport const ZodMiniBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodMiniBigInt.init(inst, def);\n});\n// int64\nexport function int64(params) {\n return core._int64(ZodMiniBigIntFormat, params);\n}\n// uint64\nexport function uint64(params) {\n return core._uint64(ZodMiniBigIntFormat, params);\n}\nexport const ZodMiniSymbol = /*@__PURE__*/ core.$constructor(\"ZodMiniSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function symbol(params) {\n return core._symbol(ZodMiniSymbol, params);\n}\nexport const ZodMiniUndefined = /*@__PURE__*/ core.$constructor(\"ZodMiniUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nfunction _undefined(params) {\n return core._undefined(ZodMiniUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodMiniNull = /*@__PURE__*/ core.$constructor(\"ZodMiniNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nfunction _null(params) {\n return core._null(ZodMiniNull, params);\n}\nexport { _null as null };\nexport const ZodMiniAny = /*@__PURE__*/ core.$constructor(\"ZodMiniAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function any() {\n return core._any(ZodMiniAny);\n}\nexport const ZodMiniUnknown = /*@__PURE__*/ core.$constructor(\"ZodMiniUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function unknown() {\n return core._unknown(ZodMiniUnknown);\n}\nexport const ZodMiniNever = /*@__PURE__*/ core.$constructor(\"ZodMiniNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function never(params) {\n return core._never(ZodMiniNever, params);\n}\nexport const ZodMiniVoid = /*@__PURE__*/ core.$constructor(\"ZodMiniVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nfunction _void(params) {\n return core._void(ZodMiniVoid, params);\n}\nexport { _void as void };\nexport const ZodMiniDate = /*@__PURE__*/ core.$constructor(\"ZodMiniDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function date(params) {\n return core._date(ZodMiniDate, params);\n}\nexport const ZodMiniArray = /*@__PURE__*/ core.$constructor(\"ZodMiniArray\", (inst, def) => {\n core.$ZodArray.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function array(element, params) {\n return new ZodMiniArray({\n type: \"array\",\n element: element,\n ...util.normalizeParams(params),\n });\n}\n// .keyof\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodMiniObject = /*@__PURE__*/ core.$constructor(\"ZodMiniObject\", (inst, def) => {\n core.$ZodObject.init(inst, def);\n ZodMiniType.init(inst, def);\n util.defineLazy(inst, \"shape\", () => def.shape);\n});\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodMiniObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n return new ZodMiniObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\nexport function looseObject(shape, params) {\n return new ZodMiniObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\n// object methods\nexport function extend(schema, shape) {\n return util.extend(schema, shape);\n}\nexport function safeExtend(schema, shape) {\n return util.safeExtend(schema, shape);\n}\nexport function merge(schema, shape) {\n return util.extend(schema, shape);\n}\nexport function pick(schema, mask) {\n return util.pick(schema, mask);\n}\n// .omit\nexport function omit(schema, mask) {\n return util.omit(schema, mask);\n}\nexport function partial(schema, mask) {\n return util.partial(ZodMiniOptional, schema, mask);\n}\nexport function required(schema, mask) {\n return util.required(ZodMiniNonOptional, schema, mask);\n}\nexport function catchall(inst, catchall) {\n return inst.clone({ ...inst._zod.def, catchall: catchall });\n}\nexport const ZodMiniUnion = /*@__PURE__*/ core.$constructor(\"ZodMiniUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function union(options, params) {\n return new ZodMiniUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodMiniDiscriminatedUnion\", (inst, def) => {\n core.$ZodDiscriminatedUnion.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n return new ZodMiniDiscriminatedUnion({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniIntersection = /*@__PURE__*/ core.$constructor(\"ZodMiniIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function intersection(left, right) {\n return new ZodMiniIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodMiniTuple = /*@__PURE__*/ core.$constructor(\"ZodMiniTuple\", (inst, def) => {\n core.$ZodTuple.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodMiniTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniRecord = /*@__PURE__*/ core.$constructor(\"ZodMiniRecord\", (inst, def) => {\n core.$ZodRecord.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function record(keyType, valueType, params) {\n return new ZodMiniRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function partialRecord(keyType, valueType, params) {\n const k = core.clone(keyType);\n k._zod.values = undefined;\n return new ZodMiniRecord({\n type: \"record\",\n keyType: k,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniMap = /*@__PURE__*/ core.$constructor(\"ZodMiniMap\", (inst, def) => {\n core.$ZodMap.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function map(keyType, valueType, params) {\n return new ZodMiniMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniSet = /*@__PURE__*/ core.$constructor(\"ZodMiniSet\", (inst, def) => {\n core.$ZodSet.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function set(valueType, params) {\n return new ZodMiniSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniEnum = /*@__PURE__*/ core.$constructor(\"ZodMiniEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodMiniType.init(inst, def);\n inst.options = Object.values(def.entries);\n});\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodMiniEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodMiniEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniLiteral = /*@__PURE__*/ core.$constructor(\"ZodMiniLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function literal(value, params) {\n return new ZodMiniLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniFile = /*@__PURE__*/ core.$constructor(\"ZodMiniFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function file(params) {\n return core._file(ZodMiniFile, params);\n}\nexport const ZodMiniTransform = /*@__PURE__*/ core.$constructor(\"ZodMiniTransform\", (inst, def) => {\n core.$ZodTransform.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function transform(fn) {\n return new ZodMiniTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodMiniOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function optional(innerType) {\n return new ZodMiniOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodMiniNullable = /*@__PURE__*/ core.$constructor(\"ZodMiniNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function nullable(innerType) {\n return new ZodMiniNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodMiniDefault = /*@__PURE__*/ core.$constructor(\"ZodMiniDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function _default(innerType, defaultValue) {\n return new ZodMiniDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodMiniPrefault = /*@__PURE__*/ core.$constructor(\"ZodMiniPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function prefault(innerType, defaultValue) {\n return new ZodMiniPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodMiniNonOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function nonoptional(innerType, params) {\n return new ZodMiniNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniSuccess = /*@__PURE__*/ core.$constructor(\"ZodMiniSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function success(innerType) {\n return new ZodMiniSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodMiniCatch = /*@__PURE__*/ core.$constructor(\"ZodMiniCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nfunction _catch(innerType, catchValue) {\n return new ZodMiniCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport { _catch as catch };\nexport const ZodMiniNaN = /*@__PURE__*/ core.$constructor(\"ZodMiniNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function nan(params) {\n return core._nan(ZodMiniNaN, params);\n}\nexport const ZodMiniPipe = /*@__PURE__*/ core.$constructor(\"ZodMiniPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function pipe(in_, out) {\n return new ZodMiniPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n });\n}\nexport const ZodMiniCodec = /*@__PURE__*/ core.$constructor(\"ZodMiniCodec\", (inst, def) => {\n ZodMiniPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\nexport function codec(in_, out, params) {\n return new ZodMiniCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\nexport const ZodMiniReadonly = /*@__PURE__*/ core.$constructor(\"ZodMiniReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function readonly(innerType) {\n return new ZodMiniReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodMiniTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodMiniTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function templateLiteral(parts, params) {\n return new ZodMiniTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniLazy = /*@__PURE__*/ core.$constructor(\"ZodMiniLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// export function lazy<T extends object>(getter: () => T): T {\n// return util.createTransparentProxy<T>(getter);\n// }\nfunction _lazy(getter) {\n return new ZodMiniLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport { _lazy as lazy };\nexport const ZodMiniPromise = /*@__PURE__*/ core.$constructor(\"ZodMiniPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function promise(innerType) {\n return new ZodMiniPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodMiniCustom = /*@__PURE__*/ core.$constructor(\"ZodMiniCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// custom checks\nexport function check(fn, params) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// ZodCustom\n// custom schema\nexport function custom(fn, _params) {\n return core._custom(ZodMiniCustom, fn ?? (() => true), _params);\n}\n// refine\nexport function refine(fn, _params = {}) {\n return core._refine(ZodMiniCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn) {\n return core._superRefine(fn);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\n// instanceof\nclass Class {\n constructor(..._args) { }\n}\nfunction _instanceof(cls, params = {\n error: `Input not instance of ${cls.name}`,\n}) {\n const inst = custom((data) => data instanceof cls, params);\n inst._zod.bag.Class = cls;\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Codec: ZodMiniCodec,\n Boolean: ZodMiniBoolean,\n String: ZodMiniString,\n}, ...args);\nexport function json() {\n const jsonSchema = _lazy(() => {\n return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\nexport const ZodMiniFunction = /*@__PURE__*/ core.$constructor(\"ZodMiniFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodMiniType.init(inst, def);\n});\nexport function _function(params) {\n return new ZodMiniFunction({\n type: \"function\",\n input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),\n output: params?.output ?? unknown(),\n });\n}\nexport { _function as function };\n","import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\nexport function _superRefine(fn) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n });\n return ch;\n}\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n return codec;\n}\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { z } from 'zod/v4-mini';\nimport enLocale from 'zod/v4/locales/en.js';\n// Enable parse error messages\nz.config(enLocale());\n/**\n * Get a Zod object that matches the expected type, including any optional properties.\n * (Does not provide the same guarantee for nested object types.)\n *\n * Unrecognized properties will be stripped/ignored at runtime.\n * To preserve them, use `matchingZodObjectLoose` instead.\n *\n * Using this helper instead of `const ZodFoo = z.object({...}); type Foo = z.infer<typeof ZodFoo>;`\n * is recommended in cases where the original type is defined elsewhere (such as in `common-types`),\n * to ensure all the properties stay in sync.\n */\nexport function matchingZodObject(shape) {\n return z.object(shape);\n}\n/**\n * Like `matchingZodObject`, but pass through any extra properties that aren't defined in the shape.\n *\n * See `matchingZodObject` comment for more details.\n */\nexport function matchingZodObjectLoose(shape) {\n return z.looseObject(shape);\n}\n//# sourceMappingURL=matchingZodObject.js.map","import * as util from \"../core/util.js\";\nexport const parsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"NaN\" : \"number\";\n }\n case \"object\": {\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {\n return data.constructor.name;\n }\n }\n }\n return t;\n};\nconst error = () => {\n const Sizable = {\n string: { unit: \"characters\", verb: \"to have\" },\n file: { unit: \"bytes\", verb: \"to have\" },\n array: { unit: \"items\", verb: \"to have\" },\n set: { unit: \"items\", verb: \"to have\" },\n };\n function getSizing(origin) {\n return Sizable[origin] ?? null;\n }\n const Nouns = {\n regex: \"input\",\n email: \"email address\",\n url: \"URL\",\n emoji: \"emoji\",\n uuid: \"UUID\",\n uuidv4: \"UUIDv4\",\n uuidv6: \"UUIDv6\",\n nanoid: \"nanoid\",\n guid: \"GUID\",\n cuid: \"cuid\",\n cuid2: \"cuid2\",\n ulid: \"ULID\",\n xid: \"XID\",\n ksuid: \"KSUID\",\n datetime: \"ISO datetime\",\n date: \"ISO date\",\n time: \"ISO time\",\n duration: \"ISO duration\",\n ipv4: \"IPv4 address\",\n ipv6: \"IPv6 address\",\n mac: \"MAC address\",\n cidrv4: \"IPv4 range\",\n cidrv6: \"IPv6 range\",\n base64: \"base64-encoded string\",\n base64url: \"base64url-encoded string\",\n json_string: \"JSON string\",\n e164: \"E.164 number\",\n jwt: \"JWT\",\n template_literal: \"input\",\n };\n return (issue) => {\n switch (issue.code) {\n case \"invalid_type\":\n return `Invalid input: expected ${issue.expected}, received ${parsedType(issue.input)}`;\n case \"invalid_value\":\n if (issue.values.length === 1)\n return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;\n return `Invalid option: expected one of ${util.joinValues(issue.values, \"|\")}`;\n case \"too_big\": {\n const adj = issue.inclusive ? \"<=\" : \"<\";\n const sizing = getSizing(issue.origin);\n if (sizing)\n return `Too big: expected ${issue.origin ?? \"value\"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? \"elements\"}`;\n return `Too big: expected ${issue.origin ?? \"value\"} to be ${adj}${issue.maximum.toString()}`;\n }\n case \"too_small\": {\n const adj = issue.inclusive ? \">=\" : \">\";\n const sizing = getSizing(issue.origin);\n if (sizing) {\n return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;\n }\n return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;\n }\n case \"invalid_format\": {\n const _issue = issue;\n if (_issue.format === \"starts_with\") {\n return `Invalid string: must start with \"${_issue.prefix}\"`;\n }\n if (_issue.format === \"ends_with\")\n return `Invalid string: must end with \"${_issue.suffix}\"`;\n if (_issue.format === \"includes\")\n return `Invalid string: must include \"${_issue.includes}\"`;\n if (_issue.format === \"regex\")\n return `Invalid string: must match pattern ${_issue.pattern}`;\n return `Invalid ${Nouns[_issue.format] ?? issue.format}`;\n }\n case \"not_multiple_of\":\n return `Invalid number: must be a multiple of ${issue.divisor}`;\n case \"unrecognized_keys\":\n return `Unrecognized key${issue.keys.length > 1 ? \"s\" : \"\"}: ${util.joinValues(issue.keys, \", \")}`;\n case \"invalid_key\":\n return `Invalid key in ${issue.origin}`;\n case \"invalid_union\":\n return \"Invalid input\";\n case \"invalid_element\":\n return `Invalid value in ${issue.origin}`;\n default:\n return `Invalid input`;\n }\n };\n};\nexport default function () {\n return {\n localeError: error(),\n };\n}\n","import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTaskStats = matchingZodObject({\n status: z.literal(['idle', 'pending']),\n remainingTasks: z.number(),\n totalTasks: z.number(),\n totalErrors: z.number(),\n totalWarnings: z.number(),\n});\n//# sourceMappingURL=TaskStats.js.map","import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTiming = matchingZodObject({\n name: z.string(),\n start: z.number(),\n end: z.optional(z.number()),\n threwException: z.optional(z.boolean()),\n});\n//# sourceMappingURL=Timing.js.map","import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTaskMessageLocation = matchingZodObject({\n file: z.string(),\n line: z.optional(z.number()),\n column: z.optional(z.number()),\n});\n//# sourceMappingURL=TaskMessageLocation.js.map","import { z } from 'zod/v4-mini';\nimport { ZodTaskMessageLocation } from './TaskMessageLocation.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTaskNote = matchingZodObject({\n text: z.string(),\n location: z.optional(ZodTaskMessageLocation),\n});\nexport const ZodTaskMessage = matchingZodObject({\n text: z.string(),\n source: z.string(),\n location: z.optional(ZodTaskMessageLocation),\n notes: z.optional(z.array(ZodTaskNote)),\n});\n//# sourceMappingURL=TaskMessage.js.map","import { z } from 'zod/v4-mini';\nimport { ZodTiming } from './Timing.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport { ZodTaskMessage } from './TaskMessage.js';\nexport const ZodTaskDescription = matchingZodObject({\n id: z.string(),\n name: z.string(),\n status: z.literal(['pending', 'complete']),\n inputPath: z.string(),\n outputPath: z.optional(z.string()),\n errors: z.optional(z.array(ZodTaskMessage)),\n warnings: z.optional(z.array(ZodTaskMessage)),\n startTime: z.number(),\n duration: z.optional(z.number()),\n lastUpdated: z.optional(z.number()),\n timings: z.optional(z.array(ZodTiming)),\n});\n//# sourceMappingURL=TaskDescription.js.map","import { z } from 'zod/v4-mini';\nimport { ZodTaskDescription } from './TaskDescription.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTaskList = matchingZodObject({\n tasks: z.array(ZodTaskDescription),\n});\n//# sourceMappingURL=TaskList.js.map","import { z } from 'zod/v4-mini';\nimport { matchingZodObject, matchingZodObjectLoose } from '../utilities/matchingZodObject.js';\n/**\n * Validate that the package.json includes the name and version, and pass through all other fields\n * without validation.\n */\nconst ZodBasicPackageJson = matchingZodObjectLoose({\n name: z.string(),\n version: z.string(),\n});\nexport const ZodNotifyLinkChangeInput = matchingZodObject({\n packagePath: z.string(),\n hash: z.optional(z.string()),\n definition: z.optional(ZodBasicPackageJson),\n});\n//# sourceMappingURL=NotifyLinkChangeInput.js.map","//\n// This must be in a separate file because it's imported by busSources.ts, which is also used\n// in the browser, so it must only import zod types.\n// (Also, these types are used by both `linkPath` and `unlinkPath`.)\n//\nimport { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nconst ZodPackageHashesEntry = z.object({\n browser: z.record(z.string(), z.string()),\n node: z.record(z.string(), z.string()),\n});\nconst ZodLinkedPath = matchingZodObject({\n path: z.string(),\n rootPath: z.optional(z.string()),\n includeAll: z.optional(z.boolean()),\n ignoredPackages: z.optional(z.array(z.string())),\n ignoreResolutions: z.optional(z.union([z.boolean(), z.array(z.string())])),\n resolveStrategy: z.optional(z.literal(['dedupe', 'duplicate'])),\n remote: z.optional(matchingZodObject({\n hostUrl: z.string(),\n // Skip schema validation of the resolve map since it's likely very large, and the various\n // zod and procedure type helpers ensure the type is correct in the API.\n resolveMap: z.record(z.string(), z.any()),\n // Same with the serializable package definitions.\n // If we need to enforce usage/sharing of a minimal subset of properties, that should be done\n // with smaller subset/pick type (non-zod) which is used in all relevant locations.\n packages: z.object({\n definitions: z.record(z.string(), z.any()),\n transformedDefinitions: z.record(z.string(), z.any()),\n }),\n packageHashes: z.object({\n hashesWithSource: ZodPackageHashesEntry,\n hashesWithNoSource: ZodPackageHashesEntry,\n }),\n })),\n});\nexport const ZodLinkPathInput = matchingZodObject({ linkedPath: ZodLinkedPath });\nexport const ZodLinkPathOutput = matchingZodObject({\n // Don't check the schema of the resolve map as it can be very large.\n resolveMap: z.record(z.string(), z.any()),\n linkedPaths: z.array(ZodLinkedPath),\n});\n//# sourceMappingURL=LinkPath.js.map","//\n// This must be in a separate file because it's imported by busSources.ts, which is also used\n// in the browser, so it must only import zod types.\n//\nimport { z } from 'zod/v4-mini';\nimport { matchingZodObject, matchingZodObjectLoose } from '../utilities/matchingZodObject.js';\n// Minimum acceptable match object for a low maintenance burden.\nconst ZodPackageSettingsMatchObject = matchingZodObject({\n name: z.string(),\n version: z.optional(z.string()),\n});\nconst ZodPackageSettingsMatch = z.union([z.string(), z.looseObject({ ...ZodPackageSettingsMatchObject.shape })]);\nconst ZodGeneratedPackageSettingsMatch = z.union([z.string(), z.required(ZodPackageSettingsMatchObject)]);\nexport const ZodGetLinkConfigOutput = matchingZodObjectLoose({\n packageSettings: z.optional(z.array(z.looseObject({ match: z.union([ZodPackageSettingsMatch, z.array(ZodPackageSettingsMatch)]) }))),\n generated: z.looseObject({ packageSettings: z.array(z.looseObject({ match: ZodGeneratedPackageSettingsMatch })) }),\n});\n//# sourceMappingURL=GetLinkConfigOutput.js.map","// This file is used in the browser,\n// so it must only import types (ts and zod) to not trigger a trpc server error due to bad tree shaking.\nimport { z } from 'zod/v4-mini';\nimport { ZodTaskStats } from '../types/TaskStats.js';\nimport { ZodTaskList } from '../types/TaskList.js';\nimport { createDataPath } from '@ms-cloudpack/data-bus';\nimport { ZodNotifyLinkChangeInput } from '../types/NotifyLinkChangeInput.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput } from '../types/LinkPath.js';\nimport { ZodGetLinkConfigOutput } from '../types/GetLinkConfigOutput.js';\nimport { ZodPackageUpdatePayload } from '../types/PackageUpdatePayload.js';\n/**\n * Used for tracking the reload count.\n */\nexport const reloadCountSource = createDataPath({\n path: ['session', 'version'],\n type: z.number(),\n});\n/**\n * Used for tracking the task stats displayed in the badge.\n */\nexport const taskStatsSource = createDataPath({\n path: ['task', 'stats'],\n type: ZodTaskStats,\n});\n/**\n * Used for tracking the list of tasks.\n */\nexport const taskListSource = createDataPath({\n path: ['task', 'list'],\n type: ZodTaskList,\n});\n/**\n * Used for tracking entry errors: `Failed to resolve module specifier \"${packageName}@${version}${filePath}\".`\n * This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.\n */\nexport const errorEntrySource = createDataPath({\n path: ['error', 'entry'],\n type: z.string(),\n});\n/**\n * Used for tracking link updates.\n */\nexport const linkUpdateSource = createDataPath({\n path: ['link', 'update'],\n type: ZodNotifyLinkChangeInput,\n});\n/**\n * Used for fetching the host configuration.\n */\nexport const linkConfigSource = createDataPath({\n path: ['link', 'config'],\n type: ZodGetLinkConfigOutput,\n});\n/**\n * Used for tracking linked paths.\n */\nexport const linkPathsSource = createDataPath({\n path: ['link', 'paths'],\n type: ZodLinkPathInput,\n});\n/**\n * Used for tracking when linking is done.\n */\nexport const linkDoneSource = createDataPath({\n path: ['link', 'done'],\n type: ZodLinkPathOutput,\n});\n/**\n * Used for detecting host disconnection on link.\n */\nexport const linkDisconnectedSource = createDataPath({\n path: ['link', 'disconnected'],\n type: z.object({ reason: z.literal(['lost', 'unreachable']) }),\n});\n/**\n * Used for HMR - notifies browser when a package has been rebuilt.\n * The bundleUrl in each entry point already contains the updated hash.\n */\nexport const packageUpdateSource = createDataPath({\n path: ['package', 'update'],\n type: ZodPackageUpdatePayload,\n});\n//# sourceMappingURL=busSources.js.map","import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodPackageUpdatePayload = matchingZodObject({\n packageName: z.string(),\n version: z.string(),\n entryPoints: z.array(z.object({\n importPath: z.string(),\n bundleUrl: z.string(),\n })),\n});\n//# sourceMappingURL=PackageUpdatePayload.js.map","//#region rolldown:runtime\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 __commonJS = (cb, mod) => function() {\n\treturn mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\tkey = keys[i];\n\t\tif (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\tvalue: mod,\n\tenumerable: true\n}) : target, mod));\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js\nvar require_typeof = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js\"(exports, module) {\n\tfunction _typeof$2(o) {\n\t\t\"@babel/helpers - typeof\";\n\t\treturn module.exports = _typeof$2 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o$1) {\n\t\t\treturn typeof o$1;\n\t\t} : function(o$1) {\n\t\t\treturn o$1 && \"function\" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? \"symbol\" : typeof o$1;\n\t\t}, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof$2(o);\n\t}\n\tmodule.exports = _typeof$2, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js\nvar require_toPrimitive = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js\"(exports, module) {\n\tvar _typeof$1 = require_typeof()[\"default\"];\n\tfunction toPrimitive$1(t, r) {\n\t\tif (\"object\" != _typeof$1(t) || !t) return t;\n\t\tvar e = t[Symbol.toPrimitive];\n\t\tif (void 0 !== e) {\n\t\t\tvar i = e.call(t, r || \"default\");\n\t\t\tif (\"object\" != _typeof$1(i)) return i;\n\t\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t\t}\n\t\treturn (\"string\" === r ? String : Number)(t);\n\t}\n\tmodule.exports = toPrimitive$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js\nvar require_toPropertyKey = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js\"(exports, module) {\n\tvar _typeof = require_typeof()[\"default\"];\n\tvar toPrimitive = require_toPrimitive();\n\tfunction toPropertyKey$1(t) {\n\t\tvar i = toPrimitive(t, \"string\");\n\t\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n\t}\n\tmodule.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js\nvar require_defineProperty = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js\"(exports, module) {\n\tvar toPropertyKey = require_toPropertyKey();\n\tfunction _defineProperty(e, r, t) {\n\t\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\t\tvalue: t,\n\t\t\tenumerable: !0,\n\t\t\tconfigurable: !0,\n\t\t\twritable: !0\n\t\t}) : e[r] = t, e;\n\t}\n\tmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js\nvar require_objectSpread2 = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js\"(exports, module) {\n\tvar defineProperty = require_defineProperty();\n\tfunction ownKeys(e, r) {\n\t\tvar t = Object.keys(e);\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tvar o = Object.getOwnPropertySymbols(e);\n\t\t\tr && (o = o.filter(function(r$1) {\n\t\t\t\treturn Object.getOwnPropertyDescriptor(e, r$1).enumerable;\n\t\t\t})), t.push.apply(t, o);\n\t\t}\n\t\treturn t;\n\t}\n\tfunction _objectSpread2(e) {\n\t\tfor (var r = 1; r < arguments.length; r++) {\n\t\t\tvar t = null != arguments[r] ? arguments[r] : {};\n\t\t\tr % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {\n\t\t\t\tdefineProperty(e, r$1, t[r$1]);\n\t\t\t}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {\n\t\t\t\tObject.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));\n\t\t\t});\n\t\t}\n\t\treturn e;\n\t}\n\tmodule.exports = _objectSpread2, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\nexport { __commonJS, __toESM, require_defineProperty, require_objectSpread2 };\n//# sourceMappingURL=objectSpread2-BvkFp-_Y.mjs.map","//#region src/observable/observable.ts\n/** @public */\nfunction isObservable(x) {\n\treturn typeof x === \"object\" && x !== null && \"subscribe\" in x;\n}\n/** @public */\nfunction observable(subscribe) {\n\tconst self = {\n\t\tsubscribe(observer) {\n\t\t\tlet teardownRef = null;\n\t\t\tlet isDone = false;\n\t\t\tlet unsubscribed = false;\n\t\t\tlet teardownImmediately = false;\n\t\t\tfunction unsubscribe() {\n\t\t\t\tif (teardownRef === null) {\n\t\t\t\t\tteardownImmediately = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (unsubscribed) return;\n\t\t\t\tunsubscribed = true;\n\t\t\t\tif (typeof teardownRef === \"function\") teardownRef();\n\t\t\t\telse if (teardownRef) teardownRef.unsubscribe();\n\t\t\t}\n\t\t\tteardownRef = subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tvar _observer$next;\n\t\t\t\t\tif (isDone) return;\n\t\t\t\t\t(_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value);\n\t\t\t\t},\n\t\t\t\terror(err) {\n\t\t\t\t\tvar _observer$error;\n\t\t\t\t\tif (isDone) return;\n\t\t\t\t\tisDone = true;\n\t\t\t\t\t(_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, err);\n\t\t\t\t\tunsubscribe();\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tvar _observer$complete;\n\t\t\t\t\tif (isDone) return;\n\t\t\t\t\tisDone = true;\n\t\t\t\t\t(_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer);\n\t\t\t\t\tunsubscribe();\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (teardownImmediately) unsubscribe();\n\t\t\treturn { unsubscribe };\n\t\t},\n\t\tpipe(...operations) {\n\t\t\treturn operations.reduce(pipeReducer, self);\n\t\t}\n\t};\n\treturn self;\n}\nfunction pipeReducer(prev, fn) {\n\treturn fn(prev);\n}\n/** @internal */\nfunction observableToPromise(observable$1) {\n\tconst ac = new AbortController();\n\tconst promise = new Promise((resolve, reject) => {\n\t\tlet isDone = false;\n\t\tfunction onDone() {\n\t\t\tif (isDone) return;\n\t\t\tisDone = true;\n\t\t\tobs$.unsubscribe();\n\t\t}\n\t\tac.signal.addEventListener(\"abort\", () => {\n\t\t\treject(ac.signal.reason);\n\t\t});\n\t\tconst obs$ = observable$1.subscribe({\n\t\t\tnext(data) {\n\t\t\t\tisDone = true;\n\t\t\t\tresolve(data);\n\t\t\t\tonDone();\n\t\t\t},\n\t\t\terror(data) {\n\t\t\t\treject(data);\n\t\t\t},\n\t\t\tcomplete() {\n\t\t\t\tac.abort();\n\t\t\t\tonDone();\n\t\t\t}\n\t\t});\n\t});\n\treturn promise;\n}\n/**\n* @internal\n*/\nfunction observableToReadableStream(observable$1, signal) {\n\tlet unsub = null;\n\tconst onAbort = () => {\n\t\tunsub === null || unsub === void 0 || unsub.unsubscribe();\n\t\tunsub = null;\n\t\tsignal.removeEventListener(\"abort\", onAbort);\n\t};\n\treturn new ReadableStream({\n\t\tstart(controller) {\n\t\t\tunsub = observable$1.subscribe({\n\t\t\t\tnext(data) {\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\tok: true,\n\t\t\t\t\t\tvalue: data\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\terror\n\t\t\t\t\t});\n\t\t\t\t\tcontroller.close();\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (signal.aborted) onAbort();\n\t\t\telse signal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t},\n\t\tcancel() {\n\t\t\tonAbort();\n\t\t}\n\t});\n}\n/** @internal */\nfunction observableToAsyncIterable(observable$1, signal) {\n\tconst stream = observableToReadableStream(observable$1, signal);\n\tconst reader = stream.getReader();\n\tconst iterator = {\n\t\tasync next() {\n\t\t\tconst value = await reader.read();\n\t\t\tif (value.done) return {\n\t\t\t\tvalue: void 0,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t\tconst { value: result } = value;\n\t\t\tif (!result.ok) throw result.error;\n\t\t\treturn {\n\t\t\t\tvalue: result.value,\n\t\t\t\tdone: false\n\t\t\t};\n\t\t},\n\t\tasync return() {\n\t\t\tawait reader.cancel();\n\t\t\treturn {\n\t\t\t\tvalue: void 0,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\t};\n\treturn { [Symbol.asyncIterator]() {\n\t\treturn iterator;\n\t} };\n}\n\n//#endregion\nexport { isObservable, observable, observableToAsyncIterable, observableToPromise };\n//# sourceMappingURL=observable-UMO3vUa_.mjs.map","import { observable } from \"@trpc/server/observable\";\n\n//#region src/links/internals/createChain.ts\n/** @internal */\nfunction createChain(opts) {\n\treturn observable((observer) => {\n\t\tfunction execute(index = 0, op = opts.op) {\n\t\t\tconst next = opts.links[index];\n\t\t\tif (!next) throw new Error(\"No more links to execute - did you forget to add an ending link?\");\n\t\t\tconst subscription = next({\n\t\t\t\top,\n\t\t\t\tnext(nextOp) {\n\t\t\t\t\tconst nextObserver = execute(index + 1, nextOp);\n\t\t\t\t\treturn nextObserver;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn subscription;\n\t\t}\n\t\tconst obs$ = execute();\n\t\treturn obs$.subscribe(observer);\n\t});\n}\n\n//#endregion\n//#region src/links/splitLink.ts\nfunction asArray(value) {\n\treturn Array.isArray(value) ? value : [value];\n}\nfunction splitLink(opts) {\n\treturn (runtime) => {\n\t\tconst yes = asArray(opts.true).map((link) => link(runtime));\n\t\tconst no = asArray(opts.false).map((link) => link(runtime));\n\t\treturn (props) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tconst links = opts.condition(props.op) ? yes : no;\n\t\t\t\treturn createChain({\n\t\t\t\t\top: props.op,\n\t\t\t\t\tlinks\n\t\t\t\t}).subscribe(observer);\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { createChain, splitLink };\n//# sourceMappingURL=splitLink-B7Cuf2c_.mjs.map","//#region src/unstable-core-do-not-import/rpc/codes.ts\n/**\n* JSON-RPC 2.0 Error codes\n*\n* `-32000` to `-32099` are reserved for implementation-defined server-errors.\n* For tRPC we're copying the last digits of HTTP 4XX errors.\n*/\nconst TRPC_ERROR_CODES_BY_KEY = {\n\tPARSE_ERROR: -32700,\n\tBAD_REQUEST: -32600,\n\tINTERNAL_SERVER_ERROR: -32603,\n\tNOT_IMPLEMENTED: -32603,\n\tBAD_GATEWAY: -32603,\n\tSERVICE_UNAVAILABLE: -32603,\n\tGATEWAY_TIMEOUT: -32603,\n\tUNAUTHORIZED: -32001,\n\tPAYMENT_REQUIRED: -32002,\n\tFORBIDDEN: -32003,\n\tNOT_FOUND: -32004,\n\tMETHOD_NOT_SUPPORTED: -32005,\n\tTIMEOUT: -32008,\n\tCONFLICT: -32009,\n\tPRECONDITION_FAILED: -32012,\n\tPAYLOAD_TOO_LARGE: -32013,\n\tUNSUPPORTED_MEDIA_TYPE: -32015,\n\tUNPROCESSABLE_CONTENT: -32022,\n\tPRECONDITION_REQUIRED: -32028,\n\tTOO_MANY_REQUESTS: -32029,\n\tCLIENT_CLOSED_REQUEST: -32099\n};\nconst TRPC_ERROR_CODES_BY_NUMBER = {\n\t[-32700]: \"PARSE_ERROR\",\n\t[-32600]: \"BAD_REQUEST\",\n\t[-32603]: \"INTERNAL_SERVER_ERROR\",\n\t[-32001]: \"UNAUTHORIZED\",\n\t[-32002]: \"PAYMENT_REQUIRED\",\n\t[-32003]: \"FORBIDDEN\",\n\t[-32004]: \"NOT_FOUND\",\n\t[-32005]: \"METHOD_NOT_SUPPORTED\",\n\t[-32008]: \"TIMEOUT\",\n\t[-32009]: \"CONFLICT\",\n\t[-32012]: \"PRECONDITION_FAILED\",\n\t[-32013]: \"PAYLOAD_TOO_LARGE\",\n\t[-32015]: \"UNSUPPORTED_MEDIA_TYPE\",\n\t[-32022]: \"UNPROCESSABLE_CONTENT\",\n\t[-32028]: \"PRECONDITION_REQUIRED\",\n\t[-32029]: \"TOO_MANY_REQUESTS\",\n\t[-32099]: \"CLIENT_CLOSED_REQUEST\"\n};\n/**\n* tRPC error codes that are considered retryable\n* With out of the box SSE, the client will reconnect when these errors are encountered\n*/\nconst retryableRpcCodes = [\n\tTRPC_ERROR_CODES_BY_KEY.BAD_GATEWAY,\n\tTRPC_ERROR_CODES_BY_KEY.SERVICE_UNAVAILABLE,\n\tTRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT,\n\tTRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR\n];\n\n//#endregion\n//#region src/unstable-core-do-not-import/utils.ts\n/**\n* Ensures there are no duplicate keys when building a procedure.\n* @internal\n*/\nfunction mergeWithoutOverrides(obj1, ...objs) {\n\tconst newObj = Object.assign(Object.create(null), obj1);\n\tfor (const overrides of objs) for (const key in overrides) {\n\t\tif (key in newObj && newObj[key] !== overrides[key]) throw new Error(`Duplicate key ${key}`);\n\t\tnewObj[key] = overrides[key];\n\t}\n\treturn newObj;\n}\n/**\n* Check that value is object\n* @internal\n*/\nfunction isObject(value) {\n\treturn !!value && !Array.isArray(value) && typeof value === \"object\";\n}\nfunction isFunction(fn) {\n\treturn typeof fn === \"function\";\n}\n/**\n* Create an object without inheriting anything from `Object.prototype`\n* @internal\n*/\nfunction omitPrototype(obj) {\n\treturn Object.assign(Object.create(null), obj);\n}\nconst asyncIteratorsSupported = typeof Symbol === \"function\" && !!Symbol.asyncIterator;\nfunction isAsyncIterable(value) {\n\treturn asyncIteratorsSupported && isObject(value) && Symbol.asyncIterator in value;\n}\n/**\n* Run an IIFE\n*/\nconst run = (fn) => fn();\nfunction noop() {}\nfunction identity(it) {\n\treturn it;\n}\n/**\n* Generic runtime assertion function. Throws, if the condition is not `true`.\n*\n* Can be used as a slightly less dangerous variant of type assertions. Code\n* mistakes would be revealed at runtime then (hopefully during testing).\n*/\nfunction assert(condition, msg = \"no additional info\") {\n\tif (!condition) throw new Error(`AssertionError: ${msg}`);\n}\nfunction sleep(ms = 0) {\n\treturn new Promise((res) => setTimeout(res, ms));\n}\n/**\n* Ponyfill for\n* [`AbortSignal.any`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static).\n*/\nfunction abortSignalsAnyPonyfill(signals) {\n\tif (typeof AbortSignal.any === \"function\") return AbortSignal.any(signals);\n\tconst ac = new AbortController();\n\tfor (const signal of signals) {\n\t\tif (signal.aborted) {\n\t\t\ttrigger();\n\t\t\tbreak;\n\t\t}\n\t\tsignal.addEventListener(\"abort\", trigger, { once: true });\n\t}\n\treturn ac.signal;\n\tfunction trigger() {\n\t\tac.abort();\n\t\tfor (const signal of signals) signal.removeEventListener(\"abort\", trigger);\n\t}\n}\n\n//#endregion\nexport { TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER, abortSignalsAnyPonyfill, assert, identity, isAsyncIterable, isFunction, isObject, mergeWithoutOverrides, noop, omitPrototype, retryableRpcCodes, run, sleep };\n//# sourceMappingURL=utils-CLZnJdb_.mjs.map","import { __toESM, require_defineProperty, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { isObject } from \"@trpc/server/unstable-core-do-not-import\";\n\n//#region src/TRPCClientError.ts\nvar import_defineProperty = __toESM(require_defineProperty(), 1);\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\nfunction isTRPCClientError(cause) {\n\treturn cause instanceof TRPCClientError;\n}\nfunction isTRPCErrorResponse(obj) {\n\treturn isObject(obj) && isObject(obj[\"error\"]) && typeof obj[\"error\"][\"code\"] === \"number\" && typeof obj[\"error\"][\"message\"] === \"string\";\n}\nfunction getMessageFromUnknownError(err, fallback) {\n\tif (typeof err === \"string\") return err;\n\tif (isObject(err) && typeof err[\"message\"] === \"string\") return err[\"message\"];\n\treturn fallback;\n}\nvar TRPCClientError = class TRPCClientError extends Error {\n\tconstructor(message, opts) {\n\t\tvar _opts$result, _opts$result2;\n\t\tconst cause = opts === null || opts === void 0 ? void 0 : opts.cause;\n\t\tsuper(message, { cause });\n\t\t(0, import_defineProperty.default)(this, \"cause\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"shape\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"data\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"meta\", void 0);\n\t\tthis.meta = opts === null || opts === void 0 ? void 0 : opts.meta;\n\t\tthis.cause = cause;\n\t\tthis.shape = opts === null || opts === void 0 || (_opts$result = opts.result) === null || _opts$result === void 0 ? void 0 : _opts$result.error;\n\t\tthis.data = opts === null || opts === void 0 || (_opts$result2 = opts.result) === null || _opts$result2 === void 0 ? void 0 : _opts$result2.error.data;\n\t\tthis.name = \"TRPCClientError\";\n\t\tObject.setPrototypeOf(this, TRPCClientError.prototype);\n\t}\n\tstatic from(_cause, opts = {}) {\n\t\tconst cause = _cause;\n\t\tif (isTRPCClientError(cause)) {\n\t\t\tif (opts.meta) cause.meta = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, cause.meta), opts.meta);\n\t\t\treturn cause;\n\t\t}\n\t\tif (isTRPCErrorResponse(cause)) return new TRPCClientError(cause.error.message, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { result: cause }));\n\t\treturn new TRPCClientError(getMessageFromUnknownError(cause, \"Unknown error\"), (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { cause }));\n\t}\n};\n\n//#endregion\nexport { TRPCClientError, isTRPCClientError };\n//# sourceMappingURL=TRPCClientError-CjKyS10w.mjs.map","//#region src/internals/transformer.ts\n/**\n* @internal\n*/\n/**\n* @internal\n*/\nfunction getTransformer(transformer) {\n\tconst _transformer = transformer;\n\tif (!_transformer) return {\n\t\tinput: {\n\t\t\tserialize: (data) => data,\n\t\t\tdeserialize: (data) => data\n\t\t},\n\t\toutput: {\n\t\t\tserialize: (data) => data,\n\t\t\tdeserialize: (data) => data\n\t\t}\n\t};\n\tif (\"input\" in _transformer) return _transformer;\n\treturn {\n\t\tinput: _transformer,\n\t\toutput: _transformer\n\t};\n}\n\n//#endregion\nexport { getTransformer };\n//# sourceMappingURL=unstable-internals-Bg7n9BBj.mjs.map","import { __toESM, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { getTransformer } from \"./unstable-internals-Bg7n9BBj.mjs\";\n\n//#region src/getFetch.ts\nconst isFunction = (fn) => typeof fn === \"function\";\nfunction getFetch(customFetchImpl) {\n\tif (customFetchImpl) return customFetchImpl;\n\tif (typeof window !== \"undefined\" && isFunction(window.fetch)) return window.fetch;\n\tif (typeof globalThis !== \"undefined\" && isFunction(globalThis.fetch)) return globalThis.fetch;\n\tthrow new Error(\"No fetch implementation found\");\n}\n\n//#endregion\n//#region src/links/internals/httpUtils.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\nfunction resolveHTTPLinkOptions(opts) {\n\treturn {\n\t\turl: opts.url.toString(),\n\t\tfetch: opts.fetch,\n\t\ttransformer: getTransformer(opts.transformer),\n\t\tmethodOverride: opts.methodOverride\n\t};\n}\nfunction arrayToDict(array) {\n\tconst dict = {};\n\tfor (let index = 0; index < array.length; index++) {\n\t\tconst element = array[index];\n\t\tdict[index] = element;\n\t}\n\treturn dict;\n}\nconst METHOD = {\n\tquery: \"GET\",\n\tmutation: \"POST\",\n\tsubscription: \"PATCH\"\n};\nfunction getInput(opts) {\n\treturn \"input\" in opts ? opts.transformer.input.serialize(opts.input) : arrayToDict(opts.inputs.map((_input) => opts.transformer.input.serialize(_input)));\n}\nconst getUrl = (opts) => {\n\tconst parts = opts.url.split(\"?\");\n\tconst base = parts[0].replace(/\\/$/, \"\");\n\tlet url = base + \"/\" + opts.path;\n\tconst queryParts = [];\n\tif (parts[1]) queryParts.push(parts[1]);\n\tif (\"inputs\" in opts) queryParts.push(\"batch=1\");\n\tif (opts.type === \"query\" || opts.type === \"subscription\") {\n\t\tconst input = getInput(opts);\n\t\tif (input !== void 0 && opts.methodOverride !== \"POST\") queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`);\n\t}\n\tif (queryParts.length) url += \"?\" + queryParts.join(\"&\");\n\treturn url;\n};\nconst getBody = (opts) => {\n\tif (opts.type === \"query\" && opts.methodOverride !== \"POST\") return void 0;\n\tconst input = getInput(opts);\n\treturn input !== void 0 ? JSON.stringify(input) : void 0;\n};\nconst jsonHttpRequester = (opts) => {\n\treturn httpRequest((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {\n\t\tcontentTypeHeader: \"application/json\",\n\t\tgetUrl,\n\t\tgetBody\n\t}));\n};\n/**\n* Polyfill for DOMException with AbortError name\n*/\nvar AbortError = class extends Error {\n\tconstructor() {\n\t\tconst name = \"AbortError\";\n\t\tsuper(name);\n\t\tthis.name = name;\n\t\tthis.message = name;\n\t}\n};\n/**\n* Polyfill for `signal.throwIfAborted()`\n*\n* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted\n*/\nconst throwIfAborted = (signal) => {\n\tvar _signal$throwIfAborte;\n\tif (!(signal === null || signal === void 0 ? void 0 : signal.aborted)) return;\n\t(_signal$throwIfAborte = signal.throwIfAborted) === null || _signal$throwIfAborte === void 0 || _signal$throwIfAborte.call(signal);\n\tif (typeof DOMException !== \"undefined\") throw new DOMException(\"AbortError\", \"AbortError\");\n\tthrow new AbortError();\n};\nasync function fetchHTTPResponse(opts) {\n\tvar _opts$methodOverride;\n\tthrowIfAborted(opts.signal);\n\tconst url = opts.getUrl(opts);\n\tconst body = opts.getBody(opts);\n\tconst method = (_opts$methodOverride = opts.methodOverride) !== null && _opts$methodOverride !== void 0 ? _opts$methodOverride : METHOD[opts.type];\n\tconst resolvedHeaders = await (async () => {\n\t\tconst heads = await opts.headers();\n\t\tif (Symbol.iterator in heads) return Object.fromEntries(heads);\n\t\treturn heads;\n\t})();\n\tconst headers = (0, import_objectSpread2.default)((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts.contentTypeHeader && method !== \"GET\" ? { \"content-type\": opts.contentTypeHeader } : {}), opts.trpcAcceptHeader ? { \"trpc-accept\": opts.trpcAcceptHeader } : void 0), resolvedHeaders);\n\treturn getFetch(opts.fetch)(url, {\n\t\tmethod,\n\t\tsignal: opts.signal,\n\t\tbody,\n\t\theaders\n\t});\n}\nasync function httpRequest(opts) {\n\tconst meta = {};\n\tconst res = await fetchHTTPResponse(opts);\n\tmeta.response = res;\n\tconst json = await res.json();\n\tmeta.responseJSON = json;\n\treturn {\n\t\tjson,\n\t\tmeta\n\t};\n}\n\n//#endregion\nexport { fetchHTTPResponse, getBody, getFetch, getUrl, httpRequest, jsonHttpRequester, resolveHTTPLinkOptions };\n//# sourceMappingURL=httpUtils-Dv57hbOd.mjs.map","import { __toESM, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { TRPCClientError } from \"./TRPCClientError-CjKyS10w.mjs\";\nimport { getUrl, httpRequest, jsonHttpRequester, resolveHTTPLinkOptions } from \"./httpUtils-Dv57hbOd.mjs\";\nimport { observable } from \"@trpc/server/observable\";\nimport { transformResult } from \"@trpc/server/unstable-core-do-not-import\";\n\n//#region src/links/internals/contentTypes.ts\nfunction isOctetType(input) {\n\treturn input instanceof Uint8Array || input instanceof Blob;\n}\nfunction isFormData(input) {\n\treturn input instanceof FormData;\n}\nfunction isNonJsonSerializable(input) {\n\treturn isOctetType(input) || isFormData(input);\n}\n\n//#endregion\n//#region src/links/httpLink.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\nconst universalRequester = (opts) => {\n\tif (\"input\" in opts) {\n\t\tconst { input } = opts;\n\t\tif (isFormData(input)) {\n\t\t\tif (opts.type !== \"mutation\" && opts.methodOverride !== \"POST\") throw new Error(\"FormData is only supported for mutations\");\n\t\t\treturn httpRequest((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {\n\t\t\t\tcontentTypeHeader: void 0,\n\t\t\t\tgetUrl,\n\t\t\t\tgetBody: () => input\n\t\t\t}));\n\t\t}\n\t\tif (isOctetType(input)) {\n\t\t\tif (opts.type !== \"mutation\" && opts.methodOverride !== \"POST\") throw new Error(\"Octet type input is only supported for mutations\");\n\t\t\treturn httpRequest((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {\n\t\t\t\tcontentTypeHeader: \"application/octet-stream\",\n\t\t\t\tgetUrl,\n\t\t\t\tgetBody: () => input\n\t\t\t}));\n\t\t}\n\t}\n\treturn jsonHttpRequester(opts);\n};\n/**\n* @see https://trpc.io/docs/client/links/httpLink\n*/\nfunction httpLink(opts) {\n\tconst resolvedOpts = resolveHTTPLinkOptions(opts);\n\treturn () => {\n\t\treturn (operationOpts) => {\n\t\t\tconst { op } = operationOpts;\n\t\t\treturn observable((observer) => {\n\t\t\t\tconst { path, input, type } = op;\n\t\t\t\t/* istanbul ignore if -- @preserve */\n\t\t\t\tif (type === \"subscription\") throw new Error(\"Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`\");\n\t\t\t\tconst request = universalRequester((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, resolvedOpts), {}, {\n\t\t\t\t\ttype,\n\t\t\t\t\tpath,\n\t\t\t\t\tinput,\n\t\t\t\t\tsignal: op.signal,\n\t\t\t\t\theaders() {\n\t\t\t\t\t\tif (!opts.headers) return {};\n\t\t\t\t\t\tif (typeof opts.headers === \"function\") return opts.headers({ op });\n\t\t\t\t\t\treturn opts.headers;\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tlet meta = void 0;\n\t\t\t\trequest.then((res) => {\n\t\t\t\t\tmeta = res.meta;\n\t\t\t\t\tconst transformed = transformResult(res.json, resolvedOpts.transformer.output);\n\t\t\t\t\tif (!transformed.ok) {\n\t\t\t\t\t\tobserver.error(TRPCClientError.from(transformed.error, { meta }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tobserver.next({\n\t\t\t\t\t\tcontext: res.meta,\n\t\t\t\t\t\tresult: transformed.result\n\t\t\t\t\t});\n\t\t\t\t\tobserver.complete();\n\t\t\t\t}).catch((cause) => {\n\t\t\t\t\tobserver.error(TRPCClientError.from(cause, { meta }));\n\t\t\t\t});\n\t\t\t\treturn () => {};\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { httpLink, isFormData, isNonJsonSerializable, isOctetType };\n//# sourceMappingURL=httpLink-DCFpUmZF.mjs.map","import { TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER, isObject } from \"./utils-CLZnJdb_.mjs\";\n\n//#region rolldown:runtime\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 __commonJS = (cb, mod) => function() {\n\treturn mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\tkey = keys[i];\n\t\tif (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\tvalue: mod,\n\tenumerable: true\n}) : target, mod));\n\n//#endregion\n//#region src/unstable-core-do-not-import/createProxy.ts\nconst noop = () => {};\nconst freezeIfAvailable = (obj) => {\n\tif (Object.freeze) Object.freeze(obj);\n};\nfunction createInnerProxy(callback, path, memo) {\n\tvar _memo$cacheKey;\n\tconst cacheKey = path.join(\".\");\n\t(_memo$cacheKey = memo[cacheKey]) !== null && _memo$cacheKey !== void 0 || (memo[cacheKey] = new Proxy(noop, {\n\t\tget(_obj, key) {\n\t\t\tif (typeof key !== \"string\" || key === \"then\") return void 0;\n\t\t\treturn createInnerProxy(callback, [...path, key], memo);\n\t\t},\n\t\tapply(_1, _2, args) {\n\t\t\tconst lastOfPath = path[path.length - 1];\n\t\t\tlet opts = {\n\t\t\t\targs,\n\t\t\t\tpath\n\t\t\t};\n\t\t\tif (lastOfPath === \"call\") opts = {\n\t\t\t\targs: args.length >= 2 ? [args[1]] : [],\n\t\t\t\tpath: path.slice(0, -1)\n\t\t\t};\n\t\t\telse if (lastOfPath === \"apply\") opts = {\n\t\t\t\targs: args.length >= 2 ? args[1] : [],\n\t\t\t\tpath: path.slice(0, -1)\n\t\t\t};\n\t\t\tfreezeIfAvailable(opts.args);\n\t\t\tfreezeIfAvailable(opts.path);\n\t\t\treturn callback(opts);\n\t\t}\n\t}));\n\treturn memo[cacheKey];\n}\n/**\n* Creates a proxy that calls the callback with the path and arguments\n*\n* @internal\n*/\nconst createRecursiveProxy = (callback) => createInnerProxy(callback, [], Object.create(null));\n/**\n* Used in place of `new Proxy` where each handler will map 1 level deep to another value.\n*\n* @internal\n*/\nconst createFlatProxy = (callback) => {\n\treturn new Proxy(noop, { get(_obj, name) {\n\t\tif (name === \"then\") return void 0;\n\t\treturn callback(name);\n\t} });\n};\n\n//#endregion\n//#region src/unstable-core-do-not-import/http/getHTTPStatusCode.ts\nconst JSONRPC2_TO_HTTP_CODE = {\n\tPARSE_ERROR: 400,\n\tBAD_REQUEST: 400,\n\tUNAUTHORIZED: 401,\n\tPAYMENT_REQUIRED: 402,\n\tFORBIDDEN: 403,\n\tNOT_FOUND: 404,\n\tMETHOD_NOT_SUPPORTED: 405,\n\tTIMEOUT: 408,\n\tCONFLICT: 409,\n\tPRECONDITION_FAILED: 412,\n\tPAYLOAD_TOO_LARGE: 413,\n\tUNSUPPORTED_MEDIA_TYPE: 415,\n\tUNPROCESSABLE_CONTENT: 422,\n\tPRECONDITION_REQUIRED: 428,\n\tTOO_MANY_REQUESTS: 429,\n\tCLIENT_CLOSED_REQUEST: 499,\n\tINTERNAL_SERVER_ERROR: 500,\n\tNOT_IMPLEMENTED: 501,\n\tBAD_GATEWAY: 502,\n\tSERVICE_UNAVAILABLE: 503,\n\tGATEWAY_TIMEOUT: 504\n};\nconst HTTP_CODE_TO_JSONRPC2 = {\n\t400: \"BAD_REQUEST\",\n\t401: \"UNAUTHORIZED\",\n\t402: \"PAYMENT_REQUIRED\",\n\t403: \"FORBIDDEN\",\n\t404: \"NOT_FOUND\",\n\t405: \"METHOD_NOT_SUPPORTED\",\n\t408: \"TIMEOUT\",\n\t409: \"CONFLICT\",\n\t412: \"PRECONDITION_FAILED\",\n\t413: \"PAYLOAD_TOO_LARGE\",\n\t415: \"UNSUPPORTED_MEDIA_TYPE\",\n\t422: \"UNPROCESSABLE_CONTENT\",\n\t428: \"PRECONDITION_REQUIRED\",\n\t429: \"TOO_MANY_REQUESTS\",\n\t499: \"CLIENT_CLOSED_REQUEST\",\n\t500: \"INTERNAL_SERVER_ERROR\",\n\t501: \"NOT_IMPLEMENTED\",\n\t502: \"BAD_GATEWAY\",\n\t503: \"SERVICE_UNAVAILABLE\",\n\t504: \"GATEWAY_TIMEOUT\"\n};\nfunction getStatusCodeFromKey(code) {\n\tvar _JSONRPC2_TO_HTTP_COD;\n\treturn (_JSONRPC2_TO_HTTP_COD = JSONRPC2_TO_HTTP_CODE[code]) !== null && _JSONRPC2_TO_HTTP_COD !== void 0 ? _JSONRPC2_TO_HTTP_COD : 500;\n}\nfunction getStatusKeyFromCode(code) {\n\tvar _HTTP_CODE_TO_JSONRPC;\n\treturn (_HTTP_CODE_TO_JSONRPC = HTTP_CODE_TO_JSONRPC2[code]) !== null && _HTTP_CODE_TO_JSONRPC !== void 0 ? _HTTP_CODE_TO_JSONRPC : \"INTERNAL_SERVER_ERROR\";\n}\nfunction getHTTPStatusCode(json) {\n\tconst arr = Array.isArray(json) ? json : [json];\n\tconst httpStatuses = new Set(arr.map((res) => {\n\t\tif (\"error\" in res && isObject(res.error.data)) {\n\t\t\tvar _res$error$data;\n\t\t\tif (typeof ((_res$error$data = res.error.data) === null || _res$error$data === void 0 ? void 0 : _res$error$data[\"httpStatus\"]) === \"number\") return res.error.data[\"httpStatus\"];\n\t\t\tconst code = TRPC_ERROR_CODES_BY_NUMBER[res.error.code];\n\t\t\treturn getStatusCodeFromKey(code);\n\t\t}\n\t\treturn 200;\n\t}));\n\tif (httpStatuses.size !== 1) return 207;\n\tconst httpStatus = httpStatuses.values().next().value;\n\treturn httpStatus;\n}\nfunction getHTTPStatusCodeFromError(error) {\n\treturn getStatusCodeFromKey(error.code);\n}\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js\nvar require_typeof = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js\"(exports, module) {\n\tfunction _typeof$2(o) {\n\t\t\"@babel/helpers - typeof\";\n\t\treturn module.exports = _typeof$2 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o$1) {\n\t\t\treturn typeof o$1;\n\t\t} : function(o$1) {\n\t\t\treturn o$1 && \"function\" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? \"symbol\" : typeof o$1;\n\t\t}, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof$2(o);\n\t}\n\tmodule.exports = _typeof$2, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js\nvar require_toPrimitive = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js\"(exports, module) {\n\tvar _typeof$1 = require_typeof()[\"default\"];\n\tfunction toPrimitive$1(t, r) {\n\t\tif (\"object\" != _typeof$1(t) || !t) return t;\n\t\tvar e = t[Symbol.toPrimitive];\n\t\tif (void 0 !== e) {\n\t\t\tvar i = e.call(t, r || \"default\");\n\t\t\tif (\"object\" != _typeof$1(i)) return i;\n\t\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t\t}\n\t\treturn (\"string\" === r ? String : Number)(t);\n\t}\n\tmodule.exports = toPrimitive$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js\nvar require_toPropertyKey = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js\"(exports, module) {\n\tvar _typeof = require_typeof()[\"default\"];\n\tvar toPrimitive = require_toPrimitive();\n\tfunction toPropertyKey$1(t) {\n\t\tvar i = toPrimitive(t, \"string\");\n\t\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n\t}\n\tmodule.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js\nvar require_defineProperty = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js\"(exports, module) {\n\tvar toPropertyKey = require_toPropertyKey();\n\tfunction _defineProperty(e, r, t) {\n\t\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\t\tvalue: t,\n\t\t\tenumerable: !0,\n\t\t\tconfigurable: !0,\n\t\t\twritable: !0\n\t\t}) : e[r] = t, e;\n\t}\n\tmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js\nvar require_objectSpread2 = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js\"(exports, module) {\n\tvar defineProperty = require_defineProperty();\n\tfunction ownKeys(e, r) {\n\t\tvar t = Object.keys(e);\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tvar o = Object.getOwnPropertySymbols(e);\n\t\t\tr && (o = o.filter(function(r$1) {\n\t\t\t\treturn Object.getOwnPropertyDescriptor(e, r$1).enumerable;\n\t\t\t})), t.push.apply(t, o);\n\t\t}\n\t\treturn t;\n\t}\n\tfunction _objectSpread2(e) {\n\t\tfor (var r = 1; r < arguments.length; r++) {\n\t\t\tvar t = null != arguments[r] ? arguments[r] : {};\n\t\t\tr % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {\n\t\t\t\tdefineProperty(e, r$1, t[r$1]);\n\t\t\t}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {\n\t\t\t\tObject.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));\n\t\t\t});\n\t\t}\n\t\treturn e;\n\t}\n\tmodule.exports = _objectSpread2, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region src/unstable-core-do-not-import/error/getErrorShape.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* @internal\n*/\nfunction getErrorShape(opts) {\n\tconst { path, error, config } = opts;\n\tconst { code } = opts.error;\n\tconst shape = {\n\t\tmessage: error.message,\n\t\tcode: TRPC_ERROR_CODES_BY_KEY[code],\n\t\tdata: {\n\t\t\tcode,\n\t\t\thttpStatus: getHTTPStatusCodeFromError(error)\n\t\t}\n\t};\n\tif (config.isDev && typeof opts.error.stack === \"string\") shape.data.stack = opts.error.stack;\n\tif (typeof path === \"string\") shape.data.path = path;\n\treturn config.errorFormatter((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { shape }));\n}\n\n//#endregion\nexport { HTTP_CODE_TO_JSONRPC2, JSONRPC2_TO_HTTP_CODE, __commonJS, __toESM, createFlatProxy, createRecursiveProxy, getErrorShape, getHTTPStatusCode, getHTTPStatusCodeFromError, getStatusCodeFromKey, getStatusKeyFromCode, require_defineProperty, require_objectSpread2 };\n//# sourceMappingURL=getErrorShape-BH60iMC2.mjs.map","import { __toESM, createRecursiveProxy, require_defineProperty, require_objectSpread2 } from \"./getErrorShape-BH60iMC2.mjs\";\nimport { isFunction, isObject, mergeWithoutOverrides, omitPrototype } from \"./utils-CLZnJdb_.mjs\";\n\n//#region src/unstable-core-do-not-import/error/formatter.ts\nconst defaultFormatter = ({ shape }) => {\n\treturn shape;\n};\n\n//#endregion\n//#region src/unstable-core-do-not-import/error/TRPCError.ts\nvar import_defineProperty = __toESM(require_defineProperty(), 1);\nvar UnknownCauseError = class extends Error {};\nfunction getCauseFromUnknown(cause) {\n\tif (cause instanceof Error) return cause;\n\tconst type = typeof cause;\n\tif (type === \"undefined\" || type === \"function\" || cause === null) return void 0;\n\tif (type !== \"object\") return new Error(String(cause));\n\tif (isObject(cause)) return Object.assign(new UnknownCauseError(), cause);\n\treturn void 0;\n}\nfunction getTRPCErrorFromUnknown(cause) {\n\tif (cause instanceof TRPCError) return cause;\n\tif (cause instanceof Error && cause.name === \"TRPCError\") return cause;\n\tconst trpcError = new TRPCError({\n\t\tcode: \"INTERNAL_SERVER_ERROR\",\n\t\tcause\n\t});\n\tif (cause instanceof Error && cause.stack) trpcError.stack = cause.stack;\n\treturn trpcError;\n}\nvar TRPCError = class extends Error {\n\tconstructor(opts) {\n\t\tvar _ref, _opts$message, _this$cause;\n\t\tconst cause = getCauseFromUnknown(opts.cause);\n\t\tconst message = (_ref = (_opts$message = opts.message) !== null && _opts$message !== void 0 ? _opts$message : cause === null || cause === void 0 ? void 0 : cause.message) !== null && _ref !== void 0 ? _ref : opts.code;\n\t\tsuper(message, { cause });\n\t\t(0, import_defineProperty.default)(this, \"cause\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"code\", void 0);\n\t\tthis.code = opts.code;\n\t\tthis.name = \"TRPCError\";\n\t\t(_this$cause = this.cause) !== null && _this$cause !== void 0 || (this.cause = cause);\n\t}\n};\n\n//#endregion\n//#region src/unstable-core-do-not-import/transformer.ts\nvar import_objectSpread2$1 = __toESM(require_objectSpread2(), 1);\n/**\n* @internal\n*/\nfunction getDataTransformer(transformer) {\n\tif (\"input\" in transformer) return transformer;\n\treturn {\n\t\tinput: transformer,\n\t\toutput: transformer\n\t};\n}\n/**\n* @internal\n*/\nconst defaultTransformer = {\n\tinput: {\n\t\tserialize: (obj) => obj,\n\t\tdeserialize: (obj) => obj\n\t},\n\toutput: {\n\t\tserialize: (obj) => obj,\n\t\tdeserialize: (obj) => obj\n\t}\n};\nfunction transformTRPCResponseItem(config, item) {\n\tif (\"error\" in item) return (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, item), {}, { error: config.transformer.output.serialize(item.error) });\n\tif (\"data\" in item.result) return (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, item), {}, { result: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, item.result), {}, { data: config.transformer.output.serialize(item.result.data) }) });\n\treturn item;\n}\n/**\n* Takes a unserialized `TRPCResponse` and serializes it with the router's transformers\n**/\nfunction transformTRPCResponse(config, itemOrItems) {\n\treturn Array.isArray(itemOrItems) ? itemOrItems.map((item) => transformTRPCResponseItem(config, item)) : transformTRPCResponseItem(config, itemOrItems);\n}\n/** @internal */\nfunction transformResultInner(response, transformer) {\n\tif (\"error\" in response) {\n\t\tconst error = transformer.deserialize(response.error);\n\t\treturn {\n\t\t\tok: false,\n\t\t\terror: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response), {}, { error })\n\t\t};\n\t}\n\tconst result = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response.result), (!response.result.type || response.result.type === \"data\") && {\n\t\ttype: \"data\",\n\t\tdata: transformer.deserialize(response.result.data)\n\t});\n\treturn {\n\t\tok: true,\n\t\tresult\n\t};\n}\nvar TransformResultError = class extends Error {\n\tconstructor() {\n\t\tsuper(\"Unable to transform response from server\");\n\t}\n};\n/**\n* Transforms and validates that the result is a valid TRPCResponse\n* @internal\n*/\nfunction transformResult(response, transformer) {\n\tlet result;\n\ttry {\n\t\tresult = transformResultInner(response, transformer);\n\t} catch (_unused) {\n\t\tthrow new TransformResultError();\n\t}\n\tif (!result.ok && (!isObject(result.error.error) || typeof result.error.error[\"code\"] !== \"number\")) throw new TransformResultError();\n\tif (result.ok && !isObject(result.result)) throw new TransformResultError();\n\treturn result;\n}\n\n//#endregion\n//#region src/unstable-core-do-not-import/router.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* @internal\n*/\nconst lazyMarker = \"lazyMarker\";\nfunction once(fn) {\n\tconst uncalled = Symbol();\n\tlet result = uncalled;\n\treturn () => {\n\t\tif (result === uncalled) result = fn();\n\t\treturn result;\n\t};\n}\n/**\n* Lazy load a router\n* @see https://trpc.io/docs/server/merging-routers#lazy-load\n*/\nfunction lazy(importRouter) {\n\tasync function resolve() {\n\t\tconst mod = await importRouter();\n\t\tif (isRouter(mod)) return mod;\n\t\tconst routers = Object.values(mod);\n\t\tif (routers.length !== 1 || !isRouter(routers[0])) throw new Error(\"Invalid router module - either define exactly 1 export or return the router directly.\\nExample: `lazy(() => import('./slow.js').then((m) => m.slowRouter))`\");\n\t\treturn routers[0];\n\t}\n\tresolve[lazyMarker] = true;\n\treturn resolve;\n}\nfunction isLazy(input) {\n\treturn typeof input === \"function\" && lazyMarker in input;\n}\nfunction isRouter(value) {\n\treturn isObject(value) && isObject(value[\"_def\"]) && \"router\" in value[\"_def\"];\n}\nconst emptyRouter = {\n\t_ctx: null,\n\t_errorShape: null,\n\t_meta: null,\n\tqueries: {},\n\tmutations: {},\n\tsubscriptions: {},\n\terrorFormatter: defaultFormatter,\n\ttransformer: defaultTransformer\n};\n/**\n* Reserved words that can't be used as router or procedure names\n*/\nconst reservedWords = [\n\t\"then\",\n\t\"call\",\n\t\"apply\"\n];\n/**\n* @internal\n*/\nfunction createRouterFactory(config) {\n\tfunction createRouterInner(input) {\n\t\tconst reservedWordsUsed = new Set(Object.keys(input).filter((v) => reservedWords.includes(v)));\n\t\tif (reservedWordsUsed.size > 0) throw new Error(\"Reserved words used in `router({})` call: \" + Array.from(reservedWordsUsed).join(\", \"));\n\t\tconst procedures = omitPrototype({});\n\t\tconst lazy$1 = omitPrototype({});\n\t\tfunction createLazyLoader(opts) {\n\t\t\treturn {\n\t\t\t\tref: opts.ref,\n\t\t\t\tload: once(async () => {\n\t\t\t\t\tconst router$1 = await opts.ref();\n\t\t\t\t\tconst lazyPath = [...opts.path, opts.key];\n\t\t\t\t\tconst lazyKey = lazyPath.join(\".\");\n\t\t\t\t\topts.aggregate[opts.key] = step(router$1._def.record, lazyPath);\n\t\t\t\t\tdelete lazy$1[lazyKey];\n\t\t\t\t\tfor (const [nestedKey, nestedItem] of Object.entries(router$1._def.lazy)) {\n\t\t\t\t\t\tconst nestedRouterKey = [...lazyPath, nestedKey].join(\".\");\n\t\t\t\t\t\tlazy$1[nestedRouterKey] = createLazyLoader({\n\t\t\t\t\t\t\tref: nestedItem.ref,\n\t\t\t\t\t\t\tpath: lazyPath,\n\t\t\t\t\t\t\tkey: nestedKey,\n\t\t\t\t\t\t\taggregate: opts.aggregate[opts.key]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t};\n\t\t}\n\t\tfunction step(from, path = []) {\n\t\t\tconst aggregate = omitPrototype({});\n\t\t\tfor (const [key, item] of Object.entries(from !== null && from !== void 0 ? from : {})) {\n\t\t\t\tif (isLazy(item)) {\n\t\t\t\t\tlazy$1[[...path, key].join(\".\")] = createLazyLoader({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tref: item,\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\taggregate\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (isRouter(item)) {\n\t\t\t\t\taggregate[key] = step(item._def.record, [...path, key]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!isProcedure(item)) {\n\t\t\t\t\taggregate[key] = step(item, [...path, key]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst newPath = [...path, key].join(\".\");\n\t\t\t\tif (procedures[newPath]) throw new Error(`Duplicate key: ${newPath}`);\n\t\t\t\tprocedures[newPath] = item;\n\t\t\t\taggregate[key] = item;\n\t\t\t}\n\t\t\treturn aggregate;\n\t\t}\n\t\tconst record = step(input);\n\t\tconst _def = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({\n\t\t\t_config: config,\n\t\t\trouter: true,\n\t\t\tprocedures,\n\t\t\tlazy: lazy$1\n\t\t}, emptyRouter), {}, { record });\n\t\tconst router = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, record), {}, {\n\t\t\t_def,\n\t\t\tcreateCaller: createCallerFactory()({ _def })\n\t\t});\n\t\treturn router;\n\t}\n\treturn createRouterInner;\n}\nfunction isProcedure(procedureOrRouter) {\n\treturn typeof procedureOrRouter === \"function\";\n}\n/**\n* @internal\n*/\nasync function getProcedureAtPath(router, path) {\n\tconst { _def } = router;\n\tlet procedure = _def.procedures[path];\n\twhile (!procedure) {\n\t\tconst key = Object.keys(_def.lazy).find((key$1) => path.startsWith(key$1));\n\t\tif (!key) return null;\n\t\tconst lazyRouter = _def.lazy[key];\n\t\tawait lazyRouter.load();\n\t\tprocedure = _def.procedures[path];\n\t}\n\treturn procedure;\n}\n/**\n* @internal\n*/\nasync function callProcedure(opts) {\n\tconst { type, path } = opts;\n\tconst proc = await getProcedureAtPath(opts.router, path);\n\tif (!proc || !isProcedure(proc) || proc._def.type !== type && !opts.allowMethodOverride) throw new TRPCError({\n\t\tcode: \"NOT_FOUND\",\n\t\tmessage: `No \"${type}\"-procedure on path \"${path}\"`\n\t});\n\t/* istanbul ignore if -- @preserve */\n\tif (proc._def.type !== type && opts.allowMethodOverride && proc._def.type === \"subscription\") throw new TRPCError({\n\t\tcode: \"METHOD_NOT_SUPPORTED\",\n\t\tmessage: `Method override is not supported for subscriptions`\n\t});\n\treturn proc(opts);\n}\nfunction createCallerFactory() {\n\treturn function createCallerInner(router) {\n\t\tconst { _def } = router;\n\t\treturn function createCaller(ctxOrCallback, opts) {\n\t\t\treturn createRecursiveProxy(async (innerOpts) => {\n\t\t\t\tconst { path, args } = innerOpts;\n\t\t\t\tconst fullPath = path.join(\".\");\n\t\t\t\tif (path.length === 1 && path[0] === \"_def\") return _def;\n\t\t\t\tconst procedure = await getProcedureAtPath(router, fullPath);\n\t\t\t\tlet ctx = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tif (!procedure) throw new TRPCError({\n\t\t\t\t\t\tcode: \"NOT_FOUND\",\n\t\t\t\t\t\tmessage: `No procedure found on path \"${path}\"`\n\t\t\t\t\t});\n\t\t\t\t\tctx = isFunction(ctxOrCallback) ? await Promise.resolve(ctxOrCallback()) : ctxOrCallback;\n\t\t\t\t\treturn await procedure({\n\t\t\t\t\t\tpath: fullPath,\n\t\t\t\t\t\tgetRawInput: async () => args[0],\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\ttype: procedure._def.type,\n\t\t\t\t\t\tsignal: opts === null || opts === void 0 ? void 0 : opts.signal\n\t\t\t\t\t});\n\t\t\t\t} catch (cause) {\n\t\t\t\t\tvar _opts$onError, _procedure$_def$type;\n\t\t\t\t\topts === null || opts === void 0 || (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, {\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\terror: getTRPCErrorFromUnknown(cause),\n\t\t\t\t\t\tinput: args[0],\n\t\t\t\t\t\tpath: fullPath,\n\t\t\t\t\t\ttype: (_procedure$_def$type = procedure === null || procedure === void 0 ? void 0 : procedure._def.type) !== null && _procedure$_def$type !== void 0 ? _procedure$_def$type : \"unknown\"\n\t\t\t\t\t});\n\t\t\t\t\tthrow cause;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t};\n}\nfunction mergeRouters(...routerList) {\n\tvar _routerList$, _routerList$2;\n\tconst record = mergeWithoutOverrides({}, ...routerList.map((r) => r._def.record));\n\tconst errorFormatter = routerList.reduce((currentErrorFormatter, nextRouter) => {\n\t\tif (nextRouter._def._config.errorFormatter && nextRouter._def._config.errorFormatter !== defaultFormatter) {\n\t\t\tif (currentErrorFormatter !== defaultFormatter && currentErrorFormatter !== nextRouter._def._config.errorFormatter) throw new Error(\"You seem to have several error formatters\");\n\t\t\treturn nextRouter._def._config.errorFormatter;\n\t\t}\n\t\treturn currentErrorFormatter;\n\t}, defaultFormatter);\n\tconst transformer = routerList.reduce((prev, current) => {\n\t\tif (current._def._config.transformer && current._def._config.transformer !== defaultTransformer) {\n\t\t\tif (prev !== defaultTransformer && prev !== current._def._config.transformer) throw new Error(\"You seem to have several transformers\");\n\t\t\treturn current._def._config.transformer;\n\t\t}\n\t\treturn prev;\n\t}, defaultTransformer);\n\tconst router = createRouterFactory({\n\t\terrorFormatter,\n\t\ttransformer,\n\t\tisDev: routerList.every((r) => r._def._config.isDev),\n\t\tallowOutsideOfServer: routerList.every((r) => r._def._config.allowOutsideOfServer),\n\t\tisServer: routerList.every((r) => r._def._config.isServer),\n\t\t$types: (_routerList$ = routerList[0]) === null || _routerList$ === void 0 ? void 0 : _routerList$._def._config.$types,\n\t\tsse: (_routerList$2 = routerList[0]) === null || _routerList$2 === void 0 ? void 0 : _routerList$2._def._config.sse\n\t})(record);\n\treturn router;\n}\n\n//#endregion\n//#region src/unstable-core-do-not-import/stream/tracked.ts\nconst trackedSymbol = Symbol();\n/**\n* Produce a typed server-sent event message\n* @deprecated use `tracked(id, data)` instead\n*/\nfunction sse(event) {\n\treturn tracked(event.id, event.data);\n}\nfunction isTrackedEnvelope(value) {\n\treturn Array.isArray(value) && value[2] === trackedSymbol;\n}\n/**\n* Automatically track an event so that it can be resumed from a given id if the connection is lost\n*/\nfunction tracked(id, data) {\n\tif (id === \"\") throw new Error(\"`id` must not be an empty string as empty string is the same as not setting the id at all\");\n\treturn [\n\t\tid,\n\t\tdata,\n\t\ttrackedSymbol\n\t];\n}\n\n//#endregion\nexport { TRPCError, callProcedure, createCallerFactory, createRouterFactory, defaultFormatter, defaultTransformer, getCauseFromUnknown, getDataTransformer, getProcedureAtPath, getTRPCErrorFromUnknown, isTrackedEnvelope, lazy, mergeRouters, sse, tracked, transformResult, transformTRPCResponse };\n//# sourceMappingURL=tracked-DBSMdVzR.mjs.map","import { __toESM, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { TRPCClientError } from \"./TRPCClientError-CjKyS10w.mjs\";\nimport { getUrl, jsonHttpRequester, resolveHTTPLinkOptions } from \"./httpUtils-Dv57hbOd.mjs\";\nimport { observable } from \"@trpc/server/observable\";\nimport { transformResult } from \"@trpc/server/unstable-core-do-not-import\";\n\n//#region src/internals/dataLoader.ts\n/**\n* A function that should never be called unless we messed something up.\n*/\nconst throwFatalError = () => {\n\tthrow new Error(\"Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new\");\n};\n/**\n* Dataloader that's very inspired by https://github.com/graphql/dataloader\n* Less configuration, no caching, and allows you to cancel requests\n* When cancelling a single fetch the whole batch will be cancelled only when _all_ items are cancelled\n*/\nfunction dataLoader(batchLoader) {\n\tlet pendingItems = null;\n\tlet dispatchTimer = null;\n\tconst destroyTimerAndPendingItems = () => {\n\t\tclearTimeout(dispatchTimer);\n\t\tdispatchTimer = null;\n\t\tpendingItems = null;\n\t};\n\t/**\n\t* Iterate through the items and split them into groups based on the `batchLoader`'s validate function\n\t*/\n\tfunction groupItems(items) {\n\t\tconst groupedItems = [[]];\n\t\tlet index = 0;\n\t\twhile (true) {\n\t\t\tconst item = items[index];\n\t\t\tif (!item) break;\n\t\t\tconst lastGroup = groupedItems[groupedItems.length - 1];\n\t\t\tif (item.aborted) {\n\t\t\t\tvar _item$reject;\n\t\t\t\t(_item$reject = item.reject) === null || _item$reject === void 0 || _item$reject.call(item, new Error(\"Aborted\"));\n\t\t\t\tindex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst isValid = batchLoader.validate(lastGroup.concat(item).map((it) => it.key));\n\t\t\tif (isValid) {\n\t\t\t\tlastGroup.push(item);\n\t\t\t\tindex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (lastGroup.length === 0) {\n\t\t\t\tvar _item$reject2;\n\t\t\t\t(_item$reject2 = item.reject) === null || _item$reject2 === void 0 || _item$reject2.call(item, new Error(\"Input is too big for a single dispatch\"));\n\t\t\t\tindex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tgroupedItems.push([]);\n\t\t}\n\t\treturn groupedItems;\n\t}\n\tfunction dispatch() {\n\t\tconst groupedItems = groupItems(pendingItems);\n\t\tdestroyTimerAndPendingItems();\n\t\tfor (const items of groupedItems) {\n\t\t\tif (!items.length) continue;\n\t\t\tconst batch = { items };\n\t\t\tfor (const item of items) item.batch = batch;\n\t\t\tconst promise = batchLoader.fetch(batch.items.map((_item) => _item.key));\n\t\t\tpromise.then(async (result) => {\n\t\t\t\tawait Promise.all(result.map(async (valueOrPromise, index) => {\n\t\t\t\t\tconst item = batch.items[index];\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar _item$resolve;\n\t\t\t\t\t\tconst value = await Promise.resolve(valueOrPromise);\n\t\t\t\t\t\t(_item$resolve = item.resolve) === null || _item$resolve === void 0 || _item$resolve.call(item, value);\n\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\tvar _item$reject3;\n\t\t\t\t\t\t(_item$reject3 = item.reject) === null || _item$reject3 === void 0 || _item$reject3.call(item, cause);\n\t\t\t\t\t}\n\t\t\t\t\titem.batch = null;\n\t\t\t\t\titem.reject = null;\n\t\t\t\t\titem.resolve = null;\n\t\t\t\t}));\n\t\t\t\tfor (const item of batch.items) {\n\t\t\t\t\tvar _item$reject4;\n\t\t\t\t\t(_item$reject4 = item.reject) === null || _item$reject4 === void 0 || _item$reject4.call(item, new Error(\"Missing result\"));\n\t\t\t\t\titem.batch = null;\n\t\t\t\t}\n\t\t\t}).catch((cause) => {\n\t\t\t\tfor (const item of batch.items) {\n\t\t\t\t\tvar _item$reject5;\n\t\t\t\t\t(_item$reject5 = item.reject) === null || _item$reject5 === void 0 || _item$reject5.call(item, cause);\n\t\t\t\t\titem.batch = null;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tfunction load(key) {\n\t\tvar _dispatchTimer;\n\t\tconst item = {\n\t\t\taborted: false,\n\t\t\tkey,\n\t\t\tbatch: null,\n\t\t\tresolve: throwFatalError,\n\t\t\treject: throwFatalError\n\t\t};\n\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\tvar _pendingItems;\n\t\t\titem.reject = reject;\n\t\t\titem.resolve = resolve;\n\t\t\t(_pendingItems = pendingItems) !== null && _pendingItems !== void 0 || (pendingItems = []);\n\t\t\tpendingItems.push(item);\n\t\t});\n\t\t(_dispatchTimer = dispatchTimer) !== null && _dispatchTimer !== void 0 || (dispatchTimer = setTimeout(dispatch));\n\t\treturn promise;\n\t}\n\treturn { load };\n}\n\n//#endregion\n//#region src/internals/signals.ts\n/**\n* Like `Promise.all()` but for abort signals\n* - When all signals have been aborted, the merged signal will be aborted\n* - If one signal is `null`, no signal will be aborted\n*/\nfunction allAbortSignals(...signals) {\n\tconst ac = new AbortController();\n\tconst count = signals.length;\n\tlet abortedCount = 0;\n\tconst onAbort = () => {\n\t\tif (++abortedCount === count) ac.abort();\n\t};\n\tfor (const signal of signals) if (signal === null || signal === void 0 ? void 0 : signal.aborted) onAbort();\n\telse signal === null || signal === void 0 || signal.addEventListener(\"abort\", onAbort, { once: true });\n\treturn ac.signal;\n}\n/**\n* Like `Promise.race` but for abort signals\n*\n* Basically, a ponyfill for\n* [`AbortSignal.any`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static).\n*/\nfunction raceAbortSignals(...signals) {\n\tconst ac = new AbortController();\n\tfor (const signal of signals) if (signal === null || signal === void 0 ? void 0 : signal.aborted) ac.abort();\n\telse signal === null || signal === void 0 || signal.addEventListener(\"abort\", () => ac.abort(), { once: true });\n\treturn ac.signal;\n}\nfunction abortSignalToPromise(signal) {\n\treturn new Promise((_, reject) => {\n\t\tif (signal.aborted) {\n\t\t\treject(signal.reason);\n\t\t\treturn;\n\t\t}\n\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\treject(signal.reason);\n\t\t}, { once: true });\n\t});\n}\n\n//#endregion\n//#region src/links/httpBatchLink.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* @see https://trpc.io/docs/client/links/httpBatchLink\n*/\nfunction httpBatchLink(opts) {\n\tvar _opts$maxURLLength, _opts$maxItems;\n\tconst resolvedOpts = resolveHTTPLinkOptions(opts);\n\tconst maxURLLength = (_opts$maxURLLength = opts.maxURLLength) !== null && _opts$maxURLLength !== void 0 ? _opts$maxURLLength : Infinity;\n\tconst maxItems = (_opts$maxItems = opts.maxItems) !== null && _opts$maxItems !== void 0 ? _opts$maxItems : Infinity;\n\treturn () => {\n\t\tconst batchLoader = (type) => {\n\t\t\treturn {\n\t\t\t\tvalidate(batchOps) {\n\t\t\t\t\tif (maxURLLength === Infinity && maxItems === Infinity) return true;\n\t\t\t\t\tif (batchOps.length > maxItems) return false;\n\t\t\t\t\tconst path = batchOps.map((op) => op.path).join(\",\");\n\t\t\t\t\tconst inputs = batchOps.map((op) => op.input);\n\t\t\t\t\tconst url = getUrl((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, resolvedOpts), {}, {\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tinputs,\n\t\t\t\t\t\tsignal: null\n\t\t\t\t\t}));\n\t\t\t\t\treturn url.length <= maxURLLength;\n\t\t\t\t},\n\t\t\t\tasync fetch(batchOps) {\n\t\t\t\t\tconst path = batchOps.map((op) => op.path).join(\",\");\n\t\t\t\t\tconst inputs = batchOps.map((op) => op.input);\n\t\t\t\t\tconst signal = allAbortSignals(...batchOps.map((op) => op.signal));\n\t\t\t\t\tconst res = await jsonHttpRequester((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, resolvedOpts), {}, {\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tinputs,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\theaders() {\n\t\t\t\t\t\t\tif (!opts.headers) return {};\n\t\t\t\t\t\t\tif (typeof opts.headers === \"function\") return opts.headers({ opList: batchOps });\n\t\t\t\t\t\t\treturn opts.headers;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsignal\n\t\t\t\t\t}));\n\t\t\t\t\tconst resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json);\n\t\t\t\t\tconst result = resJSON.map((item) => ({\n\t\t\t\t\t\tmeta: res.meta,\n\t\t\t\t\t\tjson: item\n\t\t\t\t\t}));\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\tconst query = dataLoader(batchLoader(\"query\"));\n\t\tconst mutation = dataLoader(batchLoader(\"mutation\"));\n\t\tconst loaders = {\n\t\t\tquery,\n\t\t\tmutation\n\t\t};\n\t\treturn ({ op }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\t/* istanbul ignore if -- @preserve */\n\t\t\t\tif (op.type === \"subscription\") throw new Error(\"Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`\");\n\t\t\t\tconst loader = loaders[op.type];\n\t\t\t\tconst promise = loader.load(op);\n\t\t\t\tlet _res = void 0;\n\t\t\t\tpromise.then((res) => {\n\t\t\t\t\t_res = res;\n\t\t\t\t\tconst transformed = transformResult(res.json, resolvedOpts.transformer.output);\n\t\t\t\t\tif (!transformed.ok) {\n\t\t\t\t\t\tobserver.error(TRPCClientError.from(transformed.error, { meta: res.meta }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tobserver.next({\n\t\t\t\t\t\tcontext: res.meta,\n\t\t\t\t\t\tresult: transformed.result\n\t\t\t\t\t});\n\t\t\t\t\tobserver.complete();\n\t\t\t\t}).catch((err) => {\n\t\t\t\t\tobserver.error(TRPCClientError.from(err, { meta: _res === null || _res === void 0 ? void 0 : _res.meta }));\n\t\t\t\t});\n\t\t\t\treturn () => {};\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { abortSignalToPromise, allAbortSignals, dataLoader, httpBatchLink, raceAbortSignals };\n//# sourceMappingURL=httpBatchLink-BOe5aCcR.mjs.map","import { observable } from \"./observable-UMO3vUa_.mjs\";\n\n//#region src/observable/operators.ts\nfunction map(project) {\n\treturn (source) => {\n\t\treturn observable((destination) => {\n\t\t\tlet index = 0;\n\t\t\tconst subscription = source.subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tdestination.next(project(value, index++));\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tdestination.error(error);\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tdestination.complete();\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn subscription;\n\t\t});\n\t};\n}\nfunction share(_opts) {\n\treturn (source) => {\n\t\tlet refCount = 0;\n\t\tlet subscription = null;\n\t\tconst observers = [];\n\t\tfunction startIfNeeded() {\n\t\t\tif (subscription) return;\n\t\t\tsubscription = source.subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tfor (const observer of observers) {\n\t\t\t\t\t\tvar _observer$next;\n\t\t\t\t\t\t(_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tfor (const observer of observers) {\n\t\t\t\t\t\tvar _observer$error;\n\t\t\t\t\t\t(_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, error);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tfor (const observer of observers) {\n\t\t\t\t\t\tvar _observer$complete;\n\t\t\t\t\t\t(_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tfunction resetIfNeeded() {\n\t\t\tif (refCount === 0 && subscription) {\n\t\t\t\tconst _sub = subscription;\n\t\t\t\tsubscription = null;\n\t\t\t\t_sub.unsubscribe();\n\t\t\t}\n\t\t}\n\t\treturn observable((subscriber) => {\n\t\t\trefCount++;\n\t\t\tobservers.push(subscriber);\n\t\t\tstartIfNeeded();\n\t\t\treturn { unsubscribe() {\n\t\t\t\trefCount--;\n\t\t\t\tresetIfNeeded();\n\t\t\t\tconst index = observers.findIndex((v) => v === subscriber);\n\t\t\t\tif (index > -1) observers.splice(index, 1);\n\t\t\t} };\n\t\t});\n\t};\n}\nfunction tap(observer) {\n\treturn (source) => {\n\t\treturn observable((destination) => {\n\t\t\treturn source.subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tvar _observer$next2;\n\t\t\t\t\t(_observer$next2 = observer.next) === null || _observer$next2 === void 0 || _observer$next2.call(observer, value);\n\t\t\t\t\tdestination.next(value);\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tvar _observer$error2;\n\t\t\t\t\t(_observer$error2 = observer.error) === null || _observer$error2 === void 0 || _observer$error2.call(observer, error);\n\t\t\t\t\tdestination.error(error);\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tvar _observer$complete2;\n\t\t\t\t\t(_observer$complete2 = observer.complete) === null || _observer$complete2 === void 0 || _observer$complete2.call(observer);\n\t\t\t\t\tdestination.complete();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n}\nconst distinctUnsetMarker = Symbol();\nfunction distinctUntilChanged(compare = (a, b) => a === b) {\n\treturn (source) => {\n\t\treturn observable((destination) => {\n\t\t\tlet lastValue = distinctUnsetMarker;\n\t\t\treturn source.subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tif (lastValue !== distinctUnsetMarker && compare(lastValue, value)) return;\n\t\t\t\t\tlastValue = value;\n\t\t\t\t\tdestination.next(value);\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tdestination.error(error);\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tdestination.complete();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n}\nconst isDeepEqual = (a, b) => {\n\tif (a === b) return true;\n\tconst bothAreObjects = a && b && typeof a === \"object\" && typeof b === \"object\";\n\treturn !!bothAreObjects && Object.keys(a).length === Object.keys(b).length && Object.entries(a).every(([k, v]) => isDeepEqual(v, b[k]));\n};\nfunction distinctUntilDeepChanged() {\n\treturn distinctUntilChanged(isDeepEqual);\n}\n\n//#endregion\n//#region src/observable/behaviorSubject.ts\n/**\n* @internal\n* An observable that maintains and provides a \"current value\" to subscribers\n* @see https://www.learnrxjs.io/learn-rxjs/subjects/behaviorsubject\n*/\nfunction behaviorSubject(initialValue) {\n\tlet value = initialValue;\n\tconst observerList = [];\n\tconst addObserver = (observer) => {\n\t\tif (value !== void 0) observer.next(value);\n\t\tobserverList.push(observer);\n\t};\n\tconst removeObserver = (observer) => {\n\t\tobserverList.splice(observerList.indexOf(observer), 1);\n\t};\n\tconst obs = observable((observer) => {\n\t\taddObserver(observer);\n\t\treturn () => {\n\t\t\tremoveObserver(observer);\n\t\t};\n\t});\n\tobs.next = (nextValue) => {\n\t\tif (value === nextValue) return;\n\t\tvalue = nextValue;\n\t\tfor (const observer of observerList) observer.next(nextValue);\n\t};\n\tobs.get = () => value;\n\treturn obs;\n}\n\n//#endregion\nexport { behaviorSubject, distinctUntilChanged, distinctUntilDeepChanged, map, share, tap };\n//# sourceMappingURL=observable-CUiPknO-.mjs.map","import { __toESM, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { observable, tap } from \"@trpc/server/observable\";\n\n//#region src/links/loggerLink.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\nfunction isFormData(value) {\n\tif (typeof FormData === \"undefined\") return false;\n\treturn value instanceof FormData;\n}\nconst palettes = {\n\tcss: {\n\t\tquery: [\"72e3ff\", \"3fb0d8\"],\n\t\tmutation: [\"c5a3fc\", \"904dfc\"],\n\t\tsubscription: [\"ff49e1\", \"d83fbe\"]\n\t},\n\tansi: {\n\t\tregular: {\n\t\t\tquery: [\"\\x1B[30;46m\", \"\\x1B[97;46m\"],\n\t\t\tmutation: [\"\\x1B[30;45m\", \"\\x1B[97;45m\"],\n\t\t\tsubscription: [\"\\x1B[30;42m\", \"\\x1B[97;42m\"]\n\t\t},\n\t\tbold: {\n\t\t\tquery: [\"\\x1B[1;30;46m\", \"\\x1B[1;97;46m\"],\n\t\t\tmutation: [\"\\x1B[1;30;45m\", \"\\x1B[1;97;45m\"],\n\t\t\tsubscription: [\"\\x1B[1;30;42m\", \"\\x1B[1;97;42m\"]\n\t\t}\n\t}\n};\nfunction constructPartsAndArgs(opts) {\n\tconst { direction, type, withContext, path, id, input } = opts;\n\tconst parts = [];\n\tconst args = [];\n\tif (opts.colorMode === \"none\") parts.push(direction === \"up\" ? \">>\" : \"<<\", type, `#${id}`, path);\n\telse if (opts.colorMode === \"ansi\") {\n\t\tconst [lightRegular, darkRegular] = palettes.ansi.regular[type];\n\t\tconst [lightBold, darkBold] = palettes.ansi.bold[type];\n\t\tconst reset = \"\\x1B[0m\";\n\t\tparts.push(direction === \"up\" ? lightRegular : darkRegular, direction === \"up\" ? \">>\" : \"<<\", type, direction === \"up\" ? lightBold : darkBold, `#${id}`, path, reset);\n\t} else {\n\t\tconst [light, dark] = palettes.css[type];\n\t\tconst css = `\n background-color: #${direction === \"up\" ? light : dark};\n color: ${direction === \"up\" ? \"black\" : \"white\"};\n padding: 2px;\n `;\n\t\tparts.push(\"%c\", direction === \"up\" ? \">>\" : \"<<\", type, `#${id}`, `%c${path}%c`, \"%O\");\n\t\targs.push(css, `${css}; font-weight: bold;`, `${css}; font-weight: normal;`);\n\t}\n\tif (direction === \"up\") args.push(withContext ? {\n\t\tinput,\n\t\tcontext: opts.context\n\t} : { input });\n\telse args.push((0, import_objectSpread2.default)({\n\t\tinput,\n\t\tresult: opts.result,\n\t\telapsedMs: opts.elapsedMs\n\t}, withContext && { context: opts.context }));\n\treturn {\n\t\tparts,\n\t\targs\n\t};\n}\nconst defaultLogger = ({ c = console, colorMode = \"css\", withContext }) => (props) => {\n\tconst rawInput = props.input;\n\tconst input = isFormData(rawInput) ? Object.fromEntries(rawInput) : rawInput;\n\tconst { parts, args } = constructPartsAndArgs((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, props), {}, {\n\t\tcolorMode,\n\t\tinput,\n\t\twithContext\n\t}));\n\tconst fn = props.direction === \"down\" && props.result && (props.result instanceof Error || \"error\" in props.result.result && props.result.result.error) ? \"error\" : \"log\";\n\tc[fn].apply(null, [parts.join(\" \")].concat(args));\n};\n/**\n* @see https://trpc.io/docs/v11/client/links/loggerLink\n*/\nfunction loggerLink(opts = {}) {\n\tvar _opts$colorMode, _opts$withContext;\n\tconst { enabled = () => true } = opts;\n\tconst colorMode = (_opts$colorMode = opts.colorMode) !== null && _opts$colorMode !== void 0 ? _opts$colorMode : typeof window === \"undefined\" ? \"ansi\" : \"css\";\n\tconst withContext = (_opts$withContext = opts.withContext) !== null && _opts$withContext !== void 0 ? _opts$withContext : colorMode === \"css\";\n\tconst { logger = defaultLogger({\n\t\tc: opts.console,\n\t\tcolorMode,\n\t\twithContext\n\t}) } = opts;\n\treturn () => {\n\t\treturn ({ op, next }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tif (enabled((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, op), {}, { direction: \"up\" }))) logger((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, op), {}, { direction: \"up\" }));\n\t\t\t\tconst requestStartTime = Date.now();\n\t\t\t\tfunction logResult(result) {\n\t\t\t\t\tconst elapsedMs = Date.now() - requestStartTime;\n\t\t\t\t\tif (enabled((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, op), {}, {\n\t\t\t\t\t\tdirection: \"down\",\n\t\t\t\t\t\tresult\n\t\t\t\t\t}))) logger((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, op), {}, {\n\t\t\t\t\t\tdirection: \"down\",\n\t\t\t\t\t\telapsedMs,\n\t\t\t\t\t\tresult\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\treturn next(op).pipe(tap({\n\t\t\t\t\tnext(result) {\n\t\t\t\t\t\tlogResult(result);\n\t\t\t\t\t},\n\t\t\t\t\terror(result) {\n\t\t\t\t\t\tlogResult(result);\n\t\t\t\t\t}\n\t\t\t\t})).subscribe(observer);\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { loggerLink };\n//# sourceMappingURL=loggerLink-ineCN1PO.mjs.map","import { __toESM, require_defineProperty, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { TRPCClientError } from \"./TRPCClientError-CjKyS10w.mjs\";\nimport { getTransformer } from \"./unstable-internals-Bg7n9BBj.mjs\";\nimport { behaviorSubject, observable } from \"@trpc/server/observable\";\nimport { run, sleep, transformResult } from \"@trpc/server/unstable-core-do-not-import\";\n\n//#region src/links/wsLink/wsClient/options.ts\nconst lazyDefaults = {\n\tenabled: false,\n\tcloseMs: 0\n};\nconst keepAliveDefaults = {\n\tenabled: false,\n\tpongTimeoutMs: 1e3,\n\tintervalMs: 5e3\n};\n/**\n* Calculates a delay for exponential backoff based on the retry attempt index.\n* The delay starts at 0 for the first attempt and doubles for each subsequent attempt,\n* capped at 30 seconds.\n*/\nconst exponentialBackoff = (attemptIndex) => {\n\treturn attemptIndex === 0 ? 0 : Math.min(1e3 * 2 ** attemptIndex, 3e4);\n};\n\n//#endregion\n//#region src/links/internals/urlWithConnectionParams.ts\n/**\n* Get the result of a value or function that returns a value\n* It also optionally accepts typesafe arguments for the function\n*/\nconst resultOf = (value, ...args) => {\n\treturn typeof value === \"function\" ? value(...args) : value;\n};\n\n//#endregion\n//#region src/links/wsLink/wsClient/utils.ts\nvar import_defineProperty$3 = __toESM(require_defineProperty(), 1);\nvar TRPCWebSocketClosedError = class TRPCWebSocketClosedError extends Error {\n\tconstructor(opts) {\n\t\tsuper(opts.message, { cause: opts.cause });\n\t\tthis.name = \"TRPCWebSocketClosedError\";\n\t\tObject.setPrototypeOf(this, TRPCWebSocketClosedError.prototype);\n\t}\n};\n/**\n* Utility class for managing a timeout that can be started, stopped, and reset.\n* Useful for scenarios where the timeout duration is reset dynamically based on events.\n*/\nvar ResettableTimeout = class {\n\tconstructor(onTimeout, timeoutMs) {\n\t\tthis.onTimeout = onTimeout;\n\t\tthis.timeoutMs = timeoutMs;\n\t\t(0, import_defineProperty$3.default)(this, \"timeout\", void 0);\n\t}\n\t/**\n\t* Resets the current timeout, restarting it with the same duration.\n\t* Does nothing if no timeout is active.\n\t*/\n\treset() {\n\t\tif (!this.timeout) return;\n\t\tclearTimeout(this.timeout);\n\t\tthis.timeout = setTimeout(this.onTimeout, this.timeoutMs);\n\t}\n\tstart() {\n\t\tclearTimeout(this.timeout);\n\t\tthis.timeout = setTimeout(this.onTimeout, this.timeoutMs);\n\t}\n\tstop() {\n\t\tclearTimeout(this.timeout);\n\t\tthis.timeout = void 0;\n\t}\n};\nfunction withResolvers() {\n\tlet resolve;\n\tlet reject;\n\tconst promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\treturn {\n\t\tpromise,\n\t\tresolve,\n\t\treject\n\t};\n}\n/**\n* Resolves a WebSocket URL and optionally appends connection parameters.\n*\n* If connectionParams are provided, appends 'connectionParams=1' query parameter.\n*/\nasync function prepareUrl(urlOptions) {\n\tconst url = await resultOf(urlOptions.url);\n\tif (!urlOptions.connectionParams) return url;\n\tconst prefix = url.includes(\"?\") ? \"&\" : \"?\";\n\tconst connectionParams = `${prefix}connectionParams=1`;\n\treturn url + connectionParams;\n}\nasync function buildConnectionMessage(connectionParams) {\n\tconst message = {\n\t\tmethod: \"connectionParams\",\n\t\tdata: await resultOf(connectionParams)\n\t};\n\treturn JSON.stringify(message);\n}\n\n//#endregion\n//#region src/links/wsLink/wsClient/requestManager.ts\nvar import_defineProperty$2 = __toESM(require_defineProperty(), 1);\n/**\n* Manages WebSocket requests, tracking their lifecycle and providing utility methods\n* for handling outgoing and pending requests.\n*\n* - **Outgoing requests**: Requests that are queued and waiting to be sent.\n* - **Pending requests**: Requests that have been sent and are in flight awaiting a response.\n* For subscriptions, multiple responses may be received until the subscription is closed.\n*/\nvar RequestManager = class {\n\tconstructor() {\n\t\t(0, import_defineProperty$2.default)(this, \"outgoingRequests\", new Array());\n\t\t(0, import_defineProperty$2.default)(this, \"pendingRequests\", {});\n\t}\n\t/**\n\t* Registers a new request by adding it to the outgoing queue and setting up\n\t* callbacks for lifecycle events such as completion or error.\n\t*\n\t* @param message - The outgoing message to be sent.\n\t* @param callbacks - Callback functions to observe the request's state.\n\t* @returns A cleanup function to manually remove the request.\n\t*/\n\tregister(message, callbacks) {\n\t\tconst { promise: end, resolve } = withResolvers();\n\t\tthis.outgoingRequests.push({\n\t\t\tid: String(message.id),\n\t\t\tmessage,\n\t\t\tend,\n\t\t\tcallbacks: {\n\t\t\t\tnext: callbacks.next,\n\t\t\t\tcomplete: () => {\n\t\t\t\t\tcallbacks.complete();\n\t\t\t\t\tresolve();\n\t\t\t\t},\n\t\t\t\terror: (e) => {\n\t\t\t\t\tcallbacks.error(e);\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn () => {\n\t\t\tthis.delete(message.id);\n\t\t\tcallbacks.complete();\n\t\t\tresolve();\n\t\t};\n\t}\n\t/**\n\t* Deletes a request from both the outgoing and pending collections, if it exists.\n\t*/\n\tdelete(messageId) {\n\t\tif (messageId === null) return;\n\t\tthis.outgoingRequests = this.outgoingRequests.filter(({ id }) => id !== String(messageId));\n\t\tdelete this.pendingRequests[String(messageId)];\n\t}\n\t/**\n\t* Moves all outgoing requests to the pending state and clears the outgoing queue.\n\t*\n\t* The caller is expected to handle the actual sending of the requests\n\t* (e.g., sending them over the network) after this method is called.\n\t*\n\t* @returns The list of requests that were transitioned to the pending state.\n\t*/\n\tflush() {\n\t\tconst requests = this.outgoingRequests;\n\t\tthis.outgoingRequests = [];\n\t\tfor (const request of requests) this.pendingRequests[request.id] = request;\n\t\treturn requests;\n\t}\n\t/**\n\t* Retrieves all currently pending requests, which are in flight awaiting responses\n\t* or handling ongoing subscriptions.\n\t*/\n\tgetPendingRequests() {\n\t\treturn Object.values(this.pendingRequests);\n\t}\n\t/**\n\t* Retrieves a specific pending request by its message ID.\n\t*/\n\tgetPendingRequest(messageId) {\n\t\tif (messageId === null) return null;\n\t\treturn this.pendingRequests[String(messageId)];\n\t}\n\t/**\n\t* Retrieves all outgoing requests, which are waiting to be sent.\n\t*/\n\tgetOutgoingRequests() {\n\t\treturn this.outgoingRequests;\n\t}\n\t/**\n\t* Retrieves all requests, both outgoing and pending, with their respective states.\n\t*\n\t* @returns An array of all requests with their state (\"outgoing\" or \"pending\").\n\t*/\n\tgetRequests() {\n\t\treturn [...this.getOutgoingRequests().map((request) => ({\n\t\t\tstate: \"outgoing\",\n\t\t\tmessage: request.message,\n\t\t\tend: request.end,\n\t\t\tcallbacks: request.callbacks\n\t\t})), ...this.getPendingRequests().map((request) => ({\n\t\t\tstate: \"pending\",\n\t\t\tmessage: request.message,\n\t\t\tend: request.end,\n\t\t\tcallbacks: request.callbacks\n\t\t}))];\n\t}\n\t/**\n\t* Checks if there are any pending requests, including ongoing subscriptions.\n\t*/\n\thasPendingRequests() {\n\t\treturn this.getPendingRequests().length > 0;\n\t}\n\t/**\n\t* Checks if there are any pending subscriptions\n\t*/\n\thasPendingSubscriptions() {\n\t\treturn this.getPendingRequests().some((request) => request.message.method === \"subscription\");\n\t}\n\t/**\n\t* Checks if there are any outgoing requests waiting to be sent.\n\t*/\n\thasOutgoingRequests() {\n\t\treturn this.outgoingRequests.length > 0;\n\t}\n};\n\n//#endregion\n//#region src/links/wsLink/wsClient/wsConnection.ts\nvar import_defineProperty$1 = __toESM(require_defineProperty(), 1);\n/**\n* Opens a WebSocket connection asynchronously and returns a promise\n* that resolves when the connection is successfully established.\n* The promise rejects if an error occurs during the connection attempt.\n*/\nfunction asyncWsOpen(ws) {\n\tconst { promise, resolve, reject } = withResolvers();\n\tws.addEventListener(\"open\", () => {\n\t\tws.removeEventListener(\"error\", reject);\n\t\tresolve();\n\t});\n\tws.addEventListener(\"error\", reject);\n\treturn promise;\n}\n/**\n* Sets up a periodic ping-pong mechanism to keep the WebSocket connection alive.\n*\n* - Sends \"PING\" messages at regular intervals defined by `intervalMs`.\n* - If a \"PONG\" response is not received within the `pongTimeoutMs`, the WebSocket is closed.\n* - The ping timer resets upon receiving any message to maintain activity.\n* - Automatically starts the ping process when the WebSocket connection is opened.\n* - Cleans up timers when the WebSocket is closed.\n*\n* @param ws - The WebSocket instance to manage.\n* @param options - Configuration options for ping-pong intervals and timeouts.\n*/\nfunction setupPingInterval(ws, { intervalMs, pongTimeoutMs }) {\n\tlet pingTimeout;\n\tlet pongTimeout;\n\tfunction start() {\n\t\tpingTimeout = setTimeout(() => {\n\t\t\tws.send(\"PING\");\n\t\t\tpongTimeout = setTimeout(() => {\n\t\t\t\tws.close();\n\t\t\t}, pongTimeoutMs);\n\t\t}, intervalMs);\n\t}\n\tfunction reset() {\n\t\tclearTimeout(pingTimeout);\n\t\tstart();\n\t}\n\tfunction pong() {\n\t\tclearTimeout(pongTimeout);\n\t\treset();\n\t}\n\tws.addEventListener(\"open\", start);\n\tws.addEventListener(\"message\", ({ data }) => {\n\t\tclearTimeout(pingTimeout);\n\t\tstart();\n\t\tif (data === \"PONG\") pong();\n\t});\n\tws.addEventListener(\"close\", () => {\n\t\tclearTimeout(pingTimeout);\n\t\tclearTimeout(pongTimeout);\n\t});\n}\n/**\n* Manages a WebSocket connection with support for reconnection, keep-alive mechanisms,\n* and observable state tracking.\n*/\nvar WsConnection = class WsConnection {\n\tconstructor(opts) {\n\t\tvar _opts$WebSocketPonyfi;\n\t\t(0, import_defineProperty$1.default)(this, \"id\", ++WsConnection.connectCount);\n\t\t(0, import_defineProperty$1.default)(this, \"WebSocketPonyfill\", void 0);\n\t\t(0, import_defineProperty$1.default)(this, \"urlOptions\", void 0);\n\t\t(0, import_defineProperty$1.default)(this, \"keepAliveOpts\", void 0);\n\t\t(0, import_defineProperty$1.default)(this, \"wsObservable\", behaviorSubject(null));\n\t\t(0, import_defineProperty$1.default)(this, \"openPromise\", null);\n\t\tthis.WebSocketPonyfill = (_opts$WebSocketPonyfi = opts.WebSocketPonyfill) !== null && _opts$WebSocketPonyfi !== void 0 ? _opts$WebSocketPonyfi : WebSocket;\n\t\tif (!this.WebSocketPonyfill) throw new Error(\"No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill\");\n\t\tthis.urlOptions = opts.urlOptions;\n\t\tthis.keepAliveOpts = opts.keepAlive;\n\t}\n\tget ws() {\n\t\treturn this.wsObservable.get();\n\t}\n\tset ws(ws) {\n\t\tthis.wsObservable.next(ws);\n\t}\n\t/**\n\t* Checks if the WebSocket connection is open and ready to communicate.\n\t*/\n\tisOpen() {\n\t\treturn !!this.ws && this.ws.readyState === this.WebSocketPonyfill.OPEN && !this.openPromise;\n\t}\n\t/**\n\t* Checks if the WebSocket connection is closed or in the process of closing.\n\t*/\n\tisClosed() {\n\t\treturn !!this.ws && (this.ws.readyState === this.WebSocketPonyfill.CLOSING || this.ws.readyState === this.WebSocketPonyfill.CLOSED);\n\t}\n\tasync open() {\n\t\tvar _this = this;\n\t\tif (_this.openPromise) return _this.openPromise;\n\t\t_this.id = ++WsConnection.connectCount;\n\t\tconst wsPromise = prepareUrl(_this.urlOptions).then((url) => new _this.WebSocketPonyfill(url));\n\t\t_this.openPromise = wsPromise.then(async (ws) => {\n\t\t\t_this.ws = ws;\n\t\t\tws.addEventListener(\"message\", function({ data }) {\n\t\t\t\tif (data === \"PING\") this.send(\"PONG\");\n\t\t\t});\n\t\t\tif (_this.keepAliveOpts.enabled) setupPingInterval(ws, _this.keepAliveOpts);\n\t\t\tws.addEventListener(\"close\", () => {\n\t\t\t\tif (_this.ws === ws) _this.ws = null;\n\t\t\t});\n\t\t\tawait asyncWsOpen(ws);\n\t\t\tif (_this.urlOptions.connectionParams) ws.send(await buildConnectionMessage(_this.urlOptions.connectionParams));\n\t\t});\n\t\ttry {\n\t\t\tawait _this.openPromise;\n\t\t} finally {\n\t\t\t_this.openPromise = null;\n\t\t}\n\t}\n\t/**\n\t* Closes the WebSocket connection gracefully.\n\t* Waits for any ongoing open operation to complete before closing.\n\t*/\n\tasync close() {\n\t\tvar _this2 = this;\n\t\ttry {\n\t\t\tawait _this2.openPromise;\n\t\t} finally {\n\t\t\tvar _this$ws;\n\t\t\t(_this$ws = _this2.ws) === null || _this$ws === void 0 || _this$ws.close();\n\t\t}\n\t}\n};\n(0, import_defineProperty$1.default)(WsConnection, \"connectCount\", 0);\n/**\n* Provides a backward-compatible representation of the connection state.\n*/\nfunction backwardCompatibility(connection) {\n\tif (connection.isOpen()) return {\n\t\tid: connection.id,\n\t\tstate: \"open\",\n\t\tws: connection.ws\n\t};\n\tif (connection.isClosed()) return {\n\t\tid: connection.id,\n\t\tstate: \"closed\",\n\t\tws: connection.ws\n\t};\n\tif (!connection.ws) return null;\n\treturn {\n\t\tid: connection.id,\n\t\tstate: \"connecting\",\n\t\tws: connection.ws\n\t};\n}\n\n//#endregion\n//#region src/links/wsLink/wsClient/wsClient.ts\nvar import_defineProperty = __toESM(require_defineProperty(), 1);\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* A WebSocket client for managing TRPC operations, supporting lazy initialization,\n* reconnection, keep-alive, and request management.\n*/\nvar WsClient = class {\n\tconstructor(opts) {\n\t\tvar _opts$retryDelayMs;\n\t\t(0, import_defineProperty.default)(this, \"connectionState\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"allowReconnect\", false);\n\t\t(0, import_defineProperty.default)(this, \"requestManager\", new RequestManager());\n\t\t(0, import_defineProperty.default)(this, \"activeConnection\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"reconnectRetryDelay\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"inactivityTimeout\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"callbacks\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"lazyMode\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"reconnecting\", null);\n\t\tthis.callbacks = {\n\t\t\tonOpen: opts.onOpen,\n\t\t\tonClose: opts.onClose,\n\t\t\tonError: opts.onError\n\t\t};\n\t\tconst lazyOptions = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, lazyDefaults), opts.lazy);\n\t\tthis.inactivityTimeout = new ResettableTimeout(() => {\n\t\t\tif (this.requestManager.hasOutgoingRequests() || this.requestManager.hasPendingRequests()) {\n\t\t\t\tthis.inactivityTimeout.reset();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.close().catch(() => null);\n\t\t}, lazyOptions.closeMs);\n\t\tthis.activeConnection = new WsConnection({\n\t\t\tWebSocketPonyfill: opts.WebSocket,\n\t\t\turlOptions: opts,\n\t\t\tkeepAlive: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, keepAliveDefaults), opts.keepAlive)\n\t\t});\n\t\tthis.activeConnection.wsObservable.subscribe({ next: (ws) => {\n\t\t\tif (!ws) return;\n\t\t\tthis.setupWebSocketListeners(ws);\n\t\t} });\n\t\tthis.reconnectRetryDelay = (_opts$retryDelayMs = opts.retryDelayMs) !== null && _opts$retryDelayMs !== void 0 ? _opts$retryDelayMs : exponentialBackoff;\n\t\tthis.lazyMode = lazyOptions.enabled;\n\t\tthis.connectionState = behaviorSubject({\n\t\t\ttype: \"state\",\n\t\t\tstate: lazyOptions.enabled ? \"idle\" : \"connecting\",\n\t\t\terror: null\n\t\t});\n\t\tif (!this.lazyMode) this.open().catch(() => null);\n\t}\n\t/**\n\t* Opens the WebSocket connection. Handles reconnection attempts and updates\n\t* the connection state accordingly.\n\t*/\n\tasync open() {\n\t\tvar _this = this;\n\t\t_this.allowReconnect = true;\n\t\tif (_this.connectionState.get().state === \"idle\") _this.connectionState.next({\n\t\t\ttype: \"state\",\n\t\t\tstate: \"connecting\",\n\t\t\terror: null\n\t\t});\n\t\ttry {\n\t\t\tawait _this.activeConnection.open();\n\t\t} catch (error) {\n\t\t\t_this.reconnect(new TRPCWebSocketClosedError({\n\t\t\t\tmessage: \"Initialization error\",\n\t\t\t\tcause: error\n\t\t\t}));\n\t\t\treturn _this.reconnecting;\n\t\t}\n\t}\n\t/**\n\t* Closes the WebSocket connection and stops managing requests.\n\t* Ensures all outgoing and pending requests are properly finalized.\n\t*/\n\tasync close() {\n\t\tvar _this2 = this;\n\t\t_this2.allowReconnect = false;\n\t\t_this2.inactivityTimeout.stop();\n\t\tconst requestsToAwait = [];\n\t\tfor (const request of _this2.requestManager.getRequests()) if (request.message.method === \"subscription\") request.callbacks.complete();\n\t\telse if (request.state === \"outgoing\") request.callbacks.error(TRPCClientError.from(new TRPCWebSocketClosedError({ message: \"Closed before connection was established\" })));\n\t\telse requestsToAwait.push(request.end);\n\t\tawait Promise.all(requestsToAwait).catch(() => null);\n\t\tawait _this2.activeConnection.close().catch(() => null);\n\t\t_this2.connectionState.next({\n\t\t\ttype: \"state\",\n\t\t\tstate: \"idle\",\n\t\t\terror: null\n\t\t});\n\t}\n\t/**\n\t* Method to request the server.\n\t* Handles data transformation, batching of requests, and subscription lifecycle.\n\t*\n\t* @param op - The operation details including id, type, path, input and signal\n\t* @param transformer - Data transformer for serializing requests and deserializing responses\n\t* @param lastEventId - Optional ID of the last received event for subscriptions\n\t*\n\t* @returns An observable that emits operation results and handles cleanup\n\t*/\n\trequest({ op: { id, type, path, input, signal }, transformer, lastEventId }) {\n\t\treturn observable((observer) => {\n\t\t\tconst abort = this.batchSend({\n\t\t\t\tid,\n\t\t\t\tmethod: type,\n\t\t\t\tparams: {\n\t\t\t\t\tinput: transformer.input.serialize(input),\n\t\t\t\t\tpath,\n\t\t\t\t\tlastEventId\n\t\t\t\t}\n\t\t\t}, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, observer), {}, { next(event) {\n\t\t\t\tconst transformed = transformResult(event, transformer.output);\n\t\t\t\tif (!transformed.ok) {\n\t\t\t\t\tobserver.error(TRPCClientError.from(transformed.error));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tobserver.next({ result: transformed.result });\n\t\t\t} }));\n\t\t\treturn () => {\n\t\t\t\tabort();\n\t\t\t\tif (type === \"subscription\" && this.activeConnection.isOpen()) this.send({\n\t\t\t\t\tid,\n\t\t\t\t\tmethod: \"subscription.stop\"\n\t\t\t\t});\n\t\t\t\tsignal === null || signal === void 0 || signal.removeEventListener(\"abort\", abort);\n\t\t\t};\n\t\t});\n\t}\n\tget connection() {\n\t\treturn backwardCompatibility(this.activeConnection);\n\t}\n\treconnect(closedError) {\n\t\tvar _this3 = this;\n\t\tthis.connectionState.next({\n\t\t\ttype: \"state\",\n\t\t\tstate: \"connecting\",\n\t\t\terror: TRPCClientError.from(closedError)\n\t\t});\n\t\tif (this.reconnecting) return;\n\t\tconst tryReconnect = async (attemptIndex) => {\n\t\t\ttry {\n\t\t\t\tawait sleep(_this3.reconnectRetryDelay(attemptIndex));\n\t\t\t\tif (_this3.allowReconnect) {\n\t\t\t\t\tawait _this3.activeConnection.close();\n\t\t\t\t\tawait _this3.activeConnection.open();\n\t\t\t\t\tif (_this3.requestManager.hasPendingRequests()) _this3.send(_this3.requestManager.getPendingRequests().map(({ message }) => message));\n\t\t\t\t}\n\t\t\t\t_this3.reconnecting = null;\n\t\t\t} catch (_unused) {\n\t\t\t\tawait tryReconnect(attemptIndex + 1);\n\t\t\t}\n\t\t};\n\t\tthis.reconnecting = tryReconnect(0);\n\t}\n\tsetupWebSocketListeners(ws) {\n\t\tvar _this4 = this;\n\t\tconst handleCloseOrError = (cause) => {\n\t\t\tconst reqs = this.requestManager.getPendingRequests();\n\t\t\tfor (const { message, callbacks } of reqs) {\n\t\t\t\tif (message.method === \"subscription\") continue;\n\t\t\t\tcallbacks.error(TRPCClientError.from(cause !== null && cause !== void 0 ? cause : new TRPCWebSocketClosedError({\n\t\t\t\t\tmessage: \"WebSocket closed\",\n\t\t\t\t\tcause\n\t\t\t\t})));\n\t\t\t\tthis.requestManager.delete(message.id);\n\t\t\t}\n\t\t};\n\t\tws.addEventListener(\"open\", () => {\n\t\t\trun(async () => {\n\t\t\t\tvar _this$callbacks$onOpe, _this$callbacks;\n\t\t\t\tif (_this4.lazyMode) _this4.inactivityTimeout.start();\n\t\t\t\t(_this$callbacks$onOpe = (_this$callbacks = _this4.callbacks).onOpen) === null || _this$callbacks$onOpe === void 0 || _this$callbacks$onOpe.call(_this$callbacks);\n\t\t\t\t_this4.connectionState.next({\n\t\t\t\t\ttype: \"state\",\n\t\t\t\t\tstate: \"pending\",\n\t\t\t\t\terror: null\n\t\t\t\t});\n\t\t\t}).catch((error) => {\n\t\t\t\tws.close(3e3);\n\t\t\t\thandleCloseOrError(error);\n\t\t\t});\n\t\t});\n\t\tws.addEventListener(\"message\", ({ data }) => {\n\t\t\tthis.inactivityTimeout.reset();\n\t\t\tif (typeof data !== \"string\" || [\"PING\", \"PONG\"].includes(data)) return;\n\t\t\tconst incomingMessage = JSON.parse(data);\n\t\t\tif (\"method\" in incomingMessage) {\n\t\t\t\tthis.handleIncomingRequest(incomingMessage);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.handleResponseMessage(incomingMessage);\n\t\t});\n\t\tws.addEventListener(\"close\", (event) => {\n\t\t\tvar _this$callbacks$onClo, _this$callbacks2;\n\t\t\thandleCloseOrError(event);\n\t\t\t(_this$callbacks$onClo = (_this$callbacks2 = this.callbacks).onClose) === null || _this$callbacks$onClo === void 0 || _this$callbacks$onClo.call(_this$callbacks2, event);\n\t\t\tif (!this.lazyMode || this.requestManager.hasPendingSubscriptions()) this.reconnect(new TRPCWebSocketClosedError({\n\t\t\t\tmessage: \"WebSocket closed\",\n\t\t\t\tcause: event\n\t\t\t}));\n\t\t});\n\t\tws.addEventListener(\"error\", (event) => {\n\t\t\tvar _this$callbacks$onErr, _this$callbacks3;\n\t\t\thandleCloseOrError(event);\n\t\t\t(_this$callbacks$onErr = (_this$callbacks3 = this.callbacks).onError) === null || _this$callbacks$onErr === void 0 || _this$callbacks$onErr.call(_this$callbacks3, event);\n\t\t\tthis.reconnect(new TRPCWebSocketClosedError({\n\t\t\t\tmessage: \"WebSocket closed\",\n\t\t\t\tcause: event\n\t\t\t}));\n\t\t});\n\t}\n\thandleResponseMessage(message) {\n\t\tconst request = this.requestManager.getPendingRequest(message.id);\n\t\tif (!request) return;\n\t\trequest.callbacks.next(message);\n\t\tlet completed = true;\n\t\tif (\"result\" in message && request.message.method === \"subscription\") {\n\t\t\tif (message.result.type === \"data\") request.message.params.lastEventId = message.result.id;\n\t\t\tif (message.result.type !== \"stopped\") completed = false;\n\t\t}\n\t\tif (completed) {\n\t\t\trequest.callbacks.complete();\n\t\t\tthis.requestManager.delete(message.id);\n\t\t}\n\t}\n\thandleIncomingRequest(message) {\n\t\tif (message.method === \"reconnect\") this.reconnect(new TRPCWebSocketClosedError({ message: \"Server requested reconnect\" }));\n\t}\n\t/**\n\t* Sends a message or batch of messages directly to the server.\n\t*/\n\tsend(messageOrMessages) {\n\t\tif (!this.activeConnection.isOpen()) throw new Error(\"Active connection is not open\");\n\t\tconst messages = messageOrMessages instanceof Array ? messageOrMessages : [messageOrMessages];\n\t\tthis.activeConnection.ws.send(JSON.stringify(messages.length === 1 ? messages[0] : messages));\n\t}\n\t/**\n\t* Groups requests for batch sending.\n\t*\n\t* @returns A function to abort the batched request.\n\t*/\n\tbatchSend(message, callbacks) {\n\t\tvar _this5 = this;\n\t\tthis.inactivityTimeout.reset();\n\t\trun(async () => {\n\t\t\tif (!_this5.activeConnection.isOpen()) await _this5.open();\n\t\t\tawait sleep(0);\n\t\t\tif (!_this5.requestManager.hasOutgoingRequests()) return;\n\t\t\t_this5.send(_this5.requestManager.flush().map(({ message: message$1 }) => message$1));\n\t\t}).catch((err) => {\n\t\t\tthis.requestManager.delete(message.id);\n\t\t\tcallbacks.error(TRPCClientError.from(err));\n\t\t});\n\t\treturn this.requestManager.register(message, callbacks);\n\t}\n};\n\n//#endregion\n//#region src/links/wsLink/createWsClient.ts\nfunction createWSClient(opts) {\n\treturn new WsClient(opts);\n}\n\n//#endregion\n//#region src/links/wsLink/wsLink.ts\nfunction wsLink(opts) {\n\tconst { client } = opts;\n\tconst transformer = getTransformer(opts.transformer);\n\treturn () => {\n\t\treturn ({ op }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tconst connStateSubscription = op.type === \"subscription\" ? client.connectionState.subscribe({ next(result) {\n\t\t\t\t\tobserver.next({\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\tcontext: op.context\n\t\t\t\t\t});\n\t\t\t\t} }) : null;\n\t\t\t\tconst requestSubscription = client.request({\n\t\t\t\t\top,\n\t\t\t\t\ttransformer\n\t\t\t\t}).subscribe(observer);\n\t\t\t\treturn () => {\n\t\t\t\t\trequestSubscription.unsubscribe();\n\t\t\t\t\tconnStateSubscription === null || connStateSubscription === void 0 || connStateSubscription.unsubscribe();\n\t\t\t\t};\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { createWSClient, resultOf, wsLink };\n//# sourceMappingURL=wsLink-CatceK3c.mjs.map","import { __commonJS, __toESM, require_defineProperty, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { createChain, splitLink } from \"./splitLink-B7Cuf2c_.mjs\";\nimport { TRPCClientError, isTRPCClientError } from \"./TRPCClientError-CjKyS10w.mjs\";\nimport { fetchHTTPResponse, getBody, getFetch, getUrl, resolveHTTPLinkOptions } from \"./httpUtils-Dv57hbOd.mjs\";\nimport { httpLink, isFormData, isNonJsonSerializable, isOctetType } from \"./httpLink-DCFpUmZF.mjs\";\nimport { abortSignalToPromise, allAbortSignals, dataLoader, httpBatchLink, raceAbortSignals } from \"./httpBatchLink-BOe5aCcR.mjs\";\nimport { getTransformer } from \"./unstable-internals-Bg7n9BBj.mjs\";\nimport { loggerLink } from \"./loggerLink-ineCN1PO.mjs\";\nimport { createWSClient, resultOf, wsLink } from \"./wsLink-CatceK3c.mjs\";\nimport { behaviorSubject, observable, observableToPromise, share } from \"@trpc/server/observable\";\nimport { callProcedure, createFlatProxy, createRecursiveProxy, isAbortError, isAsyncIterable, iteratorResource, jsonlStreamConsumer, makeResource, retryableRpcCodes, run, sseStreamConsumer } from \"@trpc/server/unstable-core-do-not-import\";\nimport { getTRPCErrorFromUnknown, getTRPCErrorShape, isTrackedEnvelope } from \"@trpc/server\";\nimport { TRPC_ERROR_CODES_BY_KEY } from \"@trpc/server/rpc\";\n\n//#region src/internals/TRPCUntypedClient.ts\nvar import_defineProperty = __toESM(require_defineProperty(), 1);\nvar import_objectSpread2$4 = __toESM(require_objectSpread2(), 1);\nvar TRPCUntypedClient = class {\n\tconstructor(opts) {\n\t\t(0, import_defineProperty.default)(this, \"links\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"runtime\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"requestId\", void 0);\n\t\tthis.requestId = 0;\n\t\tthis.runtime = {};\n\t\tthis.links = opts.links.map((link) => link(this.runtime));\n\t}\n\t$request(opts) {\n\t\tvar _opts$context;\n\t\tconst chain$ = createChain({\n\t\t\tlinks: this.links,\n\t\t\top: (0, import_objectSpread2$4.default)((0, import_objectSpread2$4.default)({}, opts), {}, {\n\t\t\t\tcontext: (_opts$context = opts.context) !== null && _opts$context !== void 0 ? _opts$context : {},\n\t\t\t\tid: ++this.requestId\n\t\t\t})\n\t\t});\n\t\treturn chain$.pipe(share());\n\t}\n\tasync requestAsPromise(opts) {\n\t\tvar _this = this;\n\t\ttry {\n\t\t\tconst req$ = _this.$request(opts);\n\t\t\tconst envelope = await observableToPromise(req$);\n\t\t\tconst data = envelope.result.data;\n\t\t\treturn data;\n\t\t} catch (err) {\n\t\t\tthrow TRPCClientError.from(err);\n\t\t}\n\t}\n\tquery(path, input, opts) {\n\t\treturn this.requestAsPromise({\n\t\t\ttype: \"query\",\n\t\t\tpath,\n\t\t\tinput,\n\t\t\tcontext: opts === null || opts === void 0 ? void 0 : opts.context,\n\t\t\tsignal: opts === null || opts === void 0 ? void 0 : opts.signal\n\t\t});\n\t}\n\tmutation(path, input, opts) {\n\t\treturn this.requestAsPromise({\n\t\t\ttype: \"mutation\",\n\t\t\tpath,\n\t\t\tinput,\n\t\t\tcontext: opts === null || opts === void 0 ? void 0 : opts.context,\n\t\t\tsignal: opts === null || opts === void 0 ? void 0 : opts.signal\n\t\t});\n\t}\n\tsubscription(path, input, opts) {\n\t\tconst observable$ = this.$request({\n\t\t\ttype: \"subscription\",\n\t\t\tpath,\n\t\t\tinput,\n\t\t\tcontext: opts.context,\n\t\t\tsignal: opts.signal\n\t\t});\n\t\treturn observable$.subscribe({\n\t\t\tnext(envelope) {\n\t\t\t\tswitch (envelope.result.type) {\n\t\t\t\t\tcase \"state\": {\n\t\t\t\t\t\tvar _opts$onConnectionSta;\n\t\t\t\t\t\t(_opts$onConnectionSta = opts.onConnectionStateChange) === null || _opts$onConnectionSta === void 0 || _opts$onConnectionSta.call(opts, envelope.result);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"started\": {\n\t\t\t\t\t\tvar _opts$onStarted;\n\t\t\t\t\t\t(_opts$onStarted = opts.onStarted) === null || _opts$onStarted === void 0 || _opts$onStarted.call(opts, { context: envelope.context });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"stopped\": {\n\t\t\t\t\t\tvar _opts$onStopped;\n\t\t\t\t\t\t(_opts$onStopped = opts.onStopped) === null || _opts$onStopped === void 0 || _opts$onStopped.call(opts);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"data\":\n\t\t\t\t\tcase void 0: {\n\t\t\t\t\t\tvar _opts$onData;\n\t\t\t\t\t\t(_opts$onData = opts.onData) === null || _opts$onData === void 0 || _opts$onData.call(opts, envelope.result.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\terror(err) {\n\t\t\t\tvar _opts$onError;\n\t\t\t\t(_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, err);\n\t\t\t},\n\t\t\tcomplete() {\n\t\t\t\tvar _opts$onComplete;\n\t\t\t\t(_opts$onComplete = opts.onComplete) === null || _opts$onComplete === void 0 || _opts$onComplete.call(opts);\n\t\t\t}\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/createTRPCUntypedClient.ts\nfunction createTRPCUntypedClient(opts) {\n\treturn new TRPCUntypedClient(opts);\n}\n\n//#endregion\n//#region src/createTRPCClient.ts\nconst untypedClientSymbol = Symbol.for(\"trpc_untypedClient\");\nconst clientCallTypeMap = {\n\tquery: \"query\",\n\tmutate: \"mutation\",\n\tsubscribe: \"subscription\"\n};\n/** @internal */\nconst clientCallTypeToProcedureType = (clientCallType) => {\n\treturn clientCallTypeMap[clientCallType];\n};\n/**\n* @internal\n*/\nfunction createTRPCClientProxy(client) {\n\tconst proxy = createRecursiveProxy(({ path, args }) => {\n\t\tconst pathCopy = [...path];\n\t\tconst procedureType = clientCallTypeToProcedureType(pathCopy.pop());\n\t\tconst fullPath = pathCopy.join(\".\");\n\t\treturn client[procedureType](fullPath, ...args);\n\t});\n\treturn createFlatProxy((key) => {\n\t\tif (key === untypedClientSymbol) return client;\n\t\treturn proxy[key];\n\t});\n}\nfunction createTRPCClient(opts) {\n\tconst client = new TRPCUntypedClient(opts);\n\tconst proxy = createTRPCClientProxy(client);\n\treturn proxy;\n}\n/**\n* Get an untyped client from a proxy client\n* @internal\n*/\nfunction getUntypedClient(client) {\n\treturn client[untypedClientSymbol];\n}\n\n//#endregion\n//#region src/links/httpBatchStreamLink.ts\nvar import_objectSpread2$3 = __toESM(require_objectSpread2(), 1);\n/**\n* @see https://trpc.io/docs/client/links/httpBatchStreamLink\n*/\nfunction httpBatchStreamLink(opts) {\n\tvar _opts$maxURLLength, _opts$maxItems;\n\tconst resolvedOpts = resolveHTTPLinkOptions(opts);\n\tconst maxURLLength = (_opts$maxURLLength = opts.maxURLLength) !== null && _opts$maxURLLength !== void 0 ? _opts$maxURLLength : Infinity;\n\tconst maxItems = (_opts$maxItems = opts.maxItems) !== null && _opts$maxItems !== void 0 ? _opts$maxItems : Infinity;\n\treturn () => {\n\t\tconst batchLoader = (type) => {\n\t\t\treturn {\n\t\t\t\tvalidate(batchOps) {\n\t\t\t\t\tif (maxURLLength === Infinity && maxItems === Infinity) return true;\n\t\t\t\t\tif (batchOps.length > maxItems) return false;\n\t\t\t\t\tconst path = batchOps.map((op) => op.path).join(\",\");\n\t\t\t\t\tconst inputs = batchOps.map((op) => op.input);\n\t\t\t\t\tconst url = getUrl((0, import_objectSpread2$3.default)((0, import_objectSpread2$3.default)({}, resolvedOpts), {}, {\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tinputs,\n\t\t\t\t\t\tsignal: null\n\t\t\t\t\t}));\n\t\t\t\t\treturn url.length <= maxURLLength;\n\t\t\t\t},\n\t\t\t\tasync fetch(batchOps) {\n\t\t\t\t\tconst path = batchOps.map((op) => op.path).join(\",\");\n\t\t\t\t\tconst inputs = batchOps.map((op) => op.input);\n\t\t\t\t\tconst batchSignals = allAbortSignals(...batchOps.map((op) => op.signal));\n\t\t\t\t\tconst abortController = new AbortController();\n\t\t\t\t\tconst responsePromise = fetchHTTPResponse((0, import_objectSpread2$3.default)((0, import_objectSpread2$3.default)({}, resolvedOpts), {}, {\n\t\t\t\t\t\tsignal: raceAbortSignals(batchSignals, abortController.signal),\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tcontentTypeHeader: \"application/json\",\n\t\t\t\t\t\ttrpcAcceptHeader: \"application/jsonl\",\n\t\t\t\t\t\tgetUrl,\n\t\t\t\t\t\tgetBody,\n\t\t\t\t\t\tinputs,\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\theaders() {\n\t\t\t\t\t\t\tif (!opts.headers) return {};\n\t\t\t\t\t\t\tif (typeof opts.headers === \"function\") return opts.headers({ opList: batchOps });\n\t\t\t\t\t\t\treturn opts.headers;\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t\tconst res = await responsePromise;\n\t\t\t\t\tconst [head] = await jsonlStreamConsumer({\n\t\t\t\t\t\tfrom: res.body,\n\t\t\t\t\t\tdeserialize: (data) => resolvedOpts.transformer.output.deserialize(data),\n\t\t\t\t\t\tformatError(opts$1) {\n\t\t\t\t\t\t\tconst error = opts$1.error;\n\t\t\t\t\t\t\treturn TRPCClientError.from({ error });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tabortController\n\t\t\t\t\t});\n\t\t\t\t\tconst promises = Object.keys(batchOps).map(async (key) => {\n\t\t\t\t\t\tlet json = await Promise.resolve(head[key]);\n\t\t\t\t\t\tif (\"result\" in json) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t* Not very pretty, but we need to unwrap nested data as promises\n\t\t\t\t\t\t\t* Our stream producer will only resolve top-level async values or async values that are directly nested in another async value\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tconst result = await Promise.resolve(json.result);\n\t\t\t\t\t\t\tjson = { result: { data: await Promise.resolve(result.data) } };\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tjson,\n\t\t\t\t\t\t\tmeta: { response: res }\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t\treturn promises;\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\tconst query = dataLoader(batchLoader(\"query\"));\n\t\tconst mutation = dataLoader(batchLoader(\"mutation\"));\n\t\tconst loaders = {\n\t\t\tquery,\n\t\t\tmutation\n\t\t};\n\t\treturn ({ op }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\t/* istanbul ignore if -- @preserve */\n\t\t\t\tif (op.type === \"subscription\") throw new Error(\"Subscriptions are unsupported by `httpBatchStreamLink` - use `httpSubscriptionLink` or `wsLink`\");\n\t\t\t\tconst loader = loaders[op.type];\n\t\t\t\tconst promise = loader.load(op);\n\t\t\t\tlet _res = void 0;\n\t\t\t\tpromise.then((res) => {\n\t\t\t\t\t_res = res;\n\t\t\t\t\tif (\"error\" in res.json) {\n\t\t\t\t\t\tobserver.error(TRPCClientError.from(res.json, { meta: res.meta }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if (\"result\" in res.json) {\n\t\t\t\t\t\tobserver.next({\n\t\t\t\t\t\t\tcontext: res.meta,\n\t\t\t\t\t\t\tresult: res.json.result\n\t\t\t\t\t\t});\n\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tobserver.complete();\n\t\t\t\t}).catch((err) => {\n\t\t\t\t\tobserver.error(TRPCClientError.from(err, { meta: _res === null || _res === void 0 ? void 0 : _res.meta }));\n\t\t\t\t});\n\t\t\t\treturn () => {};\n\t\t\t});\n\t\t};\n\t};\n}\n/**\n* @deprecated use {@link httpBatchStreamLink} instead\n*/\nconst unstable_httpBatchStreamLink = httpBatchStreamLink;\n\n//#endregion\n//#region src/internals/inputWithTrackedEventId.ts\nvar import_objectSpread2$2 = __toESM(require_objectSpread2(), 1);\nfunction inputWithTrackedEventId(input, lastEventId) {\n\tif (!lastEventId) return input;\n\tif (input != null && typeof input !== \"object\") return input;\n\treturn (0, import_objectSpread2$2.default)((0, import_objectSpread2$2.default)({}, input !== null && input !== void 0 ? input : {}), {}, { lastEventId });\n}\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js\nvar require_asyncIterator = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js\"(exports, module) {\n\tfunction _asyncIterator$1(r) {\n\t\tvar n, t, o, e = 2;\n\t\tfor (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) {\n\t\t\tif (t && null != (n = r[t])) return n.call(r);\n\t\t\tif (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));\n\t\t\tt = \"@@asyncIterator\", o = \"@@iterator\";\n\t\t}\n\t\tthrow new TypeError(\"Object is not async iterable\");\n\t}\n\tfunction AsyncFromSyncIterator(r) {\n\t\tfunction AsyncFromSyncIteratorContinuation(r$1) {\n\t\t\tif (Object(r$1) !== r$1) return Promise.reject(new TypeError(r$1 + \" is not an object.\"));\n\t\t\tvar n = r$1.done;\n\t\t\treturn Promise.resolve(r$1.value).then(function(r$2) {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: r$2,\n\t\t\t\t\tdone: n\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\treturn AsyncFromSyncIterator = function AsyncFromSyncIterator$1(r$1) {\n\t\t\tthis.s = r$1, this.n = r$1.next;\n\t\t}, AsyncFromSyncIterator.prototype = {\n\t\t\ts: null,\n\t\t\tn: null,\n\t\t\tnext: function next() {\n\t\t\t\treturn AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));\n\t\t\t},\n\t\t\t\"return\": function _return(r$1) {\n\t\t\t\tvar n = this.s[\"return\"];\n\t\t\t\treturn void 0 === n ? Promise.resolve({\n\t\t\t\t\tvalue: r$1,\n\t\t\t\t\tdone: !0\n\t\t\t\t}) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));\n\t\t\t},\n\t\t\t\"throw\": function _throw(r$1) {\n\t\t\t\tvar n = this.s[\"return\"];\n\t\t\t\treturn void 0 === n ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));\n\t\t\t}\n\t\t}, new AsyncFromSyncIterator(r);\n\t}\n\tmodule.exports = _asyncIterator$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region src/links/httpSubscriptionLink.ts\nvar import_asyncIterator = __toESM(require_asyncIterator(), 1);\nasync function urlWithConnectionParams(opts) {\n\tlet url = await resultOf(opts.url);\n\tif (opts.connectionParams) {\n\t\tconst params = await resultOf(opts.connectionParams);\n\t\tconst prefix = url.includes(\"?\") ? \"&\" : \"?\";\n\t\turl += prefix + \"connectionParams=\" + encodeURIComponent(JSON.stringify(params));\n\t}\n\treturn url;\n}\n/**\n* @see https://trpc.io/docs/client/links/httpSubscriptionLink\n*/\nfunction httpSubscriptionLink(opts) {\n\tconst transformer = getTransformer(opts.transformer);\n\treturn () => {\n\t\treturn ({ op }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tvar _opts$EventSource;\n\t\t\t\tconst { type, path, input } = op;\n\t\t\t\t/* istanbul ignore if -- @preserve */\n\t\t\t\tif (type !== \"subscription\") throw new Error(\"httpSubscriptionLink only supports subscriptions\");\n\t\t\t\tlet lastEventId = void 0;\n\t\t\t\tconst ac = new AbortController();\n\t\t\t\tconst signal = raceAbortSignals(op.signal, ac.signal);\n\t\t\t\tconst eventSourceStream = sseStreamConsumer({\n\t\t\t\t\turl: async () => getUrl({\n\t\t\t\t\t\ttransformer,\n\t\t\t\t\t\turl: await urlWithConnectionParams(opts),\n\t\t\t\t\t\tinput: inputWithTrackedEventId(input, lastEventId),\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tsignal: null\n\t\t\t\t\t}),\n\t\t\t\t\tinit: () => resultOf(opts.eventSourceOptions, { op }),\n\t\t\t\t\tsignal,\n\t\t\t\t\tdeserialize: (data) => transformer.output.deserialize(data),\n\t\t\t\t\tEventSource: (_opts$EventSource = opts.EventSource) !== null && _opts$EventSource !== void 0 ? _opts$EventSource : globalThis.EventSource\n\t\t\t\t});\n\t\t\t\tconst connectionState = behaviorSubject({\n\t\t\t\t\ttype: \"state\",\n\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\terror: null\n\t\t\t\t});\n\t\t\t\tconst connectionSub = connectionState.subscribe({ next(state) {\n\t\t\t\t\tobserver.next({ result: state });\n\t\t\t\t} });\n\t\t\t\trun(async () => {\n\t\t\t\t\tvar _iteratorAbruptCompletion = false;\n\t\t\t\t\tvar _didIteratorError = false;\n\t\t\t\t\tvar _iteratorError;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor (var _iterator = (0, import_asyncIterator.default)(eventSourceStream), _step; _iteratorAbruptCompletion = !(_step = await _iterator.next()).done; _iteratorAbruptCompletion = false) {\n\t\t\t\t\t\t\tconst chunk = _step.value;\n\t\t\t\t\t\t\tswitch (chunk.type) {\n\t\t\t\t\t\t\t\tcase \"ping\": break;\n\t\t\t\t\t\t\t\tcase \"data\":\n\t\t\t\t\t\t\t\t\tconst chunkData = chunk.data;\n\t\t\t\t\t\t\t\t\tlet result;\n\t\t\t\t\t\t\t\t\tif (chunkData.id) {\n\t\t\t\t\t\t\t\t\t\tlastEventId = chunkData.id;\n\t\t\t\t\t\t\t\t\t\tresult = {\n\t\t\t\t\t\t\t\t\t\t\tid: chunkData.id,\n\t\t\t\t\t\t\t\t\t\t\tdata: chunkData\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t} else result = { data: chunkData.data };\n\t\t\t\t\t\t\t\t\tobserver.next({\n\t\t\t\t\t\t\t\t\t\tresult,\n\t\t\t\t\t\t\t\t\t\tcontext: { eventSource: chunk.eventSource }\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase \"connected\": {\n\t\t\t\t\t\t\t\t\tobserver.next({\n\t\t\t\t\t\t\t\t\t\tresult: { type: \"started\" },\n\t\t\t\t\t\t\t\t\t\tcontext: { eventSource: chunk.eventSource }\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\tstate: \"pending\",\n\t\t\t\t\t\t\t\t\t\terror: null\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase \"serialized-error\": {\n\t\t\t\t\t\t\t\t\tconst error = TRPCClientError.from({ error: chunk.error });\n\t\t\t\t\t\t\t\t\tif (retryableRpcCodes.includes(chunk.error.code)) {\n\t\t\t\t\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\t\t\t\t\t\terror\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase \"connecting\": {\n\t\t\t\t\t\t\t\t\tconst lastState = connectionState.get();\n\t\t\t\t\t\t\t\t\tconst error = chunk.event && TRPCClientError.from(chunk.event);\n\t\t\t\t\t\t\t\t\tif (!error && lastState.state === \"connecting\") break;\n\t\t\t\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\t\t\t\t\terror\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase \"timeout\": connectionState.next({\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\t\t\t\terror: new TRPCClientError(`Timeout of ${chunk.ms}ms reached while waiting for a response`)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t\t_iteratorError = err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (_iteratorAbruptCompletion && _iterator.return != null) await _iterator.return();\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tobserver.next({ result: { type: \"stopped\" } });\n\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\tstate: \"idle\",\n\t\t\t\t\t\terror: null\n\t\t\t\t\t});\n\t\t\t\t\tobserver.complete();\n\t\t\t\t}).catch((error) => {\n\t\t\t\t\tobserver.error(TRPCClientError.from(error));\n\t\t\t\t});\n\t\t\t\treturn () => {\n\t\t\t\t\tobserver.complete();\n\t\t\t\t\tac.abort();\n\t\t\t\t\tconnectionSub.unsubscribe();\n\t\t\t\t};\n\t\t\t});\n\t\t};\n\t};\n}\n/**\n* @deprecated use {@link httpSubscriptionLink} instead\n*/\nconst unstable_httpSubscriptionLink = httpSubscriptionLink;\n\n//#endregion\n//#region src/links/retryLink.ts\nvar import_objectSpread2$1 = __toESM(require_objectSpread2(), 1);\n/**\n* @see https://trpc.io/docs/v11/client/links/retryLink\n*/\nfunction retryLink(opts) {\n\treturn () => {\n\t\treturn (callOpts) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tlet next$;\n\t\t\t\tlet callNextTimeout = void 0;\n\t\t\t\tlet lastEventId = void 0;\n\t\t\t\tattempt(1);\n\t\t\t\tfunction opWithLastEventId() {\n\t\t\t\t\tconst op = callOpts.op;\n\t\t\t\t\tif (!lastEventId) return op;\n\t\t\t\t\treturn (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, op), {}, { input: inputWithTrackedEventId(op.input, lastEventId) });\n\t\t\t\t}\n\t\t\t\tfunction attempt(attempts) {\n\t\t\t\t\tconst op = opWithLastEventId();\n\t\t\t\t\tnext$ = callOpts.next(op).subscribe({\n\t\t\t\t\t\terror(error) {\n\t\t\t\t\t\t\tvar _opts$retryDelayMs, _opts$retryDelayMs2;\n\t\t\t\t\t\t\tconst shouldRetry = opts.retry({\n\t\t\t\t\t\t\t\top,\n\t\t\t\t\t\t\t\tattempts,\n\t\t\t\t\t\t\t\terror\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (!shouldRetry) {\n\t\t\t\t\t\t\t\tobserver.error(error);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst delayMs = (_opts$retryDelayMs = (_opts$retryDelayMs2 = opts.retryDelayMs) === null || _opts$retryDelayMs2 === void 0 ? void 0 : _opts$retryDelayMs2.call(opts, attempts)) !== null && _opts$retryDelayMs !== void 0 ? _opts$retryDelayMs : 0;\n\t\t\t\t\t\t\tif (delayMs <= 0) {\n\t\t\t\t\t\t\t\tattempt(attempts + 1);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcallNextTimeout = setTimeout(() => attempt(attempts + 1), delayMs);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnext(envelope) {\n\t\t\t\t\t\t\tif ((!envelope.result.type || envelope.result.type === \"data\") && envelope.result.id) lastEventId = envelope.result.id;\n\t\t\t\t\t\t\tobserver.next(envelope);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcomplete() {\n\t\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn () => {\n\t\t\t\t\tnext$.unsubscribe();\n\t\t\t\t\tclearTimeout(callNextTimeout);\n\t\t\t\t};\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js\nvar require_usingCtx = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js\"(exports, module) {\n\tfunction _usingCtx() {\n\t\tvar r = \"function\" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {\n\t\t\tvar n$1 = Error();\n\t\t\treturn n$1.name = \"SuppressedError\", n$1.error = r$1, n$1.suppressed = e$1, n$1;\n\t\t}, e = {}, n = [];\n\t\tfunction using(r$1, e$1) {\n\t\t\tif (null != e$1) {\n\t\t\t\tif (Object(e$1) !== e$1) throw new TypeError(\"using declarations can only be used with objects, functions, null, or undefined.\");\n\t\t\t\tif (r$1) var o = e$1[Symbol.asyncDispose || Symbol[\"for\"](\"Symbol.asyncDispose\")];\n\t\t\t\tif (void 0 === o && (o = e$1[Symbol.dispose || Symbol[\"for\"](\"Symbol.dispose\")], r$1)) var t = o;\n\t\t\t\tif (\"function\" != typeof o) throw new TypeError(\"Object is not disposable.\");\n\t\t\t\tt && (o = function o$1() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tt.call(e$1);\n\t\t\t\t\t} catch (r$2) {\n\t\t\t\t\t\treturn Promise.reject(r$2);\n\t\t\t\t\t}\n\t\t\t\t}), n.push({\n\t\t\t\t\tv: e$1,\n\t\t\t\t\td: o,\n\t\t\t\t\ta: r$1\n\t\t\t\t});\n\t\t\t} else r$1 && n.push({\n\t\t\t\td: e$1,\n\t\t\t\ta: r$1\n\t\t\t});\n\t\t\treturn e$1;\n\t\t}\n\t\treturn {\n\t\t\te,\n\t\t\tu: using.bind(null, !1),\n\t\t\ta: using.bind(null, !0),\n\t\t\td: function d() {\n\t\t\t\tvar o, t = this.e, s = 0;\n\t\t\t\tfunction next() {\n\t\t\t\t\tfor (; o = n.pop();) try {\n\t\t\t\t\t\tif (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);\n\t\t\t\t\t\tif (o.d) {\n\t\t\t\t\t\t\tvar r$1 = o.d.call(o.v);\n\t\t\t\t\t\t\tif (o.a) return s |= 2, Promise.resolve(r$1).then(next, err);\n\t\t\t\t\t\t} else s |= 1;\n\t\t\t\t\t} catch (r$2) {\n\t\t\t\t\t\treturn err(r$2);\n\t\t\t\t\t}\n\t\t\t\t\tif (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();\n\t\t\t\t\tif (t !== e) throw t;\n\t\t\t\t}\n\t\t\t\tfunction err(n$1) {\n\t\t\t\t\treturn t = t !== e ? new r(n$1, t) : n$1, next();\n\t\t\t\t}\n\t\t\t\treturn next();\n\t\t\t}\n\t\t};\n\t}\n\tmodule.exports = _usingCtx, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js\nvar require_OverloadYield = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js\"(exports, module) {\n\tfunction _OverloadYield(e, d) {\n\t\tthis.v = e, this.k = d;\n\t}\n\tmodule.exports = _OverloadYield, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js\nvar require_awaitAsyncGenerator = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js\"(exports, module) {\n\tvar OverloadYield$1 = require_OverloadYield();\n\tfunction _awaitAsyncGenerator$1(e) {\n\t\treturn new OverloadYield$1(e, 0);\n\t}\n\tmodule.exports = _awaitAsyncGenerator$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js\nvar require_wrapAsyncGenerator = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js\"(exports, module) {\n\tvar OverloadYield = require_OverloadYield();\n\tfunction _wrapAsyncGenerator$1(e) {\n\t\treturn function() {\n\t\t\treturn new AsyncGenerator(e.apply(this, arguments));\n\t\t};\n\t}\n\tfunction AsyncGenerator(e) {\n\t\tvar r, t;\n\t\tfunction resume(r$1, t$1) {\n\t\t\ttry {\n\t\t\t\tvar n = e[r$1](t$1), o = n.value, u = o instanceof OverloadYield;\n\t\t\t\tPromise.resolve(u ? o.v : o).then(function(t$2) {\n\t\t\t\t\tif (u) {\n\t\t\t\t\t\tvar i = \"return\" === r$1 ? \"return\" : \"next\";\n\t\t\t\t\t\tif (!o.k || t$2.done) return resume(i, t$2);\n\t\t\t\t\t\tt$2 = e[i](t$2).value;\n\t\t\t\t\t}\n\t\t\t\t\tsettle(n.done ? \"return\" : \"normal\", t$2);\n\t\t\t\t}, function(e$1) {\n\t\t\t\t\tresume(\"throw\", e$1);\n\t\t\t\t});\n\t\t\t} catch (e$1) {\n\t\t\t\tsettle(\"throw\", e$1);\n\t\t\t}\n\t\t}\n\t\tfunction settle(e$1, n) {\n\t\t\tswitch (e$1) {\n\t\t\t\tcase \"return\":\n\t\t\t\t\tr.resolve({\n\t\t\t\t\t\tvalue: n,\n\t\t\t\t\t\tdone: !0\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tr.reject(n);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: r.resolve({\n\t\t\t\t\tvalue: n,\n\t\t\t\t\tdone: !1\n\t\t\t\t});\n\t\t\t}\n\t\t\t(r = r.next) ? resume(r.key, r.arg) : t = null;\n\t\t}\n\t\tthis._invoke = function(e$1, n) {\n\t\t\treturn new Promise(function(o, u) {\n\t\t\t\tvar i = {\n\t\t\t\t\tkey: e$1,\n\t\t\t\t\targ: n,\n\t\t\t\t\tresolve: o,\n\t\t\t\t\treject: u,\n\t\t\t\t\tnext: null\n\t\t\t\t};\n\t\t\t\tt ? t = t.next = i : (r = t = i, resume(e$1, n));\n\t\t\t});\n\t\t}, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0);\n\t}\n\tAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function() {\n\t\treturn this;\n\t}, AsyncGenerator.prototype.next = function(e) {\n\t\treturn this._invoke(\"next\", e);\n\t}, AsyncGenerator.prototype[\"throw\"] = function(e) {\n\t\treturn this._invoke(\"throw\", e);\n\t}, AsyncGenerator.prototype[\"return\"] = function(e) {\n\t\treturn this._invoke(\"return\", e);\n\t};\n\tmodule.exports = _wrapAsyncGenerator$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region src/links/localLink.ts\nvar import_usingCtx = __toESM(require_usingCtx(), 1);\nvar import_awaitAsyncGenerator = __toESM(require_awaitAsyncGenerator(), 1);\nvar import_wrapAsyncGenerator = __toESM(require_wrapAsyncGenerator(), 1);\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* localLink is a terminating link that allows you to make tRPC procedure calls directly in your application without going through HTTP.\n*\n* @see https://trpc.io/docs/links/localLink\n*/\nfunction unstable_localLink(opts) {\n\tconst transformer = getTransformer(opts.transformer);\n\tconst transformChunk = (chunk) => {\n\t\tif (opts.transformer) return chunk;\n\t\tif (chunk === void 0) return chunk;\n\t\tconst serialized = JSON.stringify(transformer.input.serialize(chunk));\n\t\tconst deserialized = JSON.parse(transformer.output.deserialize(serialized));\n\t\treturn deserialized;\n\t};\n\treturn () => ({ op }) => observable((observer) => {\n\t\tlet ctx = void 0;\n\t\tconst ac = new AbortController();\n\t\tconst signal = raceAbortSignals(op.signal, ac.signal);\n\t\tconst signalPromise = abortSignalToPromise(signal);\n\t\tsignalPromise.catch(() => {});\n\t\tlet input = op.input;\n\t\tasync function runProcedure(newInput) {\n\t\t\tinput = newInput;\n\t\t\tctx = await opts.createContext();\n\t\t\treturn callProcedure({\n\t\t\t\trouter: opts.router,\n\t\t\t\tpath: op.path,\n\t\t\t\tgetRawInput: async () => newInput,\n\t\t\t\tctx,\n\t\t\t\ttype: op.type,\n\t\t\t\tsignal\n\t\t\t});\n\t\t}\n\t\tfunction onErrorCallback(cause) {\n\t\t\tvar _opts$onError;\n\t\t\tif (isAbortError(cause)) return;\n\t\t\t(_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, {\n\t\t\t\terror: getTRPCErrorFromUnknown(cause),\n\t\t\t\ttype: op.type,\n\t\t\t\tpath: op.path,\n\t\t\t\tinput,\n\t\t\t\tctx\n\t\t\t});\n\t\t}\n\t\tfunction coerceToTRPCClientError(cause) {\n\t\t\tif (isTRPCClientError(cause)) return cause;\n\t\t\tconst error = getTRPCErrorFromUnknown(cause);\n\t\t\tconst shape = getTRPCErrorShape({\n\t\t\t\tconfig: opts.router._def._config,\n\t\t\t\tctx,\n\t\t\t\terror,\n\t\t\t\tinput,\n\t\t\t\tpath: op.path,\n\t\t\t\ttype: op.type\n\t\t\t});\n\t\t\treturn TRPCClientError.from({ error: transformChunk(shape) });\n\t\t}\n\t\trun(async () => {\n\t\t\tswitch (op.type) {\n\t\t\t\tcase \"query\":\n\t\t\t\tcase \"mutation\": {\n\t\t\t\t\tconst result = await runProcedure(op.input);\n\t\t\t\t\tif (!isAsyncIterable(result)) {\n\t\t\t\t\t\tobserver.next({ result: { data: transformChunk(result) } });\n\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tobserver.next({ result: { data: (0, import_wrapAsyncGenerator.default)(function* () {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar _usingCtx$1 = (0, import_usingCtx.default)();\n\t\t\t\t\t\t\tconst iterator = _usingCtx$1.a(iteratorResource(result));\n\t\t\t\t\t\t\tconst _finally = _usingCtx$1.u(makeResource({}, () => {\n\t\t\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\t\tconst res = yield (0, import_awaitAsyncGenerator.default)(Promise.race([iterator.next(), signalPromise]));\n\t\t\t\t\t\t\t\t\tif (res.done) return transformChunk(res.value);\n\t\t\t\t\t\t\t\t\tyield transformChunk(res.value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\t\t\tonErrorCallback(cause);\n\t\t\t\t\t\t\t\tthrow coerceToTRPCClientError(cause);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t\t_usingCtx$1.e = _;\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tyield (0, import_awaitAsyncGenerator.default)(_usingCtx$1.d());\n\t\t\t\t\t\t}\n\t\t\t\t\t})() } });\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"subscription\": try {\n\t\t\t\t\tvar _usingCtx3 = (0, import_usingCtx.default)();\n\t\t\t\t\tconst connectionState = behaviorSubject({\n\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\terror: null\n\t\t\t\t\t});\n\t\t\t\t\tconst connectionSub = connectionState.subscribe({ next(state) {\n\t\t\t\t\t\tobserver.next({ result: state });\n\t\t\t\t\t} });\n\t\t\t\t\tlet lastEventId = void 0;\n\t\t\t\t\tconst _finally = _usingCtx3.u(makeResource({}, async () => {\n\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tstate: \"idle\",\n\t\t\t\t\t\t\terror: null\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconnectionSub.unsubscribe();\n\t\t\t\t\t}));\n\t\t\t\t\twhile (true) try {\n\t\t\t\t\t\tvar _usingCtx4 = (0, import_usingCtx.default)();\n\t\t\t\t\t\tconst result = await runProcedure(inputWithTrackedEventId(op.input, lastEventId));\n\t\t\t\t\t\tif (!isAsyncIterable(result)) throw new Error(\"Expected an async iterable\");\n\t\t\t\t\t\tconst iterator = _usingCtx4.a(iteratorResource(result));\n\t\t\t\t\t\tobserver.next({ result: { type: \"started\" } });\n\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tstate: \"pending\",\n\t\t\t\t\t\t\terror: null\n\t\t\t\t\t\t});\n\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\tlet res;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tres = await Promise.race([iterator.next(), signalPromise]);\n\t\t\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\t\t\tif (isAbortError(cause)) return;\n\t\t\t\t\t\t\t\tconst error = getTRPCErrorFromUnknown(cause);\n\t\t\t\t\t\t\t\tif (!retryableRpcCodes.includes(TRPC_ERROR_CODES_BY_KEY[error.code])) throw coerceToTRPCClientError(error);\n\t\t\t\t\t\t\t\tonErrorCallback(error);\n\t\t\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\t\t\t\terror: coerceToTRPCClientError(error)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res.done) return;\n\t\t\t\t\t\t\tlet chunk;\n\t\t\t\t\t\t\tif (isTrackedEnvelope(res.value)) {\n\t\t\t\t\t\t\t\tlastEventId = res.value[0];\n\t\t\t\t\t\t\t\tchunk = {\n\t\t\t\t\t\t\t\t\tid: res.value[0],\n\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\tid: res.value[0],\n\t\t\t\t\t\t\t\t\t\tdata: res.value[1]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t} else chunk = { data: res.value };\n\t\t\t\t\t\t\tobserver.next({ result: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, chunk), {}, { data: transformChunk(chunk.data) }) });\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t_usingCtx4.e = _;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tawait _usingCtx4.d();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (_) {\n\t\t\t\t\t_usingCtx3.e = _;\n\t\t\t\t} finally {\n\t\t\t\t\t_usingCtx3.d();\n\t\t\t\t}\n\t\t\t}\n\t\t}).catch((cause) => {\n\t\t\tonErrorCallback(cause);\n\t\t\tobserver.error(coerceToTRPCClientError(cause));\n\t\t});\n\t\treturn () => {\n\t\t\tac.abort();\n\t\t};\n\t});\n}\n/**\n* @deprecated Renamed to `unstable_localLink`. This alias will be removed in a future major release.\n*/\nconst experimental_localLink = unstable_localLink;\n\n//#endregion\nexport { TRPCClientError, TRPCUntypedClient, clientCallTypeToProcedureType, createTRPCClient, createTRPCClientProxy, createTRPCClient as createTRPCProxyClient, createTRPCUntypedClient, createWSClient, experimental_localLink, getFetch, getUntypedClient, httpBatchLink, httpBatchStreamLink, httpLink, httpSubscriptionLink, isFormData, isNonJsonSerializable, isOctetType, isTRPCClientError, loggerLink, retryLink, splitLink, unstable_httpBatchStreamLink, unstable_httpSubscriptionLink, unstable_localLink, wsLink };\n//# sourceMappingURL=index.mjs.map","import { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport { createTRPCClient, createWSClient, httpBatchLink, splitLink, wsLink } from '@trpc/client';\nimport { ensureWebsocketDefined } from '../utilities/ensureWebsocketDefined.js';\nimport { ignoreSelfSignedCertErrors } from '../utilities/ignoreSelfSignedCertErrors.js';\n/**\n * Creates a cloudpack client that can be used to communicate with the cloudpack server using trpc.\n */\nexport async function createCloudpackClient(options) {\n const { url: wsUrl, reporter, onOpen } = options;\n // We polyfill websocket in node conditions.\n await ensureWebsocketDefined();\n ignoreSelfSignedCertErrors({ reporter });\n // Ignore these wsClient `onError` events as we handle them with try/catch when checking if a session is active\n reporter?.ignoreLogMessage('Received network error or non-101 status code.');\n reporter?.ignoreLogMessage('Connection was closed before it was established.');\n // Create the client.\n const wsClient = createWSClient({\n url: wsUrl,\n onError: (evt) => {\n const error = evt;\n // On node evt is an Event with a message property\n // On browser it is an Event with no relevant information\n // We can't directly log or stringify the event as it will be undefined\n if (error?.message) {\n console.error(`[Cloudpack] Websocket client error: ${error.message}`);\n }\n else {\n console.error('[Cloudpack] Unexpected websocket client error');\n }\n },\n onOpen() {\n onOpen?.();\n },\n });\n const tempUrl = makeUrl(wsUrl);\n // Replace the protocol with http so that we can use the same url for http requests.\n const isSSL = tempUrl.protocol === 'wss:';\n tempUrl.protocol = isSSL ? 'https:' : 'http:';\n const httpUrl = tempUrl.toString().replace(/\\/$/, '');\n const client = createTRPCClient({\n links: [\n // send subscriptions to the websocket client and handle operations with HTTP requests\n splitLink({\n condition(op) {\n return op.type === 'subscription';\n },\n true: wsLink({\n client: wsClient,\n }),\n false: httpBatchLink({\n url: httpUrl,\n }),\n }),\n ],\n });\n const close = async () => {\n await wsClient.close();\n };\n // Add a default onError handler for onDataChanged subscriptions.\n // Otherwise errors (such as from zod type violations) will be hidden.\n const onDataChanged = {\n subscribe: (source, opts) => {\n opts = { ...opts };\n opts.onError ??= (err) => {\n console.error(`[Cloudpack] Error in ${source.path.join('.')} data subscription (this may be a Cloudpack bug): ` +\n err.message);\n };\n return client.onDataChanged.subscribe(source, opts);\n },\n };\n // Ugh. This is a hack to get around the fact that the client is a proxy.\n // Make another proxy which defines the close method and onDataChanged wrapper,\n // and passes through everything else to the original client.\n return new Proxy({ close, onDataChanged }, {\n get(target, prop) {\n // eslint-disable-next-line no-prototype-builtins\n if (target.hasOwnProperty(prop)) {\n return target[prop];\n }\n return client[prop];\n },\n });\n}\n//# sourceMappingURL=createCloudpackClient.js.map","export async function ensureWebsocketDefined() {\n if (typeof global !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const g = global;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (typeof g.WebSocket === 'undefined') {\n const { WebSocket: NodeWebSocket } = await import('ws');\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n g.WebSocket = NodeWebSocket;\n }\n }\n}\n//# sourceMappingURL=ensureWebsocketDefined.js.map","export function ignoreSelfSignedCertErrors({ reporter }) {\n if (typeof process !== 'undefined') {\n // When using self-signed certificates for the api server, node fails to make requests unless we set this.\n // eslint-disable-next-line no-restricted-properties -- ok to set properties\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';\n // When we do this, node creates a console.error that we need to ignore:\n //\n // (node:26988) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0'\n // makes TLS connections and HTTPS requests insecure by disabling certificate verification.\n reporter?.ignoreLogMessage('Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable');\n }\n}\n//# sourceMappingURL=ignoreSelfSignedCertErrors.js.map","/**\n * Attempt to create a URL object from a string, and throw an informative error if it fails.\n * (The URL constructor throws a very generic error.)\n */\nexport function makeUrl(input, base) {\n try {\n // eslint-disable-next-line no-restricted-syntax -- this is the function definition\n return new URL(input, base);\n }\n catch {\n throw new Error(`Invalid URL: \"${input}\", base: \"${base || ''}\"`);\n }\n}\n//# sourceMappingURL=makeUrl.js.map","\n import API from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/cjs.js??ruleSet[1].rules[0].oneOf[1].use[1]!./UIManager.module.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/cjs.js??ruleSet[1].rules[0].oneOf[1].use[1]!./UIManager.module.css\";\n export default content && content.locals ? content.locals : undefined;\n","import styles from './UIManager.module.css';\n\n/**\n * UI Manager for handling status display\n */\nexport class UIManager {\n private element: HTMLElement | null;\n\n constructor(elementId: string = 'root') {\n this.element = document.getElementById(elementId);\n }\n\n /**\n * Display a status message to the user\n */\n updateStatus(input: { message: string; tip?: string; isError?: boolean; data?: unknown }): void {\n const { message, tip, isError = false, data } = input;\n\n const method = isError ? 'error' : 'debug';\n if (data) {\n console[method](message, data);\n } else {\n console[method](message);\n }\n\n if (!this.element) return;\n\n this.element.innerHTML = `\n <div class=\"${styles.statusContainer + (isError ? ` ${styles.errorContainer}` : '')}\">\n <h2 class=\"${styles.title}\">Cloudpack Link Proxy</h2>\n <p class=\"${styles.message}\">${isError ? 'Error: ' : ''}${message}</p>\n ${tip ? `<p class=\"${styles.message}\"><strong>Tip:</strong> ${tip}</p>` : ''}\n <p class=\"${styles.warning}\">Do not close this page while Cloudpack link is running.</p>\n </div>\n `;\n }\n}\n","import type { CloudpackClient } from '@ms-cloudpack/api-server/browser';\n\ntype ClientId = 'link' | 'host';\n\n/**\n * Connection Manager for handling client connections\n */\nexport class ConnectionManager {\n private clients = new Map<string, CloudpackClient>();\n private connectionStates = new Map<string, boolean>();\n private checkInterval: number | null = null;\n private readonly checkIntervalMs: number = 5000; // 5 seconds\n\n /**\n * Add a client to be monitored\n */\n addClient(id: ClientId, client: CloudpackClient): void {\n this.clients.set(id, client);\n this.connectionStates.set(id, true);\n }\n\n /**\n * Get a client by ID\n */\n getClient(id: ClientId): CloudpackClient | undefined {\n return this.clients.get(id);\n }\n\n /**\n * Check if a client is connected\n */\n async checkConnection(id: ClientId): Promise<boolean> {\n const client = this.clients.get(id);\n if (!client) return false;\n\n try {\n await client.getSessionId.query();\n return true;\n } catch (e) {\n console.warn(`${id} client connection lost:`, e);\n return false;\n }\n }\n\n /**\n * Start monitoring all client connections\n */\n startMonitoring(\n onConnectionChange: (params: { id: ClientId; isConnected: boolean; wasConnected: boolean }) => Promise<void>,\n ): void {\n if (this.checkInterval) {\n window.clearInterval(this.checkInterval);\n }\n\n this.checkInterval = window.setInterval(() => {\n (async () => {\n for (const [id, _] of this.clients) {\n if (id != 'link' && id != 'host') throw new Error(`Invalid client ID: ${id}`);\n\n const wasConnected = this.connectionStates.get(id) || false;\n const isConnected = await this.checkConnection(id);\n\n if (wasConnected !== isConnected) {\n await onConnectionChange({ id, isConnected, wasConnected });\n }\n\n this.connectionStates.set(id, isConnected);\n }\n })().catch((error) => {\n console.error('Error in connection monitoring:', error);\n });\n }, this.checkIntervalMs);\n }\n\n /**\n * Stop monitoring connections\n */\n stopMonitoring(): void {\n if (this.checkInterval) {\n window.clearInterval(this.checkInterval);\n this.checkInterval = null;\n }\n }\n\n /**\n * Close all clients\n */\n async closeAll(): Promise<void> {\n for (const [id, client] of this.clients) {\n try {\n await client.close();\n console.log(`Closed ${id} client`);\n } catch (err) {\n console.error(`Error closing ${id} client:`, err);\n }\n }\n this.clients.clear();\n this.connectionStates.clear();\n }\n}\n","import { createCloudpackClient } from '@ms-cloudpack/api-server/browser';\n\n/**\n * Check if an API server is active at the given URL\n */\nexport async function isApiServerActive(url: string): Promise<boolean> {\n console.debug(`[Cloudpack] Checking session at ${url}`);\n\n const client = await createCloudpackClient({ url });\n let isActive = false;\n try {\n isActive = !!(await client.getSessionId.query());\n } catch {\n /* no-op */\n } finally {\n await client.close();\n }\n\n return isActive;\n}\n","import { LinkProxyApp } from './LinkProxyApp.js';\n\n// Start the application\nconst app = new LinkProxyApp();\nvoid app.initialize();\n","import type { NotifyLinkChangeInput, LinkPathInput, GetLinkConfigOutput } from '@ms-cloudpack/api-server/browser';\nimport {\n createCloudpackClient,\n linkUpdateSource,\n linkConfigSource,\n linkPathsSource,\n linkDoneSource,\n linkDisconnectedSource,\n} from '@ms-cloudpack/api-server/browser';\nimport { UIManager } from './UIManager.js';\nimport { ConnectionManager } from './ConnectionManager.js';\nimport { isApiServerActive } from './isApiServerActive.js';\n\n/**\n * Link Proxy application that handles communication between host and link sessions\n */\nexport class LinkProxyApp {\n private ui: UIManager;\n private connectionManager: ConnectionManager;\n private linkedPathData: LinkPathInput | null = null;\n\n constructor() {\n this.ui = new UIManager();\n this.connectionManager = new ConnectionManager();\n }\n\n /**\n * Handle a connection state change\n */\n private handleConnectionChange = async (params: {\n id: string;\n isConnected: boolean;\n wasConnected: boolean;\n }): Promise<void> => {\n const { id, isConnected, wasConnected } = params;\n // Only handle disconnections\n if (wasConnected && !isConnected) {\n if (id === 'host') {\n await this.handleHostDisconnection();\n } else if (id === 'link') {\n await this.handleLinkDisconnection();\n }\n }\n };\n\n /**\n * Handle host disconnection\n */\n private async handleHostDisconnection(options?: { unreachable?: boolean }): Promise<void> {\n const isUnreachable = options?.unreachable ?? false;\n const reason = isUnreachable ? 'unreachable' : 'lost';\n // This is shown momentarily before the cleanup.\n this.ui.updateStatus({\n message: `Connection to host ${reason}. The session will be terminated.`,\n isError: true,\n });\n\n const linkClient = this.connectionManager.getClient('link');\n let isLinkClosed = false;\n if (linkClient) {\n try {\n await linkClient.publishData.mutate({\n ...linkDisconnectedSource,\n data: { reason },\n });\n isLinkClosed = true;\n } catch {\n // This is also shown momentarily before the cleanup.\n this.ui.updateStatus({ message: `Error notifying link client of host connection ${reason}.`, isError: true });\n }\n }\n\n await this.cleanup();\n\n // Generate the appropriate tip based on the situation\n let tip: string;\n if (isUnreachable) {\n tip =\n 'Make sure you have a <code>cloudpack start</code> session running and use the URL from your app to run link with the following command: <code>cloudpack link --remote [URL]</code>';\n } else {\n tip = 'If you did not close the start session terminal, this is a bug. Please report it.';\n // Append additional information about link client notification if needed\n if (!isLinkClosed) {\n tip +=\n ' Link client was not successfully notified of host disconnection. You may need to terminate the link session in the terminal.';\n }\n }\n // This is the message the user will see after the cleanup.\n this.ui.updateStatus({\n message: `Connection to host ${reason}. You can close this page.`,\n tip,\n isError: true,\n });\n }\n\n /**\n * Handle link disconnection\n */\n private async handleLinkDisconnection(): Promise<void> {\n // This is shown momentarily before the cleanup, more information on following messages.\n this.ui.updateStatus({\n message: 'Connection to link client lost. Cleaning up linked paths...',\n isError: true,\n });\n\n const hostClient = this.connectionManager.getClient('host');\n if (hostClient && this.linkedPathData) {\n const { linkedPath } = this.linkedPathData;\n const unlinkedPath = linkedPath.path;\n try {\n await hostClient.unlinkPath.mutate({ linkedPath: { path: unlinkedPath } });\n this.ui.updateStatus({\n message: 'Connection to link client lost. Successfully unlinked paths on host. You can close this page.',\n tip: 'If you did not close the link client terminal. This is a bug. Please report it.',\n });\n } catch (err) {\n this.ui.updateStatus({\n message: 'Connection to link client lost. Failed to unlink paths on host.',\n // TODO: Add unlinking logic for this case\n tip: 'You may need to restart the host application to unlink the paths.',\n isError: true,\n data: err,\n });\n }\n } else {\n this.ui.updateStatus({\n message: 'Cannot clean up: host client or link data not available',\n tip: 'You may need to restart the host application to unlink the paths.',\n isError: true,\n });\n }\n\n await this.cleanup();\n }\n\n /**\n * Set up event handlers and subscriptions\n */\n private setupLinkUpdateHandler(): void {\n const linkClient = this.connectionManager.getClient('link');\n const hostClient = this.connectionManager.getClient('host');\n\n if (!linkClient || !hostClient) return;\n\n // Setup link update handler\n linkClient.onDataChanged.subscribe(linkUpdateSource, {\n onData: (updateData) => {\n this.ui.updateStatus({ message: 'Forwarding package update to the host...', data: updateData });\n\n hostClient.notifyLinkChange\n .mutate(updateData as NotifyLinkChangeInput)\n .then(() => this.ui.updateStatus({ message: 'Cloudpack Link Proxy listening for updates...' }))\n .catch((err) => {\n this.ui.updateStatus({\n message: 'Error forwarding package update to the host. This is a bug. Please report it.',\n isError: true,\n data: err,\n });\n });\n },\n });\n }\n\n /**\n * Handle link path setup and changes\n */\n private async setupLinkPathHandler(): Promise<void> {\n const hostClient = this.connectionManager.getClient('host');\n const linkClient = this.connectionManager.getClient('link');\n if (!linkClient || !hostClient) return;\n\n // Check if the link server has already set up the paths\n if (await linkClient.getData.query(linkPathsSource)) return;\n\n linkClient.onDataChanged.subscribe(linkPathsSource, {\n onData: (setupData) => {\n this.ui.updateStatus({ message: 'Processing link setup...', data: setupData });\n\n // Store the linked path data for potential cleanup\n this.linkedPathData = setupData as LinkPathInput;\n\n void hostClient.linkPath.mutate(this.linkedPathData).then((result) => {\n const { resolveMap, linkedPaths } = result;\n this.ui.updateStatus({ message: 'Sending link setup result back to the link server...', data: result });\n\n void linkClient.publishData\n .mutate({\n ...linkDoneSource,\n data: { resolveMap, linkedPaths },\n })\n .then(() => {\n this.ui.updateStatus({ message: 'Cloudpack Link Proxy listening for updates...' });\n })\n .catch((err) => {\n this.ui.updateStatus({\n message: 'Error sending link setup result back to the link server. Please try to run link again.',\n tip: 'This is a bug. Please report it.',\n isError: true,\n data: err,\n });\n });\n });\n },\n });\n }\n\n /**\n * Set up configuration\n */\n private async setupConfig(): Promise<void> {\n const linkClient = this.connectionManager.getClient('link');\n const hostClient = this.connectionManager.getClient('host');\n\n if (!linkClient || !hostClient) return;\n\n try {\n const config = (await linkClient.getData.query(linkConfigSource)) as GetLinkConfigOutput | undefined;\n\n if (!config) {\n this.ui.updateStatus({ message: 'Fetching host configuration...' });\n\n const hostConfig = await hostClient.getLinkConfig.query();\n this.ui.updateStatus({ message: 'Sending host configuration to the link server...', data: hostConfig });\n\n await linkClient.publishData.mutate({\n ...linkConfigSource,\n data: hostConfig,\n });\n\n this.ui.updateStatus({ message: 'Host configuration sent to the link server.' });\n }\n } catch (err) {\n this.ui.updateStatus({\n message: 'Error setting up configuration. Please try to run link again.',\n tip: 'This is a bug. Please report it.',\n isError: true,\n data: err,\n });\n }\n }\n\n /**\n * Clean up resources\n */\n private async cleanup(): Promise<void> {\n this.connectionManager.stopMonitoring();\n await this.connectionManager.closeAll();\n }\n\n /**\n * Initialize the application\n */\n public async initialize(): Promise<void> {\n this.ui.updateStatus({ message: 'Initializing Cloudpack Link Proxy...' });\n\n try {\n // Validate Cloudpack context\n if (!window.__cloudpack) {\n this.ui.updateStatus({\n message: 'Cloudpack context not found on window.',\n tip: 'This is a bug. Please report it.',\n isError: true,\n });\n throw new Error('Cloudpack not found on window.');\n }\n\n const { pageSessionContext } = window.__cloudpack;\n\n if (!pageSessionContext) {\n this.ui.updateStatus({\n message: 'Session context not found on window.__cloudpack.',\n tip: 'This is a bug. Please report it.',\n isError: true,\n data: window.__cloudpack,\n });\n throw new Error('Session context not found on window.__cloudpack');\n }\n\n const { apiUrl, hostApiServerUrls } = pageSessionContext;\n\n if (!hostApiServerUrls || hostApiServerUrls.length <= 0) {\n this.ui.updateStatus({\n message: 'No host URL provided.',\n tip: 'This is a bug. Please report it.',\n data: pageSessionContext,\n isError: true,\n });\n return;\n }\n\n // Initialize link client\n const linkClient = await createCloudpackClient({ url: apiUrl });\n this.connectionManager.addClient('link', linkClient);\n\n // Find an active host API server\n let hostUrl: string | undefined;\n for (const url of hostApiServerUrls) {\n this.ui.updateStatus({ message: `Checking host API server at ${url}...` });\n const isActive = await isApiServerActive(url);\n if (isActive) {\n this.ui.updateStatus({ message: `Host API server is active at ${url}.` });\n hostUrl = url;\n break;\n }\n }\n\n if (!hostUrl) {\n await this.handleHostDisconnection({ unreachable: true });\n return;\n }\n\n // Initialize host client\n const hostClient = await createCloudpackClient({ url: hostUrl });\n this.connectionManager.addClient('host', hostClient);\n\n // Display session information\n const linkSessionId = await linkClient.getSessionId.query();\n const hostSessionId = await hostClient.getSessionId.query();\n this.ui.updateStatus({ message: `Link Session: ${linkSessionId}, Host Session: ${hostSessionId}` });\n\n // Set up connection monitoring\n this.connectionManager.startMonitoring(this.handleConnectionChange);\n\n // Set up event handlers and configuration\n this.setupLinkUpdateHandler();\n await this.setupLinkPathHandler();\n await this.setupConfig();\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : String(err);\n this.ui.updateStatus({\n message: errorMessage,\n isError: true,\n tip: 'This is a bug. Please report it.',\n data: err,\n });\n await this.cleanup();\n }\n }\n}\n","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root {\n --color-neutral-background1: #ffffff;\n --color-status-danger-background1: #fdf3f4;\n --color-neutral-background2: #fafafa;\n --color-status-danger-foreground1: #b10e1c;\n --color-neutral-foreground1: #242424;\n --color-neutral-foreground2: #424242;\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n --color-neutral-background1: #292929;\n --color-status-danger-background1: #3b0509;\n --color-neutral-background2: #1f1f1f;\n --color-status-danger-foreground1: #dc626d;\n --color-neutral-foreground1: #ffffff;\n --color-neutral-foreground2: #d6d6d6;\n }\n}\n\nbody {\n background-color: var(--color-neutral-background1);\n margin: 0;\n padding: 0;\n font-family:\n 'Segoe UI',\n 'Segoe UI Web (West European)',\n -apple-system,\n BlinkMacSystemFont,\n Roboto,\n 'Helvetica Neue',\n sans-serif;\n}\n\n.statusContainer__v64eNmuXrV4WWsOKdGgy {\n padding: 20px;\n border-radius: 4px;\n background-color: var(--color-neutral-background2);\n margin: 20px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.errorContainer__ScZ3E77NPMqtBzp0OwUr {\n background-color: var(--color-status-danger-background1);\n}\n\n.title__b6Vf2DbiFQkD7AEkJ7p_ h2 {\n color: var(--color-neutral-foreground1);\n margin-top: 0;\n}\n\n.message__05tS4aUzls4kEWk9hkA7 {\n color: var(--color-neutral-foreground1);\n}\n\n.errorContainer__ScZ3E77NPMqtBzp0OwUr .title__b6Vf2DbiFQkD7AEkJ7p_ {\n color: var(--color-status-danger-foreground1);\n}\n\n.errorContainer__ScZ3E77NPMqtBzp0OwUr .message__05tS4aUzls4kEWk9hkA7 {\n color: var(--color-status-danger-foreground1);\n}\n\n.message__05tS4aUzls4kEWk9hkA7 code {\n background-color: var(--color-neutral-background1);\n padding: 2px 5px;\n border-radius: 3px;\n font-family: 'Consolas', 'Monaco', 'Courier New', monospace;\n font-size: 0.9em;\n}\n\n.errorContainer__ScZ3E77NPMqtBzp0OwUr .message__05tS4aUzls4kEWk9hkA7 code {\n background-color: rgba(0, 0, 0, 0.1);\n}\n\n.warning__kheFps3bT2VbnjAMYfSr {\n font-weight: bold;\n margin-top: 20px;\n color: var(--color-neutral-foreground2);\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/UIManager.module.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,oCAAoC;EACpC,0CAA0C;EAC1C,oCAAoC;EACpC,0CAA0C;EAC1C,oCAAoC;EACpC,oCAAoC;AACtC;;AAEA;EACE;IACE,oCAAoC;IACpC,0CAA0C;IAC1C,oCAAoC;IACpC,0CAA0C;IAC1C,oCAAoC;IACpC,oCAAoC;EACtC;AACF;;AAEA;EACE,kDAAkD;EAClD,SAAS;EACT,UAAU;EACV;;;;;;;cAOY;AACd;;AAEA;EACE,aAAa;EACb,kBAAkB;EAClB,kDAAkD;EAClD,YAAY;EACZ,wCAAwC;AAC1C;;AAEA;EACE,wDAAwD;AAC1D;;AAEA;EACE,uCAAuC;EACvC,aAAa;AACf;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,kDAAkD;EAClD,gBAAgB;EAChB,kBAAkB;EAClB,2DAA2D;EAC3D,gBAAgB;AAClB;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,uCAAuC;AACzC\",\"sourcesContent\":[\":root {\\n --color-neutral-background1: #ffffff;\\n --color-status-danger-background1: #fdf3f4;\\n --color-neutral-background2: #fafafa;\\n --color-status-danger-foreground1: #b10e1c;\\n --color-neutral-foreground1: #242424;\\n --color-neutral-foreground2: #424242;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n :root {\\n --color-neutral-background1: #292929;\\n --color-status-danger-background1: #3b0509;\\n --color-neutral-background2: #1f1f1f;\\n --color-status-danger-foreground1: #dc626d;\\n --color-neutral-foreground1: #ffffff;\\n --color-neutral-foreground2: #d6d6d6;\\n }\\n}\\n\\n:global body {\\n background-color: var(--color-neutral-background1);\\n margin: 0;\\n padding: 0;\\n font-family:\\n 'Segoe UI',\\n 'Segoe UI Web (West European)',\\n -apple-system,\\n BlinkMacSystemFont,\\n Roboto,\\n 'Helvetica Neue',\\n sans-serif;\\n}\\n\\n.statusContainer {\\n padding: 20px;\\n border-radius: 4px;\\n background-color: var(--color-neutral-background2);\\n margin: 20px;\\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\\n}\\n\\n.errorContainer {\\n background-color: var(--color-status-danger-background1);\\n}\\n\\n.title h2 {\\n color: var(--color-neutral-foreground1);\\n margin-top: 0;\\n}\\n\\n.message {\\n color: var(--color-neutral-foreground1);\\n}\\n\\n.errorContainer .title {\\n color: var(--color-status-danger-foreground1);\\n}\\n\\n.errorContainer .message {\\n color: var(--color-status-danger-foreground1);\\n}\\n\\n.message code {\\n background-color: var(--color-neutral-background1);\\n padding: 2px 5px;\\n border-radius: 3px;\\n font-family: 'Consolas', 'Monaco', 'Courier New', monospace;\\n font-size: 0.9em;\\n}\\n\\n.errorContainer .message code {\\n background-color: rgba(0, 0, 0, 0.1);\\n}\\n\\n.warning {\\n font-weight: bold;\\n margin-top: 20px;\\n color: var(--color-neutral-foreground2);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"statusContainer\": `statusContainer__v64eNmuXrV4WWsOKdGgy`,\n\t\"errorContainer\": `errorContainer__ScZ3E77NPMqtBzp0OwUr`,\n\t\"title\": `title__b6Vf2DbiFQkD7AEkJ7p_`,\n\t\"message\": `message__05tS4aUzls4kEWk9hkA7`,\n\t\"warning\": `warning__kheFps3bT2VbnjAMYfSr`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;"],"names":["$constructor","name","initializer","params","init","inst","def","_zod","Object","defineProperty","value","constr","_","traits","Set","enumerable","has","add","proto","prototype","keys","i","length","k","bind","Parent","Definition","_a","this","deferred","fn","Symbol","hasInstance","freeze","status","$ZodAsyncError","Error","constructor","super","globalConfig","config","newConfig","assign","joinValues","array","separator","map","val","stringifyPrimitive","join","jsonStringifyReplacer","toString","cached","getter","cleanRegex","source","start","startsWith","end","endsWith","slice","EVALUATING","defineLazy","object","key","get","undefined","set","v","configurable","captureStackTrace","_args","data","Array","isArray","escapeRegex","str","replace","clone","cl","parent","normalizeParams","_params","error","message","aborted","x","startIndex","issues","continue","prefixIssues","path","iss","unshift","unwrapMessage","finalizeIssue","ctx","full","customError","localeError","reportInput","input","navigator","userAgent","includes","Function","Number","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","MAX_VALUE","JSON","stringify","$ZodError","$ZodRealError","_parse","_Err","schema","_ctx","async","result","run","Promise","e","Err","callee","parse","_parseAsync","parseAsync","_safeParse","success","safeParse","_safeParseAsync","safeParseAsync","cuid","cuid2","ulid","xid","ksuid","nanoid","duration","extendedDuration","guid","uuid","version","RegExp","uuid4","uuid6","uuid7","email","html5Email","rfc5322Email","unicodeEmail","idnEmail","browserEmail","_emoji","emoji","ipv4","ipv6","mac","delimiter","escapedDelim","cidrv4","cidrv6","base64","base64url","hostname","domain","e164","dateSource","date","timeSource","args","hhmm","precision","time","datetime","opts","local","push","offset","timeRegex","string","minimum","maximum","bigint","integer","number","_null","_undefined","lowercase","uppercase","hex","fixedBase64","bodyLength","padding","fixedBase64url","md5_hex","md5_base64","md5_base64url","sha1_hex","sha1_base64","sha1_base64url","sha256_hex","sha256_base64","sha256_base64url","sha384_hex","sha384_base64","sha384_base64url","sha512_hex","sha512_base64","sha512_base64url","major","minor","patch","$ZodType","bag","checks","ch","onattach","runChecks","payload","asyncResult","isAborted","when","currLen","check","resolve","then","handleCanaryResult","canary","checkResult","skipChecks","direction","validate","r","vendor","$ZodString","pattern","patterns","pop","coerce","String","expected","code","$ZodNumber","isNaN","isFinite","received","$ZodBoolean","Boolean","$ZodAny","$ZodUnknown","handleArrayResult","final","index","$ZodArray","proms","item","element","all","handlePropertyResult","$ZodObject","desc","getOwnPropertyDescriptor","sh","shape","newSh","_normalized","okeys","filter","optin","optout","keySet","numKeys","optionalKeys","normalizeDef","propValues","field","values","isObject","catchall","unrecognized","_catchall","t","type","handleCatchall","handleUnionResults","results","nonaborted","errors","$ZodUnion","options","some","o","every","flatMap","option","from","p","single","first","$ZodRecord","ctor","prot","hasOwnProperty","call","keyType","recordKeys","valueType","Reflect","ownKeys","keyResult","origin","$ZodLiteral","handleOptionalResult","$ZodOptional","innerType","$ZodNonOptional","handleNonOptionalResult","globalThis","__zod_globalRegistry","_map","WeakMap","_idmap","Map","_meta","meta","id","clear","remove","delete","pm","f","ZodMiniType","_def","brand","register","reg","ZodMiniString","Class","ZodMiniNumber","ZodMiniBoolean","ZodMiniAny","any","ZodMiniUnknown","ZodMiniArray","ZodMiniObject","looseObject","ZodMiniUnion","union","ZodMiniRecord","record","ZodMiniLiteral","literal","ZodMiniOptional","optional","ZodMiniNonOptional","matchingZodObject","matchingZodObjectLoose","Sizable","unit","verb","file","getSizing","Nouns","regex","url","uuidv4","uuidv6","json_string","jwt","template_literal","issue","getPrototypeOf","adj","inclusive","sizing","_issue","format","prefix","suffix","divisor","remainingTasks","totalTasks","totalErrors","totalWarnings","ZodTiming","threwException","ZodTaskMessageLocation","line","column","ZodTaskNote","text","location","ZodTaskMessage","notes","ZodTaskDescription","inputPath","outputPath","warnings","startTime","lastUpdated","timings","tasks","ZodBasicPackageJson","ZodNotifyLinkChangeInput","packagePath","hash","definition","ZodPackageHashesEntry","browser","node","ZodLinkedPath","rootPath","includeAll","ignoredPackages","ignoreResolutions","resolveStrategy","remote","hostUrl","resolveMap","packages","definitions","transformedDefinitions","packageHashes","hashesWithSource","hashesWithNoSource","ZodLinkPathInput","linkedPath","ZodLinkPathOutput","linkedPaths","ZodPackageSettingsMatchObject","ZodPackageSettingsMatch","ZodGeneratedPackageSettingsMatch","defs","mergedDescriptors","descriptors","getOwnPropertyDescriptors","defineProperties","mergeDefs","oldShape","target","prop","writable","ZodGetLinkConfigOutput","packageSettings","match","generated","linkUpdateSource","packageName","entryPoints","importPath","bundleUrl","linkConfigSource","linkPathsSource","linkDoneSource","linkDisconnectedSource","reason","__create","create","__defProp","__getOwnPropDesc","__getOwnPropNames","getOwnPropertyNames","__getProtoOf","__hasOwnProp","__commonJS","cb","mod","exports","__toESM","isNodeMode","to","except","n","__copyProps","__esModule","require_typeof","module","_typeof$2","iterator","o$1","require_toPrimitive","_typeof$1","toPrimitive","TypeError","require_toPropertyKey","_typeof","require_defineProperty","toPropertyKey","require_objectSpread2","getOwnPropertySymbols","r$1","apply","arguments","forEach","subscribe","self","observer","teardownRef","isDone","unsubscribed","teardownImmediately","unsubscribe","next","_observer$next","err","_observer$error","complete","_observer$complete","pipe","operations","reduce","pipeReducer","prev","createChain","execute","op","links","nextOp","asArray","splitLink","runtime","yes","true","link","no","false","props","condition","asyncIterator","sleep","ms","res","setTimeout","import_defineProperty","import_objectSpread2","TRPCClientError","_opts$result","_opts$result2","cause","default","setPrototypeOf","_cause","obj","transformer","output","serialize","deserialize","METHOD","query","mutation","subscription","getInput","dict","arrayToDict","inputs","_input","parts","split","queryParts","methodOverride","encodeURIComponent","AbortError","throwIfAborted","signal","_signal$throwIfAborte","DOMException","freezeIfAvailable","createInnerProxy","callback","memo","_memo$cacheKey","cacheKey","Proxy","_obj","_1","_2","lastOfPath","import_objectSpread2$1","TransformResultError","response","ok","transformResultInner","_unused","throwFatalError","batchLoader","pendingItems","dispatchTimer","dispatch","groupedItems","items","lastGroup","_item$reject","reject","_item$reject2","concat","it","groupItems","clearTimeout","batch","fetch","_item","valueOrPromise","_item$resolve","_item$reject3","_item$reject4","catch","_item$reject5","load","_dispatchTimer","promise","_pendingItems","httpBatchLink","_opts$maxURLLength","_opts$maxItems","resolvedOpts","maxURLLength","Infinity","maxItems","batchOps","signals","ac","AbortController","count","abortedCount","onAbort","abort","addEventListener","once","_opts$methodOverride","getUrl","body","getBody","method","resolvedHeaders","heads","headers","fromEntries","contentTypeHeader","trpcAcceptHeader","customFetchImpl","window","getFetch","json","responseJSON","opList","loaders","_res","transformed","context","initialValue","observerList","obs","addObserver","splice","indexOf","removeObserver","nextValue","lazyDefaults","enabled","closeMs","keepAliveDefaults","pongTimeoutMs","intervalMs","exponentialBackoff","attemptIndex","Math","min","import_defineProperty$3","TRPCWebSocketClosedError","ResettableTimeout","onTimeout","timeoutMs","reset","timeout","stop","withResolvers","rej","import_defineProperty$2","RequestManager","callbacks","outgoingRequests","messageId","pendingRequests","flush","requests","request","getPendingRequests","getPendingRequest","getOutgoingRequests","getRequests","state","hasPendingRequests","hasPendingSubscriptions","hasOutgoingRequests","import_defineProperty$1","setupPingInterval","ws","pingTimeout","pongTimeout","send","close","WsConnection","_opts$WebSocketPonyfi","connectCount","WebSocketPonyfill","WebSocket","urlOptions","keepAliveOpts","keepAlive","wsObservable","isOpen","readyState","OPEN","openPromise","isClosed","CLOSING","CLOSED","open","_this","wsPromise","connectionParams","prepareUrl","removeEventListener","asyncWsOpen","buildConnectionMessage","_this$ws","WsClient","_opts$retryDelayMs","onOpen","onClose","onError","lazyOptions","lazy","inactivityTimeout","requestManager","activeConnection","setupWebSocketListeners","reconnectRetryDelay","retryDelayMs","lazyMode","connectionState","allowReconnect","reconnect","reconnecting","_this2","requestsToAwait","lastEventId","batchSend","event","connection","closedError","_this3","tryReconnect","_this4","handleCloseOrError","reqs","_this$callbacks$onOpe","_this$callbacks","incomingMessage","handleIncomingRequest","handleResponseMessage","_this$callbacks$onClo","_this$callbacks2","_this$callbacks$onErr","_this$callbacks3","completed","messageOrMessages","messages","_this5","message$1","wsLink","client","connStateSubscription","requestSubscription","import_objectSpread2$4","TRPCUntypedClient","requestId","$request","_opts$context","refCount","observers","subscriber","_sub","resetIfNeeded","findIndex","requestAsPromise","req$","observable$1","onDone","obs$","observableToPromise","envelope","_opts$onConnectionSta","onConnectionStateChange","_opts$onStarted","onStarted","_opts$onStopped","onStopped","_opts$onData","onData","_opts$onError","_opts$onComplete","onComplete","untypedClientSymbol","for","clientCallTypeMap","mutate","AsyncFromSyncIterator","AsyncFromSyncIteratorContinuation","done","r$2","s","require_asyncIterator","require_usingCtx","SuppressedError","e$1","n$1","suppressed","using","asyncDispose","dispose","d","a","u","require_OverloadYield","require_awaitAsyncGenerator","OverloadYield$1","require_wrapAsyncGenerator","OverloadYield","AsyncGenerator","resume","t$1","t$2","settle","arg","_invoke","createCloudpackClient","wsUrl","reporter","g","NodeWebSocket","ensureWebsocketDefined","process","env","NODE_TLS_REJECT_UNAUTHORIZED","ignoreLogMessage","ignoreSelfSignedCertErrors","wsClient","evt","console","tempUrl","base","URL","makeUrl","isSSL","protocol","httpUrl","proxy","pathCopy","procedureType","clientCallType","fullPath","createTRPCClientProxy","createTRPCClient","onDataChanged","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","UIManager","elementId","document","getElementById","updateStatus","tip","isError","innerHTML","styles","statusContainer","errorContainer","title","warning","ConnectionManager","clients","connectionStates","checkInterval","checkIntervalMs","addClient","getClient","checkConnection","getSessionId","warn","startMonitoring","onConnectionChange","clearInterval","setInterval","wasConnected","isConnected","stopMonitoring","closeAll","log","isApiServerActive","debug","isActive","app","ui","connectionManager","linkedPathData","handleHostDisconnection","handleLinkDisconnection","isUnreachable","unreachable","linkClient","isLinkClosed","publishData","cleanup","hostClient","unlinkedPath","unlinkPath","updateData","notifyLinkChange","setupLinkPathHandler","getData","setupData","linkPath","setupConfig","hostConfig","getLinkConfig","initialize","__cloudpack","pageSessionContext","apiUrl","hostApiServerUrls","linkSessionId","hostSessionId","handleConnectionChange","setupLinkUpdateHandler","errorMessage","css","styleElement","styleSheet","cssText","firstChild","removeChild","appendChild","createTextNode","style","styleTarget","querySelector","HTMLIFrameElement","contentDocument","head","getTarget","___CSS_LOADER_EXPORT___","stylesInDOM","getIndexByIdentifier","identifier","modulesToDom","list","idCountMap","identifiers","indexByIdentifier","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","api","update","newObj","lastIdentifiers","newList","newLastIdentifiers","_i","_index","needLayer","btoa","unescape","parentNode","removeStyleElement","content","cssMapping","sourceMapping","nonce","setAttribute","cssWithMappingToString","modules","dedupe","alreadyImportedModules","_k","createElement","attributes"],"ignoreList":[],"sourceRoot":""}
1
+ {"version":3,"file":"lib/index.js","mappings":";IACIA,EADAC,ECKAC,EAIAC,E,UCIJC,EAAOC,QAVP,SAA2BC,EAAKC,GAC9B,GAAIA,EAAaC,WACfD,EAAaC,WAAWC,QAAUH,MAC7B,CACL,KAAOC,EAAaG,YAClBH,EAAaI,YAAYJ,EAAaG,YAExCH,EAAaK,YAAYC,SAASC,eAAeR,GACnD,CACF,C,SCVA,IAAIS,EAAO,CAAC,EA+BZX,EAAOC,QAPP,SAA0BW,EAAQC,GAChC,IAAIC,EAtBN,SAAmBA,GACjB,QAA4B,IAAjBH,EAAKG,GAAyB,CACvC,IAAIC,EAAcN,SAASO,cAAcF,GAGzC,GAAIG,OAAOC,mBAAqBH,aAAuBE,OAAOC,kBAC5D,IAGEH,EAAcA,EAAYI,gBAAgBC,IAC5C,CAAE,MAAOC,GAEPN,EAAc,IAChB,CAEFJ,EA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,CACZ3Y,KAAK44B,GAAGhC,aAAa,CAAE1uB,QAAS,gCAAgCyQ,OAChEsD,EAAUtD,EACV,KACF,CAGF,IAAKsD,EAEH,kBADMjc,KAAK+4B,wBAAwB,CAAEG,aAAa,IAKpD,MAAMK,QAAmB1E,GAAsB,CAAElc,IAAKsD,IACtDjc,KAAK64B,kBAAkBnB,UAAU,OAAQ6B,GAGzC,MAAMiB,QAAsBrB,EAAWtB,aAAarU,QAC9CiX,QAAsBlB,EAAW1B,aAAarU,QACpDxjB,KAAK44B,GAAGhC,aAAa,CAAE1uB,QAAS,iBAAiBsyB,oBAAgCC,MAGjFz6B,KAAK64B,kBAAkBd,gBAAgB/3B,KAAK06B,wBAG5C16B,KAAK26B,+BACC36B,KAAK45B,6BACL55B,KAAKg6B,aACb,CAAE,MAAOlZ,GACP,MAAM8Z,EAAe9Z,aAAe7kB,MAAQ6kB,EAAI5Y,QAAUmJ,OAAOyP,GACjE9gB,KAAK44B,GAAGhC,aAAa,CACnB1uB,QAAS0yB,EACT9D,SAAS,EACTD,IAAK,mCACLp3B,KAAMqhB,UAEF9gB,KAAKs5B,SACb,CACF,GD7UGX,GAAIwB","sources":["webpack://@ms-cloudpack/link-proxy/webpack/runtime/create fake namespace object","webpack://@ms-cloudpack/link-proxy/webpack/runtime/import chunk loading","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/styleTagTransform.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/insertBySelector.js","webpack://@ms-cloudpack/link-proxy/./src/UIManager.module.css","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/injectStylesIntoStyleTag.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/styleDomAPI.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/runtime/sourceMaps.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/setAttributesWithoutAttributes.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/runtime/api.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/insertStyleElement.js","webpack://@ms-cloudpack/link-proxy/webpack/bootstrap","webpack://@ms-cloudpack/link-proxy/webpack/runtime/compat get default export","webpack://@ms-cloudpack/link-proxy/webpack/runtime/define property getters","webpack://@ms-cloudpack/link-proxy/webpack/runtime/ensure chunk","webpack://@ms-cloudpack/link-proxy/webpack/runtime/get javascript chunk filename","webpack://@ms-cloudpack/link-proxy/webpack/runtime/hasOwnProperty shorthand","webpack://@ms-cloudpack/link-proxy/webpack/runtime/make namespace object","webpack://@ms-cloudpack/link-proxy/webpack/runtime/nonce","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/core/core.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/core/util.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/core/errors.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/core/parse.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/core/regexes.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/core/versions.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/core/schemas.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/core/registries.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/mini/schemas.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/core/api.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/utilities/matchingZodObject.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/zod-npm-4.3.5-018a94fb5d/package/v4/locales/en.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskStats.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/Timing.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskMessageLocation.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskMessage.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskDescription.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/TaskList.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/NotifyLinkChangeInput.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/LinkPath.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/GetLinkConfigOutput.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/data/busSources.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/types/PackageUpdatePayload.js","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/objectSpread2-BvkFp-_Y.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-844ae4f4be/package/dist/observable-UMO3vUa_.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/splitLink-B7Cuf2c_.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-844ae4f4be/package/dist/codes-DagpWZLc.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/TRPCClientError-CjKyS10w.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/unstable-internals-Bg7n9BBj.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/httpUtils-Dv57hbOd.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/httpLink-DCFpUmZF.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-844ae4f4be/package/dist/getErrorShape-vC8mUXJD.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-844ae4f4be/package/dist/tracked-D4V22yc5.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/httpBatchLink-BOe5aCcR.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-server-virtual-844ae4f4be/package/dist/observable-CUiPknO-.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/loggerLink-ineCN1PO.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/wsLink-CatceK3c.mjs","webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/@trpc-client-virtual-1ec246abff/package/dist/index.mjs","webpack://@ms-cloudpack/link-proxy/../api-server/lib/trpc/createCloudpackClient.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/utilities/ensureWebsocketDefined.js","webpack://@ms-cloudpack/link-proxy/../api-server/lib/utilities/ignoreSelfSignedCertErrors.js","webpack://@ms-cloudpack/link-proxy/../path-string-parsing/lib/makeUrl.js","webpack://@ms-cloudpack/link-proxy/./src/UIManager.module.css?4067","webpack://@ms-cloudpack/link-proxy/./src/UIManager.ts","webpack://@ms-cloudpack/link-proxy/./src/ConnectionManager.ts","webpack://@ms-cloudpack/link-proxy/./src/isApiServerActive.ts","webpack://@ms-cloudpack/link-proxy/./src/index.ts","webpack://@ms-cloudpack/link-proxy/./src/LinkProxyApp.ts"],"sourcesContent":["var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t293: 0\n};\n\nvar installChunk = (data) => {\n\tvar {__webpack_esm_ids__, __webpack_esm_modules__, __webpack_esm_runtime__} = data;\n\t// add \"modules\" to the modules object,\n\t// then flag all \"ids\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tfor(moduleId in __webpack_esm_modules__) {\n\t\tif(__webpack_require__.o(__webpack_esm_modules__, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = __webpack_esm_modules__[moduleId];\n\t\t}\n\t}\n\tif(__webpack_esm_runtime__) __webpack_esm_runtime__(__webpack_require__);\n\tfor(;i < __webpack_esm_ids__.length; i++) {\n\t\tchunkId = __webpack_esm_ids__[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[__webpack_esm_ids__[i]] = 0;\n\t}\n\n}\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// import() chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[1]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = import(\"../\" + __webpack_require__.u(chunkId)).then(installChunk, (e) => {\n\t\t\t\t\t\tif(installedChunks[chunkId] !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\tthrow e;\n\t\t\t\t\t});\n\t\t\t\t\tvar promise = Promise.race([promise, new Promise((resolve) => (installedChunkData = installedChunks[chunkId] = [resolve]))])\n\t\t\t\t\tpromises.push(installedChunkData[1] = promise);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no external install chunk\n\n// no on chunks loaded\n// no HMR\n\n// no HMR manifest","\"use strict\";\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n styleElement.appendChild(document.createTextNode(css));\n }\n}\nmodule.exports = styleTagTransform;","\"use strict\";\n\nvar memo = {};\n\n/* istanbul ignore next */\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target);\n\n // Special case to return head of iframe instead of iframe itself\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n memo[target] = styleTarget;\n }\n return memo[target];\n}\n\n/* istanbul ignore next */\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n target.appendChild(style);\n}\nmodule.exports = insertBySelector;","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `:root {\n --color-neutral-background1: #ffffff;\n --color-status-danger-background1: #fdf3f4;\n --color-neutral-background2: #fafafa;\n --color-status-danger-foreground1: #b10e1c;\n --color-neutral-foreground1: #242424;\n --color-neutral-foreground2: #424242;\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n --color-neutral-background1: #292929;\n --color-status-danger-background1: #3b0509;\n --color-neutral-background2: #1f1f1f;\n --color-status-danger-foreground1: #dc626d;\n --color-neutral-foreground1: #ffffff;\n --color-neutral-foreground2: #d6d6d6;\n }\n}\n\nbody {\n background-color: var(--color-neutral-background1);\n margin: 0;\n padding: 0;\n font-family:\n 'Segoe UI',\n 'Segoe UI Web (West European)',\n -apple-system,\n BlinkMacSystemFont,\n Roboto,\n 'Helvetica Neue',\n sans-serif;\n}\n\n.statusContainer__v64eNmuXrV4WWsOKdGgy {\n padding: 20px;\n border-radius: 4px;\n background-color: var(--color-neutral-background2);\n margin: 20px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.errorContainer__ScZ3E77NPMqtBzp0OwUr {\n background-color: var(--color-status-danger-background1);\n}\n\n.title__b6Vf2DbiFQkD7AEkJ7p_ h2 {\n color: var(--color-neutral-foreground1);\n margin-top: 0;\n}\n\n.message__05tS4aUzls4kEWk9hkA7 {\n color: var(--color-neutral-foreground1);\n}\n\n.errorContainer__ScZ3E77NPMqtBzp0OwUr .title__b6Vf2DbiFQkD7AEkJ7p_ {\n color: var(--color-status-danger-foreground1);\n}\n\n.errorContainer__ScZ3E77NPMqtBzp0OwUr .message__05tS4aUzls4kEWk9hkA7 {\n color: var(--color-status-danger-foreground1);\n}\n\n.message__05tS4aUzls4kEWk9hkA7 code {\n background-color: var(--color-neutral-background1);\n padding: 2px 5px;\n border-radius: 3px;\n font-family: 'Consolas', 'Monaco', 'Courier New', monospace;\n font-size: 0.9em;\n}\n\n.errorContainer__ScZ3E77NPMqtBzp0OwUr .message__05tS4aUzls4kEWk9hkA7 code {\n background-color: rgba(0, 0, 0, 0.1);\n}\n\n.warning__kheFps3bT2VbnjAMYfSr {\n font-weight: bold;\n margin-top: 20px;\n color: var(--color-neutral-foreground2);\n}\n`, \"\",{\"version\":3,\"sources\":[\"webpack://./src/UIManager.module.css\"],\"names\":[],\"mappings\":\"AAAA;EACE,oCAAoC;EACpC,0CAA0C;EAC1C,oCAAoC;EACpC,0CAA0C;EAC1C,oCAAoC;EACpC,oCAAoC;AACtC;;AAEA;EACE;IACE,oCAAoC;IACpC,0CAA0C;IAC1C,oCAAoC;IACpC,0CAA0C;IAC1C,oCAAoC;IACpC,oCAAoC;EACtC;AACF;;AAEA;EACE,kDAAkD;EAClD,SAAS;EACT,UAAU;EACV;;;;;;;cAOY;AACd;;AAEA;EACE,aAAa;EACb,kBAAkB;EAClB,kDAAkD;EAClD,YAAY;EACZ,wCAAwC;AAC1C;;AAEA;EACE,wDAAwD;AAC1D;;AAEA;EACE,uCAAuC;EACvC,aAAa;AACf;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,kDAAkD;EAClD,gBAAgB;EAChB,kBAAkB;EAClB,2DAA2D;EAC3D,gBAAgB;AAClB;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,uCAAuC;AACzC\",\"sourcesContent\":[\":root {\\n --color-neutral-background1: #ffffff;\\n --color-status-danger-background1: #fdf3f4;\\n --color-neutral-background2: #fafafa;\\n --color-status-danger-foreground1: #b10e1c;\\n --color-neutral-foreground1: #242424;\\n --color-neutral-foreground2: #424242;\\n}\\n\\n@media (prefers-color-scheme: dark) {\\n :root {\\n --color-neutral-background1: #292929;\\n --color-status-danger-background1: #3b0509;\\n --color-neutral-background2: #1f1f1f;\\n --color-status-danger-foreground1: #dc626d;\\n --color-neutral-foreground1: #ffffff;\\n --color-neutral-foreground2: #d6d6d6;\\n }\\n}\\n\\n:global body {\\n background-color: var(--color-neutral-background1);\\n margin: 0;\\n padding: 0;\\n font-family:\\n 'Segoe UI',\\n 'Segoe UI Web (West European)',\\n -apple-system,\\n BlinkMacSystemFont,\\n Roboto,\\n 'Helvetica Neue',\\n sans-serif;\\n}\\n\\n.statusContainer {\\n padding: 20px;\\n border-radius: 4px;\\n background-color: var(--color-neutral-background2);\\n margin: 20px;\\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\\n}\\n\\n.errorContainer {\\n background-color: var(--color-status-danger-background1);\\n}\\n\\n.title h2 {\\n color: var(--color-neutral-foreground1);\\n margin-top: 0;\\n}\\n\\n.message {\\n color: var(--color-neutral-foreground1);\\n}\\n\\n.errorContainer .title {\\n color: var(--color-status-danger-foreground1);\\n}\\n\\n.errorContainer .message {\\n color: var(--color-status-danger-foreground1);\\n}\\n\\n.message code {\\n background-color: var(--color-neutral-background1);\\n padding: 2px 5px;\\n border-radius: 3px;\\n font-family: 'Consolas', 'Monaco', 'Courier New', monospace;\\n font-size: 0.9em;\\n}\\n\\n.errorContainer .message code {\\n background-color: rgba(0, 0, 0, 0.1);\\n}\\n\\n.warning {\\n font-weight: bold;\\n margin-top: 20px;\\n color: var(--color-neutral-foreground2);\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\n___CSS_LOADER_EXPORT___.locals = {\n\t\"statusContainer\": `statusContainer__v64eNmuXrV4WWsOKdGgy`,\n\t\"errorContainer\": `errorContainer__ScZ3E77NPMqtBzp0OwUr`,\n\t\"title\": `title__b6Vf2DbiFQkD7AEkJ7p_`,\n\t\"message\": `message__05tS4aUzls4kEWk9hkA7`,\n\t\"warning\": `warning__kheFps3bT2VbnjAMYfSr`\n};\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\nvar stylesInDOM = [];\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n return result;\n}\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n identifiers.push(identifier);\n }\n return identifiers;\n}\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n return updater;\n}\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n var newLastIdentifiers = modulesToDom(newList, options);\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n var _index = getIndexByIdentifier(_identifier);\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n stylesInDOM.splice(_index, 1);\n }\n }\n lastIdentifiers = newLastIdentifiers;\n };\n};","\"use strict\";\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n var needLayer = typeof obj.layer !== \"undefined\";\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n css += obj.css;\n if (needLayer) {\n css += \"}\";\n }\n if (obj.media) {\n css += \"}\";\n }\n if (obj.supports) {\n css += \"}\";\n }\n var sourceMap = obj.sourceMap;\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n }\n\n // For old IE\n /* istanbul ignore if */\n options.styleTagTransform(css, styleElement, options.options);\n}\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n styleElement.parentNode.removeChild(styleElement);\n}\n\n/* istanbul ignore next */\nfunction domAPI(options) {\n if (typeof document === \"undefined\") {\n return {\n update: function update() {},\n remove: function remove() {}\n };\n }\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\nmodule.exports = domAPI;","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};","\"use strict\";\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = typeof __webpack_nonce__ !== \"undefined\" ? __webpack_nonce__ : null;\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\nmodule.exports = setAttributesWithoutAttributes;","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\nmodule.exports = insertStyleElement;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".chunk.js\";\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nc = undefined;","/** A special constant with type `never` */\nexport const NEVER = Object.freeze({\n status: \"aborted\",\n});\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, params) {\n function init(inst, def) {\n if (!inst._zod) {\n Object.defineProperty(inst, \"_zod\", {\n value: {\n def,\n constr: _,\n traits: new Set(),\n },\n enumerable: false,\n });\n }\n if (inst._zod.traits.has(name)) {\n return;\n }\n inst._zod.traits.add(name);\n initializer(inst, def);\n // support prototype modifications\n const proto = _.prototype;\n const keys = Object.keys(proto);\n for (let i = 0; i < keys.length; i++) {\n const k = keys[i];\n if (!(k in inst)) {\n inst[k] = proto[k].bind(inst);\n }\n }\n }\n // doesn't work if Parent has a constructor with arguments\n const Parent = params?.Parent ?? Object;\n class Definition extends Parent {\n }\n Object.defineProperty(Definition, \"name\", { value: name });\n function _(def) {\n var _a;\n const inst = params?.Parent ? new Definition() : this;\n init(inst, def);\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n for (const fn of inst._zod.deferred) {\n fn();\n }\n return inst;\n }\n Object.defineProperty(_, \"init\", { value: init });\n Object.defineProperty(_, Symbol.hasInstance, {\n value: (inst) => {\n if (params?.Parent && inst instanceof params.Parent)\n return true;\n return inst?._zod?.traits?.has(name);\n },\n });\n Object.defineProperty(_, \"name\", { value: name });\n return _;\n}\n////////////////////////////// UTILITIES ///////////////////////////////////////\nexport const $brand = Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n constructor() {\n super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n }\n}\nexport class $ZodEncodeError extends Error {\n constructor(name) {\n super(`Encountered unidirectional transform during encode: ${name}`);\n this.name = \"ZodEncodeError\";\n }\n}\nexport const globalConfig = {};\nexport function config(newConfig) {\n if (newConfig)\n Object.assign(globalConfig, newConfig);\n return globalConfig;\n}\n","// functions\nexport function assertEqual(val) {\n return val;\n}\nexport function assertNotEqual(val) {\n return val;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n const values = Object.entries(entries)\n .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n .map(([_, v]) => v);\n return values;\n}\nexport function joinValues(array, separator = \"|\") {\n return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n if (typeof value === \"bigint\")\n return value.toString();\n return value;\n}\nexport function cached(getter) {\n const set = false;\n return {\n get value() {\n if (!set) {\n const value = getter();\n Object.defineProperty(this, \"value\", { value });\n return value;\n }\n throw new Error(\"cached value already set\");\n },\n };\n}\nexport function nullish(input) {\n return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n const valDecCount = (val.toString().split(\".\")[1] || \"\").length;\n const stepString = step.toString();\n let stepDecCount = (stepString.split(\".\")[1] || \"\").length;\n if (stepDecCount === 0 && /\\d?e-\\d?/.test(stepString)) {\n const match = stepString.match(/\\d?e-(\\d?)/);\n if (match?.[1]) {\n stepDecCount = Number.parseInt(match[1]);\n }\n }\n const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;\n const valInt = Number.parseInt(val.toFixed(decCount).replace(\".\", \"\"));\n const stepInt = Number.parseInt(step.toFixed(decCount).replace(\".\", \"\"));\n return (valInt % stepInt) / 10 ** decCount;\n}\nconst EVALUATING = Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n let value = undefined;\n Object.defineProperty(object, key, {\n get() {\n if (value === EVALUATING) {\n // Circular reference detected, return undefined to break the cycle\n return undefined;\n }\n if (value === undefined) {\n value = EVALUATING;\n value = getter();\n }\n return value;\n },\n set(v) {\n Object.defineProperty(object, key, {\n value: v,\n // configurable: true,\n });\n // object[key] = v;\n },\n configurable: true,\n });\n}\nexport function objectClone(obj) {\n return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n Object.defineProperty(target, prop, {\n value,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n}\nexport function mergeDefs(...defs) {\n const mergedDescriptors = {};\n for (const def of defs) {\n const descriptors = Object.getOwnPropertyDescriptors(def);\n Object.assign(mergedDescriptors, descriptors);\n }\n return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n if (!path)\n return obj;\n return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n const keys = Object.keys(promisesObj);\n const promises = keys.map((key) => promisesObj[key]);\n return Promise.all(promises).then((results) => {\n const resolvedObj = {};\n for (let i = 0; i < keys.length; i++) {\n resolvedObj[keys[i]] = results[i];\n }\n return resolvedObj;\n });\n}\nexport function randomString(length = 10) {\n const chars = \"abcdefghijklmnopqrstuvwxyz\";\n let str = \"\";\n for (let i = 0; i < length; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n}\nexport function esc(str) {\n return JSON.stringify(str);\n}\nexport function slugify(input) {\n return input\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, \"\")\n .replace(/[\\s_-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = cached(() => {\n // @ts-ignore\n if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n return false;\n }\n try {\n const F = Function;\n new F(\"\");\n return true;\n }\n catch (_) {\n return false;\n }\n});\nexport function isPlainObject(o) {\n if (isObject(o) === false)\n return false;\n // modified constructor\n const ctor = o.constructor;\n if (ctor === undefined)\n return true;\n if (typeof ctor !== \"function\")\n return true;\n // modified prototype\n const prot = ctor.prototype;\n if (isObject(prot) === false)\n return false;\n // ctor doesn't have static `isPrototypeOf`\n if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n return false;\n }\n return true;\n}\nexport function shallowClone(o) {\n if (isPlainObject(o))\n return { ...o };\n if (Array.isArray(o))\n return [...o];\n return o;\n}\nexport function numKeys(data) {\n let keyCount = 0;\n for (const key in data) {\n if (Object.prototype.hasOwnProperty.call(data, key)) {\n keyCount++;\n }\n }\n return keyCount;\n}\nexport const getParsedType = (data) => {\n const t = typeof data;\n switch (t) {\n case \"undefined\":\n return \"undefined\";\n case \"string\":\n return \"string\";\n case \"number\":\n return Number.isNaN(data) ? \"nan\" : \"number\";\n case \"boolean\":\n return \"boolean\";\n case \"function\":\n return \"function\";\n case \"bigint\":\n return \"bigint\";\n case \"symbol\":\n return \"symbol\";\n case \"object\":\n if (Array.isArray(data)) {\n return \"array\";\n }\n if (data === null) {\n return \"null\";\n }\n if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n return \"promise\";\n }\n if (typeof Map !== \"undefined\" && data instanceof Map) {\n return \"map\";\n }\n if (typeof Set !== \"undefined\" && data instanceof Set) {\n return \"set\";\n }\n if (typeof Date !== \"undefined\" && data instanceof Date) {\n return \"date\";\n }\n // @ts-ignore\n if (typeof File !== \"undefined\" && data instanceof File) {\n return \"file\";\n }\n return \"object\";\n default:\n throw new Error(`Unknown data type: ${t}`);\n }\n};\nexport const propertyKeyTypes = new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = new Set([\"string\", \"number\", \"bigint\", \"boolean\", \"symbol\", \"undefined\"]);\nexport function escapeRegex(str) {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n const cl = new inst._zod.constr(def ?? inst._zod.def);\n if (!def || params?.parent)\n cl._zod.parent = inst;\n return cl;\n}\nexport function normalizeParams(_params) {\n const params = _params;\n if (!params)\n return {};\n if (typeof params === \"string\")\n return { error: () => params };\n if (params?.message !== undefined) {\n if (params?.error !== undefined)\n throw new Error(\"Cannot specify both `message` and `error` params\");\n params.error = params.message;\n }\n delete params.message;\n if (typeof params.error === \"string\")\n return { ...params, error: () => params.error };\n return params;\n}\nexport function createTransparentProxy(getter) {\n let target;\n return new Proxy({}, {\n get(_, prop, receiver) {\n target ?? (target = getter());\n return Reflect.get(target, prop, receiver);\n },\n set(_, prop, value, receiver) {\n target ?? (target = getter());\n return Reflect.set(target, prop, value, receiver);\n },\n has(_, prop) {\n target ?? (target = getter());\n return Reflect.has(target, prop);\n },\n deleteProperty(_, prop) {\n target ?? (target = getter());\n return Reflect.deleteProperty(target, prop);\n },\n ownKeys(_) {\n target ?? (target = getter());\n return Reflect.ownKeys(target);\n },\n getOwnPropertyDescriptor(_, prop) {\n target ?? (target = getter());\n return Reflect.getOwnPropertyDescriptor(target, prop);\n },\n defineProperty(_, prop, descriptor) {\n target ?? (target = getter());\n return Reflect.defineProperty(target, prop, descriptor);\n },\n });\n}\nexport function stringifyPrimitive(value) {\n if (typeof value === \"bigint\")\n return value.toString() + \"n\";\n if (typeof value === \"string\")\n return `\"${value}\"`;\n return `${value}`;\n}\nexport function optionalKeys(shape) {\n return Object.keys(shape).filter((k) => {\n return shape[k]._zod.optin === \"optional\" && shape[k]._zod.optout === \"optional\";\n });\n}\nexport const NUMBER_FORMAT_RANGES = {\n safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n int32: [-2147483648, 2147483647],\n uint32: [0, 4294967295],\n float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n};\nexport const BIGINT_FORMAT_RANGES = {\n int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = {};\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n newShape[key] = currDef.shape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function omit(schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const newShape = { ...schema._zod.def.shape };\n for (const key in mask) {\n if (!(key in currDef.shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n delete newShape[key];\n }\n assignProp(this, \"shape\", newShape); // self-caching\n return newShape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function extend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to extend: expected a plain object\");\n }\n const checks = schema._zod.def.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n // Only throw if new shape overlaps with existing shape\n // Use getOwnPropertyDescriptor to check key existence without accessing values\n const existingShape = schema._zod.def.shape;\n for (const key in shape) {\n if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n }\n }\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n if (!isPlainObject(shape)) {\n throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const _shape = { ...schema._zod.def.shape, ...shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n });\n return clone(schema, def);\n}\nexport function merge(a, b) {\n const def = mergeDefs(a._zod.def, {\n get shape() {\n const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n assignProp(this, \"shape\", _shape); // self-caching\n return _shape;\n },\n get catchall() {\n return b._zod.def.catchall;\n },\n checks: [], // delete existing checks\n });\n return clone(a, def);\n}\nexport function partial(Class, schema, mask) {\n const currDef = schema._zod.def;\n const checks = currDef.checks;\n const hasChecks = checks && checks.length > 0;\n if (hasChecks) {\n throw new Error(\".partial() cannot be used on object schemas containing refinements\");\n }\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in oldShape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n else {\n for (const key in oldShape) {\n // if (oldShape[key]!._zod.optin === \"optional\") continue;\n shape[key] = Class\n ? new Class({\n type: \"optional\",\n innerType: oldShape[key],\n })\n : oldShape[key];\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n checks: [],\n });\n return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n const def = mergeDefs(schema._zod.def, {\n get shape() {\n const oldShape = schema._zod.def.shape;\n const shape = { ...oldShape };\n if (mask) {\n for (const key in mask) {\n if (!(key in shape)) {\n throw new Error(`Unrecognized key: \"${key}\"`);\n }\n if (!mask[key])\n continue;\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n else {\n for (const key in oldShape) {\n // overwrite with non-optional\n shape[key] = new Class({\n type: \"nonoptional\",\n innerType: oldShape[key],\n });\n }\n }\n assignProp(this, \"shape\", shape); // self-caching\n return shape;\n },\n });\n return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n if (x.aborted === true)\n return true;\n for (let i = startIndex; i < x.issues.length; i++) {\n if (x.issues[i]?.continue !== true) {\n return true;\n }\n }\n return false;\n}\nexport function prefixIssues(path, issues) {\n return issues.map((iss) => {\n var _a;\n (_a = iss).path ?? (_a.path = []);\n iss.path.unshift(path);\n return iss;\n });\n}\nexport function unwrapMessage(message) {\n return typeof message === \"string\" ? message : message?.message;\n}\nexport function finalizeIssue(iss, ctx, config) {\n const full = { ...iss, path: iss.path ?? [] };\n // for backwards compatibility\n if (!iss.message) {\n const message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n unwrapMessage(ctx?.error?.(iss)) ??\n unwrapMessage(config.customError?.(iss)) ??\n unwrapMessage(config.localeError?.(iss)) ??\n \"Invalid input\";\n full.message = message;\n }\n // delete (full as any).def;\n delete full.inst;\n delete full.continue;\n if (!ctx?.reportInput) {\n delete full.input;\n }\n return full;\n}\nexport function getSizableOrigin(input) {\n if (input instanceof Set)\n return \"set\";\n if (input instanceof Map)\n return \"map\";\n // @ts-ignore\n if (input instanceof File)\n return \"file\";\n return \"unknown\";\n}\nexport function getLengthableOrigin(input) {\n if (Array.isArray(input))\n return \"array\";\n if (typeof input === \"string\")\n return \"string\";\n return \"unknown\";\n}\nexport function parsedType(data) {\n const t = typeof data;\n switch (t) {\n case \"number\": {\n return Number.isNaN(data) ? \"nan\" : \"number\";\n }\n case \"object\": {\n if (data === null) {\n return \"null\";\n }\n if (Array.isArray(data)) {\n return \"array\";\n }\n const obj = data;\n if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n return obj.constructor.name;\n }\n }\n }\n return t;\n}\nexport function issue(...args) {\n const [iss, input, inst] = args;\n if (typeof iss === \"string\") {\n return {\n message: iss,\n code: \"custom\",\n input,\n inst,\n };\n }\n return { ...iss };\n}\nexport function cleanEnum(obj) {\n return Object.entries(obj)\n .filter(([k, _]) => {\n // return true if NaN, meaning it's not a number, thus a string key\n return Number.isNaN(Number.parseInt(k, 10));\n })\n .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n const binaryString = atob(base64);\n const bytes = new Uint8Array(binaryString.length);\n for (let i = 0; i < binaryString.length; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n let binaryString = \"\";\n for (let i = 0; i < bytes.length; i++) {\n binaryString += String.fromCharCode(bytes[i]);\n }\n return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n const cleanHex = hex.replace(/^0x/, \"\");\n if (cleanHex.length % 2 !== 0) {\n throw new Error(\"Invalid hex string length\");\n }\n const bytes = new Uint8Array(cleanHex.length / 2);\n for (let i = 0; i < cleanHex.length; i += 2) {\n bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n }\n return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n return Array.from(bytes)\n .map((b) => b.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n// instanceof\nexport class Class {\n constructor(..._args) { }\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\nconst initializer = (inst, def) => {\n inst.name = \"$ZodError\";\n Object.defineProperty(inst, \"_zod\", {\n value: inst._zod,\n enumerable: false,\n });\n Object.defineProperty(inst, \"issues\", {\n value: def,\n enumerable: false,\n });\n inst.message = JSON.stringify(def, util.jsonStringifyReplacer, 2);\n Object.defineProperty(inst, \"toString\", {\n value: () => inst.message,\n enumerable: false,\n });\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, { Parent: Error });\nexport function flattenError(error, mapper = (issue) => issue.message) {\n const fieldErrors = {};\n const formErrors = [];\n for (const sub of error.issues) {\n if (sub.path.length > 0) {\n fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];\n fieldErrors[sub.path[0]].push(mapper(sub));\n }\n else {\n formErrors.push(mapper(sub));\n }\n }\n return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n const fieldErrors = { _errors: [] };\n const processError = (error) => {\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n issue.errors.map((issues) => processError({ issues }));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues });\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues });\n }\n else if (issue.path.length === 0) {\n fieldErrors._errors.push(mapper(issue));\n }\n else {\n let curr = fieldErrors;\n let i = 0;\n while (i < issue.path.length) {\n const el = issue.path[i];\n const terminal = i === issue.path.length - 1;\n if (!terminal) {\n curr[el] = curr[el] || { _errors: [] };\n }\n else {\n curr[el] = curr[el] || { _errors: [] };\n curr[el]._errors.push(mapper(issue));\n }\n curr = curr[el];\n i++;\n }\n }\n }\n };\n processError(error);\n return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n const result = { errors: [] };\n const processError = (error, path = []) => {\n var _a, _b;\n for (const issue of error.issues) {\n if (issue.code === \"invalid_union\" && issue.errors.length) {\n // regular union error\n issue.errors.map((issues) => processError({ issues }, issue.path));\n }\n else if (issue.code === \"invalid_key\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else if (issue.code === \"invalid_element\") {\n processError({ issues: issue.issues }, issue.path);\n }\n else {\n const fullpath = [...path, ...issue.path];\n if (fullpath.length === 0) {\n result.errors.push(mapper(issue));\n continue;\n }\n let curr = result;\n let i = 0;\n while (i < fullpath.length) {\n const el = fullpath[i];\n const terminal = i === fullpath.length - 1;\n if (typeof el === \"string\") {\n curr.properties ?? (curr.properties = {});\n (_a = curr.properties)[el] ?? (_a[el] = { errors: [] });\n curr = curr.properties[el];\n }\n else {\n curr.items ?? (curr.items = []);\n (_b = curr.items)[el] ?? (_b[el] = { errors: [] });\n curr = curr.items[el];\n }\n if (terminal) {\n curr.errors.push(mapper(issue));\n }\n i++;\n }\n }\n }\n };\n processError(error);\n return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n * issues: [\n * {\n * expected: 'string',\n * code: 'invalid_type',\n * path: [ 'username' ],\n * message: 'Invalid input: expected string'\n * },\n * {\n * expected: 'number',\n * code: 'invalid_type',\n * path: [ 'favoriteNumbers', 1 ],\n * message: 'Invalid input: expected number'\n * }\n * ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n * ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n * ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n const segs = [];\n const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n for (const seg of path) {\n if (typeof seg === \"number\")\n segs.push(`[${seg}]`);\n else if (typeof seg === \"symbol\")\n segs.push(`[${JSON.stringify(String(seg))}]`);\n else if (/[^\\w$]/.test(seg))\n segs.push(`[${JSON.stringify(seg)}]`);\n else {\n if (segs.length)\n segs.push(\".\");\n segs.push(seg);\n }\n }\n return segs.join(\"\");\n}\nexport function prettifyError(error) {\n const lines = [];\n // sort by path length\n const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n // Process each issue\n for (const issue of issues) {\n lines.push(`✖ ${issue.message}`);\n if (issue.path?.length)\n lines.push(` → at ${toDotPath(issue.path)}`);\n }\n // Convert Map to formatted string\n return lines.join(\"\\n\");\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\nexport const _parse = (_Err) => (schema, value, _ctx, _params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n if (result.issues.length) {\n const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, _params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n if (result.issues.length) {\n const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n util.captureStackTrace(e, params?.callee);\n throw e;\n }\n return result.value;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n const result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n return result.issues.length\n ? {\n success: false,\n error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };\n let result = schema._zod.run({ value, issues: [] }, ctx);\n if (result instanceof Promise)\n result = await result;\n return result.issues.length\n ? {\n success: false,\n error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n }\n : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\nexport const _encode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parse(_Err)(schema, value, ctx);\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => (schema, value, _ctx) => {\n return _parse(_Err)(schema, value, _ctx);\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _parseAsync(_Err)(schema, value, ctx);\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _parseAsync(_Err)(schema, value, _ctx);\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n const ctx = _ctx ? Object.assign(_ctx, { direction: \"backward\" }) : { direction: \"backward\" };\n return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n","import * as util from \"./util.js\";\nexport const cuid = /^[cC][^\\s-]{8,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n if (!version)\n return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\n return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\nconst _emoji = `^(\\\\p{Extended_Pictographic}|\\\\p{Emoji_Component})+$`;\nexport function emoji() {\n return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;\nexport const mac = (delimiter) => {\n const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces)\n// E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// const dateSource = `((\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\\\d|30)|(02)-(0[1-9]|1\\\\d|2[0-8])))`;\nconst dateSource = `(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`;\nexport const date = /*@__PURE__*/ new RegExp(`^${dateSource}$`);\nfunction timeSource(args) {\n const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n const regex = typeof args.precision === \"number\"\n ? args.precision === -1\n ? `${hhmm}`\n : args.precision === 0\n ? `${hhmm}:[0-5]\\\\d`\n : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n return regex;\n}\nexport function time(args) {\n return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n const time = timeSource({ precision: args.precision });\n const opts = [\"Z\"];\n if (args.local)\n opts.push(\"\");\n // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n if (args.offset)\n opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n const timeRegex = `${time}(?:${opts.join(\"|\")})`;\n return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\nexport const string = (params) => {\n const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?$/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n","export const version = {\n major: 4,\n minor: 3,\n patch: 5,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync, safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n var _a;\n inst ?? (inst = {});\n inst._zod.def = def; // set _def property\n inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n inst._zod.version = version;\n const checks = [...(inst._zod.def.checks ?? [])];\n // if inst is itself a checks.$ZodCheck, run it as a check\n if (inst._zod.traits.has(\"$ZodCheck\")) {\n checks.unshift(inst);\n }\n for (const ch of checks) {\n for (const fn of ch._zod.onattach) {\n fn(inst);\n }\n }\n if (checks.length === 0) {\n // deferred initializer\n // inst._zod.parse is not yet defined\n (_a = inst._zod).deferred ?? (_a.deferred = []);\n inst._zod.deferred?.push(() => {\n inst._zod.run = inst._zod.parse;\n });\n }\n else {\n const runChecks = (payload, checks, ctx) => {\n let isAborted = util.aborted(payload);\n let asyncResult;\n for (const ch of checks) {\n if (ch._zod.def.when) {\n const shouldRun = ch._zod.def.when(payload);\n if (!shouldRun)\n continue;\n }\n else if (isAborted) {\n continue;\n }\n const currLen = payload.issues.length;\n const _ = ch._zod.check(payload);\n if (_ instanceof Promise && ctx?.async === false) {\n throw new core.$ZodAsyncError();\n }\n if (asyncResult || _ instanceof Promise) {\n asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n await _;\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n return;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n });\n }\n else {\n const nextLen = payload.issues.length;\n if (nextLen === currLen)\n continue;\n if (!isAborted)\n isAborted = util.aborted(payload, currLen);\n }\n }\n if (asyncResult) {\n return asyncResult.then(() => {\n return payload;\n });\n }\n return payload;\n };\n const handleCanaryResult = (canary, payload, ctx) => {\n // abort if the canary is aborted\n if (util.aborted(canary)) {\n canary.aborted = true;\n return canary;\n }\n // run checks first, then\n const checkResult = runChecks(payload, checks, ctx);\n if (checkResult instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));\n }\n return inst._zod.parse(checkResult, ctx);\n };\n inst._zod.run = (payload, ctx) => {\n if (ctx.skipChecks) {\n return inst._zod.parse(payload, ctx);\n }\n if (ctx.direction === \"backward\") {\n // run canary\n // initial pass (no checks)\n const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });\n if (canary instanceof Promise) {\n return canary.then((canary) => {\n return handleCanaryResult(canary, payload, ctx);\n });\n }\n return handleCanaryResult(canary, payload, ctx);\n }\n // forward\n const result = inst._zod.parse(payload, ctx);\n if (result instanceof Promise) {\n if (ctx.async === false)\n throw new core.$ZodAsyncError();\n return result.then((result) => runChecks(result, checks, ctx));\n }\n return runChecks(result, checks, ctx);\n };\n }\n // Lazy initialize ~standard to avoid creating objects for every schema\n util.defineLazy(inst, \"~standard\", () => ({\n validate: (value) => {\n try {\n const r = safeParse(inst, value);\n return r.success ? { value: r.data } : { issues: r.error?.issues };\n }\n catch (_) {\n return safeParseAsync(inst, value).then((r) => (r.success ? { value: r.data } : { issues: r.error?.issues }));\n }\n },\n vendor: \"zod\",\n version: 1,\n }));\n});\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n inst._zod.parse = (payload, _) => {\n if (def.coerce)\n try {\n payload.value = String(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"string\")\n return payload;\n payload.issues.push({\n expected: \"string\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n // check initialization must come first\n checks.$ZodCheckStringFormat.init(inst, def);\n $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.guid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n if (def.version) {\n const versionMap = {\n v1: 1,\n v2: 2,\n v3: 3,\n v4: 4,\n v5: 5,\n v6: 6,\n v7: 7,\n v8: 8,\n };\n const v = versionMap[def.version];\n if (v === undefined)\n throw new Error(`Invalid UUID version: \"${def.version}\"`);\n def.pattern ?? (def.pattern = regexes.uuid(v));\n }\n else\n def.pattern ?? (def.pattern = regexes.uuid());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.email);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n try {\n // Trim whitespace from input\n const trimmed = payload.value.trim();\n // @ts-ignore\n const url = new URL(trimmed);\n if (def.hostname) {\n def.hostname.lastIndex = 0;\n if (!def.hostname.test(url.hostname)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid hostname\",\n pattern: def.hostname.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n if (def.protocol) {\n def.protocol.lastIndex = 0;\n if (!def.protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol)) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n note: \"Invalid protocol\",\n pattern: def.protocol.source,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n }\n // Set the output value based on normalize flag\n if (def.normalize) {\n // Use normalized URL\n payload.value = url.href;\n }\n else {\n // Preserve the original input (trimmed)\n payload.value = trimmed;\n }\n return;\n }\n catch (_) {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.emoji());\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.nanoid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cuid2);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ulid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.xid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ksuid);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.datetime(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.date);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.time(def));\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.duration);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv4);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv4`;\n});\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.ipv6);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `ipv6`;\n inst._zod.check = (payload) => {\n try {\n // @ts-ignore\n new URL(`http://[${payload.value}]`);\n // return;\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"ipv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\nexport const $ZodMAC = /*@__PURE__*/ core.$constructor(\"$ZodMAC\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.mac(def.delimiter));\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.format = `mac`;\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv4);\n $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n const parts = payload.value.split(\"/\");\n try {\n if (parts.length !== 2)\n throw new Error();\n const [address, prefix] = parts;\n if (!prefix)\n throw new Error();\n const prefixNum = Number(prefix);\n if (`${prefixNum}` !== prefix)\n throw new Error();\n if (prefixNum < 0 || prefixNum > 128)\n throw new Error();\n // @ts-ignore\n new URL(`http://[${address}]`);\n }\n catch {\n payload.issues.push({\n code: \"invalid_format\",\n format: \"cidrv6\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n }\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64(data) {\n if (data === \"\")\n return true;\n if (data.length % 4 !== 0)\n return false;\n try {\n // @ts-ignore\n atob(data);\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64\";\n inst._zod.check = (payload) => {\n if (isValidBase64(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\n////////////////////////////// ZodBase64 //////////////////////////////\nexport function isValidBase64URL(data) {\n if (!regexes.base64url.test(data))\n return false;\n const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.base64url);\n $ZodStringFormat.init(inst, def);\n inst._zod.bag.contentEncoding = \"base64url\";\n inst._zod.check = (payload) => {\n if (isValidBase64URL(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"base64url\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n def.pattern ?? (def.pattern = regexes.e164);\n $ZodStringFormat.init(inst, def);\n});\n////////////////////////////// ZodJWT //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n try {\n const tokensParts = token.split(\".\");\n if (tokensParts.length !== 3)\n return false;\n const [header] = tokensParts;\n if (!header)\n return false;\n // @ts-ignore\n const parsedHeader = JSON.parse(atob(header));\n if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n return false;\n if (!parsedHeader.alg)\n return false;\n if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n return false;\n return true;\n }\n catch {\n return false;\n }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (isValidJWT(payload.value, def.alg))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: \"jwt\",\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCustomStringFormat\", (inst, def) => {\n $ZodStringFormat.init(inst, def);\n inst._zod.check = (payload) => {\n if (def.fn(payload.value))\n return;\n payload.issues.push({\n code: \"invalid_format\",\n format: def.format,\n input: payload.value,\n inst,\n continue: !def.abort,\n });\n };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Number(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n return payload;\n }\n const received = typeof input === \"number\"\n ? Number.isNaN(input)\n ? \"NaN\"\n : !Number.isFinite(input)\n ? \"Infinity\"\n : undefined\n : undefined;\n payload.issues.push({\n expected: \"number\",\n code: \"invalid_type\",\n input,\n inst,\n ...(received ? { received } : {}),\n });\n return payload;\n };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumberFormat\", (inst, def) => {\n checks.$ZodCheckNumberFormat.init(inst, def);\n $ZodNumber.init(inst, def); // no format checks\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.boolean;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = Boolean(payload.value);\n }\n catch (_) { }\n const input = payload.value;\n if (typeof input === \"boolean\")\n return payload;\n payload.issues.push({\n expected: \"boolean\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.bigint;\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce)\n try {\n payload.value = BigInt(payload.value);\n }\n catch (_) { }\n if (typeof payload.value === \"bigint\")\n return payload;\n payload.issues.push({\n expected: \"bigint\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigIntFormat\", (inst, def) => {\n checks.$ZodCheckBigIntFormat.init(inst, def);\n $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"symbol\")\n return payload;\n payload.issues.push({\n expected: \"symbol\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.undefined;\n inst._zod.values = new Set([undefined]);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"undefined\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.pattern = regexes.null;\n inst._zod.values = new Set([null]);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (input === null)\n return payload;\n payload.issues.push({\n expected: \"null\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n payload.issues.push({\n expected: \"never\",\n code: \"invalid_type\",\n input: payload.value,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (typeof input === \"undefined\")\n return payload;\n payload.issues.push({\n expected: \"void\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (def.coerce) {\n try {\n payload.value = new Date(payload.value);\n }\n catch (_err) { }\n }\n const input = payload.value;\n const isDate = input instanceof Date;\n const isValidDate = isDate && !Number.isNaN(input.getTime());\n if (isValidDate)\n return payload;\n payload.issues.push({\n expected: \"date\",\n code: \"invalid_type\",\n input,\n ...(isDate ? { received: \"Invalid Date\" } : {}),\n inst,\n });\n return payload;\n };\n});\nfunction handleArrayResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n expected: \"array\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = Array(input.length);\n const proms = [];\n for (let i = 0; i < input.length; i++) {\n const item = input[i];\n const result = def.element._zod.run({\n value: item,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n }\n else {\n handleArrayResult(result, payload, i);\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload; //handleArrayResultsAsync(parseResults, final);\n };\n});\nfunction handlePropertyResult(result, final, key, input, isOptionalOut) {\n if (result.issues.length) {\n // For optional-out schemas, ignore errors on absent keys\n if (isOptionalOut && !(key in input)) {\n return;\n }\n final.issues.push(...util.prefixIssues(key, result.issues));\n }\n if (result.value === undefined) {\n if (key in input) {\n final.value[key] = undefined;\n }\n }\n else {\n final.value[key] = result.value;\n }\n}\nfunction normalizeDef(def) {\n const keys = Object.keys(def.shape);\n for (const k of keys) {\n if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n throw new Error(`Invalid element at key \"${k}\": expected a Zod schema`);\n }\n }\n const okeys = util.optionalKeys(def.shape);\n return {\n ...def,\n keys,\n keySet: new Set(keys),\n numKeys: keys.length,\n optionalKeys: new Set(okeys),\n };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst) {\n const unrecognized = [];\n // iterate over input keys\n const keySet = def.keySet;\n const _catchall = def.catchall._zod;\n const t = _catchall.def.type;\n const isOptionalOut = _catchall.optout === \"optional\";\n for (const key in input) {\n if (keySet.has(key))\n continue;\n if (t === \"never\") {\n unrecognized.push(key);\n continue;\n }\n const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (unrecognized.length) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n keys: unrecognized,\n input,\n inst,\n });\n }\n if (!proms.length)\n return payload;\n return Promise.all(proms).then(() => {\n return payload;\n });\n}\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodType.init(inst, def);\n // const sh = def.shape;\n const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n if (!desc?.get) {\n const sh = def.shape;\n Object.defineProperty(def, \"shape\", {\n get: () => {\n const newSh = { ...sh };\n Object.defineProperty(def, \"shape\", {\n value: newSh,\n });\n return newSh;\n },\n });\n }\n const _normalized = util.cached(() => normalizeDef(def));\n util.defineLazy(inst._zod, \"propValues\", () => {\n const shape = def.shape;\n const propValues = {};\n for (const key in shape) {\n const field = shape[key]._zod;\n if (field.values) {\n propValues[key] ?? (propValues[key] = new Set());\n for (const v of field.values)\n propValues[key].add(v);\n }\n }\n return propValues;\n });\n const isObject = util.isObject;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n payload.value = {};\n const proms = [];\n const shape = value.shape;\n for (const key of value.keys) {\n const el = shape[key];\n const isOptionalOut = el._zod.optout === \"optional\";\n const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n if (r instanceof Promise) {\n proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));\n }\n else {\n handlePropertyResult(r, payload, key, input, isOptionalOut);\n }\n }\n if (!catchall) {\n return proms.length ? Promise.all(proms).then(() => payload) : payload;\n }\n return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);\n };\n});\nexport const $ZodObjectJIT = /*@__PURE__*/ core.$constructor(\"$ZodObjectJIT\", (inst, def) => {\n // requires cast because technically $ZodObject doesn't extend\n $ZodObject.init(inst, def);\n const superParse = inst._zod.parse;\n const _normalized = util.cached(() => normalizeDef(def));\n const generateFastpass = (shape) => {\n const doc = new Doc([\"shape\", \"payload\", \"ctx\"]);\n const normalized = _normalized.value;\n const parseStr = (key) => {\n const k = util.esc(key);\n return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n };\n doc.write(`const input = payload.value;`);\n const ids = Object.create(null);\n let counter = 0;\n for (const key of normalized.keys) {\n ids[key] = `key_${counter++}`;\n }\n // A: preserve key order {\n doc.write(`const newResult = {};`);\n for (const key of normalized.keys) {\n const id = ids[key];\n const k = util.esc(key);\n const schema = shape[key];\n const isOptionalOut = schema?._zod?.optout === \"optional\";\n doc.write(`const ${id} = ${parseStr(key)};`);\n if (isOptionalOut) {\n // For optional-out schemas, ignore errors on absent keys\n doc.write(`\n if (${id}.issues.length) {\n if (${k} in input) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n else {\n doc.write(`\n if (${id}.issues.length) {\n payload.issues = payload.issues.concat(${id}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${k}, ...iss.path] : [${k}]\n })));\n }\n \n if (${id}.value === undefined) {\n if (${k} in input) {\n newResult[${k}] = undefined;\n }\n } else {\n newResult[${k}] = ${id}.value;\n }\n \n `);\n }\n }\n doc.write(`payload.value = newResult;`);\n doc.write(`return payload;`);\n const fn = doc.compile();\n return (payload, ctx) => fn(shape, payload, ctx);\n };\n let fastpass;\n const isObject = util.isObject;\n const jit = !core.globalConfig.jitless;\n const allowsEval = util.allowsEval;\n const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n const catchall = def.catchall;\n let value;\n inst._zod.parse = (payload, ctx) => {\n value ?? (value = _normalized.value);\n const input = payload.value;\n if (!isObject(input)) {\n payload.issues.push({\n expected: \"object\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n // always synchronous\n if (!fastpass)\n fastpass = generateFastpass(def.shape);\n payload = fastpass(payload, ctx);\n if (!catchall)\n return payload;\n return handleCatchall([], input, payload, ctx, value, inst);\n }\n return superParse(payload, ctx);\n };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n for (const result of results) {\n if (result.issues.length === 0) {\n final.value = result.value;\n return final;\n }\n }\n const nonaborted = results.filter((r) => !util.aborted(r));\n if (nonaborted.length === 1) {\n final.value = nonaborted[0].value;\n return nonaborted[0];\n }\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.options.some((o) => o._zod.optin === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"optout\", () => def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n util.defineLazy(inst._zod, \"values\", () => {\n if (def.options.every((o) => o._zod.values)) {\n return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));\n }\n return undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n if (def.options.every((o) => o._zod.pattern)) {\n const patterns = def.options.map((o) => o._zod.pattern);\n return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n }\n return undefined;\n });\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n if (result.issues.length === 0)\n return result;\n results.push(result);\n }\n }\n if (!async)\n return handleUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleUnionResults(results, payload, inst, ctx);\n });\n };\n});\nfunction handleExclusiveUnionResults(results, final, inst, ctx) {\n const successes = results.filter((r) => r.issues.length === 0);\n if (successes.length === 1) {\n final.value = successes[0].value;\n return final;\n }\n if (successes.length === 0) {\n // No matches - same as regular union\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n });\n }\n else {\n // Multiple matches - exclusive union failure\n final.issues.push({\n code: \"invalid_union\",\n input: final.value,\n inst,\n errors: [],\n inclusive: false,\n });\n }\n return final;\n}\nexport const $ZodXor = /*@__PURE__*/ core.$constructor(\"$ZodXor\", (inst, def) => {\n $ZodUnion.init(inst, def);\n def.inclusive = false;\n const single = def.options.length === 1;\n const first = def.options[0]._zod.run;\n inst._zod.parse = (payload, ctx) => {\n if (single) {\n return first(payload, ctx);\n }\n let async = false;\n const results = [];\n for (const option of def.options) {\n const result = option._zod.run({\n value: payload.value,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n results.push(result);\n async = true;\n }\n else {\n results.push(result);\n }\n }\n if (!async)\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n return Promise.all(results).then((results) => {\n return handleExclusiveUnionResults(results, payload, inst, ctx);\n });\n };\n});\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n def.inclusive = false;\n $ZodUnion.init(inst, def);\n const _super = inst._zod.parse;\n util.defineLazy(inst._zod, \"propValues\", () => {\n const propValues = {};\n for (const option of def.options) {\n const pv = option._zod.propValues;\n if (!pv || Object.keys(pv).length === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(option)}\"`);\n for (const [k, v] of Object.entries(pv)) {\n if (!propValues[k])\n propValues[k] = new Set();\n for (const val of v) {\n propValues[k].add(val);\n }\n }\n }\n return propValues;\n });\n const disc = util.cached(() => {\n const opts = def.options;\n const map = new Map();\n for (const o of opts) {\n const values = o._zod.propValues?.[def.discriminator];\n if (!values || values.size === 0)\n throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n for (const v of values) {\n if (map.has(v)) {\n throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n }\n map.set(v, o);\n }\n }\n return map;\n });\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isObject(input)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"object\",\n input,\n inst,\n });\n return payload;\n }\n const opt = disc.value.get(input?.[def.discriminator]);\n if (opt) {\n return opt._zod.run(payload, ctx);\n }\n if (def.unionFallback) {\n return _super(payload, ctx);\n }\n // no matching discriminator\n payload.issues.push({\n code: \"invalid_union\",\n errors: [],\n note: \"No matching discriminator\",\n discriminator: def.discriminator,\n input,\n path: [def.discriminator],\n inst,\n });\n return payload;\n };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n const async = left instanceof Promise || right instanceof Promise;\n if (async) {\n return Promise.all([left, right]).then(([left, right]) => {\n return handleIntersectionResults(payload, left, right);\n });\n }\n return handleIntersectionResults(payload, left, right);\n };\n});\nfunction mergeValues(a, b) {\n // const aType = parse.t(a);\n // const bType = parse.t(b);\n if (a === b) {\n return { valid: true, data: a };\n }\n if (a instanceof Date && b instanceof Date && +a === +b) {\n return { valid: true, data: a };\n }\n if (util.isPlainObject(a) && util.isPlainObject(b)) {\n const bKeys = Object.keys(b);\n const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n const newObj = { ...a, ...b };\n for (const key of sharedKeys) {\n const sharedValue = mergeValues(a[key], b[key]);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n };\n }\n newObj[key] = sharedValue.data;\n }\n return { valid: true, data: newObj };\n }\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return { valid: false, mergeErrorPath: [] };\n }\n const newArray = [];\n for (let index = 0; index < a.length; index++) {\n const itemA = a[index];\n const itemB = b[index];\n const sharedValue = mergeValues(itemA, itemB);\n if (!sharedValue.valid) {\n return {\n valid: false,\n mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n };\n }\n newArray.push(sharedValue.data);\n }\n return { valid: true, data: newArray };\n }\n return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n // Track which side(s) report each key as unrecognized\n const unrecKeys = new Map();\n let unrecIssue;\n for (const iss of left.issues) {\n if (iss.code === \"unrecognized_keys\") {\n unrecIssue ?? (unrecIssue = iss);\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).l = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n for (const iss of right.issues) {\n if (iss.code === \"unrecognized_keys\") {\n for (const k of iss.keys) {\n if (!unrecKeys.has(k))\n unrecKeys.set(k, {});\n unrecKeys.get(k).r = true;\n }\n }\n else {\n result.issues.push(iss);\n }\n }\n // Report only keys unrecognized by BOTH sides\n const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n if (bothKeys.length && unrecIssue) {\n result.issues.push({ ...unrecIssue, keys: bothKeys });\n }\n if (util.aborted(result))\n return result;\n const merged = mergeValues(left.value, right.value);\n if (!merged.valid) {\n throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n }\n result.value = merged.data;\n return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n $ZodType.init(inst, def);\n const items = def.items;\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!Array.isArray(input)) {\n payload.issues.push({\n input,\n inst,\n expected: \"tuple\",\n code: \"invalid_type\",\n });\n return payload;\n }\n payload.value = [];\n const proms = [];\n const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== \"optional\");\n const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;\n if (!def.rest) {\n const tooBig = input.length > items.length;\n const tooSmall = input.length < optStart - 1;\n if (tooBig || tooSmall) {\n payload.issues.push({\n ...(tooBig\n ? { code: \"too_big\", maximum: items.length, inclusive: true }\n : { code: \"too_small\", minimum: items.length }),\n input,\n inst,\n origin: \"array\",\n });\n return payload;\n }\n }\n let i = -1;\n for (const item of items) {\n i++;\n if (i >= input.length)\n if (i >= optStart)\n continue;\n const result = item._zod.run({\n value: input[i],\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n if (def.rest) {\n const rest = input.slice(items.length);\n for (const el of rest) {\n i++;\n const result = def.rest._zod.run({\n value: el,\n issues: [],\n }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleTupleResult(result, payload, i)));\n }\n else {\n handleTupleResult(result, payload, i);\n }\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleTupleResult(result, final, index) {\n if (result.issues.length) {\n final.issues.push(...util.prefixIssues(index, result.issues));\n }\n final.value[index] = result.value;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!util.isPlainObject(input)) {\n payload.issues.push({\n expected: \"record\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n const values = def.keyType._zod.values;\n if (values) {\n payload.value = {};\n const recordKeys = new Set();\n for (const key of values) {\n if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n recordKeys.add(typeof key === \"number\" ? key.toString() : key);\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[key] = result.value;\n }\n }\n }\n let unrecognized;\n for (const key in input) {\n if (!recordKeys.has(key)) {\n unrecognized = unrecognized ?? [];\n unrecognized.push(key);\n }\n }\n if (unrecognized && unrecognized.length > 0) {\n payload.issues.push({\n code: \"unrecognized_keys\",\n input,\n inst,\n keys: unrecognized,\n });\n }\n }\n else {\n payload.value = {};\n for (const key of Reflect.ownKeys(input)) {\n if (key === \"__proto__\")\n continue;\n let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n if (keyResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n // Numeric string fallback: if key failed with \"expected number\", retry with Number(key)\n const checkNumericKey = typeof key === \"string\" &&\n regexes.number.test(key) &&\n keyResult.issues.length &&\n keyResult.issues.some((iss) => iss.code === \"invalid_type\" && iss.expected === \"number\");\n if (checkNumericKey) {\n const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);\n if (retryResult instanceof Promise) {\n throw new Error(\"Async schemas not supported in object keys currently\");\n }\n if (retryResult.issues.length === 0) {\n keyResult = retryResult;\n }\n }\n if (keyResult.issues.length) {\n if (def.mode === \"loose\") {\n // Pass through unchanged\n payload.value[key] = input[key];\n }\n else {\n // Default \"strict\" behavior: error on invalid key\n payload.issues.push({\n code: \"invalid_key\",\n origin: \"record\",\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n input: key,\n path: [key],\n inst,\n });\n }\n continue;\n }\n const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }));\n }\n else {\n if (result.issues.length) {\n payload.issues.push(...util.prefixIssues(key, result.issues));\n }\n payload.value[keyResult.value] = result.value;\n }\n }\n }\n if (proms.length) {\n return Promise.all(proms).then(() => payload);\n }\n return payload;\n };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Map)) {\n payload.issues.push({\n expected: \"map\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n }\n const proms = [];\n payload.value = new Map();\n for (const [key, value] of input) {\n const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n if (keyResult instanceof Promise || valueResult instanceof Promise) {\n proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }));\n }\n else {\n handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n }\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n if (keyResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, keyResult.issues));\n }\n else {\n final.issues.push({\n code: \"invalid_key\",\n origin: \"map\",\n input,\n inst,\n issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n if (valueResult.issues.length) {\n if (util.propertyKeyTypes.has(typeof key)) {\n final.issues.push(...util.prefixIssues(key, valueResult.issues));\n }\n else {\n final.issues.push({\n origin: \"map\",\n code: \"invalid_element\",\n input,\n inst,\n key: key,\n issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n });\n }\n }\n final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n const input = payload.value;\n if (!(input instanceof Set)) {\n payload.issues.push({\n input,\n inst,\n expected: \"set\",\n code: \"invalid_type\",\n });\n return payload;\n }\n const proms = [];\n payload.value = new Set();\n for (const item of input) {\n const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n if (result instanceof Promise) {\n proms.push(result.then((result) => handleSetResult(result, payload)));\n }\n else\n handleSetResult(result, payload);\n }\n if (proms.length)\n return Promise.all(proms).then(() => payload);\n return payload;\n };\n});\nfunction handleSetResult(result, final) {\n if (result.issues.length) {\n final.issues.push(...result.issues);\n }\n final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n $ZodType.init(inst, def);\n const values = util.getEnumValues(def.entries);\n const valuesSet = new Set(values);\n inst._zod.values = valuesSet;\n inst._zod.pattern = new RegExp(`^(${values\n .filter((k) => util.propertyKeyTypes.has(typeof k))\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o.toString()))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (valuesSet.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n if (def.values.length === 0) {\n throw new Error(\"Cannot create literal schema with no valid values\");\n }\n const values = new Set(def.values);\n inst._zod.values = values;\n inst._zod.pattern = new RegExp(`^(${def.values\n .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))\n .join(\"|\")})$`);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n if (values.has(input)) {\n return payload;\n }\n payload.issues.push({\n code: \"invalid_value\",\n values: def.values,\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n const input = payload.value;\n // @ts-ignore\n if (input instanceof File)\n return payload;\n payload.issues.push({\n expected: \"file\",\n code: \"invalid_type\",\n input,\n inst,\n });\n return payload;\n };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(inst.constructor.name);\n }\n const _out = def.transform(payload.value, payload);\n if (ctx.async) {\n const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n return output.then((output) => {\n payload.value = output;\n return payload;\n });\n }\n if (_out instanceof Promise) {\n throw new core.$ZodAsyncError();\n }\n payload.value = _out;\n return payload;\n };\n});\nfunction handleOptionalResult(result, input) {\n if (result.issues.length && input === undefined) {\n return { issues: [], value: undefined };\n }\n return result;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n inst._zod.optout = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, undefined]) : undefined;\n });\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n if (def.innerType._zod.optin === \"optional\") {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise)\n return result.then((r) => handleOptionalResult(r, payload.value));\n return handleOptionalResult(result, payload.value);\n }\n if (payload.value === undefined) {\n return payload;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodExactOptional = /*@__PURE__*/ core.$constructor(\"$ZodExactOptional\", (inst, def) => {\n // Call parent init - inherits optin/optout = \"optional\"\n $ZodOptional.init(inst, def);\n // Override values/pattern to NOT add undefined\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"pattern\", () => def.innerType._zod.pattern);\n // Override parse to just delegate (no undefined handling)\n inst._zod.parse = (payload, ctx) => {\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"pattern\", () => {\n const pattern = def.innerType._zod.pattern;\n return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n });\n util.defineLazy(inst._zod, \"values\", () => {\n return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n // Forward direction (decode): allow null to pass through\n if (payload.value === null)\n return payload;\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n $ZodType.init(inst, def);\n // inst._zod.qin = \"true\";\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply defaults for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n /**\n * $ZodDefault returns the default value immediately in forward direction.\n * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe. */\n return payload;\n }\n // Forward direction: continue with default handling\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleDefaultResult(result, def));\n }\n return handleDefaultResult(result, def);\n };\n});\nfunction handleDefaultResult(payload, def) {\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.optin = \"optional\";\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply prefault for undefined input\n if (payload.value === undefined) {\n payload.value = def.defaultValue;\n }\n return def.innerType._zod.run(payload, ctx);\n };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => {\n const v = def.innerType._zod.values;\n return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n });\n inst._zod.parse = (payload, ctx) => {\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => handleNonOptionalResult(result, inst));\n }\n return handleNonOptionalResult(result, inst);\n };\n});\nfunction handleNonOptionalResult(payload, inst) {\n if (!payload.issues.length && payload.value === undefined) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"nonoptional\",\n input: payload.value,\n inst,\n });\n }\n return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n throw new core.$ZodEncodeError(\"ZodSuccess\");\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.issues.length === 0;\n return payload;\n });\n }\n payload.value = result.issues.length === 0;\n return payload;\n };\n});\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType._zod.optout);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n // Forward direction (decode): apply catch logic\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then((result) => {\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n });\n }\n payload.value = result.value;\n if (result.issues.length) {\n payload.value = def.catchValue({\n ...payload,\n error: {\n issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n },\n input: payload.value,\n });\n payload.issues = [];\n }\n return payload;\n };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"nan\",\n code: \"invalid_type\",\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handlePipeResult(right, def.in, ctx));\n }\n return handlePipeResult(right, def.in, ctx);\n }\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handlePipeResult(left, def.out, ctx));\n }\n return handlePipeResult(left, def.out, ctx);\n };\n});\nfunction handlePipeResult(left, next, ctx) {\n if (left.issues.length) {\n // prevent further checks\n left.aborted = true;\n return left;\n }\n return next._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodCodec = /*@__PURE__*/ core.$constructor(\"$ZodCodec\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"values\", () => def.in._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.in._zod.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.out._zod.optout);\n util.defineLazy(inst._zod, \"propValues\", () => def.in._zod.propValues);\n inst._zod.parse = (payload, ctx) => {\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const left = def.in._zod.run(payload, ctx);\n if (left instanceof Promise) {\n return left.then((left) => handleCodecAResult(left, def, ctx));\n }\n return handleCodecAResult(left, def, ctx);\n }\n else {\n const right = def.out._zod.run(payload, ctx);\n if (right instanceof Promise) {\n return right.then((right) => handleCodecAResult(right, def, ctx));\n }\n return handleCodecAResult(right, def, ctx);\n }\n };\n});\nfunction handleCodecAResult(result, def, ctx) {\n if (result.issues.length) {\n // prevent further checks\n result.aborted = true;\n return result;\n }\n const direction = ctx.direction || \"forward\";\n if (direction === \"forward\") {\n const transformed = def.transform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));\n }\n return handleCodecTxResult(result, transformed, def.out, ctx);\n }\n else {\n const transformed = def.reverseTransform(result.value, result);\n if (transformed instanceof Promise) {\n return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));\n }\n return handleCodecTxResult(result, transformed, def.in, ctx);\n }\n}\nfunction handleCodecTxResult(left, value, nextSchema, ctx) {\n // Check if transform added any issues\n if (left.issues.length) {\n left.aborted = true;\n return left;\n }\n return nextSchema._zod.run({ value, issues: left.issues }, ctx);\n}\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n $ZodType.init(inst, def);\n util.defineLazy(inst._zod, \"propValues\", () => def.innerType._zod.propValues);\n util.defineLazy(inst._zod, \"values\", () => def.innerType._zod.values);\n util.defineLazy(inst._zod, \"optin\", () => def.innerType?._zod?.optin);\n util.defineLazy(inst._zod, \"optout\", () => def.innerType?._zod?.optout);\n inst._zod.parse = (payload, ctx) => {\n if (ctx.direction === \"backward\") {\n return def.innerType._zod.run(payload, ctx);\n }\n const result = def.innerType._zod.run(payload, ctx);\n if (result instanceof Promise) {\n return result.then(handleReadonlyResult);\n }\n return handleReadonlyResult(result);\n };\n});\nfunction handleReadonlyResult(payload) {\n payload.value = Object.freeze(payload.value);\n return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n $ZodType.init(inst, def);\n const regexParts = [];\n for (const part of def.parts) {\n if (typeof part === \"object\" && part !== null) {\n // is Zod schema\n if (!part._zod.pattern) {\n // if (!source)\n throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n }\n const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n if (!source)\n throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n const start = source.startsWith(\"^\") ? 1 : 0;\n const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n regexParts.push(source.slice(start, end));\n }\n else if (part === null || util.primitiveTypes.has(typeof part)) {\n regexParts.push(util.escapeRegex(`${part}`));\n }\n else {\n throw new Error(`Invalid template literal part: ${part}`);\n }\n }\n inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"string\") {\n payload.issues.push({\n input: payload.value,\n inst,\n expected: \"string\",\n code: \"invalid_type\",\n });\n return payload;\n }\n inst._zod.pattern.lastIndex = 0;\n if (!inst._zod.pattern.test(payload.value)) {\n payload.issues.push({\n input: payload.value,\n inst,\n code: \"invalid_format\",\n format: def.format ?? \"template_literal\",\n pattern: inst._zod.pattern.source,\n });\n return payload;\n }\n return payload;\n };\n});\nexport const $ZodFunction = /*@__PURE__*/ core.$constructor(\"$ZodFunction\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._def = def;\n inst._zod.def = def;\n inst.implement = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implement() must be called with a function\");\n }\n return function (...args) {\n const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;\n const result = Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return parse(inst._def.output, result);\n }\n return result;\n };\n };\n inst.implementAsync = (func) => {\n if (typeof func !== \"function\") {\n throw new Error(\"implementAsync() must be called with a function\");\n }\n return async function (...args) {\n const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;\n const result = await Reflect.apply(func, this, parsedArgs);\n if (inst._def.output) {\n return await parseAsync(inst._def.output, result);\n }\n return result;\n };\n };\n inst._zod.parse = (payload, _ctx) => {\n if (typeof payload.value !== \"function\") {\n payload.issues.push({\n code: \"invalid_type\",\n expected: \"function\",\n input: payload.value,\n inst,\n });\n return payload;\n }\n // Check if output is a promise type to determine if we should use async implementation\n const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === \"promise\";\n if (hasPromiseOutput) {\n payload.value = inst.implementAsync(payload.value);\n }\n else {\n payload.value = inst.implement(payload.value);\n }\n return payload;\n };\n inst.input = (...args) => {\n const F = inst.constructor;\n if (Array.isArray(args[0])) {\n return new F({\n type: \"function\",\n input: new $ZodTuple({\n type: \"tuple\",\n items: args[0],\n rest: args[1],\n }),\n output: inst._def.output,\n });\n }\n return new F({\n type: \"function\",\n input: args[0],\n output: inst._def.output,\n });\n };\n inst.output = (output) => {\n const F = inst.constructor;\n return new F({\n type: \"function\",\n input: inst._def.input,\n output,\n });\n };\n return inst;\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, ctx) => {\n return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n $ZodType.init(inst, def);\n // let _innerType!: any;\n // util.defineLazy(def, \"getter\", () => {\n // if (!_innerType) {\n // _innerType = def.getter();\n // }\n // return () => _innerType;\n // });\n util.defineLazy(inst._zod, \"innerType\", () => def.getter());\n util.defineLazy(inst._zod, \"pattern\", () => inst._zod.innerType?._zod?.pattern);\n util.defineLazy(inst._zod, \"propValues\", () => inst._zod.innerType?._zod?.propValues);\n util.defineLazy(inst._zod, \"optin\", () => inst._zod.innerType?._zod?.optin ?? undefined);\n util.defineLazy(inst._zod, \"optout\", () => inst._zod.innerType?._zod?.optout ?? undefined);\n inst._zod.parse = (payload, ctx) => {\n const inner = inst._zod.innerType;\n return inner._zod.run(payload, ctx);\n };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n checks.$ZodCheck.init(inst, def);\n $ZodType.init(inst, def);\n inst._zod.parse = (payload, _) => {\n return payload;\n };\n inst._zod.check = (payload) => {\n const input = payload.value;\n const r = def.fn(input);\n if (r instanceof Promise) {\n return r.then((r) => handleRefineResult(r, payload, input, inst));\n }\n handleRefineResult(r, payload, input, inst);\n return;\n };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n if (!result) {\n const _iss = {\n code: \"custom\",\n input,\n inst, // incorporates params.error into issue reporting\n path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n continue: !inst._zod.def.abort,\n // params: inst._zod.def.params,\n };\n if (inst._zod.def.params)\n _iss.params = inst._zod.def.params;\n payload.issues.push(util.issue(_iss));\n }\n}\n","var _a;\nexport const $output = Symbol(\"ZodOutput\");\nexport const $input = Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n constructor() {\n this._map = new WeakMap();\n this._idmap = new Map();\n }\n add(schema, ..._meta) {\n const meta = _meta[0];\n this._map.set(schema, meta);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.set(meta.id, schema);\n }\n return this;\n }\n clear() {\n this._map = new WeakMap();\n this._idmap = new Map();\n return this;\n }\n remove(schema) {\n const meta = this._map.get(schema);\n if (meta && typeof meta === \"object\" && \"id\" in meta) {\n this._idmap.delete(meta.id);\n }\n this._map.delete(schema);\n return this;\n }\n get(schema) {\n // return this._map.get(schema) as any;\n // inherit metadata\n const p = schema._zod.parent;\n if (p) {\n const pm = { ...(this.get(p) ?? {}) };\n delete pm.id; // do not inherit id\n const f = { ...pm, ...this._map.get(schema) };\n return Object.keys(f).length ? f : undefined;\n }\n return this._map.get(schema);\n }\n has(schema) {\n return this._map.has(schema);\n }\n}\n// registries\nexport function registry() {\n return new $ZodRegistry();\n}\n(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());\nexport const globalRegistry = globalThis.__zod_globalRegistry;\n","import * as core from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\nimport * as parse from \"./parse.js\";\nexport const ZodMiniType = /*@__PURE__*/ core.$constructor(\"ZodMiniType\", (inst, def) => {\n if (!inst._zod)\n throw new Error(\"Uninitialized schema in ZodMiniType.\");\n core.$ZodType.init(inst, def);\n inst.def = def;\n inst.type = def.type;\n inst.parse = (data, params) => parse.parse(inst, data, params, { callee: inst.parse });\n inst.safeParse = (data, params) => parse.safeParse(inst, data, params);\n inst.parseAsync = async (data, params) => parse.parseAsync(inst, data, params, { callee: inst.parseAsync });\n inst.safeParseAsync = async (data, params) => parse.safeParseAsync(inst, data, params);\n inst.check = (...checks) => {\n return inst.clone({\n ...def,\n checks: [\n ...(def.checks ?? []),\n ...checks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n ],\n }, { parent: true });\n };\n inst.with = inst.check;\n inst.clone = (_def, params) => core.clone(inst, _def, params);\n inst.brand = () => inst;\n inst.register = ((reg, meta) => {\n reg.add(inst, meta);\n return inst;\n });\n inst.apply = (fn) => fn(inst);\n});\nexport const ZodMiniString = /*@__PURE__*/ core.$constructor(\"ZodMiniString\", (inst, def) => {\n core.$ZodString.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function string(params) {\n return core._string(ZodMiniString, params);\n}\nexport const ZodMiniStringFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniStringFormat\", (inst, def) => {\n core.$ZodStringFormat.init(inst, def);\n ZodMiniString.init(inst, def);\n});\nexport const ZodMiniEmail = /*@__PURE__*/ core.$constructor(\"ZodMiniEmail\", (inst, def) => {\n core.$ZodEmail.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function email(params) {\n return core._email(ZodMiniEmail, params);\n}\nexport const ZodMiniGUID = /*@__PURE__*/ core.$constructor(\"ZodMiniGUID\", (inst, def) => {\n core.$ZodGUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function guid(params) {\n return core._guid(ZodMiniGUID, params);\n}\nexport const ZodMiniUUID = /*@__PURE__*/ core.$constructor(\"ZodMiniUUID\", (inst, def) => {\n core.$ZodUUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function uuid(params) {\n return core._uuid(ZodMiniUUID, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function uuidv4(params) {\n return core._uuidv4(ZodMiniUUID, params);\n}\n// ZodMiniUUIDv6\n// @__NO_SIDE_EFFECTS__\nexport function uuidv6(params) {\n return core._uuidv6(ZodMiniUUID, params);\n}\n// ZodMiniUUIDv7\n// @__NO_SIDE_EFFECTS__\nexport function uuidv7(params) {\n return core._uuidv7(ZodMiniUUID, params);\n}\nexport const ZodMiniURL = /*@__PURE__*/ core.$constructor(\"ZodMiniURL\", (inst, def) => {\n core.$ZodURL.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function url(params) {\n return core._url(ZodMiniURL, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function httpUrl(params) {\n return core._url(ZodMiniURL, {\n protocol: /^https?$/,\n hostname: core.regexes.domain,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniEmoji = /*@__PURE__*/ core.$constructor(\"ZodMiniEmoji\", (inst, def) => {\n core.$ZodEmoji.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function emoji(params) {\n return core._emoji(ZodMiniEmoji, params);\n}\nexport const ZodMiniNanoID = /*@__PURE__*/ core.$constructor(\"ZodMiniNanoID\", (inst, def) => {\n core.$ZodNanoID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nanoid(params) {\n return core._nanoid(ZodMiniNanoID, params);\n}\nexport const ZodMiniCUID = /*@__PURE__*/ core.$constructor(\"ZodMiniCUID\", (inst, def) => {\n core.$ZodCUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cuid(params) {\n return core._cuid(ZodMiniCUID, params);\n}\nexport const ZodMiniCUID2 = /*@__PURE__*/ core.$constructor(\"ZodMiniCUID2\", (inst, def) => {\n core.$ZodCUID2.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cuid2(params) {\n return core._cuid2(ZodMiniCUID2, params);\n}\nexport const ZodMiniULID = /*@__PURE__*/ core.$constructor(\"ZodMiniULID\", (inst, def) => {\n core.$ZodULID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ulid(params) {\n return core._ulid(ZodMiniULID, params);\n}\nexport const ZodMiniXID = /*@__PURE__*/ core.$constructor(\"ZodMiniXID\", (inst, def) => {\n core.$ZodXID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function xid(params) {\n return core._xid(ZodMiniXID, params);\n}\nexport const ZodMiniKSUID = /*@__PURE__*/ core.$constructor(\"ZodMiniKSUID\", (inst, def) => {\n core.$ZodKSUID.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ksuid(params) {\n return core._ksuid(ZodMiniKSUID, params);\n}\nexport const ZodMiniIPv4 = /*@__PURE__*/ core.$constructor(\"ZodMiniIPv4\", (inst, def) => {\n core.$ZodIPv4.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ipv4(params) {\n return core._ipv4(ZodMiniIPv4, params);\n}\nexport const ZodMiniIPv6 = /*@__PURE__*/ core.$constructor(\"ZodMiniIPv6\", (inst, def) => {\n core.$ZodIPv6.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function ipv6(params) {\n return core._ipv6(ZodMiniIPv6, params);\n}\nexport const ZodMiniCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodMiniCIDRv4\", (inst, def) => {\n core.$ZodCIDRv4.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cidrv4(params) {\n return core._cidrv4(ZodMiniCIDRv4, params);\n}\nexport const ZodMiniCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodMiniCIDRv6\", (inst, def) => {\n core.$ZodCIDRv6.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function cidrv6(params) {\n return core._cidrv6(ZodMiniCIDRv6, params);\n}\nexport const ZodMiniMAC = /*@__PURE__*/ core.$constructor(\"ZodMiniMAC\", (inst, def) => {\n core.$ZodMAC.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function mac(params) {\n return core._mac(ZodMiniMAC, params);\n}\nexport const ZodMiniBase64 = /*@__PURE__*/ core.$constructor(\"ZodMiniBase64\", (inst, def) => {\n core.$ZodBase64.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function base64(params) {\n return core._base64(ZodMiniBase64, params);\n}\nexport const ZodMiniBase64URL = /*@__PURE__*/ core.$constructor(\"ZodMiniBase64URL\", (inst, def) => {\n core.$ZodBase64URL.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function base64url(params) {\n return core._base64url(ZodMiniBase64URL, params);\n}\nexport const ZodMiniE164 = /*@__PURE__*/ core.$constructor(\"ZodMiniE164\", (inst, def) => {\n core.$ZodE164.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function e164(params) {\n return core._e164(ZodMiniE164, params);\n}\nexport const ZodMiniJWT = /*@__PURE__*/ core.$constructor(\"ZodMiniJWT\", (inst, def) => {\n core.$ZodJWT.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function jwt(params) {\n return core._jwt(ZodMiniJWT, params);\n}\nexport const ZodMiniCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniCustomStringFormat\", (inst, def) => {\n core.$ZodCustomStringFormat.init(inst, def);\n ZodMiniStringFormat.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n return core._stringFormat(ZodMiniCustomStringFormat, format, fnOrRegex, _params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function hostname(_params) {\n return core._stringFormat(ZodMiniCustomStringFormat, \"hostname\", core.regexes.hostname, _params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function hex(_params) {\n return core._stringFormat(ZodMiniCustomStringFormat, \"hex\", core.regexes.hex, _params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function hash(alg, params) {\n const enc = params?.enc ?? \"hex\";\n const format = `${alg}_${enc}`;\n const regex = core.regexes[format];\n // check for unrecognized format\n if (!regex)\n throw new Error(`Unrecognized hash format: ${format}`);\n return core._stringFormat(ZodMiniCustomStringFormat, format, regex, params);\n}\nexport const ZodMiniNumber = /*@__PURE__*/ core.$constructor(\"ZodMiniNumber\", (inst, def) => {\n core.$ZodNumber.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function number(params) {\n return core._number(ZodMiniNumber, params);\n}\nexport const ZodMiniNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniNumberFormat\", (inst, def) => {\n core.$ZodNumberFormat.init(inst, def);\n ZodMiniNumber.init(inst, def);\n});\n// int\n// @__NO_SIDE_EFFECTS__\nexport function int(params) {\n return core._int(ZodMiniNumberFormat, params);\n}\n// float32\n// @__NO_SIDE_EFFECTS__\nexport function float32(params) {\n return core._float32(ZodMiniNumberFormat, params);\n}\n// float64\n// @__NO_SIDE_EFFECTS__\nexport function float64(params) {\n return core._float64(ZodMiniNumberFormat, params);\n}\n// int32\n// @__NO_SIDE_EFFECTS__\nexport function int32(params) {\n return core._int32(ZodMiniNumberFormat, params);\n}\n// uint32\n// @__NO_SIDE_EFFECTS__\nexport function uint32(params) {\n return core._uint32(ZodMiniNumberFormat, params);\n}\nexport const ZodMiniBoolean = /*@__PURE__*/ core.$constructor(\"ZodMiniBoolean\", (inst, def) => {\n core.$ZodBoolean.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function boolean(params) {\n return core._boolean(ZodMiniBoolean, params);\n}\nexport const ZodMiniBigInt = /*@__PURE__*/ core.$constructor(\"ZodMiniBigInt\", (inst, def) => {\n core.$ZodBigInt.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function bigint(params) {\n return core._bigint(ZodMiniBigInt, params);\n}\nexport const ZodMiniBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodMiniBigIntFormat\", (inst, def) => {\n core.$ZodBigIntFormat.init(inst, def);\n ZodMiniBigInt.init(inst, def);\n});\n// int64\n// @__NO_SIDE_EFFECTS__\nexport function int64(params) {\n return core._int64(ZodMiniBigIntFormat, params);\n}\n// uint64\n// @__NO_SIDE_EFFECTS__\nexport function uint64(params) {\n return core._uint64(ZodMiniBigIntFormat, params);\n}\nexport const ZodMiniSymbol = /*@__PURE__*/ core.$constructor(\"ZodMiniSymbol\", (inst, def) => {\n core.$ZodSymbol.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function symbol(params) {\n return core._symbol(ZodMiniSymbol, params);\n}\nexport const ZodMiniUndefined = /*@__PURE__*/ core.$constructor(\"ZodMiniUndefined\", (inst, def) => {\n core.$ZodUndefined.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _undefined(params) {\n return core._undefined(ZodMiniUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodMiniNull = /*@__PURE__*/ core.$constructor(\"ZodMiniNull\", (inst, def) => {\n core.$ZodNull.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _null(params) {\n return core._null(ZodMiniNull, params);\n}\nexport { _null as null };\nexport const ZodMiniAny = /*@__PURE__*/ core.$constructor(\"ZodMiniAny\", (inst, def) => {\n core.$ZodAny.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function any() {\n return core._any(ZodMiniAny);\n}\nexport const ZodMiniUnknown = /*@__PURE__*/ core.$constructor(\"ZodMiniUnknown\", (inst, def) => {\n core.$ZodUnknown.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function unknown() {\n return core._unknown(ZodMiniUnknown);\n}\nexport const ZodMiniNever = /*@__PURE__*/ core.$constructor(\"ZodMiniNever\", (inst, def) => {\n core.$ZodNever.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function never(params) {\n return core._never(ZodMiniNever, params);\n}\nexport const ZodMiniVoid = /*@__PURE__*/ core.$constructor(\"ZodMiniVoid\", (inst, def) => {\n core.$ZodVoid.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _void(params) {\n return core._void(ZodMiniVoid, params);\n}\nexport { _void as void };\nexport const ZodMiniDate = /*@__PURE__*/ core.$constructor(\"ZodMiniDate\", (inst, def) => {\n core.$ZodDate.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function date(params) {\n return core._date(ZodMiniDate, params);\n}\nexport const ZodMiniArray = /*@__PURE__*/ core.$constructor(\"ZodMiniArray\", (inst, def) => {\n core.$ZodArray.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function array(element, params) {\n return new ZodMiniArray({\n type: \"array\",\n element: element,\n ...util.normalizeParams(params),\n });\n}\n// .keyof\n// @__NO_SIDE_EFFECTS__\nexport function keyof(schema) {\n const shape = schema._zod.def.shape;\n return _enum(Object.keys(shape));\n}\nexport const ZodMiniObject = /*@__PURE__*/ core.$constructor(\"ZodMiniObject\", (inst, def) => {\n core.$ZodObject.init(inst, def);\n ZodMiniType.init(inst, def);\n util.defineLazy(inst, \"shape\", () => def.shape);\n});\n// @__NO_SIDE_EFFECTS__\nexport function object(shape, params) {\n const def = {\n type: \"object\",\n shape: shape ?? {},\n ...util.normalizeParams(params),\n };\n return new ZodMiniObject(def);\n}\n// strictObject\n// @__NO_SIDE_EFFECTS__\nexport function strictObject(shape, params) {\n return new ZodMiniObject({\n type: \"object\",\n shape,\n catchall: never(),\n ...util.normalizeParams(params),\n });\n}\n// looseObject\n// @__NO_SIDE_EFFECTS__\nexport function looseObject(shape, params) {\n return new ZodMiniObject({\n type: \"object\",\n shape,\n catchall: unknown(),\n ...util.normalizeParams(params),\n });\n}\n// object methods\n// @__NO_SIDE_EFFECTS__\nexport function extend(schema, shape) {\n return util.extend(schema, shape);\n}\n// @__NO_SIDE_EFFECTS__\nexport function safeExtend(schema, shape) {\n return util.safeExtend(schema, shape);\n}\n// @__NO_SIDE_EFFECTS__\nexport function merge(schema, shape) {\n return util.extend(schema, shape);\n}\n// @__NO_SIDE_EFFECTS__\nexport function pick(schema, mask) {\n return util.pick(schema, mask);\n}\n// .omit\n// @__NO_SIDE_EFFECTS__\nexport function omit(schema, mask) {\n return util.omit(schema, mask);\n}\n// @__NO_SIDE_EFFECTS__\nexport function partial(schema, mask) {\n return util.partial(ZodMiniOptional, schema, mask);\n}\n// @__NO_SIDE_EFFECTS__\nexport function required(schema, mask) {\n return util.required(ZodMiniNonOptional, schema, mask);\n}\n// @__NO_SIDE_EFFECTS__\nexport function catchall(inst, catchall) {\n return inst.clone({ ...inst._zod.def, catchall: catchall });\n}\nexport const ZodMiniUnion = /*@__PURE__*/ core.$constructor(\"ZodMiniUnion\", (inst, def) => {\n core.$ZodUnion.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function union(options, params) {\n return new ZodMiniUnion({\n type: \"union\",\n options: options,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniXor = /*@__PURE__*/ core.$constructor(\"ZodMiniXor\", (inst, def) => {\n ZodMiniUnion.init(inst, def);\n core.$ZodXor.init(inst, def);\n});\n/** Creates an exclusive union (XOR) where exactly one option must match.\n * Unlike regular unions that succeed when any option matches, xor fails if\n * zero or more than one option matches the input. */\nexport function xor(options, params) {\n return new ZodMiniXor({\n type: \"union\",\n options: options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodMiniDiscriminatedUnion\", (inst, def) => {\n core.$ZodDiscriminatedUnion.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function discriminatedUnion(discriminator, options, params) {\n return new ZodMiniDiscriminatedUnion({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniIntersection = /*@__PURE__*/ core.$constructor(\"ZodMiniIntersection\", (inst, def) => {\n core.$ZodIntersection.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function intersection(left, right) {\n return new ZodMiniIntersection({\n type: \"intersection\",\n left: left,\n right: right,\n });\n}\nexport const ZodMiniTuple = /*@__PURE__*/ core.$constructor(\"ZodMiniTuple\", (inst, def) => {\n core.$ZodTuple.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function tuple(items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof core.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new ZodMiniTuple({\n type: \"tuple\",\n items: items,\n rest,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniRecord = /*@__PURE__*/ core.$constructor(\"ZodMiniRecord\", (inst, def) => {\n core.$ZodRecord.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function record(keyType, valueType, params) {\n return new ZodMiniRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function partialRecord(keyType, valueType, params) {\n const k = core.clone(keyType);\n k._zod.values = undefined;\n return new ZodMiniRecord({\n type: \"record\",\n keyType: k,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport function looseRecord(keyType, valueType, params) {\n return new ZodMiniRecord({\n type: \"record\",\n keyType,\n valueType: valueType,\n mode: \"loose\",\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniMap = /*@__PURE__*/ core.$constructor(\"ZodMiniMap\", (inst, def) => {\n core.$ZodMap.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function map(keyType, valueType, params) {\n return new ZodMiniMap({\n type: \"map\",\n keyType: keyType,\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniSet = /*@__PURE__*/ core.$constructor(\"ZodMiniSet\", (inst, def) => {\n core.$ZodSet.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function set(valueType, params) {\n return new ZodMiniSet({\n type: \"set\",\n valueType: valueType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniEnum = /*@__PURE__*/ core.$constructor(\"ZodMiniEnum\", (inst, def) => {\n core.$ZodEnum.init(inst, def);\n ZodMiniType.init(inst, def);\n inst.options = Object.values(def.entries);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _enum(values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n return new ZodMiniEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport { _enum as enum };\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n return new ZodMiniEnum({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniLiteral = /*@__PURE__*/ core.$constructor(\"ZodMiniLiteral\", (inst, def) => {\n core.$ZodLiteral.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function literal(value, params) {\n return new ZodMiniLiteral({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniFile = /*@__PURE__*/ core.$constructor(\"ZodMiniFile\", (inst, def) => {\n core.$ZodFile.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function file(params) {\n return core._file(ZodMiniFile, params);\n}\nexport const ZodMiniTransform = /*@__PURE__*/ core.$constructor(\"ZodMiniTransform\", (inst, def) => {\n core.$ZodTransform.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function transform(fn) {\n return new ZodMiniTransform({\n type: \"transform\",\n transform: fn,\n });\n}\nexport const ZodMiniOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniOptional\", (inst, def) => {\n core.$ZodOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function optional(innerType) {\n return new ZodMiniOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodMiniExactOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniExactOptional\", (inst, def) => {\n core.$ZodExactOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function exactOptional(innerType) {\n return new ZodMiniExactOptional({\n type: \"optional\",\n innerType: innerType,\n });\n}\nexport const ZodMiniNullable = /*@__PURE__*/ core.$constructor(\"ZodMiniNullable\", (inst, def) => {\n core.$ZodNullable.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nullable(innerType) {\n return new ZodMiniNullable({\n type: \"nullable\",\n innerType: innerType,\n });\n}\n// nullish\n// @__NO_SIDE_EFFECTS__\nexport function nullish(innerType) {\n return optional(nullable(innerType));\n}\nexport const ZodMiniDefault = /*@__PURE__*/ core.$constructor(\"ZodMiniDefault\", (inst, def) => {\n core.$ZodDefault.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function _default(innerType, defaultValue) {\n return new ZodMiniDefault({\n type: \"default\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodMiniPrefault = /*@__PURE__*/ core.$constructor(\"ZodMiniPrefault\", (inst, def) => {\n core.$ZodPrefault.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function prefault(innerType, defaultValue) {\n return new ZodMiniPrefault({\n type: \"prefault\",\n innerType: innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\nexport const ZodMiniNonOptional = /*@__PURE__*/ core.$constructor(\"ZodMiniNonOptional\", (inst, def) => {\n core.$ZodNonOptional.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nonoptional(innerType, params) {\n return new ZodMiniNonOptional({\n type: \"nonoptional\",\n innerType: innerType,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniSuccess = /*@__PURE__*/ core.$constructor(\"ZodMiniSuccess\", (inst, def) => {\n core.$ZodSuccess.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function success(innerType) {\n return new ZodMiniSuccess({\n type: \"success\",\n innerType: innerType,\n });\n}\nexport const ZodMiniCatch = /*@__PURE__*/ core.$constructor(\"ZodMiniCatch\", (inst, def) => {\n core.$ZodCatch.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nfunction _catch(innerType, catchValue) {\n return new ZodMiniCatch({\n type: \"catch\",\n innerType: innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\nexport { _catch as catch };\nexport const ZodMiniNaN = /*@__PURE__*/ core.$constructor(\"ZodMiniNaN\", (inst, def) => {\n core.$ZodNaN.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function nan(params) {\n return core._nan(ZodMiniNaN, params);\n}\nexport const ZodMiniPipe = /*@__PURE__*/ core.$constructor(\"ZodMiniPipe\", (inst, def) => {\n core.$ZodPipe.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function pipe(in_, out) {\n return new ZodMiniPipe({\n type: \"pipe\",\n in: in_,\n out: out,\n });\n}\nexport const ZodMiniCodec = /*@__PURE__*/ core.$constructor(\"ZodMiniCodec\", (inst, def) => {\n ZodMiniPipe.init(inst, def);\n core.$ZodCodec.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function codec(in_, out, params) {\n return new ZodMiniCodec({\n type: \"pipe\",\n in: in_,\n out: out,\n transform: params.decode,\n reverseTransform: params.encode,\n });\n}\nexport const ZodMiniReadonly = /*@__PURE__*/ core.$constructor(\"ZodMiniReadonly\", (inst, def) => {\n core.$ZodReadonly.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function readonly(innerType) {\n return new ZodMiniReadonly({\n type: \"readonly\",\n innerType: innerType,\n });\n}\nexport const ZodMiniTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodMiniTemplateLiteral\", (inst, def) => {\n core.$ZodTemplateLiteral.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function templateLiteral(parts, params) {\n return new ZodMiniTemplateLiteral({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\nexport const ZodMiniLazy = /*@__PURE__*/ core.$constructor(\"ZodMiniLazy\", (inst, def) => {\n core.$ZodLazy.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// export function lazy<T extends object>(getter: () => T): T {\n// return util.createTransparentProxy<T>(getter);\n// }\n// @__NO_SIDE_EFFECTS__\nfunction _lazy(getter) {\n return new ZodMiniLazy({\n type: \"lazy\",\n getter: getter,\n });\n}\nexport { _lazy as lazy };\nexport const ZodMiniPromise = /*@__PURE__*/ core.$constructor(\"ZodMiniPromise\", (inst, def) => {\n core.$ZodPromise.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function promise(innerType) {\n return new ZodMiniPromise({\n type: \"promise\",\n innerType: innerType,\n });\n}\nexport const ZodMiniCustom = /*@__PURE__*/ core.$constructor(\"ZodMiniCustom\", (inst, def) => {\n core.$ZodCustom.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// custom checks\n// @__NO_SIDE_EFFECTS__\nexport function check(fn, params) {\n const ch = new core.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// ZodCustom\n// custom schema\n// @__NO_SIDE_EFFECTS__\nexport function custom(fn, _params) {\n return core._custom(ZodMiniCustom, fn ?? (() => true), _params);\n}\n// refine\n// @__NO_SIDE_EFFECTS__\nexport function refine(fn, _params = {}) {\n return core._refine(ZodMiniCustom, fn, _params);\n}\n// superRefine\n// @__NO_SIDE_EFFECTS__\nexport function superRefine(fn) {\n return core._superRefine(fn);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\n// instanceof\nclass Class {\n constructor(..._args) { }\n}\n// @__NO_SIDE_EFFECTS__\nfunction _instanceof(cls, params = {}) {\n const inst = custom((data) => data instanceof cls, params);\n inst._zod.bag.Class = cls;\n // Override check to emit invalid_type instead of custom\n inst._zod.check = (payload) => {\n if (!(payload.value instanceof cls)) {\n payload.issues.push({\n code: \"invalid_type\",\n expected: cls.name,\n input: payload.value,\n inst,\n path: [...(inst._zod.def.path ?? [])],\n });\n }\n };\n return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n Codec: ZodMiniCodec,\n Boolean: ZodMiniBoolean,\n String: ZodMiniString,\n}, ...args);\n// @__NO_SIDE_EFFECTS__\nexport function json() {\n const jsonSchema = _lazy(() => {\n return union([string(), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n });\n return jsonSchema;\n}\nexport const ZodMiniFunction = /*@__PURE__*/ core.$constructor(\"ZodMiniFunction\", (inst, def) => {\n core.$ZodFunction.init(inst, def);\n ZodMiniType.init(inst, def);\n});\n// @__NO_SIDE_EFFECTS__\nexport function _function(params) {\n return new ZodMiniFunction({\n type: \"function\",\n input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),\n output: params?.output ?? unknown(),\n });\n}\nexport { _function as function };\n","import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n return new Class({\n type: \"string\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n return new Class({\n type: \"string\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n return new Class({\n type: \"string\",\n format: \"email\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"guid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v4\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v6\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n return new Class({\n type: \"string\",\n format: \"uuid\",\n check: \"string_format\",\n abort: false,\n version: \"v7\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n return new Class({\n type: \"string\",\n format: \"emoji\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"nanoid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cuid2\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ulid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"xid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ksuid\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"ipv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n return new Class({\n type: \"string\",\n format: \"mac\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv4\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n return new Class({\n type: \"string\",\n format: \"cidrv6\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n return new Class({\n type: \"string\",\n format: \"base64url\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n return new Class({\n type: \"string\",\n format: \"e164\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n return new Class({\n type: \"string\",\n format: \"jwt\",\n check: \"string_format\",\n abort: false,\n ...util.normalizeParams(params),\n });\n}\nexport const TimePrecision = {\n Any: null,\n Minute: -1,\n Second: 0,\n Millisecond: 3,\n Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"datetime\",\n check: \"string_format\",\n offset: false,\n local: false,\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n return new Class({\n type: \"string\",\n format: \"date\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n return new Class({\n type: \"string\",\n format: \"time\",\n check: \"string_format\",\n precision: null,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n return new Class({\n type: \"string\",\n format: \"duration\",\n check: \"string_format\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n return new Class({\n type: \"number\",\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n return new Class({\n type: \"number\",\n coerce: true,\n checks: [],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"safeint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"float64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"int32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n return new Class({\n type: \"number\",\n check: \"number_format\",\n abort: false,\n format: \"uint32\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n return new Class({\n type: \"boolean\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n return new Class({\n type: \"boolean\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n return new Class({\n type: \"bigint\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n return new Class({\n type: \"bigint\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"int64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n return new Class({\n type: \"bigint\",\n check: \"bigint_format\",\n abort: false,\n format: \"uint64\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n return new Class({\n type: \"symbol\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n return new Class({\n type: \"undefined\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n return new Class({\n type: \"null\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n return new Class({\n type: \"any\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n return new Class({\n type: \"unknown\",\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n return new Class({\n type: \"never\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n return new Class({\n type: \"void\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n return new Class({\n type: \"date\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n return new Class({\n type: \"date\",\n coerce: true,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n return new Class({\n type: \"nan\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n return new checks.$ZodCheckLessThan({\n check: \"less_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: false,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n return new checks.$ZodCheckGreaterThan({\n check: \"greater_than\",\n ...util.normalizeParams(params),\n value,\n inclusive: true,\n });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n return new checks.$ZodCheckMultipleOf({\n check: \"multiple_of\",\n ...util.normalizeParams(params),\n value,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n return new checks.$ZodCheckMaxSize({\n check: \"max_size\",\n ...util.normalizeParams(params),\n maximum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n return new checks.$ZodCheckMinSize({\n check: \"min_size\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n return new checks.$ZodCheckSizeEquals({\n check: \"size_equals\",\n ...util.normalizeParams(params),\n size,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n const ch = new checks.$ZodCheckMaxLength({\n check: \"max_length\",\n ...util.normalizeParams(params),\n maximum,\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n return new checks.$ZodCheckMinLength({\n check: \"min_length\",\n ...util.normalizeParams(params),\n minimum,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n return new checks.$ZodCheckLengthEquals({\n check: \"length_equals\",\n ...util.normalizeParams(params),\n length,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n return new checks.$ZodCheckRegex({\n check: \"string_format\",\n format: \"regex\",\n ...util.normalizeParams(params),\n pattern,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n return new checks.$ZodCheckLowerCase({\n check: \"string_format\",\n format: \"lowercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n return new checks.$ZodCheckUpperCase({\n check: \"string_format\",\n format: \"uppercase\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n return new checks.$ZodCheckIncludes({\n check: \"string_format\",\n format: \"includes\",\n ...util.normalizeParams(params),\n includes,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n return new checks.$ZodCheckStartsWith({\n check: \"string_format\",\n format: \"starts_with\",\n ...util.normalizeParams(params),\n prefix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n return new checks.$ZodCheckEndsWith({\n check: \"string_format\",\n format: \"ends_with\",\n ...util.normalizeParams(params),\n suffix,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n return new checks.$ZodCheckProperty({\n check: \"property\",\n property,\n schema,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n return new checks.$ZodCheckMimeType({\n check: \"mime_type\",\n mime: types,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n return new checks.$ZodCheckOverwrite({\n check: \"overwrite\",\n tx,\n });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n return new Class({\n type: \"array\",\n element,\n // get element() {\n // return element;\n // },\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n ...util.normalizeParams(params),\n });\n}\nexport function _xor(Class, options, params) {\n return new Class({\n type: \"union\",\n options,\n inclusive: false,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n return new Class({\n type: \"union\",\n options,\n discriminator,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n return new Class({\n type: \"intersection\",\n left,\n right,\n });\n}\n// export function _tuple(\n// Class: util.SchemaClass<schemas.$ZodTuple>,\n// items: [],\n// params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n const params = hasRest ? _params : _paramsOrRest;\n const rest = hasRest ? _paramsOrRest : null;\n return new Class({\n type: \"tuple\",\n items,\n rest,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n return new Class({\n type: \"record\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n return new Class({\n type: \"map\",\n keyType,\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n return new Class({\n type: \"set\",\n valueType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n // if (Array.isArray(values)) {\n // for (const value of values) {\n // entries[value] = value;\n // }\n // } else {\n // Object.assign(entries, values);\n // }\n // const entries: util.EnumLike = {};\n // for (const val of values) {\n // entries[val] = val;\n // }\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n return new Class({\n type: \"enum\",\n entries,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n return new Class({\n type: \"literal\",\n values: Array.isArray(value) ? value : [value],\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n return new Class({\n type: \"file\",\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n return new Class({\n type: \"transform\",\n transform: fn,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n return new Class({\n type: \"optional\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n return new Class({\n type: \"nullable\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n return new Class({\n type: \"default\",\n innerType,\n get defaultValue() {\n return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n },\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n return new Class({\n type: \"nonoptional\",\n innerType,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n return new Class({\n type: \"success\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n return new Class({\n type: \"catch\",\n innerType,\n catchValue: (typeof catchValue === \"function\" ? catchValue : () => catchValue),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n return new Class({\n type: \"pipe\",\n in: in_,\n out,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n return new Class({\n type: \"readonly\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n return new Class({\n type: \"template_literal\",\n parts,\n ...util.normalizeParams(params),\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n return new Class({\n type: \"lazy\",\n getter,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n return new Class({\n type: \"promise\",\n innerType,\n });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n const norm = util.normalizeParams(_params);\n norm.abort ?? (norm.abort = true); // default to abort:false\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...norm,\n });\n return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n const schema = new Class({\n type: \"custom\",\n check: \"custom\",\n fn: fn,\n ...util.normalizeParams(_params),\n });\n return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn) {\n const ch = _check((payload) => {\n payload.addIssue = (issue) => {\n if (typeof issue === \"string\") {\n payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n }\n else {\n // for Zod 3 backwards compatibility\n const _issue = issue;\n if (_issue.fatal)\n _issue.continue = false;\n _issue.code ?? (_issue.code = \"custom\");\n _issue.input ?? (_issue.input = payload.value);\n _issue.inst ?? (_issue.inst = ch);\n _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n payload.issues.push(util.issue(_issue));\n }\n };\n return fn(payload.value, payload);\n });\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n const ch = new checks.$ZodCheck({\n check: \"custom\",\n ...util.normalizeParams(params),\n });\n ch._zod.check = fn;\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n const ch = new checks.$ZodCheck({ check: \"describe\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, description });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n const ch = new checks.$ZodCheck({ check: \"meta\" });\n ch._zod.onattach = [\n (inst) => {\n const existing = registries.globalRegistry.get(inst) ?? {};\n registries.globalRegistry.add(inst, { ...existing, ...metadata });\n },\n ];\n ch._zod.check = () => { }; // no-op check\n return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n const params = util.normalizeParams(_params);\n let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n if (params.case !== \"sensitive\") {\n truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n }\n const truthySet = new Set(truthyArray);\n const falsySet = new Set(falsyArray);\n const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n const _String = Classes.String ?? schemas.$ZodString;\n const stringSchema = new _String({ type: \"string\", error: params.error });\n const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n const codec = new _Codec({\n type: \"pipe\",\n in: stringSchema,\n out: booleanSchema,\n transform: ((input, payload) => {\n let data = input;\n if (params.case !== \"sensitive\")\n data = data.toLowerCase();\n if (truthySet.has(data)) {\n return true;\n }\n else if (falsySet.has(data)) {\n return false;\n }\n else {\n payload.issues.push({\n code: \"invalid_value\",\n expected: \"stringbool\",\n values: [...truthySet, ...falsySet],\n input: payload.value,\n inst: codec,\n continue: false,\n });\n return {};\n }\n }),\n reverseTransform: ((input, _payload) => {\n if (input === true) {\n return truthyArray[0] || \"true\";\n }\n else {\n return falsyArray[0] || \"false\";\n }\n }),\n error: params.error,\n });\n return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n const params = util.normalizeParams(_params);\n const def = {\n ...util.normalizeParams(_params),\n check: \"string_format\",\n type: \"string\",\n format,\n fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n ...params,\n };\n if (fnOrRegex instanceof RegExp) {\n def.pattern = fnOrRegex;\n }\n const inst = new Class(def);\n return inst;\n}\n","/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { z } from 'zod/v4-mini';\nimport enLocale from 'zod/v4/locales/en.js';\n// Enable parse error messages\nz.config(enLocale());\n/**\n * Get a Zod object that matches the expected type, including any optional properties.\n * (Does not provide the same guarantee for nested object types.)\n *\n * Unrecognized properties will be stripped/ignored at runtime.\n * To preserve them, use `matchingZodObjectLoose` instead.\n *\n * Using this helper instead of `const ZodFoo = z.object({...}); type Foo = z.infer<typeof ZodFoo>;`\n * is recommended in cases where the original type is defined elsewhere (such as in `common-types`),\n * to ensure all the properties stay in sync.\n */\nexport function matchingZodObject(shape) {\n return z.object(shape);\n}\n/**\n * Like `matchingZodObject`, but pass through any extra properties that aren't defined in the shape.\n *\n * See `matchingZodObject` comment for more details.\n */\nexport function matchingZodObjectLoose(shape) {\n return z.looseObject(shape);\n}\n//# sourceMappingURL=matchingZodObject.js.map","import * as util from \"../core/util.js\";\nconst error = () => {\n const Sizable = {\n string: { unit: \"characters\", verb: \"to have\" },\n file: { unit: \"bytes\", verb: \"to have\" },\n array: { unit: \"items\", verb: \"to have\" },\n set: { unit: \"items\", verb: \"to have\" },\n map: { unit: \"entries\", verb: \"to have\" },\n };\n function getSizing(origin) {\n return Sizable[origin] ?? null;\n }\n const FormatDictionary = {\n regex: \"input\",\n email: \"email address\",\n url: \"URL\",\n emoji: \"emoji\",\n uuid: \"UUID\",\n uuidv4: \"UUIDv4\",\n uuidv6: \"UUIDv6\",\n nanoid: \"nanoid\",\n guid: \"GUID\",\n cuid: \"cuid\",\n cuid2: \"cuid2\",\n ulid: \"ULID\",\n xid: \"XID\",\n ksuid: \"KSUID\",\n datetime: \"ISO datetime\",\n date: \"ISO date\",\n time: \"ISO time\",\n duration: \"ISO duration\",\n ipv4: \"IPv4 address\",\n ipv6: \"IPv6 address\",\n mac: \"MAC address\",\n cidrv4: \"IPv4 range\",\n cidrv6: \"IPv6 range\",\n base64: \"base64-encoded string\",\n base64url: \"base64url-encoded string\",\n json_string: \"JSON string\",\n e164: \"E.164 number\",\n jwt: \"JWT\",\n template_literal: \"input\",\n };\n // type names: missing keys = do not translate (use raw value via ?? fallback)\n const TypeDictionary = {\n // Compatibility: \"nan\" -> \"NaN\" for display\n nan: \"NaN\",\n // All other type names omitted - they fall back to raw values via ?? operator\n };\n return (issue) => {\n switch (issue.code) {\n case \"invalid_type\": {\n const expected = TypeDictionary[issue.expected] ?? issue.expected;\n const receivedType = util.parsedType(issue.input);\n const received = TypeDictionary[receivedType] ?? receivedType;\n return `Invalid input: expected ${expected}, received ${received}`;\n }\n case \"invalid_value\":\n if (issue.values.length === 1)\n return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;\n return `Invalid option: expected one of ${util.joinValues(issue.values, \"|\")}`;\n case \"too_big\": {\n const adj = issue.inclusive ? \"<=\" : \"<\";\n const sizing = getSizing(issue.origin);\n if (sizing)\n return `Too big: expected ${issue.origin ?? \"value\"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? \"elements\"}`;\n return `Too big: expected ${issue.origin ?? \"value\"} to be ${adj}${issue.maximum.toString()}`;\n }\n case \"too_small\": {\n const adj = issue.inclusive ? \">=\" : \">\";\n const sizing = getSizing(issue.origin);\n if (sizing) {\n return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;\n }\n return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;\n }\n case \"invalid_format\": {\n const _issue = issue;\n if (_issue.format === \"starts_with\") {\n return `Invalid string: must start with \"${_issue.prefix}\"`;\n }\n if (_issue.format === \"ends_with\")\n return `Invalid string: must end with \"${_issue.suffix}\"`;\n if (_issue.format === \"includes\")\n return `Invalid string: must include \"${_issue.includes}\"`;\n if (_issue.format === \"regex\")\n return `Invalid string: must match pattern ${_issue.pattern}`;\n return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;\n }\n case \"not_multiple_of\":\n return `Invalid number: must be a multiple of ${issue.divisor}`;\n case \"unrecognized_keys\":\n return `Unrecognized key${issue.keys.length > 1 ? \"s\" : \"\"}: ${util.joinValues(issue.keys, \", \")}`;\n case \"invalid_key\":\n return `Invalid key in ${issue.origin}`;\n case \"invalid_union\":\n return \"Invalid input\";\n case \"invalid_element\":\n return `Invalid value in ${issue.origin}`;\n default:\n return `Invalid input`;\n }\n };\n};\nexport default function () {\n return {\n localeError: error(),\n };\n}\n","import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTaskStats = matchingZodObject({\n status: z.literal(['idle', 'pending']),\n remainingTasks: z.number(),\n totalTasks: z.number(),\n totalErrors: z.number(),\n totalWarnings: z.number(),\n});\n//# sourceMappingURL=TaskStats.js.map","import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTiming = matchingZodObject({\n name: z.string(),\n start: z.number(),\n end: z.optional(z.number()),\n threwException: z.optional(z.boolean()),\n});\n//# sourceMappingURL=Timing.js.map","import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTaskMessageLocation = matchingZodObject({\n file: z.string(),\n line: z.optional(z.number()),\n column: z.optional(z.number()),\n});\n//# sourceMappingURL=TaskMessageLocation.js.map","import { z } from 'zod/v4-mini';\nimport { ZodTaskMessageLocation } from './TaskMessageLocation.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTaskNote = matchingZodObject({\n text: z.string(),\n location: z.optional(ZodTaskMessageLocation),\n});\nexport const ZodTaskMessage = matchingZodObject({\n text: z.string(),\n source: z.string(),\n location: z.optional(ZodTaskMessageLocation),\n notes: z.optional(z.array(ZodTaskNote)),\n});\n//# sourceMappingURL=TaskMessage.js.map","import { z } from 'zod/v4-mini';\nimport { ZodTiming } from './Timing.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nimport { ZodTaskMessage } from './TaskMessage.js';\nexport const ZodTaskDescription = matchingZodObject({\n id: z.string(),\n name: z.string(),\n status: z.literal(['pending', 'complete']),\n inputPath: z.string(),\n outputPath: z.optional(z.string()),\n errors: z.optional(z.array(ZodTaskMessage)),\n warnings: z.optional(z.array(ZodTaskMessage)),\n startTime: z.number(),\n duration: z.optional(z.number()),\n lastUpdated: z.optional(z.number()),\n timings: z.optional(z.array(ZodTiming)),\n});\n//# sourceMappingURL=TaskDescription.js.map","import { z } from 'zod/v4-mini';\nimport { ZodTaskDescription } from './TaskDescription.js';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodTaskList = matchingZodObject({\n tasks: z.array(ZodTaskDescription),\n});\n//# sourceMappingURL=TaskList.js.map","import { z } from 'zod/v4-mini';\nimport { matchingZodObject, matchingZodObjectLoose } from '../utilities/matchingZodObject.js';\n/**\n * Validate that the package.json includes the name and version, and pass through all other fields\n * without validation.\n */\nconst ZodBasicPackageJson = matchingZodObjectLoose({\n name: z.string(),\n version: z.string(),\n});\nexport const ZodNotifyLinkChangeInput = matchingZodObject({\n packagePath: z.string(),\n hash: z.optional(z.string()),\n definition: z.optional(ZodBasicPackageJson),\n});\n//# sourceMappingURL=NotifyLinkChangeInput.js.map","//\n// This must be in a separate file because it's imported by busSources.ts, which is also used\n// in the browser, so it must only import zod types.\n// (Also, these types are used by both `linkPath` and `unlinkPath`.)\n//\nimport { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nconst ZodPackageHashesEntry = z.object({\n browser: z.record(z.string(), z.string()),\n node: z.record(z.string(), z.string()),\n});\nconst ZodLinkedPath = matchingZodObject({\n path: z.string(),\n rootPath: z.optional(z.string()),\n includeAll: z.optional(z.boolean()),\n ignoredPackages: z.optional(z.array(z.string())),\n ignoreResolutions: z.optional(z.union([z.boolean(), z.array(z.string())])),\n resolveStrategy: z.optional(z.literal(['dedupe', 'duplicate'])),\n remote: z.optional(matchingZodObject({\n hostUrl: z.string(),\n // Skip schema validation of the resolve map since it's likely very large, and the various\n // zod and procedure type helpers ensure the type is correct in the API.\n resolveMap: z.record(z.string(), z.any()),\n // Same with the serializable package definitions.\n // If we need to enforce usage/sharing of a minimal subset of properties, that should be done\n // with smaller subset/pick type (non-zod) which is used in all relevant locations.\n packages: z.object({\n definitions: z.record(z.string(), z.any()),\n transformedDefinitions: z.record(z.string(), z.any()),\n }),\n packageHashes: z.object({\n hashesWithSource: ZodPackageHashesEntry,\n hashesWithNoSource: ZodPackageHashesEntry,\n }),\n })),\n});\nexport const ZodLinkPathInput = matchingZodObject({ linkedPath: ZodLinkedPath });\nexport const ZodLinkPathOutput = matchingZodObject({\n // Don't check the schema of the resolve map as it can be very large.\n resolveMap: z.record(z.string(), z.any()),\n linkedPaths: z.array(ZodLinkedPath),\n});\n//# sourceMappingURL=LinkPath.js.map","//\n// This must be in a separate file because it's imported by busSources.ts, which is also used\n// in the browser, so it must only import zod types.\n//\nimport { z } from 'zod/v4-mini';\nimport { matchingZodObject, matchingZodObjectLoose } from '../utilities/matchingZodObject.js';\n// Minimum acceptable match object for a low maintenance burden.\nconst ZodPackageSettingsMatchObject = matchingZodObject({\n name: z.string(),\n version: z.optional(z.string()),\n});\nconst ZodPackageSettingsMatch = z.union([z.string(), z.looseObject({ ...ZodPackageSettingsMatchObject.shape })]);\nconst ZodGeneratedPackageSettingsMatch = z.union([z.string(), z.required(ZodPackageSettingsMatchObject)]);\nexport const ZodGetLinkConfigOutput = matchingZodObjectLoose({\n packageSettings: z.optional(z.array(z.looseObject({ match: z.union([ZodPackageSettingsMatch, z.array(ZodPackageSettingsMatch)]) }))),\n generated: z.looseObject({ packageSettings: z.array(z.looseObject({ match: ZodGeneratedPackageSettingsMatch })) }),\n});\n//# sourceMappingURL=GetLinkConfigOutput.js.map","// This file is used in the browser,\n// so it must only import types (ts and zod) to not trigger a trpc server error due to bad tree shaking.\nimport { z } from 'zod/v4-mini';\nimport { ZodTaskStats } from '../types/TaskStats.js';\nimport { ZodTaskList } from '../types/TaskList.js';\nimport { createDataPath } from '@ms-cloudpack/data-bus';\nimport { ZodNotifyLinkChangeInput } from '../types/NotifyLinkChangeInput.js';\nimport { ZodLinkPathInput, ZodLinkPathOutput } from '../types/LinkPath.js';\nimport { ZodGetLinkConfigOutput } from '../types/GetLinkConfigOutput.js';\nimport { ZodPackageUpdatePayload } from '../types/PackageUpdatePayload.js';\n/**\n * Used for tracking the reload count.\n */\nexport const reloadCountSource = createDataPath({\n path: ['session', 'version'],\n type: z.number(),\n});\n/**\n * Used for tracking the task stats displayed in the badge.\n */\nexport const taskStatsSource = createDataPath({\n path: ['task', 'stats'],\n type: ZodTaskStats,\n});\n/**\n * Used for tracking the list of tasks.\n */\nexport const taskListSource = createDataPath({\n path: ['task', 'list'],\n type: ZodTaskList,\n});\n/**\n * Used for tracking entry errors: `Failed to resolve module specifier \"${packageName}@${version}${filePath}\".`\n * This is used to display errors in the UI and to notify the user of the error when autoUpdateEntries is enabled.\n */\nexport const errorEntrySource = createDataPath({\n path: ['error', 'entry'],\n type: z.string(),\n});\n/**\n * Used for tracking link updates.\n */\nexport const linkUpdateSource = createDataPath({\n path: ['link', 'update'],\n type: ZodNotifyLinkChangeInput,\n});\n/**\n * Used for fetching the host configuration.\n */\nexport const linkConfigSource = createDataPath({\n path: ['link', 'config'],\n type: ZodGetLinkConfigOutput,\n});\n/**\n * Used for tracking linked paths.\n */\nexport const linkPathsSource = createDataPath({\n path: ['link', 'paths'],\n type: ZodLinkPathInput,\n});\n/**\n * Used for tracking when linking is done.\n */\nexport const linkDoneSource = createDataPath({\n path: ['link', 'done'],\n type: ZodLinkPathOutput,\n});\n/**\n * Used for detecting host disconnection on link.\n */\nexport const linkDisconnectedSource = createDataPath({\n path: ['link', 'disconnected'],\n type: z.object({ reason: z.literal(['lost', 'unreachable']) }),\n});\n/**\n * Used for HMR - notifies browser when a package has been rebuilt.\n * The bundleUrl in each entry point already contains the updated hash.\n */\nexport const packageUpdateSource = createDataPath({\n path: ['package', 'update'],\n type: ZodPackageUpdatePayload,\n});\n//# sourceMappingURL=busSources.js.map","import { z } from 'zod/v4-mini';\nimport { matchingZodObject } from '../utilities/matchingZodObject.js';\nexport const ZodPackageUpdatePayload = matchingZodObject({\n packageName: z.string(),\n version: z.string(),\n entryPoints: z.array(z.object({\n importPath: z.string(),\n bundleUrl: z.string(),\n })),\n});\n//# sourceMappingURL=PackageUpdatePayload.js.map","//#region rolldown:runtime\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 __commonJS = (cb, mod) => function() {\n\treturn mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\tkey = keys[i];\n\t\tif (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\tvalue: mod,\n\tenumerable: true\n}) : target, mod));\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js\nvar require_typeof = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js\"(exports, module) {\n\tfunction _typeof$2(o) {\n\t\t\"@babel/helpers - typeof\";\n\t\treturn module.exports = _typeof$2 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o$1) {\n\t\t\treturn typeof o$1;\n\t\t} : function(o$1) {\n\t\t\treturn o$1 && \"function\" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? \"symbol\" : typeof o$1;\n\t\t}, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof$2(o);\n\t}\n\tmodule.exports = _typeof$2, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js\nvar require_toPrimitive = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js\"(exports, module) {\n\tvar _typeof$1 = require_typeof()[\"default\"];\n\tfunction toPrimitive$1(t, r) {\n\t\tif (\"object\" != _typeof$1(t) || !t) return t;\n\t\tvar e = t[Symbol.toPrimitive];\n\t\tif (void 0 !== e) {\n\t\t\tvar i = e.call(t, r || \"default\");\n\t\t\tif (\"object\" != _typeof$1(i)) return i;\n\t\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t\t}\n\t\treturn (\"string\" === r ? String : Number)(t);\n\t}\n\tmodule.exports = toPrimitive$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js\nvar require_toPropertyKey = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js\"(exports, module) {\n\tvar _typeof = require_typeof()[\"default\"];\n\tvar toPrimitive = require_toPrimitive();\n\tfunction toPropertyKey$1(t) {\n\t\tvar i = toPrimitive(t, \"string\");\n\t\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n\t}\n\tmodule.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js\nvar require_defineProperty = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js\"(exports, module) {\n\tvar toPropertyKey = require_toPropertyKey();\n\tfunction _defineProperty(e, r, t) {\n\t\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\t\tvalue: t,\n\t\t\tenumerable: !0,\n\t\t\tconfigurable: !0,\n\t\t\twritable: !0\n\t\t}) : e[r] = t, e;\n\t}\n\tmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js\nvar require_objectSpread2 = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js\"(exports, module) {\n\tvar defineProperty = require_defineProperty();\n\tfunction ownKeys(e, r) {\n\t\tvar t = Object.keys(e);\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tvar o = Object.getOwnPropertySymbols(e);\n\t\t\tr && (o = o.filter(function(r$1) {\n\t\t\t\treturn Object.getOwnPropertyDescriptor(e, r$1).enumerable;\n\t\t\t})), t.push.apply(t, o);\n\t\t}\n\t\treturn t;\n\t}\n\tfunction _objectSpread2(e) {\n\t\tfor (var r = 1; r < arguments.length; r++) {\n\t\t\tvar t = null != arguments[r] ? arguments[r] : {};\n\t\t\tr % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {\n\t\t\t\tdefineProperty(e, r$1, t[r$1]);\n\t\t\t}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {\n\t\t\t\tObject.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));\n\t\t\t});\n\t\t}\n\t\treturn e;\n\t}\n\tmodule.exports = _objectSpread2, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\nexport { __commonJS, __toESM, require_defineProperty, require_objectSpread2 };\n//# sourceMappingURL=objectSpread2-BvkFp-_Y.mjs.map","//#region src/observable/observable.ts\n/** @public */\nfunction isObservable(x) {\n\treturn typeof x === \"object\" && x !== null && \"subscribe\" in x;\n}\n/** @public */\nfunction observable(subscribe) {\n\tconst self = {\n\t\tsubscribe(observer) {\n\t\t\tlet teardownRef = null;\n\t\t\tlet isDone = false;\n\t\t\tlet unsubscribed = false;\n\t\t\tlet teardownImmediately = false;\n\t\t\tfunction unsubscribe() {\n\t\t\t\tif (teardownRef === null) {\n\t\t\t\t\tteardownImmediately = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (unsubscribed) return;\n\t\t\t\tunsubscribed = true;\n\t\t\t\tif (typeof teardownRef === \"function\") teardownRef();\n\t\t\t\telse if (teardownRef) teardownRef.unsubscribe();\n\t\t\t}\n\t\t\tteardownRef = subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tvar _observer$next;\n\t\t\t\t\tif (isDone) return;\n\t\t\t\t\t(_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value);\n\t\t\t\t},\n\t\t\t\terror(err) {\n\t\t\t\t\tvar _observer$error;\n\t\t\t\t\tif (isDone) return;\n\t\t\t\t\tisDone = true;\n\t\t\t\t\t(_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, err);\n\t\t\t\t\tunsubscribe();\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tvar _observer$complete;\n\t\t\t\t\tif (isDone) return;\n\t\t\t\t\tisDone = true;\n\t\t\t\t\t(_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer);\n\t\t\t\t\tunsubscribe();\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (teardownImmediately) unsubscribe();\n\t\t\treturn { unsubscribe };\n\t\t},\n\t\tpipe(...operations) {\n\t\t\treturn operations.reduce(pipeReducer, self);\n\t\t}\n\t};\n\treturn self;\n}\nfunction pipeReducer(prev, fn) {\n\treturn fn(prev);\n}\n/** @internal */\nfunction observableToPromise(observable$1) {\n\tconst ac = new AbortController();\n\tconst promise = new Promise((resolve, reject) => {\n\t\tlet isDone = false;\n\t\tfunction onDone() {\n\t\t\tif (isDone) return;\n\t\t\tisDone = true;\n\t\t\tobs$.unsubscribe();\n\t\t}\n\t\tac.signal.addEventListener(\"abort\", () => {\n\t\t\treject(ac.signal.reason);\n\t\t});\n\t\tconst obs$ = observable$1.subscribe({\n\t\t\tnext(data) {\n\t\t\t\tisDone = true;\n\t\t\t\tresolve(data);\n\t\t\t\tonDone();\n\t\t\t},\n\t\t\terror(data) {\n\t\t\t\treject(data);\n\t\t\t},\n\t\t\tcomplete() {\n\t\t\t\tac.abort();\n\t\t\t\tonDone();\n\t\t\t}\n\t\t});\n\t});\n\treturn promise;\n}\n/**\n* @internal\n*/\nfunction observableToReadableStream(observable$1, signal) {\n\tlet unsub = null;\n\tconst onAbort = () => {\n\t\tunsub === null || unsub === void 0 || unsub.unsubscribe();\n\t\tunsub = null;\n\t\tsignal.removeEventListener(\"abort\", onAbort);\n\t};\n\treturn new ReadableStream({\n\t\tstart(controller) {\n\t\t\tunsub = observable$1.subscribe({\n\t\t\t\tnext(data) {\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\tok: true,\n\t\t\t\t\t\tvalue: data\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tcontroller.enqueue({\n\t\t\t\t\t\tok: false,\n\t\t\t\t\t\terror\n\t\t\t\t\t});\n\t\t\t\t\tcontroller.close();\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tcontroller.close();\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (signal.aborted) onAbort();\n\t\t\telse signal.addEventListener(\"abort\", onAbort, { once: true });\n\t\t},\n\t\tcancel() {\n\t\t\tonAbort();\n\t\t}\n\t});\n}\n/** @internal */\nfunction observableToAsyncIterable(observable$1, signal) {\n\tconst stream = observableToReadableStream(observable$1, signal);\n\tconst reader = stream.getReader();\n\tconst iterator = {\n\t\tasync next() {\n\t\t\tconst value = await reader.read();\n\t\t\tif (value.done) return {\n\t\t\t\tvalue: void 0,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t\tconst { value: result } = value;\n\t\t\tif (!result.ok) throw result.error;\n\t\t\treturn {\n\t\t\t\tvalue: result.value,\n\t\t\t\tdone: false\n\t\t\t};\n\t\t},\n\t\tasync return() {\n\t\t\tawait reader.cancel();\n\t\t\treturn {\n\t\t\t\tvalue: void 0,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\t};\n\treturn { [Symbol.asyncIterator]() {\n\t\treturn iterator;\n\t} };\n}\n\n//#endregion\nexport { isObservable, observable, observableToAsyncIterable, observableToPromise };\n//# sourceMappingURL=observable-UMO3vUa_.mjs.map","import { observable } from \"@trpc/server/observable\";\n\n//#region src/links/internals/createChain.ts\n/** @internal */\nfunction createChain(opts) {\n\treturn observable((observer) => {\n\t\tfunction execute(index = 0, op = opts.op) {\n\t\t\tconst next = opts.links[index];\n\t\t\tif (!next) throw new Error(\"No more links to execute - did you forget to add an ending link?\");\n\t\t\tconst subscription = next({\n\t\t\t\top,\n\t\t\t\tnext(nextOp) {\n\t\t\t\t\tconst nextObserver = execute(index + 1, nextOp);\n\t\t\t\t\treturn nextObserver;\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn subscription;\n\t\t}\n\t\tconst obs$ = execute();\n\t\treturn obs$.subscribe(observer);\n\t});\n}\n\n//#endregion\n//#region src/links/splitLink.ts\nfunction asArray(value) {\n\treturn Array.isArray(value) ? value : [value];\n}\nfunction splitLink(opts) {\n\treturn (runtime) => {\n\t\tconst yes = asArray(opts.true).map((link) => link(runtime));\n\t\tconst no = asArray(opts.false).map((link) => link(runtime));\n\t\treturn (props) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tconst links = opts.condition(props.op) ? yes : no;\n\t\t\t\treturn createChain({\n\t\t\t\t\top: props.op,\n\t\t\t\t\tlinks\n\t\t\t\t}).subscribe(observer);\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { createChain, splitLink };\n//# sourceMappingURL=splitLink-B7Cuf2c_.mjs.map","//#region src/unstable-core-do-not-import/utils.ts\n/**\n* Ensures there are no duplicate keys when building a procedure.\n* @internal\n*/\nfunction mergeWithoutOverrides(obj1, ...objs) {\n\tconst newObj = Object.assign(emptyObject(), obj1);\n\tfor (const overrides of objs) for (const key in overrides) {\n\t\tif (key in newObj && newObj[key] !== overrides[key]) throw new Error(`Duplicate key ${key}`);\n\t\tnewObj[key] = overrides[key];\n\t}\n\treturn newObj;\n}\n/**\n* Check that value is object\n* @internal\n*/\nfunction isObject(value) {\n\treturn !!value && !Array.isArray(value) && typeof value === \"object\";\n}\nfunction isFunction(fn) {\n\treturn typeof fn === \"function\";\n}\n/**\n* Create an object without inheriting anything from `Object.prototype`\n* @internal\n*/\nfunction emptyObject() {\n\treturn Object.create(null);\n}\nconst asyncIteratorsSupported = typeof Symbol === \"function\" && !!Symbol.asyncIterator;\nfunction isAsyncIterable(value) {\n\treturn asyncIteratorsSupported && isObject(value) && Symbol.asyncIterator in value;\n}\n/**\n* Run an IIFE\n*/\nconst run = (fn) => fn();\nfunction noop() {}\nfunction identity(it) {\n\treturn it;\n}\n/**\n* Generic runtime assertion function. Throws, if the condition is not `true`.\n*\n* Can be used as a slightly less dangerous variant of type assertions. Code\n* mistakes would be revealed at runtime then (hopefully during testing).\n*/\nfunction assert(condition, msg = \"no additional info\") {\n\tif (!condition) throw new Error(`AssertionError: ${msg}`);\n}\nfunction sleep(ms = 0) {\n\treturn new Promise((res) => setTimeout(res, ms));\n}\n/**\n* Ponyfill for\n* [`AbortSignal.any`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static).\n*/\nfunction abortSignalsAnyPonyfill(signals) {\n\tif (typeof AbortSignal.any === \"function\") return AbortSignal.any(signals);\n\tconst ac = new AbortController();\n\tfor (const signal of signals) {\n\t\tif (signal.aborted) {\n\t\t\ttrigger();\n\t\t\tbreak;\n\t\t}\n\t\tsignal.addEventListener(\"abort\", trigger, { once: true });\n\t}\n\treturn ac.signal;\n\tfunction trigger() {\n\t\tac.abort();\n\t\tfor (const signal of signals) signal.removeEventListener(\"abort\", trigger);\n\t}\n}\n\n//#endregion\n//#region src/unstable-core-do-not-import/rpc/codes.ts\n/**\n* JSON-RPC 2.0 Error codes\n*\n* `-32000` to `-32099` are reserved for implementation-defined server-errors.\n* For tRPC we're copying the last digits of HTTP 4XX errors.\n*/\nconst TRPC_ERROR_CODES_BY_KEY = {\n\tPARSE_ERROR: -32700,\n\tBAD_REQUEST: -32600,\n\tINTERNAL_SERVER_ERROR: -32603,\n\tNOT_IMPLEMENTED: -32603,\n\tBAD_GATEWAY: -32603,\n\tSERVICE_UNAVAILABLE: -32603,\n\tGATEWAY_TIMEOUT: -32603,\n\tUNAUTHORIZED: -32001,\n\tPAYMENT_REQUIRED: -32002,\n\tFORBIDDEN: -32003,\n\tNOT_FOUND: -32004,\n\tMETHOD_NOT_SUPPORTED: -32005,\n\tTIMEOUT: -32008,\n\tCONFLICT: -32009,\n\tPRECONDITION_FAILED: -32012,\n\tPAYLOAD_TOO_LARGE: -32013,\n\tUNSUPPORTED_MEDIA_TYPE: -32015,\n\tUNPROCESSABLE_CONTENT: -32022,\n\tPRECONDITION_REQUIRED: -32028,\n\tTOO_MANY_REQUESTS: -32029,\n\tCLIENT_CLOSED_REQUEST: -32099\n};\nconst TRPC_ERROR_CODES_BY_NUMBER = {\n\t[-32700]: \"PARSE_ERROR\",\n\t[-32600]: \"BAD_REQUEST\",\n\t[-32603]: \"INTERNAL_SERVER_ERROR\",\n\t[-32001]: \"UNAUTHORIZED\",\n\t[-32002]: \"PAYMENT_REQUIRED\",\n\t[-32003]: \"FORBIDDEN\",\n\t[-32004]: \"NOT_FOUND\",\n\t[-32005]: \"METHOD_NOT_SUPPORTED\",\n\t[-32008]: \"TIMEOUT\",\n\t[-32009]: \"CONFLICT\",\n\t[-32012]: \"PRECONDITION_FAILED\",\n\t[-32013]: \"PAYLOAD_TOO_LARGE\",\n\t[-32015]: \"UNSUPPORTED_MEDIA_TYPE\",\n\t[-32022]: \"UNPROCESSABLE_CONTENT\",\n\t[-32028]: \"PRECONDITION_REQUIRED\",\n\t[-32029]: \"TOO_MANY_REQUESTS\",\n\t[-32099]: \"CLIENT_CLOSED_REQUEST\"\n};\n/**\n* tRPC error codes that are considered retryable\n* With out of the box SSE, the client will reconnect when these errors are encountered\n*/\nconst retryableRpcCodes = [\n\tTRPC_ERROR_CODES_BY_KEY.BAD_GATEWAY,\n\tTRPC_ERROR_CODES_BY_KEY.SERVICE_UNAVAILABLE,\n\tTRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT,\n\tTRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR\n];\n\n//#endregion\nexport { TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER, abortSignalsAnyPonyfill, assert, emptyObject, identity, isAsyncIterable, isFunction, isObject, mergeWithoutOverrides, noop, retryableRpcCodes, run, sleep };\n//# sourceMappingURL=codes-DagpWZLc.mjs.map","import { __toESM, require_defineProperty, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { isObject } from \"@trpc/server/unstable-core-do-not-import\";\n\n//#region src/TRPCClientError.ts\nvar import_defineProperty = __toESM(require_defineProperty(), 1);\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\nfunction isTRPCClientError(cause) {\n\treturn cause instanceof TRPCClientError;\n}\nfunction isTRPCErrorResponse(obj) {\n\treturn isObject(obj) && isObject(obj[\"error\"]) && typeof obj[\"error\"][\"code\"] === \"number\" && typeof obj[\"error\"][\"message\"] === \"string\";\n}\nfunction getMessageFromUnknownError(err, fallback) {\n\tif (typeof err === \"string\") return err;\n\tif (isObject(err) && typeof err[\"message\"] === \"string\") return err[\"message\"];\n\treturn fallback;\n}\nvar TRPCClientError = class TRPCClientError extends Error {\n\tconstructor(message, opts) {\n\t\tvar _opts$result, _opts$result2;\n\t\tconst cause = opts === null || opts === void 0 ? void 0 : opts.cause;\n\t\tsuper(message, { cause });\n\t\t(0, import_defineProperty.default)(this, \"cause\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"shape\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"data\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"meta\", void 0);\n\t\tthis.meta = opts === null || opts === void 0 ? void 0 : opts.meta;\n\t\tthis.cause = cause;\n\t\tthis.shape = opts === null || opts === void 0 || (_opts$result = opts.result) === null || _opts$result === void 0 ? void 0 : _opts$result.error;\n\t\tthis.data = opts === null || opts === void 0 || (_opts$result2 = opts.result) === null || _opts$result2 === void 0 ? void 0 : _opts$result2.error.data;\n\t\tthis.name = \"TRPCClientError\";\n\t\tObject.setPrototypeOf(this, TRPCClientError.prototype);\n\t}\n\tstatic from(_cause, opts = {}) {\n\t\tconst cause = _cause;\n\t\tif (isTRPCClientError(cause)) {\n\t\t\tif (opts.meta) cause.meta = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, cause.meta), opts.meta);\n\t\t\treturn cause;\n\t\t}\n\t\tif (isTRPCErrorResponse(cause)) return new TRPCClientError(cause.error.message, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { result: cause }));\n\t\treturn new TRPCClientError(getMessageFromUnknownError(cause, \"Unknown error\"), (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { cause }));\n\t}\n};\n\n//#endregion\nexport { TRPCClientError, isTRPCClientError };\n//# sourceMappingURL=TRPCClientError-CjKyS10w.mjs.map","//#region src/internals/transformer.ts\n/**\n* @internal\n*/\n/**\n* @internal\n*/\nfunction getTransformer(transformer) {\n\tconst _transformer = transformer;\n\tif (!_transformer) return {\n\t\tinput: {\n\t\t\tserialize: (data) => data,\n\t\t\tdeserialize: (data) => data\n\t\t},\n\t\toutput: {\n\t\t\tserialize: (data) => data,\n\t\t\tdeserialize: (data) => data\n\t\t}\n\t};\n\tif (\"input\" in _transformer) return _transformer;\n\treturn {\n\t\tinput: _transformer,\n\t\toutput: _transformer\n\t};\n}\n\n//#endregion\nexport { getTransformer };\n//# sourceMappingURL=unstable-internals-Bg7n9BBj.mjs.map","import { __toESM, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { getTransformer } from \"./unstable-internals-Bg7n9BBj.mjs\";\n\n//#region src/getFetch.ts\nconst isFunction = (fn) => typeof fn === \"function\";\nfunction getFetch(customFetchImpl) {\n\tif (customFetchImpl) return customFetchImpl;\n\tif (typeof window !== \"undefined\" && isFunction(window.fetch)) return window.fetch;\n\tif (typeof globalThis !== \"undefined\" && isFunction(globalThis.fetch)) return globalThis.fetch;\n\tthrow new Error(\"No fetch implementation found\");\n}\n\n//#endregion\n//#region src/links/internals/httpUtils.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\nfunction resolveHTTPLinkOptions(opts) {\n\treturn {\n\t\turl: opts.url.toString(),\n\t\tfetch: opts.fetch,\n\t\ttransformer: getTransformer(opts.transformer),\n\t\tmethodOverride: opts.methodOverride\n\t};\n}\nfunction arrayToDict(array) {\n\tconst dict = {};\n\tfor (let index = 0; index < array.length; index++) {\n\t\tconst element = array[index];\n\t\tdict[index] = element;\n\t}\n\treturn dict;\n}\nconst METHOD = {\n\tquery: \"GET\",\n\tmutation: \"POST\",\n\tsubscription: \"PATCH\"\n};\nfunction getInput(opts) {\n\treturn \"input\" in opts ? opts.transformer.input.serialize(opts.input) : arrayToDict(opts.inputs.map((_input) => opts.transformer.input.serialize(_input)));\n}\nconst getUrl = (opts) => {\n\tconst parts = opts.url.split(\"?\");\n\tconst base = parts[0].replace(/\\/$/, \"\");\n\tlet url = base + \"/\" + opts.path;\n\tconst queryParts = [];\n\tif (parts[1]) queryParts.push(parts[1]);\n\tif (\"inputs\" in opts) queryParts.push(\"batch=1\");\n\tif (opts.type === \"query\" || opts.type === \"subscription\") {\n\t\tconst input = getInput(opts);\n\t\tif (input !== void 0 && opts.methodOverride !== \"POST\") queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`);\n\t}\n\tif (queryParts.length) url += \"?\" + queryParts.join(\"&\");\n\treturn url;\n};\nconst getBody = (opts) => {\n\tif (opts.type === \"query\" && opts.methodOverride !== \"POST\") return void 0;\n\tconst input = getInput(opts);\n\treturn input !== void 0 ? JSON.stringify(input) : void 0;\n};\nconst jsonHttpRequester = (opts) => {\n\treturn httpRequest((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {\n\t\tcontentTypeHeader: \"application/json\",\n\t\tgetUrl,\n\t\tgetBody\n\t}));\n};\n/**\n* Polyfill for DOMException with AbortError name\n*/\nvar AbortError = class extends Error {\n\tconstructor() {\n\t\tconst name = \"AbortError\";\n\t\tsuper(name);\n\t\tthis.name = name;\n\t\tthis.message = name;\n\t}\n};\n/**\n* Polyfill for `signal.throwIfAborted()`\n*\n* @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/throwIfAborted\n*/\nconst throwIfAborted = (signal) => {\n\tvar _signal$throwIfAborte;\n\tif (!(signal === null || signal === void 0 ? void 0 : signal.aborted)) return;\n\t(_signal$throwIfAborte = signal.throwIfAborted) === null || _signal$throwIfAborte === void 0 || _signal$throwIfAborte.call(signal);\n\tif (typeof DOMException !== \"undefined\") throw new DOMException(\"AbortError\", \"AbortError\");\n\tthrow new AbortError();\n};\nasync function fetchHTTPResponse(opts) {\n\tvar _opts$methodOverride;\n\tthrowIfAborted(opts.signal);\n\tconst url = opts.getUrl(opts);\n\tconst body = opts.getBody(opts);\n\tconst method = (_opts$methodOverride = opts.methodOverride) !== null && _opts$methodOverride !== void 0 ? _opts$methodOverride : METHOD[opts.type];\n\tconst resolvedHeaders = await (async () => {\n\t\tconst heads = await opts.headers();\n\t\tif (Symbol.iterator in heads) return Object.fromEntries(heads);\n\t\treturn heads;\n\t})();\n\tconst headers = (0, import_objectSpread2.default)((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts.contentTypeHeader && method !== \"GET\" ? { \"content-type\": opts.contentTypeHeader } : {}), opts.trpcAcceptHeader ? { \"trpc-accept\": opts.trpcAcceptHeader } : void 0), resolvedHeaders);\n\treturn getFetch(opts.fetch)(url, {\n\t\tmethod,\n\t\tsignal: opts.signal,\n\t\tbody,\n\t\theaders\n\t});\n}\nasync function httpRequest(opts) {\n\tconst meta = {};\n\tconst res = await fetchHTTPResponse(opts);\n\tmeta.response = res;\n\tconst json = await res.json();\n\tmeta.responseJSON = json;\n\treturn {\n\t\tjson,\n\t\tmeta\n\t};\n}\n\n//#endregion\nexport { fetchHTTPResponse, getBody, getFetch, getUrl, httpRequest, jsonHttpRequester, resolveHTTPLinkOptions };\n//# sourceMappingURL=httpUtils-Dv57hbOd.mjs.map","import { __toESM, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { TRPCClientError } from \"./TRPCClientError-CjKyS10w.mjs\";\nimport { getUrl, httpRequest, jsonHttpRequester, resolveHTTPLinkOptions } from \"./httpUtils-Dv57hbOd.mjs\";\nimport { observable } from \"@trpc/server/observable\";\nimport { transformResult } from \"@trpc/server/unstable-core-do-not-import\";\n\n//#region src/links/internals/contentTypes.ts\nfunction isOctetType(input) {\n\treturn input instanceof Uint8Array || input instanceof Blob;\n}\nfunction isFormData(input) {\n\treturn input instanceof FormData;\n}\nfunction isNonJsonSerializable(input) {\n\treturn isOctetType(input) || isFormData(input);\n}\n\n//#endregion\n//#region src/links/httpLink.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\nconst universalRequester = (opts) => {\n\tif (\"input\" in opts) {\n\t\tconst { input } = opts;\n\t\tif (isFormData(input)) {\n\t\t\tif (opts.type !== \"mutation\" && opts.methodOverride !== \"POST\") throw new Error(\"FormData is only supported for mutations\");\n\t\t\treturn httpRequest((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {\n\t\t\t\tcontentTypeHeader: void 0,\n\t\t\t\tgetUrl,\n\t\t\t\tgetBody: () => input\n\t\t\t}));\n\t\t}\n\t\tif (isOctetType(input)) {\n\t\t\tif (opts.type !== \"mutation\" && opts.methodOverride !== \"POST\") throw new Error(\"Octet type input is only supported for mutations\");\n\t\t\treturn httpRequest((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, {\n\t\t\t\tcontentTypeHeader: \"application/octet-stream\",\n\t\t\t\tgetUrl,\n\t\t\t\tgetBody: () => input\n\t\t\t}));\n\t\t}\n\t}\n\treturn jsonHttpRequester(opts);\n};\n/**\n* @see https://trpc.io/docs/client/links/httpLink\n*/\nfunction httpLink(opts) {\n\tconst resolvedOpts = resolveHTTPLinkOptions(opts);\n\treturn () => {\n\t\treturn (operationOpts) => {\n\t\t\tconst { op } = operationOpts;\n\t\t\treturn observable((observer) => {\n\t\t\t\tconst { path, input, type } = op;\n\t\t\t\t/* istanbul ignore if -- @preserve */\n\t\t\t\tif (type === \"subscription\") throw new Error(\"Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`\");\n\t\t\t\tconst request = universalRequester((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, resolvedOpts), {}, {\n\t\t\t\t\ttype,\n\t\t\t\t\tpath,\n\t\t\t\t\tinput,\n\t\t\t\t\tsignal: op.signal,\n\t\t\t\t\theaders() {\n\t\t\t\t\t\tif (!opts.headers) return {};\n\t\t\t\t\t\tif (typeof opts.headers === \"function\") return opts.headers({ op });\n\t\t\t\t\t\treturn opts.headers;\n\t\t\t\t\t}\n\t\t\t\t}));\n\t\t\t\tlet meta = void 0;\n\t\t\t\trequest.then((res) => {\n\t\t\t\t\tmeta = res.meta;\n\t\t\t\t\tconst transformed = transformResult(res.json, resolvedOpts.transformer.output);\n\t\t\t\t\tif (!transformed.ok) {\n\t\t\t\t\t\tobserver.error(TRPCClientError.from(transformed.error, { meta }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tobserver.next({\n\t\t\t\t\t\tcontext: res.meta,\n\t\t\t\t\t\tresult: transformed.result\n\t\t\t\t\t});\n\t\t\t\t\tobserver.complete();\n\t\t\t\t}).catch((cause) => {\n\t\t\t\t\tobserver.error(TRPCClientError.from(cause, { meta }));\n\t\t\t\t});\n\t\t\t\treturn () => {};\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { httpLink, isFormData, isNonJsonSerializable, isOctetType };\n//# sourceMappingURL=httpLink-DCFpUmZF.mjs.map","import { TRPC_ERROR_CODES_BY_KEY, TRPC_ERROR_CODES_BY_NUMBER, emptyObject, isObject } from \"./codes-DagpWZLc.mjs\";\n\n//#region rolldown:runtime\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 __commonJS = (cb, mod) => function() {\n\treturn mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\tkey = keys[i];\n\t\tif (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\tvalue: mod,\n\tenumerable: true\n}) : target, mod));\n\n//#endregion\n//#region src/unstable-core-do-not-import/createProxy.ts\nconst noop = () => {};\nconst freezeIfAvailable = (obj) => {\n\tif (Object.freeze) Object.freeze(obj);\n};\nfunction createInnerProxy(callback, path, memo) {\n\tvar _memo$cacheKey;\n\tconst cacheKey = path.join(\".\");\n\t(_memo$cacheKey = memo[cacheKey]) !== null && _memo$cacheKey !== void 0 || (memo[cacheKey] = new Proxy(noop, {\n\t\tget(_obj, key) {\n\t\t\tif (typeof key !== \"string\" || key === \"then\") return void 0;\n\t\t\treturn createInnerProxy(callback, [...path, key], memo);\n\t\t},\n\t\tapply(_1, _2, args) {\n\t\t\tconst lastOfPath = path[path.length - 1];\n\t\t\tlet opts = {\n\t\t\t\targs,\n\t\t\t\tpath\n\t\t\t};\n\t\t\tif (lastOfPath === \"call\") opts = {\n\t\t\t\targs: args.length >= 2 ? [args[1]] : [],\n\t\t\t\tpath: path.slice(0, -1)\n\t\t\t};\n\t\t\telse if (lastOfPath === \"apply\") opts = {\n\t\t\t\targs: args.length >= 2 ? args[1] : [],\n\t\t\t\tpath: path.slice(0, -1)\n\t\t\t};\n\t\t\tfreezeIfAvailable(opts.args);\n\t\t\tfreezeIfAvailable(opts.path);\n\t\t\treturn callback(opts);\n\t\t}\n\t}));\n\treturn memo[cacheKey];\n}\n/**\n* Creates a proxy that calls the callback with the path and arguments\n*\n* @internal\n*/\nconst createRecursiveProxy = (callback) => createInnerProxy(callback, [], emptyObject());\n/**\n* Used in place of `new Proxy` where each handler will map 1 level deep to another value.\n*\n* @internal\n*/\nconst createFlatProxy = (callback) => {\n\treturn new Proxy(noop, { get(_obj, name) {\n\t\tif (name === \"then\") return void 0;\n\t\treturn callback(name);\n\t} });\n};\n\n//#endregion\n//#region src/unstable-core-do-not-import/http/getHTTPStatusCode.ts\nconst JSONRPC2_TO_HTTP_CODE = {\n\tPARSE_ERROR: 400,\n\tBAD_REQUEST: 400,\n\tUNAUTHORIZED: 401,\n\tPAYMENT_REQUIRED: 402,\n\tFORBIDDEN: 403,\n\tNOT_FOUND: 404,\n\tMETHOD_NOT_SUPPORTED: 405,\n\tTIMEOUT: 408,\n\tCONFLICT: 409,\n\tPRECONDITION_FAILED: 412,\n\tPAYLOAD_TOO_LARGE: 413,\n\tUNSUPPORTED_MEDIA_TYPE: 415,\n\tUNPROCESSABLE_CONTENT: 422,\n\tPRECONDITION_REQUIRED: 428,\n\tTOO_MANY_REQUESTS: 429,\n\tCLIENT_CLOSED_REQUEST: 499,\n\tINTERNAL_SERVER_ERROR: 500,\n\tNOT_IMPLEMENTED: 501,\n\tBAD_GATEWAY: 502,\n\tSERVICE_UNAVAILABLE: 503,\n\tGATEWAY_TIMEOUT: 504\n};\nconst HTTP_CODE_TO_JSONRPC2 = {\n\t400: \"BAD_REQUEST\",\n\t401: \"UNAUTHORIZED\",\n\t402: \"PAYMENT_REQUIRED\",\n\t403: \"FORBIDDEN\",\n\t404: \"NOT_FOUND\",\n\t405: \"METHOD_NOT_SUPPORTED\",\n\t408: \"TIMEOUT\",\n\t409: \"CONFLICT\",\n\t412: \"PRECONDITION_FAILED\",\n\t413: \"PAYLOAD_TOO_LARGE\",\n\t415: \"UNSUPPORTED_MEDIA_TYPE\",\n\t422: \"UNPROCESSABLE_CONTENT\",\n\t428: \"PRECONDITION_REQUIRED\",\n\t429: \"TOO_MANY_REQUESTS\",\n\t499: \"CLIENT_CLOSED_REQUEST\",\n\t500: \"INTERNAL_SERVER_ERROR\",\n\t501: \"NOT_IMPLEMENTED\",\n\t502: \"BAD_GATEWAY\",\n\t503: \"SERVICE_UNAVAILABLE\",\n\t504: \"GATEWAY_TIMEOUT\"\n};\nfunction getStatusCodeFromKey(code) {\n\tvar _JSONRPC2_TO_HTTP_COD;\n\treturn (_JSONRPC2_TO_HTTP_COD = JSONRPC2_TO_HTTP_CODE[code]) !== null && _JSONRPC2_TO_HTTP_COD !== void 0 ? _JSONRPC2_TO_HTTP_COD : 500;\n}\nfunction getStatusKeyFromCode(code) {\n\tvar _HTTP_CODE_TO_JSONRPC;\n\treturn (_HTTP_CODE_TO_JSONRPC = HTTP_CODE_TO_JSONRPC2[code]) !== null && _HTTP_CODE_TO_JSONRPC !== void 0 ? _HTTP_CODE_TO_JSONRPC : \"INTERNAL_SERVER_ERROR\";\n}\nfunction getHTTPStatusCode(json) {\n\tconst arr = Array.isArray(json) ? json : [json];\n\tconst httpStatuses = new Set(arr.map((res) => {\n\t\tif (\"error\" in res && isObject(res.error.data)) {\n\t\t\tvar _res$error$data;\n\t\t\tif (typeof ((_res$error$data = res.error.data) === null || _res$error$data === void 0 ? void 0 : _res$error$data[\"httpStatus\"]) === \"number\") return res.error.data[\"httpStatus\"];\n\t\t\tconst code = TRPC_ERROR_CODES_BY_NUMBER[res.error.code];\n\t\t\treturn getStatusCodeFromKey(code);\n\t\t}\n\t\treturn 200;\n\t}));\n\tif (httpStatuses.size !== 1) return 207;\n\tconst httpStatus = httpStatuses.values().next().value;\n\treturn httpStatus;\n}\nfunction getHTTPStatusCodeFromError(error) {\n\treturn getStatusCodeFromKey(error.code);\n}\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js\nvar require_typeof = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js\"(exports, module) {\n\tfunction _typeof$2(o) {\n\t\t\"@babel/helpers - typeof\";\n\t\treturn module.exports = _typeof$2 = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(o$1) {\n\t\t\treturn typeof o$1;\n\t\t} : function(o$1) {\n\t\t\treturn o$1 && \"function\" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? \"symbol\" : typeof o$1;\n\t\t}, module.exports.__esModule = true, module.exports[\"default\"] = module.exports, _typeof$2(o);\n\t}\n\tmodule.exports = _typeof$2, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js\nvar require_toPrimitive = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js\"(exports, module) {\n\tvar _typeof$1 = require_typeof()[\"default\"];\n\tfunction toPrimitive$1(t, r) {\n\t\tif (\"object\" != _typeof$1(t) || !t) return t;\n\t\tvar e = t[Symbol.toPrimitive];\n\t\tif (void 0 !== e) {\n\t\t\tvar i = e.call(t, r || \"default\");\n\t\t\tif (\"object\" != _typeof$1(i)) return i;\n\t\t\tthrow new TypeError(\"@@toPrimitive must return a primitive value.\");\n\t\t}\n\t\treturn (\"string\" === r ? String : Number)(t);\n\t}\n\tmodule.exports = toPrimitive$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js\nvar require_toPropertyKey = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js\"(exports, module) {\n\tvar _typeof = require_typeof()[\"default\"];\n\tvar toPrimitive = require_toPrimitive();\n\tfunction toPropertyKey$1(t) {\n\t\tvar i = toPrimitive(t, \"string\");\n\t\treturn \"symbol\" == _typeof(i) ? i : i + \"\";\n\t}\n\tmodule.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js\nvar require_defineProperty = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js\"(exports, module) {\n\tvar toPropertyKey = require_toPropertyKey();\n\tfunction _defineProperty(e, r, t) {\n\t\treturn (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n\t\t\tvalue: t,\n\t\t\tenumerable: !0,\n\t\t\tconfigurable: !0,\n\t\t\twritable: !0\n\t\t}) : e[r] = t, e;\n\t}\n\tmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js\nvar require_objectSpread2 = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js\"(exports, module) {\n\tvar defineProperty = require_defineProperty();\n\tfunction ownKeys(e, r) {\n\t\tvar t = Object.keys(e);\n\t\tif (Object.getOwnPropertySymbols) {\n\t\t\tvar o = Object.getOwnPropertySymbols(e);\n\t\t\tr && (o = o.filter(function(r$1) {\n\t\t\t\treturn Object.getOwnPropertyDescriptor(e, r$1).enumerable;\n\t\t\t})), t.push.apply(t, o);\n\t\t}\n\t\treturn t;\n\t}\n\tfunction _objectSpread2(e) {\n\t\tfor (var r = 1; r < arguments.length; r++) {\n\t\t\tvar t = null != arguments[r] ? arguments[r] : {};\n\t\t\tr % 2 ? ownKeys(Object(t), !0).forEach(function(r$1) {\n\t\t\t\tdefineProperty(e, r$1, t[r$1]);\n\t\t\t}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {\n\t\t\t\tObject.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));\n\t\t\t});\n\t\t}\n\t\treturn e;\n\t}\n\tmodule.exports = _objectSpread2, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region src/unstable-core-do-not-import/error/getErrorShape.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* @internal\n*/\nfunction getErrorShape(opts) {\n\tconst { path, error, config } = opts;\n\tconst { code } = opts.error;\n\tconst shape = {\n\t\tmessage: error.message,\n\t\tcode: TRPC_ERROR_CODES_BY_KEY[code],\n\t\tdata: {\n\t\t\tcode,\n\t\t\thttpStatus: getHTTPStatusCodeFromError(error)\n\t\t}\n\t};\n\tif (config.isDev && typeof opts.error.stack === \"string\") shape.data.stack = opts.error.stack;\n\tif (typeof path === \"string\") shape.data.path = path;\n\treturn config.errorFormatter((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, opts), {}, { shape }));\n}\n\n//#endregion\nexport { HTTP_CODE_TO_JSONRPC2, JSONRPC2_TO_HTTP_CODE, __commonJS, __toESM, createFlatProxy, createRecursiveProxy, getErrorShape, getHTTPStatusCode, getHTTPStatusCodeFromError, getStatusCodeFromKey, getStatusKeyFromCode, require_defineProperty, require_objectSpread2 };\n//# sourceMappingURL=getErrorShape-vC8mUXJD.mjs.map","import { __toESM, createRecursiveProxy, require_defineProperty, require_objectSpread2 } from \"./getErrorShape-vC8mUXJD.mjs\";\nimport { emptyObject, isFunction, isObject, mergeWithoutOverrides } from \"./codes-DagpWZLc.mjs\";\n\n//#region src/unstable-core-do-not-import/error/formatter.ts\nconst defaultFormatter = ({ shape }) => {\n\treturn shape;\n};\n\n//#endregion\n//#region src/unstable-core-do-not-import/error/TRPCError.ts\nvar import_defineProperty = __toESM(require_defineProperty(), 1);\nvar UnknownCauseError = class extends Error {};\nfunction getCauseFromUnknown(cause) {\n\tif (cause instanceof Error) return cause;\n\tconst type = typeof cause;\n\tif (type === \"undefined\" || type === \"function\" || cause === null) return void 0;\n\tif (type !== \"object\") return new Error(String(cause));\n\tif (isObject(cause)) return Object.assign(new UnknownCauseError(), cause);\n\treturn void 0;\n}\nfunction getTRPCErrorFromUnknown(cause) {\n\tif (cause instanceof TRPCError) return cause;\n\tif (cause instanceof Error && cause.name === \"TRPCError\") return cause;\n\tconst trpcError = new TRPCError({\n\t\tcode: \"INTERNAL_SERVER_ERROR\",\n\t\tcause\n\t});\n\tif (cause instanceof Error && cause.stack) trpcError.stack = cause.stack;\n\treturn trpcError;\n}\nvar TRPCError = class extends Error {\n\tconstructor(opts) {\n\t\tvar _ref, _opts$message, _this$cause;\n\t\tconst cause = getCauseFromUnknown(opts.cause);\n\t\tconst message = (_ref = (_opts$message = opts.message) !== null && _opts$message !== void 0 ? _opts$message : cause === null || cause === void 0 ? void 0 : cause.message) !== null && _ref !== void 0 ? _ref : opts.code;\n\t\tsuper(message, { cause });\n\t\t(0, import_defineProperty.default)(this, \"cause\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"code\", void 0);\n\t\tthis.code = opts.code;\n\t\tthis.name = \"TRPCError\";\n\t\t(_this$cause = this.cause) !== null && _this$cause !== void 0 || (this.cause = cause);\n\t}\n};\n\n//#endregion\n//#region src/unstable-core-do-not-import/transformer.ts\nvar import_objectSpread2$1 = __toESM(require_objectSpread2(), 1);\n/**\n* @internal\n*/\nfunction getDataTransformer(transformer) {\n\tif (\"input\" in transformer) return transformer;\n\treturn {\n\t\tinput: transformer,\n\t\toutput: transformer\n\t};\n}\n/**\n* @internal\n*/\nconst defaultTransformer = {\n\tinput: {\n\t\tserialize: (obj) => obj,\n\t\tdeserialize: (obj) => obj\n\t},\n\toutput: {\n\t\tserialize: (obj) => obj,\n\t\tdeserialize: (obj) => obj\n\t}\n};\nfunction transformTRPCResponseItem(config, item) {\n\tif (\"error\" in item) return (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, item), {}, { error: config.transformer.output.serialize(item.error) });\n\tif (\"data\" in item.result) return (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, item), {}, { result: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, item.result), {}, { data: config.transformer.output.serialize(item.result.data) }) });\n\treturn item;\n}\n/**\n* Takes a unserialized `TRPCResponse` and serializes it with the router's transformers\n**/\nfunction transformTRPCResponse(config, itemOrItems) {\n\treturn Array.isArray(itemOrItems) ? itemOrItems.map((item) => transformTRPCResponseItem(config, item)) : transformTRPCResponseItem(config, itemOrItems);\n}\n/** @internal */\nfunction transformResultInner(response, transformer) {\n\tif (\"error\" in response) {\n\t\tconst error = transformer.deserialize(response.error);\n\t\treturn {\n\t\t\tok: false,\n\t\t\terror: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response), {}, { error })\n\t\t};\n\t}\n\tconst result = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response.result), (!response.result.type || response.result.type === \"data\") && {\n\t\ttype: \"data\",\n\t\tdata: transformer.deserialize(response.result.data)\n\t});\n\treturn {\n\t\tok: true,\n\t\tresult\n\t};\n}\nvar TransformResultError = class extends Error {\n\tconstructor() {\n\t\tsuper(\"Unable to transform response from server\");\n\t}\n};\n/**\n* Transforms and validates that the result is a valid TRPCResponse\n* @internal\n*/\nfunction transformResult(response, transformer) {\n\tlet result;\n\ttry {\n\t\tresult = transformResultInner(response, transformer);\n\t} catch (_unused) {\n\t\tthrow new TransformResultError();\n\t}\n\tif (!result.ok && (!isObject(result.error.error) || typeof result.error.error[\"code\"] !== \"number\")) throw new TransformResultError();\n\tif (result.ok && !isObject(result.result)) throw new TransformResultError();\n\treturn result;\n}\n\n//#endregion\n//#region src/unstable-core-do-not-import/router.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* @internal\n*/\nconst lazyMarker = \"lazyMarker\";\nfunction once(fn) {\n\tconst uncalled = Symbol();\n\tlet result = uncalled;\n\treturn () => {\n\t\tif (result === uncalled) result = fn();\n\t\treturn result;\n\t};\n}\n/**\n* Lazy load a router\n* @see https://trpc.io/docs/server/merging-routers#lazy-load\n*/\nfunction lazy(importRouter) {\n\tasync function resolve() {\n\t\tconst mod = await importRouter();\n\t\tif (isRouter(mod)) return mod;\n\t\tconst routers = Object.values(mod);\n\t\tif (routers.length !== 1 || !isRouter(routers[0])) throw new Error(\"Invalid router module - either define exactly 1 export or return the router directly.\\nExample: `lazy(() => import('./slow.js').then((m) => m.slowRouter))`\");\n\t\treturn routers[0];\n\t}\n\tresolve[lazyMarker] = true;\n\treturn resolve;\n}\nfunction isLazy(input) {\n\treturn typeof input === \"function\" && lazyMarker in input;\n}\nfunction isRouter(value) {\n\treturn isObject(value) && isObject(value[\"_def\"]) && \"router\" in value[\"_def\"];\n}\nconst emptyRouter = {\n\t_ctx: null,\n\t_errorShape: null,\n\t_meta: null,\n\tqueries: {},\n\tmutations: {},\n\tsubscriptions: {},\n\terrorFormatter: defaultFormatter,\n\ttransformer: defaultTransformer\n};\n/**\n* Reserved words that can't be used as router or procedure names\n*/\nconst reservedWords = [\n\t\"then\",\n\t\"call\",\n\t\"apply\"\n];\n/**\n* @internal\n*/\nfunction createRouterFactory(config) {\n\tfunction createRouterInner(input) {\n\t\tconst reservedWordsUsed = new Set(Object.keys(input).filter((v) => reservedWords.includes(v)));\n\t\tif (reservedWordsUsed.size > 0) throw new Error(\"Reserved words used in `router({})` call: \" + Array.from(reservedWordsUsed).join(\", \"));\n\t\tconst procedures = emptyObject();\n\t\tconst lazy$1 = emptyObject();\n\t\tfunction createLazyLoader(opts) {\n\t\t\treturn {\n\t\t\t\tref: opts.ref,\n\t\t\t\tload: once(async () => {\n\t\t\t\t\tconst router$1 = await opts.ref();\n\t\t\t\t\tconst lazyPath = [...opts.path, opts.key];\n\t\t\t\t\tconst lazyKey = lazyPath.join(\".\");\n\t\t\t\t\topts.aggregate[opts.key] = step(router$1._def.record, lazyPath);\n\t\t\t\t\tdelete lazy$1[lazyKey];\n\t\t\t\t\tfor (const [nestedKey, nestedItem] of Object.entries(router$1._def.lazy)) {\n\t\t\t\t\t\tconst nestedRouterKey = [...lazyPath, nestedKey].join(\".\");\n\t\t\t\t\t\tlazy$1[nestedRouterKey] = createLazyLoader({\n\t\t\t\t\t\t\tref: nestedItem.ref,\n\t\t\t\t\t\t\tpath: lazyPath,\n\t\t\t\t\t\t\tkey: nestedKey,\n\t\t\t\t\t\t\taggregate: opts.aggregate[opts.key]\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t};\n\t\t}\n\t\tfunction step(from, path = []) {\n\t\t\tconst aggregate = emptyObject();\n\t\t\tfor (const [key, item] of Object.entries(from !== null && from !== void 0 ? from : {})) {\n\t\t\t\tif (isLazy(item)) {\n\t\t\t\t\tlazy$1[[...path, key].join(\".\")] = createLazyLoader({\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tref: item,\n\t\t\t\t\t\tkey,\n\t\t\t\t\t\taggregate\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (isRouter(item)) {\n\t\t\t\t\taggregate[key] = step(item._def.record, [...path, key]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (!isProcedure(item)) {\n\t\t\t\t\taggregate[key] = step(item, [...path, key]);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst newPath = [...path, key].join(\".\");\n\t\t\t\tif (procedures[newPath]) throw new Error(`Duplicate key: ${newPath}`);\n\t\t\t\tprocedures[newPath] = item;\n\t\t\t\taggregate[key] = item;\n\t\t\t}\n\t\t\treturn aggregate;\n\t\t}\n\t\tconst record = step(input);\n\t\tconst _def = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({\n\t\t\t_config: config,\n\t\t\trouter: true,\n\t\t\tprocedures,\n\t\t\tlazy: lazy$1\n\t\t}, emptyRouter), {}, { record });\n\t\tconst router = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, record), {}, {\n\t\t\t_def,\n\t\t\tcreateCaller: createCallerFactory()({ _def })\n\t\t});\n\t\treturn router;\n\t}\n\treturn createRouterInner;\n}\nfunction isProcedure(procedureOrRouter) {\n\treturn typeof procedureOrRouter === \"function\";\n}\n/**\n* @internal\n*/\nasync function getProcedureAtPath(router, path) {\n\tconst { _def } = router;\n\tlet procedure = _def.procedures[path];\n\twhile (!procedure) {\n\t\tconst key = Object.keys(_def.lazy).find((key$1) => path.startsWith(key$1));\n\t\tif (!key) return null;\n\t\tconst lazyRouter = _def.lazy[key];\n\t\tawait lazyRouter.load();\n\t\tprocedure = _def.procedures[path];\n\t}\n\treturn procedure;\n}\n/**\n* @internal\n*/\nasync function callProcedure(opts) {\n\tconst { type, path } = opts;\n\tconst proc = await getProcedureAtPath(opts.router, path);\n\tif (!proc || !isProcedure(proc) || proc._def.type !== type && !opts.allowMethodOverride) throw new TRPCError({\n\t\tcode: \"NOT_FOUND\",\n\t\tmessage: `No \"${type}\"-procedure on path \"${path}\"`\n\t});\n\t/* istanbul ignore if -- @preserve */\n\tif (proc._def.type !== type && opts.allowMethodOverride && proc._def.type === \"subscription\") throw new TRPCError({\n\t\tcode: \"METHOD_NOT_SUPPORTED\",\n\t\tmessage: `Method override is not supported for subscriptions`\n\t});\n\treturn proc(opts);\n}\nfunction createCallerFactory() {\n\treturn function createCallerInner(router) {\n\t\tconst { _def } = router;\n\t\treturn function createCaller(ctxOrCallback, opts) {\n\t\t\treturn createRecursiveProxy(async (innerOpts) => {\n\t\t\t\tconst { path, args } = innerOpts;\n\t\t\t\tconst fullPath = path.join(\".\");\n\t\t\t\tif (path.length === 1 && path[0] === \"_def\") return _def;\n\t\t\t\tconst procedure = await getProcedureAtPath(router, fullPath);\n\t\t\t\tlet ctx = void 0;\n\t\t\t\ttry {\n\t\t\t\t\tif (!procedure) throw new TRPCError({\n\t\t\t\t\t\tcode: \"NOT_FOUND\",\n\t\t\t\t\t\tmessage: `No procedure found on path \"${path}\"`\n\t\t\t\t\t});\n\t\t\t\t\tctx = isFunction(ctxOrCallback) ? await Promise.resolve(ctxOrCallback()) : ctxOrCallback;\n\t\t\t\t\treturn await procedure({\n\t\t\t\t\t\tpath: fullPath,\n\t\t\t\t\t\tgetRawInput: async () => args[0],\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\ttype: procedure._def.type,\n\t\t\t\t\t\tsignal: opts === null || opts === void 0 ? void 0 : opts.signal\n\t\t\t\t\t});\n\t\t\t\t} catch (cause) {\n\t\t\t\t\tvar _opts$onError, _procedure$_def$type;\n\t\t\t\t\topts === null || opts === void 0 || (_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, {\n\t\t\t\t\t\tctx,\n\t\t\t\t\t\terror: getTRPCErrorFromUnknown(cause),\n\t\t\t\t\t\tinput: args[0],\n\t\t\t\t\t\tpath: fullPath,\n\t\t\t\t\t\ttype: (_procedure$_def$type = procedure === null || procedure === void 0 ? void 0 : procedure._def.type) !== null && _procedure$_def$type !== void 0 ? _procedure$_def$type : \"unknown\"\n\t\t\t\t\t});\n\t\t\t\t\tthrow cause;\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\t};\n}\nfunction mergeRouters(...routerList) {\n\tvar _routerList$, _routerList$2;\n\tconst record = mergeWithoutOverrides({}, ...routerList.map((r) => r._def.record));\n\tconst errorFormatter = routerList.reduce((currentErrorFormatter, nextRouter) => {\n\t\tif (nextRouter._def._config.errorFormatter && nextRouter._def._config.errorFormatter !== defaultFormatter) {\n\t\t\tif (currentErrorFormatter !== defaultFormatter && currentErrorFormatter !== nextRouter._def._config.errorFormatter) throw new Error(\"You seem to have several error formatters\");\n\t\t\treturn nextRouter._def._config.errorFormatter;\n\t\t}\n\t\treturn currentErrorFormatter;\n\t}, defaultFormatter);\n\tconst transformer = routerList.reduce((prev, current) => {\n\t\tif (current._def._config.transformer && current._def._config.transformer !== defaultTransformer) {\n\t\t\tif (prev !== defaultTransformer && prev !== current._def._config.transformer) throw new Error(\"You seem to have several transformers\");\n\t\t\treturn current._def._config.transformer;\n\t\t}\n\t\treturn prev;\n\t}, defaultTransformer);\n\tconst router = createRouterFactory({\n\t\terrorFormatter,\n\t\ttransformer,\n\t\tisDev: routerList.every((r) => r._def._config.isDev),\n\t\tallowOutsideOfServer: routerList.every((r) => r._def._config.allowOutsideOfServer),\n\t\tisServer: routerList.every((r) => r._def._config.isServer),\n\t\t$types: (_routerList$ = routerList[0]) === null || _routerList$ === void 0 ? void 0 : _routerList$._def._config.$types,\n\t\tsse: (_routerList$2 = routerList[0]) === null || _routerList$2 === void 0 ? void 0 : _routerList$2._def._config.sse\n\t})(record);\n\treturn router;\n}\n\n//#endregion\n//#region src/unstable-core-do-not-import/stream/tracked.ts\nconst trackedSymbol = Symbol();\n/**\n* Produce a typed server-sent event message\n* @deprecated use `tracked(id, data)` instead\n*/\nfunction sse(event) {\n\treturn tracked(event.id, event.data);\n}\nfunction isTrackedEnvelope(value) {\n\treturn Array.isArray(value) && value[2] === trackedSymbol;\n}\n/**\n* Automatically track an event so that it can be resumed from a given id if the connection is lost\n*/\nfunction tracked(id, data) {\n\tif (id === \"\") throw new Error(\"`id` must not be an empty string as empty string is the same as not setting the id at all\");\n\treturn [\n\t\tid,\n\t\tdata,\n\t\ttrackedSymbol\n\t];\n}\n\n//#endregion\nexport { TRPCError, callProcedure, createCallerFactory, createRouterFactory, defaultFormatter, defaultTransformer, getCauseFromUnknown, getDataTransformer, getProcedureAtPath, getTRPCErrorFromUnknown, isTrackedEnvelope, lazy, mergeRouters, sse, tracked, transformResult, transformTRPCResponse };\n//# sourceMappingURL=tracked-D4V22yc5.mjs.map","import { __toESM, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { TRPCClientError } from \"./TRPCClientError-CjKyS10w.mjs\";\nimport { getUrl, jsonHttpRequester, resolveHTTPLinkOptions } from \"./httpUtils-Dv57hbOd.mjs\";\nimport { observable } from \"@trpc/server/observable\";\nimport { transformResult } from \"@trpc/server/unstable-core-do-not-import\";\n\n//#region src/internals/dataLoader.ts\n/**\n* A function that should never be called unless we messed something up.\n*/\nconst throwFatalError = () => {\n\tthrow new Error(\"Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new\");\n};\n/**\n* Dataloader that's very inspired by https://github.com/graphql/dataloader\n* Less configuration, no caching, and allows you to cancel requests\n* When cancelling a single fetch the whole batch will be cancelled only when _all_ items are cancelled\n*/\nfunction dataLoader(batchLoader) {\n\tlet pendingItems = null;\n\tlet dispatchTimer = null;\n\tconst destroyTimerAndPendingItems = () => {\n\t\tclearTimeout(dispatchTimer);\n\t\tdispatchTimer = null;\n\t\tpendingItems = null;\n\t};\n\t/**\n\t* Iterate through the items and split them into groups based on the `batchLoader`'s validate function\n\t*/\n\tfunction groupItems(items) {\n\t\tconst groupedItems = [[]];\n\t\tlet index = 0;\n\t\twhile (true) {\n\t\t\tconst item = items[index];\n\t\t\tif (!item) break;\n\t\t\tconst lastGroup = groupedItems[groupedItems.length - 1];\n\t\t\tif (item.aborted) {\n\t\t\t\tvar _item$reject;\n\t\t\t\t(_item$reject = item.reject) === null || _item$reject === void 0 || _item$reject.call(item, new Error(\"Aborted\"));\n\t\t\t\tindex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst isValid = batchLoader.validate(lastGroup.concat(item).map((it) => it.key));\n\t\t\tif (isValid) {\n\t\t\t\tlastGroup.push(item);\n\t\t\t\tindex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (lastGroup.length === 0) {\n\t\t\t\tvar _item$reject2;\n\t\t\t\t(_item$reject2 = item.reject) === null || _item$reject2 === void 0 || _item$reject2.call(item, new Error(\"Input is too big for a single dispatch\"));\n\t\t\t\tindex++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tgroupedItems.push([]);\n\t\t}\n\t\treturn groupedItems;\n\t}\n\tfunction dispatch() {\n\t\tconst groupedItems = groupItems(pendingItems);\n\t\tdestroyTimerAndPendingItems();\n\t\tfor (const items of groupedItems) {\n\t\t\tif (!items.length) continue;\n\t\t\tconst batch = { items };\n\t\t\tfor (const item of items) item.batch = batch;\n\t\t\tconst promise = batchLoader.fetch(batch.items.map((_item) => _item.key));\n\t\t\tpromise.then(async (result) => {\n\t\t\t\tawait Promise.all(result.map(async (valueOrPromise, index) => {\n\t\t\t\t\tconst item = batch.items[index];\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar _item$resolve;\n\t\t\t\t\t\tconst value = await Promise.resolve(valueOrPromise);\n\t\t\t\t\t\t(_item$resolve = item.resolve) === null || _item$resolve === void 0 || _item$resolve.call(item, value);\n\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\tvar _item$reject3;\n\t\t\t\t\t\t(_item$reject3 = item.reject) === null || _item$reject3 === void 0 || _item$reject3.call(item, cause);\n\t\t\t\t\t}\n\t\t\t\t\titem.batch = null;\n\t\t\t\t\titem.reject = null;\n\t\t\t\t\titem.resolve = null;\n\t\t\t\t}));\n\t\t\t\tfor (const item of batch.items) {\n\t\t\t\t\tvar _item$reject4;\n\t\t\t\t\t(_item$reject4 = item.reject) === null || _item$reject4 === void 0 || _item$reject4.call(item, new Error(\"Missing result\"));\n\t\t\t\t\titem.batch = null;\n\t\t\t\t}\n\t\t\t}).catch((cause) => {\n\t\t\t\tfor (const item of batch.items) {\n\t\t\t\t\tvar _item$reject5;\n\t\t\t\t\t(_item$reject5 = item.reject) === null || _item$reject5 === void 0 || _item$reject5.call(item, cause);\n\t\t\t\t\titem.batch = null;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tfunction load(key) {\n\t\tvar _dispatchTimer;\n\t\tconst item = {\n\t\t\taborted: false,\n\t\t\tkey,\n\t\t\tbatch: null,\n\t\t\tresolve: throwFatalError,\n\t\t\treject: throwFatalError\n\t\t};\n\t\tconst promise = new Promise((resolve, reject) => {\n\t\t\tvar _pendingItems;\n\t\t\titem.reject = reject;\n\t\t\titem.resolve = resolve;\n\t\t\t(_pendingItems = pendingItems) !== null && _pendingItems !== void 0 || (pendingItems = []);\n\t\t\tpendingItems.push(item);\n\t\t});\n\t\t(_dispatchTimer = dispatchTimer) !== null && _dispatchTimer !== void 0 || (dispatchTimer = setTimeout(dispatch));\n\t\treturn promise;\n\t}\n\treturn { load };\n}\n\n//#endregion\n//#region src/internals/signals.ts\n/**\n* Like `Promise.all()` but for abort signals\n* - When all signals have been aborted, the merged signal will be aborted\n* - If one signal is `null`, no signal will be aborted\n*/\nfunction allAbortSignals(...signals) {\n\tconst ac = new AbortController();\n\tconst count = signals.length;\n\tlet abortedCount = 0;\n\tconst onAbort = () => {\n\t\tif (++abortedCount === count) ac.abort();\n\t};\n\tfor (const signal of signals) if (signal === null || signal === void 0 ? void 0 : signal.aborted) onAbort();\n\telse signal === null || signal === void 0 || signal.addEventListener(\"abort\", onAbort, { once: true });\n\treturn ac.signal;\n}\n/**\n* Like `Promise.race` but for abort signals\n*\n* Basically, a ponyfill for\n* [`AbortSignal.any`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal/any_static).\n*/\nfunction raceAbortSignals(...signals) {\n\tconst ac = new AbortController();\n\tfor (const signal of signals) if (signal === null || signal === void 0 ? void 0 : signal.aborted) ac.abort();\n\telse signal === null || signal === void 0 || signal.addEventListener(\"abort\", () => ac.abort(), { once: true });\n\treturn ac.signal;\n}\nfunction abortSignalToPromise(signal) {\n\treturn new Promise((_, reject) => {\n\t\tif (signal.aborted) {\n\t\t\treject(signal.reason);\n\t\t\treturn;\n\t\t}\n\t\tsignal.addEventListener(\"abort\", () => {\n\t\t\treject(signal.reason);\n\t\t}, { once: true });\n\t});\n}\n\n//#endregion\n//#region src/links/httpBatchLink.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* @see https://trpc.io/docs/client/links/httpBatchLink\n*/\nfunction httpBatchLink(opts) {\n\tvar _opts$maxURLLength, _opts$maxItems;\n\tconst resolvedOpts = resolveHTTPLinkOptions(opts);\n\tconst maxURLLength = (_opts$maxURLLength = opts.maxURLLength) !== null && _opts$maxURLLength !== void 0 ? _opts$maxURLLength : Infinity;\n\tconst maxItems = (_opts$maxItems = opts.maxItems) !== null && _opts$maxItems !== void 0 ? _opts$maxItems : Infinity;\n\treturn () => {\n\t\tconst batchLoader = (type) => {\n\t\t\treturn {\n\t\t\t\tvalidate(batchOps) {\n\t\t\t\t\tif (maxURLLength === Infinity && maxItems === Infinity) return true;\n\t\t\t\t\tif (batchOps.length > maxItems) return false;\n\t\t\t\t\tconst path = batchOps.map((op) => op.path).join(\",\");\n\t\t\t\t\tconst inputs = batchOps.map((op) => op.input);\n\t\t\t\t\tconst url = getUrl((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, resolvedOpts), {}, {\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tinputs,\n\t\t\t\t\t\tsignal: null\n\t\t\t\t\t}));\n\t\t\t\t\treturn url.length <= maxURLLength;\n\t\t\t\t},\n\t\t\t\tasync fetch(batchOps) {\n\t\t\t\t\tconst path = batchOps.map((op) => op.path).join(\",\");\n\t\t\t\t\tconst inputs = batchOps.map((op) => op.input);\n\t\t\t\t\tconst signal = allAbortSignals(...batchOps.map((op) => op.signal));\n\t\t\t\t\tconst res = await jsonHttpRequester((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, resolvedOpts), {}, {\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tinputs,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\theaders() {\n\t\t\t\t\t\t\tif (!opts.headers) return {};\n\t\t\t\t\t\t\tif (typeof opts.headers === \"function\") return opts.headers({ opList: batchOps });\n\t\t\t\t\t\t\treturn opts.headers;\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsignal\n\t\t\t\t\t}));\n\t\t\t\t\tconst resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json);\n\t\t\t\t\tconst result = resJSON.map((item) => ({\n\t\t\t\t\t\tmeta: res.meta,\n\t\t\t\t\t\tjson: item\n\t\t\t\t\t}));\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\tconst query = dataLoader(batchLoader(\"query\"));\n\t\tconst mutation = dataLoader(batchLoader(\"mutation\"));\n\t\tconst loaders = {\n\t\t\tquery,\n\t\t\tmutation\n\t\t};\n\t\treturn ({ op }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\t/* istanbul ignore if -- @preserve */\n\t\t\t\tif (op.type === \"subscription\") throw new Error(\"Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`\");\n\t\t\t\tconst loader = loaders[op.type];\n\t\t\t\tconst promise = loader.load(op);\n\t\t\t\tlet _res = void 0;\n\t\t\t\tpromise.then((res) => {\n\t\t\t\t\t_res = res;\n\t\t\t\t\tconst transformed = transformResult(res.json, resolvedOpts.transformer.output);\n\t\t\t\t\tif (!transformed.ok) {\n\t\t\t\t\t\tobserver.error(TRPCClientError.from(transformed.error, { meta: res.meta }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tobserver.next({\n\t\t\t\t\t\tcontext: res.meta,\n\t\t\t\t\t\tresult: transformed.result\n\t\t\t\t\t});\n\t\t\t\t\tobserver.complete();\n\t\t\t\t}).catch((err) => {\n\t\t\t\t\tobserver.error(TRPCClientError.from(err, { meta: _res === null || _res === void 0 ? void 0 : _res.meta }));\n\t\t\t\t});\n\t\t\t\treturn () => {};\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { abortSignalToPromise, allAbortSignals, dataLoader, httpBatchLink, raceAbortSignals };\n//# sourceMappingURL=httpBatchLink-BOe5aCcR.mjs.map","import { observable } from \"./observable-UMO3vUa_.mjs\";\n\n//#region src/observable/operators.ts\nfunction map(project) {\n\treturn (source) => {\n\t\treturn observable((destination) => {\n\t\t\tlet index = 0;\n\t\t\tconst subscription = source.subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tdestination.next(project(value, index++));\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tdestination.error(error);\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tdestination.complete();\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn subscription;\n\t\t});\n\t};\n}\nfunction share(_opts) {\n\treturn (source) => {\n\t\tlet refCount = 0;\n\t\tlet subscription = null;\n\t\tconst observers = [];\n\t\tfunction startIfNeeded() {\n\t\t\tif (subscription) return;\n\t\t\tsubscription = source.subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tfor (const observer of observers) {\n\t\t\t\t\t\tvar _observer$next;\n\t\t\t\t\t\t(_observer$next = observer.next) === null || _observer$next === void 0 || _observer$next.call(observer, value);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tfor (const observer of observers) {\n\t\t\t\t\t\tvar _observer$error;\n\t\t\t\t\t\t(_observer$error = observer.error) === null || _observer$error === void 0 || _observer$error.call(observer, error);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tfor (const observer of observers) {\n\t\t\t\t\t\tvar _observer$complete;\n\t\t\t\t\t\t(_observer$complete = observer.complete) === null || _observer$complete === void 0 || _observer$complete.call(observer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tfunction resetIfNeeded() {\n\t\t\tif (refCount === 0 && subscription) {\n\t\t\t\tconst _sub = subscription;\n\t\t\t\tsubscription = null;\n\t\t\t\t_sub.unsubscribe();\n\t\t\t}\n\t\t}\n\t\treturn observable((subscriber) => {\n\t\t\trefCount++;\n\t\t\tobservers.push(subscriber);\n\t\t\tstartIfNeeded();\n\t\t\treturn { unsubscribe() {\n\t\t\t\trefCount--;\n\t\t\t\tresetIfNeeded();\n\t\t\t\tconst index = observers.findIndex((v) => v === subscriber);\n\t\t\t\tif (index > -1) observers.splice(index, 1);\n\t\t\t} };\n\t\t});\n\t};\n}\nfunction tap(observer) {\n\treturn (source) => {\n\t\treturn observable((destination) => {\n\t\t\treturn source.subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tvar _observer$next2;\n\t\t\t\t\t(_observer$next2 = observer.next) === null || _observer$next2 === void 0 || _observer$next2.call(observer, value);\n\t\t\t\t\tdestination.next(value);\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tvar _observer$error2;\n\t\t\t\t\t(_observer$error2 = observer.error) === null || _observer$error2 === void 0 || _observer$error2.call(observer, error);\n\t\t\t\t\tdestination.error(error);\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tvar _observer$complete2;\n\t\t\t\t\t(_observer$complete2 = observer.complete) === null || _observer$complete2 === void 0 || _observer$complete2.call(observer);\n\t\t\t\t\tdestination.complete();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n}\nconst distinctUnsetMarker = Symbol();\nfunction distinctUntilChanged(compare = (a, b) => a === b) {\n\treturn (source) => {\n\t\treturn observable((destination) => {\n\t\t\tlet lastValue = distinctUnsetMarker;\n\t\t\treturn source.subscribe({\n\t\t\t\tnext(value) {\n\t\t\t\t\tif (lastValue !== distinctUnsetMarker && compare(lastValue, value)) return;\n\t\t\t\t\tlastValue = value;\n\t\t\t\t\tdestination.next(value);\n\t\t\t\t},\n\t\t\t\terror(error) {\n\t\t\t\t\tdestination.error(error);\n\t\t\t\t},\n\t\t\t\tcomplete() {\n\t\t\t\t\tdestination.complete();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t};\n}\nconst isDeepEqual = (a, b) => {\n\tif (a === b) return true;\n\tconst bothAreObjects = a && b && typeof a === \"object\" && typeof b === \"object\";\n\treturn !!bothAreObjects && Object.keys(a).length === Object.keys(b).length && Object.entries(a).every(([k, v]) => isDeepEqual(v, b[k]));\n};\nfunction distinctUntilDeepChanged() {\n\treturn distinctUntilChanged(isDeepEqual);\n}\n\n//#endregion\n//#region src/observable/behaviorSubject.ts\n/**\n* @internal\n* An observable that maintains and provides a \"current value\" to subscribers\n* @see https://www.learnrxjs.io/learn-rxjs/subjects/behaviorsubject\n*/\nfunction behaviorSubject(initialValue) {\n\tlet value = initialValue;\n\tconst observerList = [];\n\tconst addObserver = (observer) => {\n\t\tif (value !== void 0) observer.next(value);\n\t\tobserverList.push(observer);\n\t};\n\tconst removeObserver = (observer) => {\n\t\tobserverList.splice(observerList.indexOf(observer), 1);\n\t};\n\tconst obs = observable((observer) => {\n\t\taddObserver(observer);\n\t\treturn () => {\n\t\t\tremoveObserver(observer);\n\t\t};\n\t});\n\tobs.next = (nextValue) => {\n\t\tif (value === nextValue) return;\n\t\tvalue = nextValue;\n\t\tfor (const observer of observerList) observer.next(nextValue);\n\t};\n\tobs.get = () => value;\n\treturn obs;\n}\n\n//#endregion\nexport { behaviorSubject, distinctUntilChanged, distinctUntilDeepChanged, map, share, tap };\n//# sourceMappingURL=observable-CUiPknO-.mjs.map","import { __toESM, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { observable, tap } from \"@trpc/server/observable\";\n\n//#region src/links/loggerLink.ts\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\nfunction isFormData(value) {\n\tif (typeof FormData === \"undefined\") return false;\n\treturn value instanceof FormData;\n}\nconst palettes = {\n\tcss: {\n\t\tquery: [\"72e3ff\", \"3fb0d8\"],\n\t\tmutation: [\"c5a3fc\", \"904dfc\"],\n\t\tsubscription: [\"ff49e1\", \"d83fbe\"]\n\t},\n\tansi: {\n\t\tregular: {\n\t\t\tquery: [\"\\x1B[30;46m\", \"\\x1B[97;46m\"],\n\t\t\tmutation: [\"\\x1B[30;45m\", \"\\x1B[97;45m\"],\n\t\t\tsubscription: [\"\\x1B[30;42m\", \"\\x1B[97;42m\"]\n\t\t},\n\t\tbold: {\n\t\t\tquery: [\"\\x1B[1;30;46m\", \"\\x1B[1;97;46m\"],\n\t\t\tmutation: [\"\\x1B[1;30;45m\", \"\\x1B[1;97;45m\"],\n\t\t\tsubscription: [\"\\x1B[1;30;42m\", \"\\x1B[1;97;42m\"]\n\t\t}\n\t}\n};\nfunction constructPartsAndArgs(opts) {\n\tconst { direction, type, withContext, path, id, input } = opts;\n\tconst parts = [];\n\tconst args = [];\n\tif (opts.colorMode === \"none\") parts.push(direction === \"up\" ? \">>\" : \"<<\", type, `#${id}`, path);\n\telse if (opts.colorMode === \"ansi\") {\n\t\tconst [lightRegular, darkRegular] = palettes.ansi.regular[type];\n\t\tconst [lightBold, darkBold] = palettes.ansi.bold[type];\n\t\tconst reset = \"\\x1B[0m\";\n\t\tparts.push(direction === \"up\" ? lightRegular : darkRegular, direction === \"up\" ? \">>\" : \"<<\", type, direction === \"up\" ? lightBold : darkBold, `#${id}`, path, reset);\n\t} else {\n\t\tconst [light, dark] = palettes.css[type];\n\t\tconst css = `\n background-color: #${direction === \"up\" ? light : dark};\n color: ${direction === \"up\" ? \"black\" : \"white\"};\n padding: 2px;\n `;\n\t\tparts.push(\"%c\", direction === \"up\" ? \">>\" : \"<<\", type, `#${id}`, `%c${path}%c`, \"%O\");\n\t\targs.push(css, `${css}; font-weight: bold;`, `${css}; font-weight: normal;`);\n\t}\n\tif (direction === \"up\") args.push(withContext ? {\n\t\tinput,\n\t\tcontext: opts.context\n\t} : { input });\n\telse args.push((0, import_objectSpread2.default)({\n\t\tinput,\n\t\tresult: opts.result,\n\t\telapsedMs: opts.elapsedMs\n\t}, withContext && { context: opts.context }));\n\treturn {\n\t\tparts,\n\t\targs\n\t};\n}\nconst defaultLogger = ({ c = console, colorMode = \"css\", withContext }) => (props) => {\n\tconst rawInput = props.input;\n\tconst input = isFormData(rawInput) ? Object.fromEntries(rawInput) : rawInput;\n\tconst { parts, args } = constructPartsAndArgs((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, props), {}, {\n\t\tcolorMode,\n\t\tinput,\n\t\twithContext\n\t}));\n\tconst fn = props.direction === \"down\" && props.result && (props.result instanceof Error || \"error\" in props.result.result && props.result.result.error) ? \"error\" : \"log\";\n\tc[fn].apply(null, [parts.join(\" \")].concat(args));\n};\n/**\n* @see https://trpc.io/docs/v11/client/links/loggerLink\n*/\nfunction loggerLink(opts = {}) {\n\tvar _opts$colorMode, _opts$withContext;\n\tconst { enabled = () => true } = opts;\n\tconst colorMode = (_opts$colorMode = opts.colorMode) !== null && _opts$colorMode !== void 0 ? _opts$colorMode : typeof window === \"undefined\" ? \"ansi\" : \"css\";\n\tconst withContext = (_opts$withContext = opts.withContext) !== null && _opts$withContext !== void 0 ? _opts$withContext : colorMode === \"css\";\n\tconst { logger = defaultLogger({\n\t\tc: opts.console,\n\t\tcolorMode,\n\t\twithContext\n\t}) } = opts;\n\treturn () => {\n\t\treturn ({ op, next }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tif (enabled((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, op), {}, { direction: \"up\" }))) logger((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, op), {}, { direction: \"up\" }));\n\t\t\t\tconst requestStartTime = Date.now();\n\t\t\t\tfunction logResult(result) {\n\t\t\t\t\tconst elapsedMs = Date.now() - requestStartTime;\n\t\t\t\t\tif (enabled((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, op), {}, {\n\t\t\t\t\t\tdirection: \"down\",\n\t\t\t\t\t\tresult\n\t\t\t\t\t}))) logger((0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, op), {}, {\n\t\t\t\t\t\tdirection: \"down\",\n\t\t\t\t\t\telapsedMs,\n\t\t\t\t\t\tresult\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t\treturn next(op).pipe(tap({\n\t\t\t\t\tnext(result) {\n\t\t\t\t\t\tlogResult(result);\n\t\t\t\t\t},\n\t\t\t\t\terror(result) {\n\t\t\t\t\t\tlogResult(result);\n\t\t\t\t\t}\n\t\t\t\t})).subscribe(observer);\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { loggerLink };\n//# sourceMappingURL=loggerLink-ineCN1PO.mjs.map","import { __toESM, require_defineProperty, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { TRPCClientError } from \"./TRPCClientError-CjKyS10w.mjs\";\nimport { getTransformer } from \"./unstable-internals-Bg7n9BBj.mjs\";\nimport { behaviorSubject, observable } from \"@trpc/server/observable\";\nimport { run, sleep, transformResult } from \"@trpc/server/unstable-core-do-not-import\";\n\n//#region src/links/wsLink/wsClient/options.ts\nconst lazyDefaults = {\n\tenabled: false,\n\tcloseMs: 0\n};\nconst keepAliveDefaults = {\n\tenabled: false,\n\tpongTimeoutMs: 1e3,\n\tintervalMs: 5e3\n};\n/**\n* Calculates a delay for exponential backoff based on the retry attempt index.\n* The delay starts at 0 for the first attempt and doubles for each subsequent attempt,\n* capped at 30 seconds.\n*/\nconst exponentialBackoff = (attemptIndex) => {\n\treturn attemptIndex === 0 ? 0 : Math.min(1e3 * 2 ** attemptIndex, 3e4);\n};\n\n//#endregion\n//#region src/links/internals/urlWithConnectionParams.ts\n/**\n* Get the result of a value or function that returns a value\n* It also optionally accepts typesafe arguments for the function\n*/\nconst resultOf = (value, ...args) => {\n\treturn typeof value === \"function\" ? value(...args) : value;\n};\n\n//#endregion\n//#region src/links/wsLink/wsClient/utils.ts\nvar import_defineProperty$3 = __toESM(require_defineProperty(), 1);\nvar TRPCWebSocketClosedError = class TRPCWebSocketClosedError extends Error {\n\tconstructor(opts) {\n\t\tsuper(opts.message, { cause: opts.cause });\n\t\tthis.name = \"TRPCWebSocketClosedError\";\n\t\tObject.setPrototypeOf(this, TRPCWebSocketClosedError.prototype);\n\t}\n};\n/**\n* Utility class for managing a timeout that can be started, stopped, and reset.\n* Useful for scenarios where the timeout duration is reset dynamically based on events.\n*/\nvar ResettableTimeout = class {\n\tconstructor(onTimeout, timeoutMs) {\n\t\tthis.onTimeout = onTimeout;\n\t\tthis.timeoutMs = timeoutMs;\n\t\t(0, import_defineProperty$3.default)(this, \"timeout\", void 0);\n\t}\n\t/**\n\t* Resets the current timeout, restarting it with the same duration.\n\t* Does nothing if no timeout is active.\n\t*/\n\treset() {\n\t\tif (!this.timeout) return;\n\t\tclearTimeout(this.timeout);\n\t\tthis.timeout = setTimeout(this.onTimeout, this.timeoutMs);\n\t}\n\tstart() {\n\t\tclearTimeout(this.timeout);\n\t\tthis.timeout = setTimeout(this.onTimeout, this.timeoutMs);\n\t}\n\tstop() {\n\t\tclearTimeout(this.timeout);\n\t\tthis.timeout = void 0;\n\t}\n};\nfunction withResolvers() {\n\tlet resolve;\n\tlet reject;\n\tconst promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\treturn {\n\t\tpromise,\n\t\tresolve,\n\t\treject\n\t};\n}\n/**\n* Resolves a WebSocket URL and optionally appends connection parameters.\n*\n* If connectionParams are provided, appends 'connectionParams=1' query parameter.\n*/\nasync function prepareUrl(urlOptions) {\n\tconst url = await resultOf(urlOptions.url);\n\tif (!urlOptions.connectionParams) return url;\n\tconst prefix = url.includes(\"?\") ? \"&\" : \"?\";\n\tconst connectionParams = `${prefix}connectionParams=1`;\n\treturn url + connectionParams;\n}\nasync function buildConnectionMessage(connectionParams) {\n\tconst message = {\n\t\tmethod: \"connectionParams\",\n\t\tdata: await resultOf(connectionParams)\n\t};\n\treturn JSON.stringify(message);\n}\n\n//#endregion\n//#region src/links/wsLink/wsClient/requestManager.ts\nvar import_defineProperty$2 = __toESM(require_defineProperty(), 1);\n/**\n* Manages WebSocket requests, tracking their lifecycle and providing utility methods\n* for handling outgoing and pending requests.\n*\n* - **Outgoing requests**: Requests that are queued and waiting to be sent.\n* - **Pending requests**: Requests that have been sent and are in flight awaiting a response.\n* For subscriptions, multiple responses may be received until the subscription is closed.\n*/\nvar RequestManager = class {\n\tconstructor() {\n\t\t(0, import_defineProperty$2.default)(this, \"outgoingRequests\", new Array());\n\t\t(0, import_defineProperty$2.default)(this, \"pendingRequests\", {});\n\t}\n\t/**\n\t* Registers a new request by adding it to the outgoing queue and setting up\n\t* callbacks for lifecycle events such as completion or error.\n\t*\n\t* @param message - The outgoing message to be sent.\n\t* @param callbacks - Callback functions to observe the request's state.\n\t* @returns A cleanup function to manually remove the request.\n\t*/\n\tregister(message, callbacks) {\n\t\tconst { promise: end, resolve } = withResolvers();\n\t\tthis.outgoingRequests.push({\n\t\t\tid: String(message.id),\n\t\t\tmessage,\n\t\t\tend,\n\t\t\tcallbacks: {\n\t\t\t\tnext: callbacks.next,\n\t\t\t\tcomplete: () => {\n\t\t\t\t\tcallbacks.complete();\n\t\t\t\t\tresolve();\n\t\t\t\t},\n\t\t\t\terror: (e) => {\n\t\t\t\t\tcallbacks.error(e);\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn () => {\n\t\t\tthis.delete(message.id);\n\t\t\tcallbacks.complete();\n\t\t\tresolve();\n\t\t};\n\t}\n\t/**\n\t* Deletes a request from both the outgoing and pending collections, if it exists.\n\t*/\n\tdelete(messageId) {\n\t\tif (messageId === null) return;\n\t\tthis.outgoingRequests = this.outgoingRequests.filter(({ id }) => id !== String(messageId));\n\t\tdelete this.pendingRequests[String(messageId)];\n\t}\n\t/**\n\t* Moves all outgoing requests to the pending state and clears the outgoing queue.\n\t*\n\t* The caller is expected to handle the actual sending of the requests\n\t* (e.g., sending them over the network) after this method is called.\n\t*\n\t* @returns The list of requests that were transitioned to the pending state.\n\t*/\n\tflush() {\n\t\tconst requests = this.outgoingRequests;\n\t\tthis.outgoingRequests = [];\n\t\tfor (const request of requests) this.pendingRequests[request.id] = request;\n\t\treturn requests;\n\t}\n\t/**\n\t* Retrieves all currently pending requests, which are in flight awaiting responses\n\t* or handling ongoing subscriptions.\n\t*/\n\tgetPendingRequests() {\n\t\treturn Object.values(this.pendingRequests);\n\t}\n\t/**\n\t* Retrieves a specific pending request by its message ID.\n\t*/\n\tgetPendingRequest(messageId) {\n\t\tif (messageId === null) return null;\n\t\treturn this.pendingRequests[String(messageId)];\n\t}\n\t/**\n\t* Retrieves all outgoing requests, which are waiting to be sent.\n\t*/\n\tgetOutgoingRequests() {\n\t\treturn this.outgoingRequests;\n\t}\n\t/**\n\t* Retrieves all requests, both outgoing and pending, with their respective states.\n\t*\n\t* @returns An array of all requests with their state (\"outgoing\" or \"pending\").\n\t*/\n\tgetRequests() {\n\t\treturn [...this.getOutgoingRequests().map((request) => ({\n\t\t\tstate: \"outgoing\",\n\t\t\tmessage: request.message,\n\t\t\tend: request.end,\n\t\t\tcallbacks: request.callbacks\n\t\t})), ...this.getPendingRequests().map((request) => ({\n\t\t\tstate: \"pending\",\n\t\t\tmessage: request.message,\n\t\t\tend: request.end,\n\t\t\tcallbacks: request.callbacks\n\t\t}))];\n\t}\n\t/**\n\t* Checks if there are any pending requests, including ongoing subscriptions.\n\t*/\n\thasPendingRequests() {\n\t\treturn this.getPendingRequests().length > 0;\n\t}\n\t/**\n\t* Checks if there are any pending subscriptions\n\t*/\n\thasPendingSubscriptions() {\n\t\treturn this.getPendingRequests().some((request) => request.message.method === \"subscription\");\n\t}\n\t/**\n\t* Checks if there are any outgoing requests waiting to be sent.\n\t*/\n\thasOutgoingRequests() {\n\t\treturn this.outgoingRequests.length > 0;\n\t}\n};\n\n//#endregion\n//#region src/links/wsLink/wsClient/wsConnection.ts\nvar import_defineProperty$1 = __toESM(require_defineProperty(), 1);\n/**\n* Opens a WebSocket connection asynchronously and returns a promise\n* that resolves when the connection is successfully established.\n* The promise rejects if an error occurs during the connection attempt.\n*/\nfunction asyncWsOpen(ws) {\n\tconst { promise, resolve, reject } = withResolvers();\n\tws.addEventListener(\"open\", () => {\n\t\tws.removeEventListener(\"error\", reject);\n\t\tresolve();\n\t});\n\tws.addEventListener(\"error\", reject);\n\treturn promise;\n}\n/**\n* Sets up a periodic ping-pong mechanism to keep the WebSocket connection alive.\n*\n* - Sends \"PING\" messages at regular intervals defined by `intervalMs`.\n* - If a \"PONG\" response is not received within the `pongTimeoutMs`, the WebSocket is closed.\n* - The ping timer resets upon receiving any message to maintain activity.\n* - Automatically starts the ping process when the WebSocket connection is opened.\n* - Cleans up timers when the WebSocket is closed.\n*\n* @param ws - The WebSocket instance to manage.\n* @param options - Configuration options for ping-pong intervals and timeouts.\n*/\nfunction setupPingInterval(ws, { intervalMs, pongTimeoutMs }) {\n\tlet pingTimeout;\n\tlet pongTimeout;\n\tfunction start() {\n\t\tpingTimeout = setTimeout(() => {\n\t\t\tws.send(\"PING\");\n\t\t\tpongTimeout = setTimeout(() => {\n\t\t\t\tws.close();\n\t\t\t}, pongTimeoutMs);\n\t\t}, intervalMs);\n\t}\n\tfunction reset() {\n\t\tclearTimeout(pingTimeout);\n\t\tstart();\n\t}\n\tfunction pong() {\n\t\tclearTimeout(pongTimeout);\n\t\treset();\n\t}\n\tws.addEventListener(\"open\", start);\n\tws.addEventListener(\"message\", ({ data }) => {\n\t\tclearTimeout(pingTimeout);\n\t\tstart();\n\t\tif (data === \"PONG\") pong();\n\t});\n\tws.addEventListener(\"close\", () => {\n\t\tclearTimeout(pingTimeout);\n\t\tclearTimeout(pongTimeout);\n\t});\n}\n/**\n* Manages a WebSocket connection with support for reconnection, keep-alive mechanisms,\n* and observable state tracking.\n*/\nvar WsConnection = class WsConnection {\n\tconstructor(opts) {\n\t\tvar _opts$WebSocketPonyfi;\n\t\t(0, import_defineProperty$1.default)(this, \"id\", ++WsConnection.connectCount);\n\t\t(0, import_defineProperty$1.default)(this, \"WebSocketPonyfill\", void 0);\n\t\t(0, import_defineProperty$1.default)(this, \"urlOptions\", void 0);\n\t\t(0, import_defineProperty$1.default)(this, \"keepAliveOpts\", void 0);\n\t\t(0, import_defineProperty$1.default)(this, \"wsObservable\", behaviorSubject(null));\n\t\t(0, import_defineProperty$1.default)(this, \"openPromise\", null);\n\t\tthis.WebSocketPonyfill = (_opts$WebSocketPonyfi = opts.WebSocketPonyfill) !== null && _opts$WebSocketPonyfi !== void 0 ? _opts$WebSocketPonyfi : WebSocket;\n\t\tif (!this.WebSocketPonyfill) throw new Error(\"No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill\");\n\t\tthis.urlOptions = opts.urlOptions;\n\t\tthis.keepAliveOpts = opts.keepAlive;\n\t}\n\tget ws() {\n\t\treturn this.wsObservable.get();\n\t}\n\tset ws(ws) {\n\t\tthis.wsObservable.next(ws);\n\t}\n\t/**\n\t* Checks if the WebSocket connection is open and ready to communicate.\n\t*/\n\tisOpen() {\n\t\treturn !!this.ws && this.ws.readyState === this.WebSocketPonyfill.OPEN && !this.openPromise;\n\t}\n\t/**\n\t* Checks if the WebSocket connection is closed or in the process of closing.\n\t*/\n\tisClosed() {\n\t\treturn !!this.ws && (this.ws.readyState === this.WebSocketPonyfill.CLOSING || this.ws.readyState === this.WebSocketPonyfill.CLOSED);\n\t}\n\tasync open() {\n\t\tvar _this = this;\n\t\tif (_this.openPromise) return _this.openPromise;\n\t\t_this.id = ++WsConnection.connectCount;\n\t\tconst wsPromise = prepareUrl(_this.urlOptions).then((url) => new _this.WebSocketPonyfill(url));\n\t\t_this.openPromise = wsPromise.then(async (ws) => {\n\t\t\t_this.ws = ws;\n\t\t\tws.addEventListener(\"message\", function({ data }) {\n\t\t\t\tif (data === \"PING\") this.send(\"PONG\");\n\t\t\t});\n\t\t\tif (_this.keepAliveOpts.enabled) setupPingInterval(ws, _this.keepAliveOpts);\n\t\t\tws.addEventListener(\"close\", () => {\n\t\t\t\tif (_this.ws === ws) _this.ws = null;\n\t\t\t});\n\t\t\tawait asyncWsOpen(ws);\n\t\t\tif (_this.urlOptions.connectionParams) ws.send(await buildConnectionMessage(_this.urlOptions.connectionParams));\n\t\t});\n\t\ttry {\n\t\t\tawait _this.openPromise;\n\t\t} finally {\n\t\t\t_this.openPromise = null;\n\t\t}\n\t}\n\t/**\n\t* Closes the WebSocket connection gracefully.\n\t* Waits for any ongoing open operation to complete before closing.\n\t*/\n\tasync close() {\n\t\tvar _this2 = this;\n\t\ttry {\n\t\t\tawait _this2.openPromise;\n\t\t} finally {\n\t\t\tvar _this$ws;\n\t\t\t(_this$ws = _this2.ws) === null || _this$ws === void 0 || _this$ws.close();\n\t\t}\n\t}\n};\n(0, import_defineProperty$1.default)(WsConnection, \"connectCount\", 0);\n/**\n* Provides a backward-compatible representation of the connection state.\n*/\nfunction backwardCompatibility(connection) {\n\tif (connection.isOpen()) return {\n\t\tid: connection.id,\n\t\tstate: \"open\",\n\t\tws: connection.ws\n\t};\n\tif (connection.isClosed()) return {\n\t\tid: connection.id,\n\t\tstate: \"closed\",\n\t\tws: connection.ws\n\t};\n\tif (!connection.ws) return null;\n\treturn {\n\t\tid: connection.id,\n\t\tstate: \"connecting\",\n\t\tws: connection.ws\n\t};\n}\n\n//#endregion\n//#region src/links/wsLink/wsClient/wsClient.ts\nvar import_defineProperty = __toESM(require_defineProperty(), 1);\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* A WebSocket client for managing TRPC operations, supporting lazy initialization,\n* reconnection, keep-alive, and request management.\n*/\nvar WsClient = class {\n\tconstructor(opts) {\n\t\tvar _opts$retryDelayMs;\n\t\t(0, import_defineProperty.default)(this, \"connectionState\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"allowReconnect\", false);\n\t\t(0, import_defineProperty.default)(this, \"requestManager\", new RequestManager());\n\t\t(0, import_defineProperty.default)(this, \"activeConnection\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"reconnectRetryDelay\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"inactivityTimeout\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"callbacks\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"lazyMode\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"reconnecting\", null);\n\t\tthis.callbacks = {\n\t\t\tonOpen: opts.onOpen,\n\t\t\tonClose: opts.onClose,\n\t\t\tonError: opts.onError\n\t\t};\n\t\tconst lazyOptions = (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, lazyDefaults), opts.lazy);\n\t\tthis.inactivityTimeout = new ResettableTimeout(() => {\n\t\t\tif (this.requestManager.hasOutgoingRequests() || this.requestManager.hasPendingRequests()) {\n\t\t\t\tthis.inactivityTimeout.reset();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.close().catch(() => null);\n\t\t}, lazyOptions.closeMs);\n\t\tthis.activeConnection = new WsConnection({\n\t\t\tWebSocketPonyfill: opts.WebSocket,\n\t\t\turlOptions: opts,\n\t\t\tkeepAlive: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, keepAliveDefaults), opts.keepAlive)\n\t\t});\n\t\tthis.activeConnection.wsObservable.subscribe({ next: (ws) => {\n\t\t\tif (!ws) return;\n\t\t\tthis.setupWebSocketListeners(ws);\n\t\t} });\n\t\tthis.reconnectRetryDelay = (_opts$retryDelayMs = opts.retryDelayMs) !== null && _opts$retryDelayMs !== void 0 ? _opts$retryDelayMs : exponentialBackoff;\n\t\tthis.lazyMode = lazyOptions.enabled;\n\t\tthis.connectionState = behaviorSubject({\n\t\t\ttype: \"state\",\n\t\t\tstate: lazyOptions.enabled ? \"idle\" : \"connecting\",\n\t\t\terror: null\n\t\t});\n\t\tif (!this.lazyMode) this.open().catch(() => null);\n\t}\n\t/**\n\t* Opens the WebSocket connection. Handles reconnection attempts and updates\n\t* the connection state accordingly.\n\t*/\n\tasync open() {\n\t\tvar _this = this;\n\t\t_this.allowReconnect = true;\n\t\tif (_this.connectionState.get().state === \"idle\") _this.connectionState.next({\n\t\t\ttype: \"state\",\n\t\t\tstate: \"connecting\",\n\t\t\terror: null\n\t\t});\n\t\ttry {\n\t\t\tawait _this.activeConnection.open();\n\t\t} catch (error) {\n\t\t\t_this.reconnect(new TRPCWebSocketClosedError({\n\t\t\t\tmessage: \"Initialization error\",\n\t\t\t\tcause: error\n\t\t\t}));\n\t\t\treturn _this.reconnecting;\n\t\t}\n\t}\n\t/**\n\t* Closes the WebSocket connection and stops managing requests.\n\t* Ensures all outgoing and pending requests are properly finalized.\n\t*/\n\tasync close() {\n\t\tvar _this2 = this;\n\t\t_this2.allowReconnect = false;\n\t\t_this2.inactivityTimeout.stop();\n\t\tconst requestsToAwait = [];\n\t\tfor (const request of _this2.requestManager.getRequests()) if (request.message.method === \"subscription\") request.callbacks.complete();\n\t\telse if (request.state === \"outgoing\") request.callbacks.error(TRPCClientError.from(new TRPCWebSocketClosedError({ message: \"Closed before connection was established\" })));\n\t\telse requestsToAwait.push(request.end);\n\t\tawait Promise.all(requestsToAwait).catch(() => null);\n\t\tawait _this2.activeConnection.close().catch(() => null);\n\t\t_this2.connectionState.next({\n\t\t\ttype: \"state\",\n\t\t\tstate: \"idle\",\n\t\t\terror: null\n\t\t});\n\t}\n\t/**\n\t* Method to request the server.\n\t* Handles data transformation, batching of requests, and subscription lifecycle.\n\t*\n\t* @param op - The operation details including id, type, path, input and signal\n\t* @param transformer - Data transformer for serializing requests and deserializing responses\n\t* @param lastEventId - Optional ID of the last received event for subscriptions\n\t*\n\t* @returns An observable that emits operation results and handles cleanup\n\t*/\n\trequest({ op: { id, type, path, input, signal }, transformer, lastEventId }) {\n\t\treturn observable((observer) => {\n\t\t\tconst abort = this.batchSend({\n\t\t\t\tid,\n\t\t\t\tmethod: type,\n\t\t\t\tparams: {\n\t\t\t\t\tinput: transformer.input.serialize(input),\n\t\t\t\t\tpath,\n\t\t\t\t\tlastEventId\n\t\t\t\t}\n\t\t\t}, (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, observer), {}, { next(event) {\n\t\t\t\tconst transformed = transformResult(event, transformer.output);\n\t\t\t\tif (!transformed.ok) {\n\t\t\t\t\tobserver.error(TRPCClientError.from(transformed.error));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tobserver.next({ result: transformed.result });\n\t\t\t} }));\n\t\t\treturn () => {\n\t\t\t\tabort();\n\t\t\t\tif (type === \"subscription\" && this.activeConnection.isOpen()) this.send({\n\t\t\t\t\tid,\n\t\t\t\t\tmethod: \"subscription.stop\"\n\t\t\t\t});\n\t\t\t\tsignal === null || signal === void 0 || signal.removeEventListener(\"abort\", abort);\n\t\t\t};\n\t\t});\n\t}\n\tget connection() {\n\t\treturn backwardCompatibility(this.activeConnection);\n\t}\n\treconnect(closedError) {\n\t\tvar _this3 = this;\n\t\tthis.connectionState.next({\n\t\t\ttype: \"state\",\n\t\t\tstate: \"connecting\",\n\t\t\terror: TRPCClientError.from(closedError)\n\t\t});\n\t\tif (this.reconnecting) return;\n\t\tconst tryReconnect = async (attemptIndex) => {\n\t\t\ttry {\n\t\t\t\tawait sleep(_this3.reconnectRetryDelay(attemptIndex));\n\t\t\t\tif (_this3.allowReconnect) {\n\t\t\t\t\tawait _this3.activeConnection.close();\n\t\t\t\t\tawait _this3.activeConnection.open();\n\t\t\t\t\tif (_this3.requestManager.hasPendingRequests()) _this3.send(_this3.requestManager.getPendingRequests().map(({ message }) => message));\n\t\t\t\t}\n\t\t\t\t_this3.reconnecting = null;\n\t\t\t} catch (_unused) {\n\t\t\t\tawait tryReconnect(attemptIndex + 1);\n\t\t\t}\n\t\t};\n\t\tthis.reconnecting = tryReconnect(0);\n\t}\n\tsetupWebSocketListeners(ws) {\n\t\tvar _this4 = this;\n\t\tconst handleCloseOrError = (cause) => {\n\t\t\tconst reqs = this.requestManager.getPendingRequests();\n\t\t\tfor (const { message, callbacks } of reqs) {\n\t\t\t\tif (message.method === \"subscription\") continue;\n\t\t\t\tcallbacks.error(TRPCClientError.from(cause !== null && cause !== void 0 ? cause : new TRPCWebSocketClosedError({\n\t\t\t\t\tmessage: \"WebSocket closed\",\n\t\t\t\t\tcause\n\t\t\t\t})));\n\t\t\t\tthis.requestManager.delete(message.id);\n\t\t\t}\n\t\t};\n\t\tws.addEventListener(\"open\", () => {\n\t\t\trun(async () => {\n\t\t\t\tvar _this$callbacks$onOpe, _this$callbacks;\n\t\t\t\tif (_this4.lazyMode) _this4.inactivityTimeout.start();\n\t\t\t\t(_this$callbacks$onOpe = (_this$callbacks = _this4.callbacks).onOpen) === null || _this$callbacks$onOpe === void 0 || _this$callbacks$onOpe.call(_this$callbacks);\n\t\t\t\t_this4.connectionState.next({\n\t\t\t\t\ttype: \"state\",\n\t\t\t\t\tstate: \"pending\",\n\t\t\t\t\terror: null\n\t\t\t\t});\n\t\t\t}).catch((error) => {\n\t\t\t\tws.close(3e3);\n\t\t\t\thandleCloseOrError(error);\n\t\t\t});\n\t\t});\n\t\tws.addEventListener(\"message\", ({ data }) => {\n\t\t\tthis.inactivityTimeout.reset();\n\t\t\tif (typeof data !== \"string\" || [\"PING\", \"PONG\"].includes(data)) return;\n\t\t\tconst incomingMessage = JSON.parse(data);\n\t\t\tif (\"method\" in incomingMessage) {\n\t\t\t\tthis.handleIncomingRequest(incomingMessage);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.handleResponseMessage(incomingMessage);\n\t\t});\n\t\tws.addEventListener(\"close\", (event) => {\n\t\t\tvar _this$callbacks$onClo, _this$callbacks2;\n\t\t\thandleCloseOrError(event);\n\t\t\t(_this$callbacks$onClo = (_this$callbacks2 = this.callbacks).onClose) === null || _this$callbacks$onClo === void 0 || _this$callbacks$onClo.call(_this$callbacks2, event);\n\t\t\tif (!this.lazyMode || this.requestManager.hasPendingSubscriptions()) this.reconnect(new TRPCWebSocketClosedError({\n\t\t\t\tmessage: \"WebSocket closed\",\n\t\t\t\tcause: event\n\t\t\t}));\n\t\t});\n\t\tws.addEventListener(\"error\", (event) => {\n\t\t\tvar _this$callbacks$onErr, _this$callbacks3;\n\t\t\thandleCloseOrError(event);\n\t\t\t(_this$callbacks$onErr = (_this$callbacks3 = this.callbacks).onError) === null || _this$callbacks$onErr === void 0 || _this$callbacks$onErr.call(_this$callbacks3, event);\n\t\t\tthis.reconnect(new TRPCWebSocketClosedError({\n\t\t\t\tmessage: \"WebSocket closed\",\n\t\t\t\tcause: event\n\t\t\t}));\n\t\t});\n\t}\n\thandleResponseMessage(message) {\n\t\tconst request = this.requestManager.getPendingRequest(message.id);\n\t\tif (!request) return;\n\t\trequest.callbacks.next(message);\n\t\tlet completed = true;\n\t\tif (\"result\" in message && request.message.method === \"subscription\") {\n\t\t\tif (message.result.type === \"data\") request.message.params.lastEventId = message.result.id;\n\t\t\tif (message.result.type !== \"stopped\") completed = false;\n\t\t}\n\t\tif (completed) {\n\t\t\trequest.callbacks.complete();\n\t\t\tthis.requestManager.delete(message.id);\n\t\t}\n\t}\n\thandleIncomingRequest(message) {\n\t\tif (message.method === \"reconnect\") this.reconnect(new TRPCWebSocketClosedError({ message: \"Server requested reconnect\" }));\n\t}\n\t/**\n\t* Sends a message or batch of messages directly to the server.\n\t*/\n\tsend(messageOrMessages) {\n\t\tif (!this.activeConnection.isOpen()) throw new Error(\"Active connection is not open\");\n\t\tconst messages = messageOrMessages instanceof Array ? messageOrMessages : [messageOrMessages];\n\t\tthis.activeConnection.ws.send(JSON.stringify(messages.length === 1 ? messages[0] : messages));\n\t}\n\t/**\n\t* Groups requests for batch sending.\n\t*\n\t* @returns A function to abort the batched request.\n\t*/\n\tbatchSend(message, callbacks) {\n\t\tvar _this5 = this;\n\t\tthis.inactivityTimeout.reset();\n\t\trun(async () => {\n\t\t\tif (!_this5.activeConnection.isOpen()) await _this5.open();\n\t\t\tawait sleep(0);\n\t\t\tif (!_this5.requestManager.hasOutgoingRequests()) return;\n\t\t\t_this5.send(_this5.requestManager.flush().map(({ message: message$1 }) => message$1));\n\t\t}).catch((err) => {\n\t\t\tthis.requestManager.delete(message.id);\n\t\t\tcallbacks.error(TRPCClientError.from(err));\n\t\t});\n\t\treturn this.requestManager.register(message, callbacks);\n\t}\n};\n\n//#endregion\n//#region src/links/wsLink/createWsClient.ts\nfunction createWSClient(opts) {\n\treturn new WsClient(opts);\n}\n\n//#endregion\n//#region src/links/wsLink/wsLink.ts\nfunction wsLink(opts) {\n\tconst { client } = opts;\n\tconst transformer = getTransformer(opts.transformer);\n\treturn () => {\n\t\treturn ({ op }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tconst connStateSubscription = op.type === \"subscription\" ? client.connectionState.subscribe({ next(result) {\n\t\t\t\t\tobserver.next({\n\t\t\t\t\t\tresult,\n\t\t\t\t\t\tcontext: op.context\n\t\t\t\t\t});\n\t\t\t\t} }) : null;\n\t\t\t\tconst requestSubscription = client.request({\n\t\t\t\t\top,\n\t\t\t\t\ttransformer\n\t\t\t\t}).subscribe(observer);\n\t\t\t\treturn () => {\n\t\t\t\t\trequestSubscription.unsubscribe();\n\t\t\t\t\tconnStateSubscription === null || connStateSubscription === void 0 || connStateSubscription.unsubscribe();\n\t\t\t\t};\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\nexport { createWSClient, resultOf, wsLink };\n//# sourceMappingURL=wsLink-CatceK3c.mjs.map","import { __commonJS, __toESM, require_defineProperty, require_objectSpread2 } from \"./objectSpread2-BvkFp-_Y.mjs\";\nimport { createChain, splitLink } from \"./splitLink-B7Cuf2c_.mjs\";\nimport { TRPCClientError, isTRPCClientError } from \"./TRPCClientError-CjKyS10w.mjs\";\nimport { fetchHTTPResponse, getBody, getFetch, getUrl, resolveHTTPLinkOptions } from \"./httpUtils-Dv57hbOd.mjs\";\nimport { httpLink, isFormData, isNonJsonSerializable, isOctetType } from \"./httpLink-DCFpUmZF.mjs\";\nimport { abortSignalToPromise, allAbortSignals, dataLoader, httpBatchLink, raceAbortSignals } from \"./httpBatchLink-BOe5aCcR.mjs\";\nimport { getTransformer } from \"./unstable-internals-Bg7n9BBj.mjs\";\nimport { loggerLink } from \"./loggerLink-ineCN1PO.mjs\";\nimport { createWSClient, resultOf, wsLink } from \"./wsLink-CatceK3c.mjs\";\nimport { behaviorSubject, observable, observableToPromise, share } from \"@trpc/server/observable\";\nimport { callProcedure, createFlatProxy, createRecursiveProxy, isAbortError, isAsyncIterable, iteratorResource, jsonlStreamConsumer, makeResource, retryableRpcCodes, run, sseStreamConsumer } from \"@trpc/server/unstable-core-do-not-import\";\nimport { getTRPCErrorFromUnknown, getTRPCErrorShape, isTrackedEnvelope } from \"@trpc/server\";\nimport { TRPC_ERROR_CODES_BY_KEY } from \"@trpc/server/rpc\";\n\n//#region src/internals/TRPCUntypedClient.ts\nvar import_defineProperty = __toESM(require_defineProperty(), 1);\nvar import_objectSpread2$4 = __toESM(require_objectSpread2(), 1);\nvar TRPCUntypedClient = class {\n\tconstructor(opts) {\n\t\t(0, import_defineProperty.default)(this, \"links\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"runtime\", void 0);\n\t\t(0, import_defineProperty.default)(this, \"requestId\", void 0);\n\t\tthis.requestId = 0;\n\t\tthis.runtime = {};\n\t\tthis.links = opts.links.map((link) => link(this.runtime));\n\t}\n\t$request(opts) {\n\t\tvar _opts$context;\n\t\tconst chain$ = createChain({\n\t\t\tlinks: this.links,\n\t\t\top: (0, import_objectSpread2$4.default)((0, import_objectSpread2$4.default)({}, opts), {}, {\n\t\t\t\tcontext: (_opts$context = opts.context) !== null && _opts$context !== void 0 ? _opts$context : {},\n\t\t\t\tid: ++this.requestId\n\t\t\t})\n\t\t});\n\t\treturn chain$.pipe(share());\n\t}\n\tasync requestAsPromise(opts) {\n\t\tvar _this = this;\n\t\ttry {\n\t\t\tconst req$ = _this.$request(opts);\n\t\t\tconst envelope = await observableToPromise(req$);\n\t\t\tconst data = envelope.result.data;\n\t\t\treturn data;\n\t\t} catch (err) {\n\t\t\tthrow TRPCClientError.from(err);\n\t\t}\n\t}\n\tquery(path, input, opts) {\n\t\treturn this.requestAsPromise({\n\t\t\ttype: \"query\",\n\t\t\tpath,\n\t\t\tinput,\n\t\t\tcontext: opts === null || opts === void 0 ? void 0 : opts.context,\n\t\t\tsignal: opts === null || opts === void 0 ? void 0 : opts.signal\n\t\t});\n\t}\n\tmutation(path, input, opts) {\n\t\treturn this.requestAsPromise({\n\t\t\ttype: \"mutation\",\n\t\t\tpath,\n\t\t\tinput,\n\t\t\tcontext: opts === null || opts === void 0 ? void 0 : opts.context,\n\t\t\tsignal: opts === null || opts === void 0 ? void 0 : opts.signal\n\t\t});\n\t}\n\tsubscription(path, input, opts) {\n\t\tconst observable$ = this.$request({\n\t\t\ttype: \"subscription\",\n\t\t\tpath,\n\t\t\tinput,\n\t\t\tcontext: opts.context,\n\t\t\tsignal: opts.signal\n\t\t});\n\t\treturn observable$.subscribe({\n\t\t\tnext(envelope) {\n\t\t\t\tswitch (envelope.result.type) {\n\t\t\t\t\tcase \"state\": {\n\t\t\t\t\t\tvar _opts$onConnectionSta;\n\t\t\t\t\t\t(_opts$onConnectionSta = opts.onConnectionStateChange) === null || _opts$onConnectionSta === void 0 || _opts$onConnectionSta.call(opts, envelope.result);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"started\": {\n\t\t\t\t\t\tvar _opts$onStarted;\n\t\t\t\t\t\t(_opts$onStarted = opts.onStarted) === null || _opts$onStarted === void 0 || _opts$onStarted.call(opts, { context: envelope.context });\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"stopped\": {\n\t\t\t\t\t\tvar _opts$onStopped;\n\t\t\t\t\t\t(_opts$onStopped = opts.onStopped) === null || _opts$onStopped === void 0 || _opts$onStopped.call(opts);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase \"data\":\n\t\t\t\t\tcase void 0: {\n\t\t\t\t\t\tvar _opts$onData;\n\t\t\t\t\t\t(_opts$onData = opts.onData) === null || _opts$onData === void 0 || _opts$onData.call(opts, envelope.result.data);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\terror(err) {\n\t\t\t\tvar _opts$onError;\n\t\t\t\t(_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, err);\n\t\t\t},\n\t\t\tcomplete() {\n\t\t\t\tvar _opts$onComplete;\n\t\t\t\t(_opts$onComplete = opts.onComplete) === null || _opts$onComplete === void 0 || _opts$onComplete.call(opts);\n\t\t\t}\n\t\t});\n\t}\n};\n\n//#endregion\n//#region src/createTRPCUntypedClient.ts\nfunction createTRPCUntypedClient(opts) {\n\treturn new TRPCUntypedClient(opts);\n}\n\n//#endregion\n//#region src/createTRPCClient.ts\nconst untypedClientSymbol = Symbol.for(\"trpc_untypedClient\");\nconst clientCallTypeMap = {\n\tquery: \"query\",\n\tmutate: \"mutation\",\n\tsubscribe: \"subscription\"\n};\n/** @internal */\nconst clientCallTypeToProcedureType = (clientCallType) => {\n\treturn clientCallTypeMap[clientCallType];\n};\n/**\n* @internal\n*/\nfunction createTRPCClientProxy(client) {\n\tconst proxy = createRecursiveProxy(({ path, args }) => {\n\t\tconst pathCopy = [...path];\n\t\tconst procedureType = clientCallTypeToProcedureType(pathCopy.pop());\n\t\tconst fullPath = pathCopy.join(\".\");\n\t\treturn client[procedureType](fullPath, ...args);\n\t});\n\treturn createFlatProxy((key) => {\n\t\tif (key === untypedClientSymbol) return client;\n\t\treturn proxy[key];\n\t});\n}\nfunction createTRPCClient(opts) {\n\tconst client = new TRPCUntypedClient(opts);\n\tconst proxy = createTRPCClientProxy(client);\n\treturn proxy;\n}\n/**\n* Get an untyped client from a proxy client\n* @internal\n*/\nfunction getUntypedClient(client) {\n\treturn client[untypedClientSymbol];\n}\n\n//#endregion\n//#region src/links/httpBatchStreamLink.ts\nvar import_objectSpread2$3 = __toESM(require_objectSpread2(), 1);\n/**\n* @see https://trpc.io/docs/client/links/httpBatchStreamLink\n*/\nfunction httpBatchStreamLink(opts) {\n\tvar _opts$maxURLLength, _opts$maxItems;\n\tconst resolvedOpts = resolveHTTPLinkOptions(opts);\n\tconst maxURLLength = (_opts$maxURLLength = opts.maxURLLength) !== null && _opts$maxURLLength !== void 0 ? _opts$maxURLLength : Infinity;\n\tconst maxItems = (_opts$maxItems = opts.maxItems) !== null && _opts$maxItems !== void 0 ? _opts$maxItems : Infinity;\n\treturn () => {\n\t\tconst batchLoader = (type) => {\n\t\t\treturn {\n\t\t\t\tvalidate(batchOps) {\n\t\t\t\t\tif (maxURLLength === Infinity && maxItems === Infinity) return true;\n\t\t\t\t\tif (batchOps.length > maxItems) return false;\n\t\t\t\t\tconst path = batchOps.map((op) => op.path).join(\",\");\n\t\t\t\t\tconst inputs = batchOps.map((op) => op.input);\n\t\t\t\t\tconst url = getUrl((0, import_objectSpread2$3.default)((0, import_objectSpread2$3.default)({}, resolvedOpts), {}, {\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\tinputs,\n\t\t\t\t\t\tsignal: null\n\t\t\t\t\t}));\n\t\t\t\t\treturn url.length <= maxURLLength;\n\t\t\t\t},\n\t\t\t\tasync fetch(batchOps) {\n\t\t\t\t\tconst path = batchOps.map((op) => op.path).join(\",\");\n\t\t\t\t\tconst inputs = batchOps.map((op) => op.input);\n\t\t\t\t\tconst batchSignals = allAbortSignals(...batchOps.map((op) => op.signal));\n\t\t\t\t\tconst abortController = new AbortController();\n\t\t\t\t\tconst responsePromise = fetchHTTPResponse((0, import_objectSpread2$3.default)((0, import_objectSpread2$3.default)({}, resolvedOpts), {}, {\n\t\t\t\t\t\tsignal: raceAbortSignals(batchSignals, abortController.signal),\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tcontentTypeHeader: \"application/json\",\n\t\t\t\t\t\ttrpcAcceptHeader: \"application/jsonl\",\n\t\t\t\t\t\tgetUrl,\n\t\t\t\t\t\tgetBody,\n\t\t\t\t\t\tinputs,\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\theaders() {\n\t\t\t\t\t\t\tif (!opts.headers) return {};\n\t\t\t\t\t\t\tif (typeof opts.headers === \"function\") return opts.headers({ opList: batchOps });\n\t\t\t\t\t\t\treturn opts.headers;\n\t\t\t\t\t\t}\n\t\t\t\t\t}));\n\t\t\t\t\tconst res = await responsePromise;\n\t\t\t\t\tconst [head] = await jsonlStreamConsumer({\n\t\t\t\t\t\tfrom: res.body,\n\t\t\t\t\t\tdeserialize: (data) => resolvedOpts.transformer.output.deserialize(data),\n\t\t\t\t\t\tformatError(opts$1) {\n\t\t\t\t\t\t\tconst error = opts$1.error;\n\t\t\t\t\t\t\treturn TRPCClientError.from({ error });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tabortController\n\t\t\t\t\t});\n\t\t\t\t\tconst promises = Object.keys(batchOps).map(async (key) => {\n\t\t\t\t\t\tlet json = await Promise.resolve(head[key]);\n\t\t\t\t\t\tif (\"result\" in json) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t* Not very pretty, but we need to unwrap nested data as promises\n\t\t\t\t\t\t\t* Our stream producer will only resolve top-level async values or async values that are directly nested in another async value\n\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\tconst result = await Promise.resolve(json.result);\n\t\t\t\t\t\t\tjson = { result: { data: await Promise.resolve(result.data) } };\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tjson,\n\t\t\t\t\t\t\tmeta: { response: res }\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t\treturn promises;\n\t\t\t\t}\n\t\t\t};\n\t\t};\n\t\tconst query = dataLoader(batchLoader(\"query\"));\n\t\tconst mutation = dataLoader(batchLoader(\"mutation\"));\n\t\tconst loaders = {\n\t\t\tquery,\n\t\t\tmutation\n\t\t};\n\t\treturn ({ op }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\t/* istanbul ignore if -- @preserve */\n\t\t\t\tif (op.type === \"subscription\") throw new Error(\"Subscriptions are unsupported by `httpBatchStreamLink` - use `httpSubscriptionLink` or `wsLink`\");\n\t\t\t\tconst loader = loaders[op.type];\n\t\t\t\tconst promise = loader.load(op);\n\t\t\t\tlet _res = void 0;\n\t\t\t\tpromise.then((res) => {\n\t\t\t\t\t_res = res;\n\t\t\t\t\tif (\"error\" in res.json) {\n\t\t\t\t\t\tobserver.error(TRPCClientError.from(res.json, { meta: res.meta }));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else if (\"result\" in res.json) {\n\t\t\t\t\t\tobserver.next({\n\t\t\t\t\t\t\tcontext: res.meta,\n\t\t\t\t\t\t\tresult: res.json.result\n\t\t\t\t\t\t});\n\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tobserver.complete();\n\t\t\t\t}).catch((err) => {\n\t\t\t\t\tobserver.error(TRPCClientError.from(err, { meta: _res === null || _res === void 0 ? void 0 : _res.meta }));\n\t\t\t\t});\n\t\t\t\treturn () => {};\n\t\t\t});\n\t\t};\n\t};\n}\n/**\n* @deprecated use {@link httpBatchStreamLink} instead\n*/\nconst unstable_httpBatchStreamLink = httpBatchStreamLink;\n\n//#endregion\n//#region src/internals/inputWithTrackedEventId.ts\nvar import_objectSpread2$2 = __toESM(require_objectSpread2(), 1);\nfunction inputWithTrackedEventId(input, lastEventId) {\n\tif (!lastEventId) return input;\n\tif (input != null && typeof input !== \"object\") return input;\n\treturn (0, import_objectSpread2$2.default)((0, import_objectSpread2$2.default)({}, input !== null && input !== void 0 ? input : {}), {}, { lastEventId });\n}\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js\nvar require_asyncIterator = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js\"(exports, module) {\n\tfunction _asyncIterator$1(r) {\n\t\tvar n, t, o, e = 2;\n\t\tfor (\"undefined\" != typeof Symbol && (t = Symbol.asyncIterator, o = Symbol.iterator); e--;) {\n\t\t\tif (t && null != (n = r[t])) return n.call(r);\n\t\t\tif (o && null != (n = r[o])) return new AsyncFromSyncIterator(n.call(r));\n\t\t\tt = \"@@asyncIterator\", o = \"@@iterator\";\n\t\t}\n\t\tthrow new TypeError(\"Object is not async iterable\");\n\t}\n\tfunction AsyncFromSyncIterator(r) {\n\t\tfunction AsyncFromSyncIteratorContinuation(r$1) {\n\t\t\tif (Object(r$1) !== r$1) return Promise.reject(new TypeError(r$1 + \" is not an object.\"));\n\t\t\tvar n = r$1.done;\n\t\t\treturn Promise.resolve(r$1.value).then(function(r$2) {\n\t\t\t\treturn {\n\t\t\t\t\tvalue: r$2,\n\t\t\t\t\tdone: n\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\t\treturn AsyncFromSyncIterator = function AsyncFromSyncIterator$1(r$1) {\n\t\t\tthis.s = r$1, this.n = r$1.next;\n\t\t}, AsyncFromSyncIterator.prototype = {\n\t\t\ts: null,\n\t\t\tn: null,\n\t\t\tnext: function next() {\n\t\t\t\treturn AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));\n\t\t\t},\n\t\t\t\"return\": function _return(r$1) {\n\t\t\t\tvar n = this.s[\"return\"];\n\t\t\t\treturn void 0 === n ? Promise.resolve({\n\t\t\t\t\tvalue: r$1,\n\t\t\t\t\tdone: !0\n\t\t\t\t}) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));\n\t\t\t},\n\t\t\t\"throw\": function _throw(r$1) {\n\t\t\t\tvar n = this.s[\"return\"];\n\t\t\t\treturn void 0 === n ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));\n\t\t\t}\n\t\t}, new AsyncFromSyncIterator(r);\n\t}\n\tmodule.exports = _asyncIterator$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region src/links/httpSubscriptionLink.ts\nvar import_asyncIterator = __toESM(require_asyncIterator(), 1);\nasync function urlWithConnectionParams(opts) {\n\tlet url = await resultOf(opts.url);\n\tif (opts.connectionParams) {\n\t\tconst params = await resultOf(opts.connectionParams);\n\t\tconst prefix = url.includes(\"?\") ? \"&\" : \"?\";\n\t\turl += prefix + \"connectionParams=\" + encodeURIComponent(JSON.stringify(params));\n\t}\n\treturn url;\n}\n/**\n* @see https://trpc.io/docs/client/links/httpSubscriptionLink\n*/\nfunction httpSubscriptionLink(opts) {\n\tconst transformer = getTransformer(opts.transformer);\n\treturn () => {\n\t\treturn ({ op }) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tvar _opts$EventSource;\n\t\t\t\tconst { type, path, input } = op;\n\t\t\t\t/* istanbul ignore if -- @preserve */\n\t\t\t\tif (type !== \"subscription\") throw new Error(\"httpSubscriptionLink only supports subscriptions\");\n\t\t\t\tlet lastEventId = void 0;\n\t\t\t\tconst ac = new AbortController();\n\t\t\t\tconst signal = raceAbortSignals(op.signal, ac.signal);\n\t\t\t\tconst eventSourceStream = sseStreamConsumer({\n\t\t\t\t\turl: async () => getUrl({\n\t\t\t\t\t\ttransformer,\n\t\t\t\t\t\turl: await urlWithConnectionParams(opts),\n\t\t\t\t\t\tinput: inputWithTrackedEventId(input, lastEventId),\n\t\t\t\t\t\tpath,\n\t\t\t\t\t\ttype,\n\t\t\t\t\t\tsignal: null\n\t\t\t\t\t}),\n\t\t\t\t\tinit: () => resultOf(opts.eventSourceOptions, { op }),\n\t\t\t\t\tsignal,\n\t\t\t\t\tdeserialize: (data) => transformer.output.deserialize(data),\n\t\t\t\t\tEventSource: (_opts$EventSource = opts.EventSource) !== null && _opts$EventSource !== void 0 ? _opts$EventSource : globalThis.EventSource\n\t\t\t\t});\n\t\t\t\tconst connectionState = behaviorSubject({\n\t\t\t\t\ttype: \"state\",\n\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\terror: null\n\t\t\t\t});\n\t\t\t\tconst connectionSub = connectionState.subscribe({ next(state) {\n\t\t\t\t\tobserver.next({ result: state });\n\t\t\t\t} });\n\t\t\t\trun(async () => {\n\t\t\t\t\tvar _iteratorAbruptCompletion = false;\n\t\t\t\t\tvar _didIteratorError = false;\n\t\t\t\t\tvar _iteratorError;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfor (var _iterator = (0, import_asyncIterator.default)(eventSourceStream), _step; _iteratorAbruptCompletion = !(_step = await _iterator.next()).done; _iteratorAbruptCompletion = false) {\n\t\t\t\t\t\t\tconst chunk = _step.value;\n\t\t\t\t\t\t\tswitch (chunk.type) {\n\t\t\t\t\t\t\t\tcase \"ping\": break;\n\t\t\t\t\t\t\t\tcase \"data\":\n\t\t\t\t\t\t\t\t\tconst chunkData = chunk.data;\n\t\t\t\t\t\t\t\t\tlet result;\n\t\t\t\t\t\t\t\t\tif (chunkData.id) {\n\t\t\t\t\t\t\t\t\t\tlastEventId = chunkData.id;\n\t\t\t\t\t\t\t\t\t\tresult = {\n\t\t\t\t\t\t\t\t\t\t\tid: chunkData.id,\n\t\t\t\t\t\t\t\t\t\t\tdata: chunkData\n\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t} else result = { data: chunkData.data };\n\t\t\t\t\t\t\t\t\tobserver.next({\n\t\t\t\t\t\t\t\t\t\tresult,\n\t\t\t\t\t\t\t\t\t\tcontext: { eventSource: chunk.eventSource }\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase \"connected\": {\n\t\t\t\t\t\t\t\t\tobserver.next({\n\t\t\t\t\t\t\t\t\t\tresult: { type: \"started\" },\n\t\t\t\t\t\t\t\t\t\tcontext: { eventSource: chunk.eventSource }\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\tstate: \"pending\",\n\t\t\t\t\t\t\t\t\t\terror: null\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase \"serialized-error\": {\n\t\t\t\t\t\t\t\t\tconst error = TRPCClientError.from({ error: chunk.error });\n\t\t\t\t\t\t\t\t\tif (retryableRpcCodes.includes(chunk.error.code)) {\n\t\t\t\t\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\t\t\t\t\t\terror\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tthrow error;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase \"connecting\": {\n\t\t\t\t\t\t\t\t\tconst lastState = connectionState.get();\n\t\t\t\t\t\t\t\t\tconst error = chunk.event && TRPCClientError.from(chunk.event);\n\t\t\t\t\t\t\t\t\tif (!error && lastState.state === \"connecting\") break;\n\t\t\t\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\t\t\t\t\terror\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcase \"timeout\": connectionState.next({\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\t\t\t\terror: new TRPCClientError(`Timeout of ${chunk.ms}ms reached while waiting for a response`)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t_didIteratorError = true;\n\t\t\t\t\t\t_iteratorError = err;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif (_iteratorAbruptCompletion && _iterator.return != null) await _iterator.return();\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tif (_didIteratorError) throw _iteratorError;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tobserver.next({ result: { type: \"stopped\" } });\n\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\tstate: \"idle\",\n\t\t\t\t\t\terror: null\n\t\t\t\t\t});\n\t\t\t\t\tobserver.complete();\n\t\t\t\t}).catch((error) => {\n\t\t\t\t\tobserver.error(TRPCClientError.from(error));\n\t\t\t\t});\n\t\t\t\treturn () => {\n\t\t\t\t\tobserver.complete();\n\t\t\t\t\tac.abort();\n\t\t\t\t\tconnectionSub.unsubscribe();\n\t\t\t\t};\n\t\t\t});\n\t\t};\n\t};\n}\n/**\n* @deprecated use {@link httpSubscriptionLink} instead\n*/\nconst unstable_httpSubscriptionLink = httpSubscriptionLink;\n\n//#endregion\n//#region src/links/retryLink.ts\nvar import_objectSpread2$1 = __toESM(require_objectSpread2(), 1);\n/**\n* @see https://trpc.io/docs/v11/client/links/retryLink\n*/\nfunction retryLink(opts) {\n\treturn () => {\n\t\treturn (callOpts) => {\n\t\t\treturn observable((observer) => {\n\t\t\t\tlet next$;\n\t\t\t\tlet callNextTimeout = void 0;\n\t\t\t\tlet lastEventId = void 0;\n\t\t\t\tattempt(1);\n\t\t\t\tfunction opWithLastEventId() {\n\t\t\t\t\tconst op = callOpts.op;\n\t\t\t\t\tif (!lastEventId) return op;\n\t\t\t\t\treturn (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, op), {}, { input: inputWithTrackedEventId(op.input, lastEventId) });\n\t\t\t\t}\n\t\t\t\tfunction attempt(attempts) {\n\t\t\t\t\tconst op = opWithLastEventId();\n\t\t\t\t\tnext$ = callOpts.next(op).subscribe({\n\t\t\t\t\t\terror(error) {\n\t\t\t\t\t\t\tvar _opts$retryDelayMs, _opts$retryDelayMs2;\n\t\t\t\t\t\t\tconst shouldRetry = opts.retry({\n\t\t\t\t\t\t\t\top,\n\t\t\t\t\t\t\t\tattempts,\n\t\t\t\t\t\t\t\terror\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tif (!shouldRetry) {\n\t\t\t\t\t\t\t\tobserver.error(error);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tconst delayMs = (_opts$retryDelayMs = (_opts$retryDelayMs2 = opts.retryDelayMs) === null || _opts$retryDelayMs2 === void 0 ? void 0 : _opts$retryDelayMs2.call(opts, attempts)) !== null && _opts$retryDelayMs !== void 0 ? _opts$retryDelayMs : 0;\n\t\t\t\t\t\t\tif (delayMs <= 0) {\n\t\t\t\t\t\t\t\tattempt(attempts + 1);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcallNextTimeout = setTimeout(() => attempt(attempts + 1), delayMs);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnext(envelope) {\n\t\t\t\t\t\t\tif ((!envelope.result.type || envelope.result.type === \"data\") && envelope.result.id) lastEventId = envelope.result.id;\n\t\t\t\t\t\t\tobserver.next(envelope);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcomplete() {\n\t\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn () => {\n\t\t\t\t\tnext$.unsubscribe();\n\t\t\t\t\tclearTimeout(callNextTimeout);\n\t\t\t\t};\n\t\t\t});\n\t\t};\n\t};\n}\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js\nvar require_usingCtx = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js\"(exports, module) {\n\tfunction _usingCtx() {\n\t\tvar r = \"function\" == typeof SuppressedError ? SuppressedError : function(r$1, e$1) {\n\t\t\tvar n$1 = Error();\n\t\t\treturn n$1.name = \"SuppressedError\", n$1.error = r$1, n$1.suppressed = e$1, n$1;\n\t\t}, e = {}, n = [];\n\t\tfunction using(r$1, e$1) {\n\t\t\tif (null != e$1) {\n\t\t\t\tif (Object(e$1) !== e$1) throw new TypeError(\"using declarations can only be used with objects, functions, null, or undefined.\");\n\t\t\t\tif (r$1) var o = e$1[Symbol.asyncDispose || Symbol[\"for\"](\"Symbol.asyncDispose\")];\n\t\t\t\tif (void 0 === o && (o = e$1[Symbol.dispose || Symbol[\"for\"](\"Symbol.dispose\")], r$1)) var t = o;\n\t\t\t\tif (\"function\" != typeof o) throw new TypeError(\"Object is not disposable.\");\n\t\t\t\tt && (o = function o$1() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tt.call(e$1);\n\t\t\t\t\t} catch (r$2) {\n\t\t\t\t\t\treturn Promise.reject(r$2);\n\t\t\t\t\t}\n\t\t\t\t}), n.push({\n\t\t\t\t\tv: e$1,\n\t\t\t\t\td: o,\n\t\t\t\t\ta: r$1\n\t\t\t\t});\n\t\t\t} else r$1 && n.push({\n\t\t\t\td: e$1,\n\t\t\t\ta: r$1\n\t\t\t});\n\t\t\treturn e$1;\n\t\t}\n\t\treturn {\n\t\t\te,\n\t\t\tu: using.bind(null, !1),\n\t\t\ta: using.bind(null, !0),\n\t\t\td: function d() {\n\t\t\t\tvar o, t = this.e, s = 0;\n\t\t\t\tfunction next() {\n\t\t\t\t\tfor (; o = n.pop();) try {\n\t\t\t\t\t\tif (!o.a && 1 === s) return s = 0, n.push(o), Promise.resolve().then(next);\n\t\t\t\t\t\tif (o.d) {\n\t\t\t\t\t\t\tvar r$1 = o.d.call(o.v);\n\t\t\t\t\t\t\tif (o.a) return s |= 2, Promise.resolve(r$1).then(next, err);\n\t\t\t\t\t\t} else s |= 1;\n\t\t\t\t\t} catch (r$2) {\n\t\t\t\t\t\treturn err(r$2);\n\t\t\t\t\t}\n\t\t\t\t\tif (1 === s) return t !== e ? Promise.reject(t) : Promise.resolve();\n\t\t\t\t\tif (t !== e) throw t;\n\t\t\t\t}\n\t\t\t\tfunction err(n$1) {\n\t\t\t\t\treturn t = t !== e ? new r(n$1, t) : n$1, next();\n\t\t\t\t}\n\t\t\t\treturn next();\n\t\t\t}\n\t\t};\n\t}\n\tmodule.exports = _usingCtx, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js\nvar require_OverloadYield = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js\"(exports, module) {\n\tfunction _OverloadYield(e, d) {\n\t\tthis.v = e, this.k = d;\n\t}\n\tmodule.exports = _OverloadYield, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js\nvar require_awaitAsyncGenerator = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js\"(exports, module) {\n\tvar OverloadYield$1 = require_OverloadYield();\n\tfunction _awaitAsyncGenerator$1(e) {\n\t\treturn new OverloadYield$1(e, 0);\n\t}\n\tmodule.exports = _awaitAsyncGenerator$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region ../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js\nvar require_wrapAsyncGenerator = __commonJS({ \"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js\"(exports, module) {\n\tvar OverloadYield = require_OverloadYield();\n\tfunction _wrapAsyncGenerator$1(e) {\n\t\treturn function() {\n\t\t\treturn new AsyncGenerator(e.apply(this, arguments));\n\t\t};\n\t}\n\tfunction AsyncGenerator(e) {\n\t\tvar r, t;\n\t\tfunction resume(r$1, t$1) {\n\t\t\ttry {\n\t\t\t\tvar n = e[r$1](t$1), o = n.value, u = o instanceof OverloadYield;\n\t\t\t\tPromise.resolve(u ? o.v : o).then(function(t$2) {\n\t\t\t\t\tif (u) {\n\t\t\t\t\t\tvar i = \"return\" === r$1 ? \"return\" : \"next\";\n\t\t\t\t\t\tif (!o.k || t$2.done) return resume(i, t$2);\n\t\t\t\t\t\tt$2 = e[i](t$2).value;\n\t\t\t\t\t}\n\t\t\t\t\tsettle(n.done ? \"return\" : \"normal\", t$2);\n\t\t\t\t}, function(e$1) {\n\t\t\t\t\tresume(\"throw\", e$1);\n\t\t\t\t});\n\t\t\t} catch (e$1) {\n\t\t\t\tsettle(\"throw\", e$1);\n\t\t\t}\n\t\t}\n\t\tfunction settle(e$1, n) {\n\t\t\tswitch (e$1) {\n\t\t\t\tcase \"return\":\n\t\t\t\t\tr.resolve({\n\t\t\t\t\t\tvalue: n,\n\t\t\t\t\t\tdone: !0\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"throw\":\n\t\t\t\t\tr.reject(n);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: r.resolve({\n\t\t\t\t\tvalue: n,\n\t\t\t\t\tdone: !1\n\t\t\t\t});\n\t\t\t}\n\t\t\t(r = r.next) ? resume(r.key, r.arg) : t = null;\n\t\t}\n\t\tthis._invoke = function(e$1, n) {\n\t\t\treturn new Promise(function(o, u) {\n\t\t\t\tvar i = {\n\t\t\t\t\tkey: e$1,\n\t\t\t\t\targ: n,\n\t\t\t\t\tresolve: o,\n\t\t\t\t\treject: u,\n\t\t\t\t\tnext: null\n\t\t\t\t};\n\t\t\t\tt ? t = t.next = i : (r = t = i, resume(e$1, n));\n\t\t\t});\n\t\t}, \"function\" != typeof e[\"return\"] && (this[\"return\"] = void 0);\n\t}\n\tAsyncGenerator.prototype[\"function\" == typeof Symbol && Symbol.asyncIterator || \"@@asyncIterator\"] = function() {\n\t\treturn this;\n\t}, AsyncGenerator.prototype.next = function(e) {\n\t\treturn this._invoke(\"next\", e);\n\t}, AsyncGenerator.prototype[\"throw\"] = function(e) {\n\t\treturn this._invoke(\"throw\", e);\n\t}, AsyncGenerator.prototype[\"return\"] = function(e) {\n\t\treturn this._invoke(\"return\", e);\n\t};\n\tmodule.exports = _wrapAsyncGenerator$1, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n} });\n\n//#endregion\n//#region src/links/localLink.ts\nvar import_usingCtx = __toESM(require_usingCtx(), 1);\nvar import_awaitAsyncGenerator = __toESM(require_awaitAsyncGenerator(), 1);\nvar import_wrapAsyncGenerator = __toESM(require_wrapAsyncGenerator(), 1);\nvar import_objectSpread2 = __toESM(require_objectSpread2(), 1);\n/**\n* localLink is a terminating link that allows you to make tRPC procedure calls directly in your application without going through HTTP.\n*\n* @see https://trpc.io/docs/links/localLink\n*/\nfunction unstable_localLink(opts) {\n\tconst transformer = getTransformer(opts.transformer);\n\tconst transformChunk = (chunk) => {\n\t\tif (opts.transformer) return chunk;\n\t\tif (chunk === void 0) return chunk;\n\t\tconst serialized = JSON.stringify(transformer.input.serialize(chunk));\n\t\tconst deserialized = JSON.parse(transformer.output.deserialize(serialized));\n\t\treturn deserialized;\n\t};\n\treturn () => ({ op }) => observable((observer) => {\n\t\tlet ctx = void 0;\n\t\tconst ac = new AbortController();\n\t\tconst signal = raceAbortSignals(op.signal, ac.signal);\n\t\tconst signalPromise = abortSignalToPromise(signal);\n\t\tsignalPromise.catch(() => {});\n\t\tlet input = op.input;\n\t\tasync function runProcedure(newInput) {\n\t\t\tinput = newInput;\n\t\t\tctx = await opts.createContext();\n\t\t\treturn callProcedure({\n\t\t\t\trouter: opts.router,\n\t\t\t\tpath: op.path,\n\t\t\t\tgetRawInput: async () => newInput,\n\t\t\t\tctx,\n\t\t\t\ttype: op.type,\n\t\t\t\tsignal\n\t\t\t});\n\t\t}\n\t\tfunction onErrorCallback(cause) {\n\t\t\tvar _opts$onError;\n\t\t\tif (isAbortError(cause)) return;\n\t\t\t(_opts$onError = opts.onError) === null || _opts$onError === void 0 || _opts$onError.call(opts, {\n\t\t\t\terror: getTRPCErrorFromUnknown(cause),\n\t\t\t\ttype: op.type,\n\t\t\t\tpath: op.path,\n\t\t\t\tinput,\n\t\t\t\tctx\n\t\t\t});\n\t\t}\n\t\tfunction coerceToTRPCClientError(cause) {\n\t\t\tif (isTRPCClientError(cause)) return cause;\n\t\t\tconst error = getTRPCErrorFromUnknown(cause);\n\t\t\tconst shape = getTRPCErrorShape({\n\t\t\t\tconfig: opts.router._def._config,\n\t\t\t\tctx,\n\t\t\t\terror,\n\t\t\t\tinput,\n\t\t\t\tpath: op.path,\n\t\t\t\ttype: op.type\n\t\t\t});\n\t\t\treturn TRPCClientError.from({ error: transformChunk(shape) });\n\t\t}\n\t\trun(async () => {\n\t\t\tswitch (op.type) {\n\t\t\t\tcase \"query\":\n\t\t\t\tcase \"mutation\": {\n\t\t\t\t\tconst result = await runProcedure(op.input);\n\t\t\t\t\tif (!isAsyncIterable(result)) {\n\t\t\t\t\t\tobserver.next({ result: { data: transformChunk(result) } });\n\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tobserver.next({ result: { data: (0, import_wrapAsyncGenerator.default)(function* () {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tvar _usingCtx$1 = (0, import_usingCtx.default)();\n\t\t\t\t\t\t\tconst iterator = _usingCtx$1.a(iteratorResource(result));\n\t\t\t\t\t\t\tconst _finally = _usingCtx$1.u(makeResource({}, () => {\n\t\t\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\t\tconst res = yield (0, import_awaitAsyncGenerator.default)(Promise.race([iterator.next(), signalPromise]));\n\t\t\t\t\t\t\t\t\tif (res.done) return transformChunk(res.value);\n\t\t\t\t\t\t\t\t\tyield transformChunk(res.value);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\t\t\tonErrorCallback(cause);\n\t\t\t\t\t\t\t\tthrow coerceToTRPCClientError(cause);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t\t_usingCtx$1.e = _;\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tyield (0, import_awaitAsyncGenerator.default)(_usingCtx$1.d());\n\t\t\t\t\t\t}\n\t\t\t\t\t})() } });\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"subscription\": try {\n\t\t\t\t\tvar _usingCtx3 = (0, import_usingCtx.default)();\n\t\t\t\t\tconst connectionState = behaviorSubject({\n\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\terror: null\n\t\t\t\t\t});\n\t\t\t\t\tconst connectionSub = connectionState.subscribe({ next(state) {\n\t\t\t\t\t\tobserver.next({ result: state });\n\t\t\t\t\t} });\n\t\t\t\t\tlet lastEventId = void 0;\n\t\t\t\t\tconst _finally = _usingCtx3.u(makeResource({}, async () => {\n\t\t\t\t\t\tobserver.complete();\n\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tstate: \"idle\",\n\t\t\t\t\t\t\terror: null\n\t\t\t\t\t\t});\n\t\t\t\t\t\tconnectionSub.unsubscribe();\n\t\t\t\t\t}));\n\t\t\t\t\twhile (true) try {\n\t\t\t\t\t\tvar _usingCtx4 = (0, import_usingCtx.default)();\n\t\t\t\t\t\tconst result = await runProcedure(inputWithTrackedEventId(op.input, lastEventId));\n\t\t\t\t\t\tif (!isAsyncIterable(result)) throw new Error(\"Expected an async iterable\");\n\t\t\t\t\t\tconst iterator = _usingCtx4.a(iteratorResource(result));\n\t\t\t\t\t\tobserver.next({ result: { type: \"started\" } });\n\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\tstate: \"pending\",\n\t\t\t\t\t\t\terror: null\n\t\t\t\t\t\t});\n\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\tlet res;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tres = await Promise.race([iterator.next(), signalPromise]);\n\t\t\t\t\t\t\t} catch (cause) {\n\t\t\t\t\t\t\t\tif (isAbortError(cause)) return;\n\t\t\t\t\t\t\t\tconst error = getTRPCErrorFromUnknown(cause);\n\t\t\t\t\t\t\t\tif (!retryableRpcCodes.includes(TRPC_ERROR_CODES_BY_KEY[error.code])) throw coerceToTRPCClientError(error);\n\t\t\t\t\t\t\t\tonErrorCallback(error);\n\t\t\t\t\t\t\t\tconnectionState.next({\n\t\t\t\t\t\t\t\t\ttype: \"state\",\n\t\t\t\t\t\t\t\t\tstate: \"connecting\",\n\t\t\t\t\t\t\t\t\terror: coerceToTRPCClientError(error)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (res.done) return;\n\t\t\t\t\t\t\tlet chunk;\n\t\t\t\t\t\t\tif (isTrackedEnvelope(res.value)) {\n\t\t\t\t\t\t\t\tlastEventId = res.value[0];\n\t\t\t\t\t\t\t\tchunk = {\n\t\t\t\t\t\t\t\t\tid: res.value[0],\n\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\tid: res.value[0],\n\t\t\t\t\t\t\t\t\t\tdata: res.value[1]\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t} else chunk = { data: res.value };\n\t\t\t\t\t\t\tobserver.next({ result: (0, import_objectSpread2.default)((0, import_objectSpread2.default)({}, chunk), {}, { data: transformChunk(chunk.data) }) });\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t_usingCtx4.e = _;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tawait _usingCtx4.d();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (_) {\n\t\t\t\t\t_usingCtx3.e = _;\n\t\t\t\t} finally {\n\t\t\t\t\t_usingCtx3.d();\n\t\t\t\t}\n\t\t\t}\n\t\t}).catch((cause) => {\n\t\t\tonErrorCallback(cause);\n\t\t\tobserver.error(coerceToTRPCClientError(cause));\n\t\t});\n\t\treturn () => {\n\t\t\tac.abort();\n\t\t};\n\t});\n}\n/**\n* @deprecated Renamed to `unstable_localLink`. This alias will be removed in a future major release.\n*/\nconst experimental_localLink = unstable_localLink;\n\n//#endregion\nexport { TRPCClientError, TRPCUntypedClient, clientCallTypeToProcedureType, createTRPCClient, createTRPCClientProxy, createTRPCClient as createTRPCProxyClient, createTRPCUntypedClient, createWSClient, experimental_localLink, getFetch, getUntypedClient, httpBatchLink, httpBatchStreamLink, httpLink, httpSubscriptionLink, isFormData, isNonJsonSerializable, isOctetType, isTRPCClientError, loggerLink, retryLink, splitLink, unstable_httpBatchStreamLink, unstable_httpSubscriptionLink, unstable_localLink, wsLink };\n//# sourceMappingURL=index.mjs.map","import { makeUrl } from '@ms-cloudpack/path-string-parsing';\nimport { createTRPCClient, createWSClient, httpBatchLink, splitLink, wsLink } from '@trpc/client';\nimport { ensureWebsocketDefined } from '../utilities/ensureWebsocketDefined.js';\nimport { ignoreSelfSignedCertErrors } from '../utilities/ignoreSelfSignedCertErrors.js';\n/**\n * Creates a cloudpack client that can be used to communicate with the cloudpack server using trpc.\n */\nexport async function createCloudpackClient(options) {\n const { url: wsUrl, reporter, onOpen } = options;\n // We polyfill websocket in node conditions.\n await ensureWebsocketDefined();\n ignoreSelfSignedCertErrors({ reporter });\n // Ignore these wsClient `onError` events as we handle them with try/catch when checking if a session is active\n reporter?.ignoreLogMessage('Received network error or non-101 status code.');\n reporter?.ignoreLogMessage('Connection was closed before it was established.');\n // Create the client.\n const wsClient = createWSClient({\n url: wsUrl,\n onError: (evt) => {\n const error = evt;\n // On node evt is an Event with a message property\n // On browser it is an Event with no relevant information\n // We can't directly log or stringify the event as it will be undefined\n if (error?.message) {\n console.error(`[Cloudpack] Websocket client error: ${error.message}`);\n }\n else {\n console.error('[Cloudpack] Unexpected websocket client error');\n }\n },\n onOpen() {\n onOpen?.();\n },\n });\n const tempUrl = makeUrl(wsUrl);\n // Replace the protocol with http so that we can use the same url for http requests.\n const isSSL = tempUrl.protocol === 'wss:';\n tempUrl.protocol = isSSL ? 'https:' : 'http:';\n const httpUrl = tempUrl.toString().replace(/\\/$/, '');\n const client = createTRPCClient({\n links: [\n // send subscriptions to the websocket client and handle operations with HTTP requests\n splitLink({\n condition(op) {\n return op.type === 'subscription';\n },\n true: wsLink({\n client: wsClient,\n }),\n false: httpBatchLink({\n url: httpUrl,\n }),\n }),\n ],\n });\n const close = async () => {\n await wsClient.close();\n };\n // Add a default onError handler for onDataChanged subscriptions.\n // Otherwise errors (such as from zod type violations) will be hidden.\n const onDataChanged = {\n subscribe: (source, opts) => {\n opts = { ...opts };\n opts.onError ??= (err) => {\n console.error(`[Cloudpack] Error in ${source.path.join('.')} data subscription (this may be a Cloudpack bug): ` +\n err.message);\n };\n return client.onDataChanged.subscribe(source, opts);\n },\n };\n // Ugh. This is a hack to get around the fact that the client is a proxy.\n // Make another proxy which defines the close method and onDataChanged wrapper,\n // and passes through everything else to the original client.\n return new Proxy({ close, onDataChanged }, {\n get(target, prop) {\n // eslint-disable-next-line no-prototype-builtins\n if (target.hasOwnProperty(prop)) {\n return target[prop];\n }\n return client[prop];\n },\n });\n}\n//# sourceMappingURL=createCloudpackClient.js.map","export async function ensureWebsocketDefined() {\n if (typeof global !== 'undefined') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const g = global;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (typeof g.WebSocket === 'undefined') {\n const { WebSocket: NodeWebSocket } = await import('ws');\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n g.WebSocket = NodeWebSocket;\n }\n }\n}\n//# sourceMappingURL=ensureWebsocketDefined.js.map","export function ignoreSelfSignedCertErrors({ reporter }) {\n if (typeof process !== 'undefined') {\n // When using self-signed certificates for the api server, node fails to make requests unless we set this.\n // eslint-disable-next-line no-restricted-properties -- ok to set properties\n process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';\n // When we do this, node creates a console.error that we need to ignore:\n //\n // (node:26988) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0'\n // makes TLS connections and HTTPS requests insecure by disabling certificate verification.\n reporter?.ignoreLogMessage('Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable');\n }\n}\n//# sourceMappingURL=ignoreSelfSignedCertErrors.js.map","/**\n * Attempt to create a URL object from a string, and throw an informative error if it fails.\n * (The URL constructor throws a very generic error.)\n */\nexport function makeUrl(input, base) {\n try {\n // eslint-disable-next-line no-restricted-syntax -- this is the function definition\n return new URL(input, base);\n }\n catch {\n throw new Error(`Invalid URL: \"${input}\", base: \"${base || ''}\"`);\n }\n}\n//# sourceMappingURL=makeUrl.js.map","\n import API from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../node_modules/.store/style-loader-virtual-bd73274477/package/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/cjs.js??ruleSet[1].rules[0].oneOf[1].use[1]!./UIManager.module.css\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../node_modules/.store/css-loader-virtual-dc0abf2d03/package/dist/cjs.js??ruleSet[1].rules[0].oneOf[1].use[1]!./UIManager.module.css\";\n export default content && content.locals ? content.locals : undefined;\n","import styles from './UIManager.module.css';\n\n/**\n * UI Manager for handling status display\n */\nexport class UIManager {\n private element: HTMLElement | null;\n\n constructor(elementId: string = 'root') {\n this.element = document.getElementById(elementId);\n }\n\n /**\n * Display a status message to the user\n */\n updateStatus(input: { message: string; tip?: string; isError?: boolean; data?: unknown }): void {\n const { message, tip, isError = false, data } = input;\n\n const method = isError ? 'error' : 'debug';\n if (data) {\n console[method](message, data);\n } else {\n console[method](message);\n }\n\n if (!this.element) return;\n\n this.element.innerHTML = `\n <div class=\"${styles.statusContainer + (isError ? ` ${styles.errorContainer}` : '')}\">\n <h2 class=\"${styles.title}\">Cloudpack Link Proxy</h2>\n <p class=\"${styles.message}\">${isError ? 'Error: ' : ''}${message}</p>\n ${tip ? `<p class=\"${styles.message}\"><strong>Tip:</strong> ${tip}</p>` : ''}\n <p class=\"${styles.warning}\">Do not close this page while Cloudpack link is running.</p>\n </div>\n `;\n }\n}\n","import type { CloudpackClient } from '@ms-cloudpack/api-server/browser';\n\ntype ClientId = 'link' | 'host';\n\n/**\n * Connection Manager for handling client connections\n */\nexport class ConnectionManager {\n private clients = new Map<string, CloudpackClient>();\n private connectionStates = new Map<string, boolean>();\n private checkInterval: number | null = null;\n private readonly checkIntervalMs: number = 5000; // 5 seconds\n\n /**\n * Add a client to be monitored\n */\n addClient(id: ClientId, client: CloudpackClient): void {\n this.clients.set(id, client);\n this.connectionStates.set(id, true);\n }\n\n /**\n * Get a client by ID\n */\n getClient(id: ClientId): CloudpackClient | undefined {\n return this.clients.get(id);\n }\n\n /**\n * Check if a client is connected\n */\n async checkConnection(id: ClientId): Promise<boolean> {\n const client = this.clients.get(id);\n if (!client) return false;\n\n try {\n await client.getSessionId.query();\n return true;\n } catch (e) {\n console.warn(`${id} client connection lost:`, e);\n return false;\n }\n }\n\n /**\n * Start monitoring all client connections\n */\n startMonitoring(\n onConnectionChange: (params: { id: ClientId; isConnected: boolean; wasConnected: boolean }) => Promise<void>,\n ): void {\n if (this.checkInterval) {\n window.clearInterval(this.checkInterval);\n }\n\n this.checkInterval = window.setInterval(() => {\n (async () => {\n for (const [id, _] of this.clients) {\n if (id != 'link' && id != 'host') throw new Error(`Invalid client ID: ${id}`);\n\n const wasConnected = this.connectionStates.get(id) || false;\n const isConnected = await this.checkConnection(id);\n\n if (wasConnected !== isConnected) {\n await onConnectionChange({ id, isConnected, wasConnected });\n }\n\n this.connectionStates.set(id, isConnected);\n }\n })().catch((error) => {\n console.error('Error in connection monitoring:', error);\n });\n }, this.checkIntervalMs);\n }\n\n /**\n * Stop monitoring connections\n */\n stopMonitoring(): void {\n if (this.checkInterval) {\n window.clearInterval(this.checkInterval);\n this.checkInterval = null;\n }\n }\n\n /**\n * Close all clients\n */\n async closeAll(): Promise<void> {\n for (const [id, client] of this.clients) {\n try {\n await client.close();\n console.log(`Closed ${id} client`);\n } catch (err) {\n console.error(`Error closing ${id} client:`, err);\n }\n }\n this.clients.clear();\n this.connectionStates.clear();\n }\n}\n","import { createCloudpackClient } from '@ms-cloudpack/api-server/browser';\n\n/**\n * Check if an API server is active at the given URL\n */\nexport async function isApiServerActive(url: string): Promise<boolean> {\n console.debug(`[Cloudpack] Checking session at ${url}`);\n\n const client = await createCloudpackClient({ url });\n let isActive = false;\n try {\n isActive = !!(await client.getSessionId.query());\n } catch {\n /* no-op */\n } finally {\n await client.close();\n }\n\n return isActive;\n}\n","import { LinkProxyApp } from './LinkProxyApp.js';\n\n// Start the application\nconst app = new LinkProxyApp();\nvoid app.initialize();\n","import type { NotifyLinkChangeInput, LinkPathInput, GetLinkConfigOutput } from '@ms-cloudpack/api-server/browser';\nimport {\n createCloudpackClient,\n linkUpdateSource,\n linkConfigSource,\n linkPathsSource,\n linkDoneSource,\n linkDisconnectedSource,\n} from '@ms-cloudpack/api-server/browser';\nimport { UIManager } from './UIManager.js';\nimport { ConnectionManager } from './ConnectionManager.js';\nimport { isApiServerActive } from './isApiServerActive.js';\n\n/**\n * Link Proxy application that handles communication between host and link sessions\n */\nexport class LinkProxyApp {\n private ui: UIManager;\n private connectionManager: ConnectionManager;\n private linkedPathData: LinkPathInput | null = null;\n\n constructor() {\n this.ui = new UIManager();\n this.connectionManager = new ConnectionManager();\n }\n\n /**\n * Handle a connection state change\n */\n private handleConnectionChange = async (params: {\n id: string;\n isConnected: boolean;\n wasConnected: boolean;\n }): Promise<void> => {\n const { id, isConnected, wasConnected } = params;\n // Only handle disconnections\n if (wasConnected && !isConnected) {\n if (id === 'host') {\n await this.handleHostDisconnection();\n } else if (id === 'link') {\n await this.handleLinkDisconnection();\n }\n }\n };\n\n /**\n * Handle host disconnection\n */\n private async handleHostDisconnection(options?: { unreachable?: boolean }): Promise<void> {\n const isUnreachable = options?.unreachable ?? false;\n const reason = isUnreachable ? 'unreachable' : 'lost';\n // This is shown momentarily before the cleanup.\n this.ui.updateStatus({\n message: `Connection to host ${reason}. The session will be terminated.`,\n isError: true,\n });\n\n const linkClient = this.connectionManager.getClient('link');\n let isLinkClosed = false;\n if (linkClient) {\n try {\n await linkClient.publishData.mutate({\n ...linkDisconnectedSource,\n data: { reason },\n });\n isLinkClosed = true;\n } catch {\n // This is also shown momentarily before the cleanup.\n this.ui.updateStatus({ message: `Error notifying link client of host connection ${reason}.`, isError: true });\n }\n }\n\n await this.cleanup();\n\n // Generate the appropriate tip based on the situation\n let tip: string;\n if (isUnreachable) {\n tip =\n 'Make sure you have a <code>cloudpack start</code> session running and use the URL from your app to run link with the following command: <code>cloudpack link --remote [URL]</code>';\n } else {\n tip = 'If you did not close the start session terminal, this is a bug. Please report it.';\n // Append additional information about link client notification if needed\n if (!isLinkClosed) {\n tip +=\n ' Link client was not successfully notified of host disconnection. You may need to terminate the link session in the terminal.';\n }\n }\n // This is the message the user will see after the cleanup.\n this.ui.updateStatus({\n message: `Connection to host ${reason}. You can close this page.`,\n tip,\n isError: true,\n });\n }\n\n /**\n * Handle link disconnection\n */\n private async handleLinkDisconnection(): Promise<void> {\n // This is shown momentarily before the cleanup, more information on following messages.\n this.ui.updateStatus({\n message: 'Connection to link client lost. Cleaning up linked paths...',\n isError: true,\n });\n\n const hostClient = this.connectionManager.getClient('host');\n if (hostClient && this.linkedPathData) {\n const { linkedPath } = this.linkedPathData;\n const unlinkedPath = linkedPath.path;\n try {\n await hostClient.unlinkPath.mutate({ linkedPath: { path: unlinkedPath } });\n this.ui.updateStatus({\n message: 'Connection to link client lost. Successfully unlinked paths on host. You can close this page.',\n tip: 'If you did not close the link client terminal. This is a bug. Please report it.',\n });\n } catch (err) {\n this.ui.updateStatus({\n message: 'Connection to link client lost. Failed to unlink paths on host.',\n // TODO: Add unlinking logic for this case\n tip: 'You may need to restart the host application to unlink the paths.',\n isError: true,\n data: err,\n });\n }\n } else {\n this.ui.updateStatus({\n message: 'Cannot clean up: host client or link data not available',\n tip: 'You may need to restart the host application to unlink the paths.',\n isError: true,\n });\n }\n\n await this.cleanup();\n }\n\n /**\n * Set up event handlers and subscriptions\n */\n private setupLinkUpdateHandler(): void {\n const linkClient = this.connectionManager.getClient('link');\n const hostClient = this.connectionManager.getClient('host');\n\n if (!linkClient || !hostClient) return;\n\n // Setup link update handler\n linkClient.onDataChanged.subscribe(linkUpdateSource, {\n onData: (updateData) => {\n this.ui.updateStatus({ message: 'Forwarding package update to the host...', data: updateData });\n\n hostClient.notifyLinkChange\n .mutate(updateData as NotifyLinkChangeInput)\n .then(() => this.ui.updateStatus({ message: 'Cloudpack Link Proxy listening for updates...' }))\n .catch((err) => {\n this.ui.updateStatus({\n message: 'Error forwarding package update to the host. This is a bug. Please report it.',\n isError: true,\n data: err,\n });\n });\n },\n });\n }\n\n /**\n * Handle link path setup and changes\n */\n private async setupLinkPathHandler(): Promise<void> {\n const hostClient = this.connectionManager.getClient('host');\n const linkClient = this.connectionManager.getClient('link');\n if (!linkClient || !hostClient) return;\n\n // Check if the link server has already set up the paths\n if (await linkClient.getData.query(linkPathsSource)) return;\n\n linkClient.onDataChanged.subscribe(linkPathsSource, {\n onData: (setupData) => {\n this.ui.updateStatus({ message: 'Processing link setup...', data: setupData });\n\n // Store the linked path data for potential cleanup\n this.linkedPathData = setupData as LinkPathInput;\n\n void hostClient.linkPath.mutate(this.linkedPathData).then((result) => {\n const { resolveMap, linkedPaths } = result;\n this.ui.updateStatus({ message: 'Sending link setup result back to the link server...', data: result });\n\n void linkClient.publishData\n .mutate({\n ...linkDoneSource,\n data: { resolveMap, linkedPaths },\n })\n .then(() => {\n this.ui.updateStatus({ message: 'Cloudpack Link Proxy listening for updates...' });\n })\n .catch((err) => {\n this.ui.updateStatus({\n message: 'Error sending link setup result back to the link server. Please try to run link again.',\n tip: 'This is a bug. Please report it.',\n isError: true,\n data: err,\n });\n });\n });\n },\n });\n }\n\n /**\n * Set up configuration\n */\n private async setupConfig(): Promise<void> {\n const linkClient = this.connectionManager.getClient('link');\n const hostClient = this.connectionManager.getClient('host');\n\n if (!linkClient || !hostClient) return;\n\n try {\n const config = (await linkClient.getData.query(linkConfigSource)) as GetLinkConfigOutput | undefined;\n\n if (!config) {\n this.ui.updateStatus({ message: 'Fetching host configuration...' });\n\n const hostConfig = await hostClient.getLinkConfig.query();\n this.ui.updateStatus({ message: 'Sending host configuration to the link server...', data: hostConfig });\n\n await linkClient.publishData.mutate({\n ...linkConfigSource,\n data: hostConfig,\n });\n\n this.ui.updateStatus({ message: 'Host configuration sent to the link server.' });\n }\n } catch (err) {\n this.ui.updateStatus({\n message: 'Error setting up configuration. Please try to run link again.',\n tip: 'This is a bug. Please report it.',\n isError: true,\n data: err,\n });\n }\n }\n\n /**\n * Clean up resources\n */\n private async cleanup(): Promise<void> {\n this.connectionManager.stopMonitoring();\n await this.connectionManager.closeAll();\n }\n\n /**\n * Initialize the application\n */\n public async initialize(): Promise<void> {\n this.ui.updateStatus({ message: 'Initializing Cloudpack Link Proxy...' });\n\n try {\n // Validate Cloudpack context\n if (!window.__cloudpack) {\n this.ui.updateStatus({\n message: 'Cloudpack context not found on window.',\n tip: 'This is a bug. Please report it.',\n isError: true,\n });\n throw new Error('Cloudpack not found on window.');\n }\n\n const { pageSessionContext } = window.__cloudpack;\n\n if (!pageSessionContext) {\n this.ui.updateStatus({\n message: 'Session context not found on window.__cloudpack.',\n tip: 'This is a bug. Please report it.',\n isError: true,\n data: window.__cloudpack,\n });\n throw new Error('Session context not found on window.__cloudpack');\n }\n\n const { apiUrl, hostApiServerUrls } = pageSessionContext;\n\n if (!hostApiServerUrls || hostApiServerUrls.length <= 0) {\n this.ui.updateStatus({\n message: 'No host URL provided.',\n tip: 'This is a bug. Please report it.',\n data: pageSessionContext,\n isError: true,\n });\n return;\n }\n\n // Initialize link client\n const linkClient = await createCloudpackClient({ url: apiUrl });\n this.connectionManager.addClient('link', linkClient);\n\n // Find an active host API server\n let hostUrl: string | undefined;\n for (const url of hostApiServerUrls) {\n this.ui.updateStatus({ message: `Checking host API server at ${url}...` });\n const isActive = await isApiServerActive(url);\n if (isActive) {\n this.ui.updateStatus({ message: `Host API server is active at ${url}.` });\n hostUrl = url;\n break;\n }\n }\n\n if (!hostUrl) {\n await this.handleHostDisconnection({ unreachable: true });\n return;\n }\n\n // Initialize host client\n const hostClient = await createCloudpackClient({ url: hostUrl });\n this.connectionManager.addClient('host', hostClient);\n\n // Display session information\n const linkSessionId = await linkClient.getSessionId.query();\n const hostSessionId = await hostClient.getSessionId.query();\n this.ui.updateStatus({ message: `Link Session: ${linkSessionId}, Host Session: ${hostSessionId}` });\n\n // Set up connection monitoring\n this.connectionManager.startMonitoring(this.handleConnectionChange);\n\n // Set up event handlers and configuration\n this.setupLinkUpdateHandler();\n await this.setupLinkPathHandler();\n await this.setupConfig();\n } catch (err) {\n const errorMessage = err instanceof Error ? err.message : String(err);\n this.ui.updateStatus({\n message: errorMessage,\n isError: true,\n tip: 'This is a bug. Please report it.',\n data: err,\n });\n await this.cleanup();\n }\n }\n}\n"],"names":["leafPrototypes","getProto","installedChunks","installChunk","module","exports","css","styleElement","styleSheet","cssText","firstChild","removeChild","appendChild","document","createTextNode","memo","insert","style","target","styleTarget","querySelector","window","HTMLIFrameElement","contentDocument","head","e","getTarget","Error","___CSS_LOADER_EXPORT___","push","id","locals","stylesInDOM","getIndexByIdentifier","identifier","result","i","length","modulesToDom","list","options","idCountMap","identifiers","item","base","count","concat","indexByIdentifier","obj","media","sourceMap","supports","layer","references","updater","addElementStyle","byIndex","splice","api","domAPI","update","newObj","remove","lastIdentifiers","newList","index","newLastIdentifiers","_i","_index","insertStyleElement","needLayer","btoa","unescape","encodeURIComponent","JSON","stringify","styleTagTransform","apply","parentNode","removeStyleElement","content","cssMapping","base64","data","sourceMapping","join","nonce","setAttribute","cssWithMappingToString","toString","this","map","modules","dedupe","undefined","alreadyImportedModules","k","_k","element","createElement","setAttributes","attributes","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","m","n","getter","__esModule","d","a","Object","getPrototypeOf","t","value","mode","then","ns","create","r","def","current","indexOf","getOwnPropertyNames","forEach","key","definition","o","defineProperty","enumerable","get","f","chunkId","Promise","all","keys","reduce","promises","u","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","__webpack_esm_ids__","__webpack_esm_modules__","__webpack_esm_runtime__","j","installedChunkData","promise","import","race","resolve","nc","$constructor","name","initializer","params","init","inst","_zod","constr","_","traits","Set","has","add","proto","bind","Parent","Definition","_a","deferred","fn","hasInstance","freeze","status","$ZodAsyncError","constructor","super","globalConfig","config","newConfig","assign","joinValues","array","separator","val","stringifyPrimitive","jsonStringifyReplacer","cached","cleanRegex","source","start","startsWith","end","endsWith","slice","EVALUATING","defineLazy","object","set","v","configurable","captureStackTrace","_args","Array","isArray","escapeRegex","str","replace","clone","cl","parent","normalizeParams","_params","error","message","aborted","x","startIndex","issues","continue","prefixIssues","path","iss","unshift","unwrapMessage","finalizeIssue","ctx","full","customError","localeError","reportInput","input","navigator","userAgent","includes","Function","Number","MIN_SAFE_INTEGER","MAX_SAFE_INTEGER","MAX_VALUE","$ZodError","$ZodRealError","_parse","_Err","schema","_ctx","async","run","Err","callee","parse","_parseAsync","parseAsync","_safeParse","success","safeParse","_safeParseAsync","safeParseAsync","cuid","cuid2","ulid","xid","ksuid","nanoid","duration","extendedDuration","guid","uuid","version","RegExp","uuid4","uuid6","uuid7","email","html5Email","rfc5322Email","unicodeEmail","idnEmail","browserEmail","_emoji","emoji","ipv4","ipv6","mac","delimiter","escapedDelim","cidrv4","cidrv6","base64url","hostname","domain","e164","dateSource","date","timeSource","args","hhmm","precision","time","datetime","opts","local","offset","timeRegex","string","minimum","maximum","bigint","integer","number","_null","_undefined","lowercase","uppercase","hex","fixedBase64","bodyLength","padding","fixedBase64url","md5_hex","md5_base64","md5_base64url","sha1_hex","sha1_base64","sha1_base64url","sha256_hex","sha256_base64","sha256_base64url","sha384_hex","sha384_base64","sha384_base64url","sha512_hex","sha512_base64","sha512_base64url","major","minor","patch","$ZodType","bag","checks","ch","onattach","runChecks","payload","asyncResult","isAborted","when","currLen","check","handleCanaryResult","canary","checkResult","skipChecks","direction","validate","vendor","$ZodString","pattern","patterns","pop","coerce","String","expected","code","$ZodNumber","isNaN","isFinite","received","$ZodBoolean","Boolean","$ZodAny","$ZodUnknown","handleArrayResult","final","$ZodArray","proms","handlePropertyResult","isOptionalOut","$ZodObject","desc","getOwnPropertyDescriptor","sh","shape","newSh","_normalized","okeys","filter","optin","optout","keySet","numKeys","optionalKeys","normalizeDef","propValues","field","values","isObject","catchall","el","unrecognized","_catchall","type","handleCatchall","handleUnionResults","results","nonaborted","errors","$ZodUnion","some","every","flatMap","option","from","p","single","first","$ZodRecord","ctor","prot","keyType","recordKeys","valueType","Reflect","ownKeys","keyResult","test","retryResult","origin","$ZodLiteral","handleOptionalResult","$ZodOptional","innerType","$ZodNonOptional","handleNonOptionalResult","globalThis","__zod_globalRegistry","_map","WeakMap","_idmap","Map","_meta","meta","clear","delete","pm","ZodMiniType","with","_def","brand","register","reg","ZodMiniString","Class","ZodMiniNumber","ZodMiniBoolean","ZodMiniAny","any","ZodMiniUnknown","ZodMiniArray","ZodMiniObject","looseObject","ZodMiniUnion","union","ZodMiniRecord","record","ZodMiniLiteral","literal","ZodMiniOptional","optional","ZodMiniNonOptional","matchingZodObject","matchingZodObjectLoose","Sizable","unit","verb","file","getSizing","FormatDictionary","regex","url","uuidv4","uuidv6","json_string","jwt","template_literal","TypeDictionary","nan","issue","receivedType","adj","inclusive","sizing","_issue","format","prefix","suffix","divisor","remainingTasks","totalTasks","totalErrors","totalWarnings","ZodTiming","threwException","ZodTaskMessageLocation","line","column","ZodTaskNote","text","location","ZodTaskMessage","notes","ZodTaskDescription","inputPath","outputPath","warnings","startTime","lastUpdated","timings","tasks","ZodBasicPackageJson","ZodNotifyLinkChangeInput","packagePath","hash","ZodPackageHashesEntry","browser","node","ZodLinkedPath","rootPath","includeAll","ignoredPackages","ignoreResolutions","resolveStrategy","remote","hostUrl","resolveMap","packages","definitions","transformedDefinitions","packageHashes","hashesWithSource","hashesWithNoSource","ZodLinkPathInput","linkedPath","ZodLinkPathOutput","linkedPaths","ZodPackageSettingsMatchObject","ZodPackageSettingsMatch","ZodGeneratedPackageSettingsMatch","defs","mergedDescriptors","descriptors","getOwnPropertyDescriptors","defineProperties","mergeDefs","oldShape","writable","ZodGetLinkConfigOutput","packageSettings","match","generated","linkUpdateSource","packageName","entryPoints","importPath","bundleUrl","linkConfigSource","linkPathsSource","linkDoneSource","linkDisconnectedSource","reason","__create","__defProp","__getOwnPropDesc","__getOwnPropNames","__getProtoOf","__hasOwnProp","__commonJS","cb","mod","__toESM","isNodeMode","to","except","__copyProps","require_typeof","_typeof$2","iterator","o$1","require_toPrimitive","_typeof$1","toPrimitive","TypeError","require_toPropertyKey","_typeof","require_defineProperty","toPropertyKey","require_objectSpread2","getOwnPropertySymbols","r$1","arguments","subscribe","self","observer","teardownRef","isDone","unsubscribed","teardownImmediately","unsubscribe","next","_observer$next","err","_observer$error","complete","_observer$complete","pipe","operations","pipeReducer","prev","createChain","execute","op","links","nextOp","asArray","splitLink","runtime","yes","true","link","no","false","props","condition","asyncIterator","sleep","ms","res","setTimeout","import_defineProperty","import_objectSpread2","TRPCClientError","_opts$result","_opts$result2","cause","default","setPrototypeOf","_cause","transformer","output","serialize","deserialize","METHOD","query","mutation","subscription","getInput","dict","arrayToDict","inputs","_input","parts","split","queryParts","methodOverride","AbortError","throwIfAborted","signal","_signal$throwIfAborte","DOMException","freezeIfAvailable","createInnerProxy","callback","_memo$cacheKey","cacheKey","Proxy","_obj","_1","_2","lastOfPath","import_objectSpread2$1","TransformResultError","response","ok","transformResultInner","_unused","throwFatalError","batchLoader","pendingItems","dispatchTimer","dispatch","groupedItems","items","lastGroup","_item$reject","reject","_item$reject2","it","groupItems","clearTimeout","batch","fetch","_item","valueOrPromise","_item$resolve","_item$reject3","_item$reject4","catch","_item$reject5","load","_dispatchTimer","_pendingItems","httpBatchLink","_opts$maxURLLength","_opts$maxItems","resolvedOpts","maxURLLength","Infinity","maxItems","batchOps","signals","ac","AbortController","abortedCount","onAbort","abort","addEventListener","once","_opts$methodOverride","getUrl","body","getBody","method","resolvedHeaders","heads","headers","fromEntries","contentTypeHeader","trpcAcceptHeader","customFetchImpl","getFetch","json","responseJSON","opList","loaders","_res","transformed","context","initialValue","observerList","obs","addObserver","removeObserver","nextValue","lazyDefaults","enabled","closeMs","keepAliveDefaults","pongTimeoutMs","intervalMs","exponentialBackoff","attemptIndex","Math","min","import_defineProperty$3","TRPCWebSocketClosedError","ResettableTimeout","onTimeout","timeoutMs","reset","timeout","stop","withResolvers","rej","import_defineProperty$2","RequestManager","callbacks","outgoingRequests","messageId","pendingRequests","flush","requests","request","getPendingRequests","getPendingRequest","getOutgoingRequests","getRequests","state","hasPendingRequests","hasPendingSubscriptions","hasOutgoingRequests","import_defineProperty$1","setupPingInterval","ws","pingTimeout","pongTimeout","send","close","WsConnection","_opts$WebSocketPonyfi","connectCount","WebSocketPonyfill","WebSocket","urlOptions","keepAliveOpts","keepAlive","wsObservable","isOpen","readyState","OPEN","openPromise","isClosed","CLOSING","CLOSED","open","_this","wsPromise","connectionParams","prepareUrl","removeEventListener","asyncWsOpen","buildConnectionMessage","_this$ws","WsClient","_opts$retryDelayMs","onOpen","onClose","onError","lazyOptions","lazy","inactivityTimeout","requestManager","activeConnection","setupWebSocketListeners","reconnectRetryDelay","retryDelayMs","lazyMode","connectionState","allowReconnect","reconnect","reconnecting","_this2","requestsToAwait","lastEventId","batchSend","event","connection","closedError","_this3","tryReconnect","_this4","handleCloseOrError","reqs","_this$callbacks$onOpe","_this$callbacks","incomingMessage","handleIncomingRequest","handleResponseMessage","_this$callbacks$onClo","_this$callbacks2","_this$callbacks$onErr","_this$callbacks3","completed","messageOrMessages","messages","_this5","message$1","wsLink","client","connStateSubscription","requestSubscription","import_objectSpread2$4","TRPCUntypedClient","requestId","$request","_opts$context","refCount","observers","subscriber","_sub","resetIfNeeded","findIndex","requestAsPromise","req$","observable$1","onDone","obs$","observableToPromise","envelope","_opts$onConnectionSta","onConnectionStateChange","_opts$onStarted","onStarted","_opts$onStopped","onStopped","_opts$onData","onData","_opts$onError","_opts$onComplete","onComplete","untypedClientSymbol","for","clientCallTypeMap","mutate","AsyncFromSyncIterator","AsyncFromSyncIteratorContinuation","done","r$2","s","require_asyncIterator","require_usingCtx","SuppressedError","e$1","n$1","suppressed","using","asyncDispose","dispose","require_OverloadYield","require_awaitAsyncGenerator","OverloadYield$1","require_wrapAsyncGenerator","OverloadYield","AsyncGenerator","resume","t$1","t$2","settle","arg","_invoke","createCloudpackClient","wsUrl","reporter","g","NodeWebSocket","ensureWebsocketDefined","process","env","NODE_TLS_REJECT_UNAUTHORIZED","ignoreLogMessage","ignoreSelfSignedCertErrors","wsClient","evt","console","tempUrl","URL","makeUrl","isSSL","protocol","httpUrl","proxy","pathCopy","procedureType","clientCallType","fullPath","createTRPCClientProxy","createTRPCClient","onDataChanged","UIManager","elementId","getElementById","updateStatus","tip","isError","innerHTML","styles","statusContainer","errorContainer","title","warning","ConnectionManager","clients","connectionStates","checkInterval","checkIntervalMs","addClient","getClient","checkConnection","getSessionId","warn","startMonitoring","onConnectionChange","clearInterval","setInterval","wasConnected","isConnected","stopMonitoring","closeAll","log","isApiServerActive","debug","isActive","app","ui","connectionManager","linkedPathData","handleHostDisconnection","handleLinkDisconnection","isUnreachable","unreachable","linkClient","isLinkClosed","publishData","cleanup","hostClient","unlinkedPath","unlinkPath","updateData","notifyLinkChange","setupLinkPathHandler","getData","setupData","linkPath","setupConfig","hostConfig","getLinkConfig","initialize","__cloudpack","pageSessionContext","apiUrl","hostApiServerUrls","linkSessionId","hostSessionId","handleConnectionChange","setupLinkUpdateHandler","errorMessage"],"ignoreList":[],"sourceRoot":""}